diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d6382fa
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,25 @@
+#
+# Generated files
+#
+loader.sce
+unloader.sce
+cleaner.sce
+loader_gateway.sce
+cleaner_gateway.sce
+jar/
+*.dll
+*.so
+*.def
+*.obj
+*.bin
+libOptimization_Toolbox_*.*
+macros/lib
+Makelib.mak
+master_help.xml
+scilab_*_help
+*.sln
+*.vcxproj
+*.vcxproj.filters
+*.vfproj
+locales/en_US/
+locales/fr_FR/
diff --git a/LICENSE_BOOST.txt b/LICENSE_BOOST.txt
new file mode 100644
index 0000000..36b7cd9
--- /dev/null
+++ b/LICENSE_BOOST.txt
@@ -0,0 +1,23 @@
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSE_Clp.txt b/LICENSE_Clp.txt
new file mode 100644
index 0000000..b6be057
--- /dev/null
+++ b/LICENSE_Clp.txt
@@ -0,0 +1,3 @@
+For licensing information for files in this directory, please see the
+comments in the header of each file. For licensing of files in each of
+the subdirectories, please see the LICENSE file in that subdirectory.
diff --git a/LICENSE_CoinUtils.txt b/LICENSE_CoinUtils.txt
new file mode 100644
index 0000000..744d6f3
--- /dev/null
+++ b/LICENSE_CoinUtils.txt
@@ -0,0 +1,239 @@
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
+OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+ a) in the case of the initial Contributor, the initial code and
+ documentation distributed under this Agreement, and
+
+ b) in the case of each subsequent Contributor:
+
+ i) changes to the Program, and
+
+ ii) additions to the Program;
+
+ where such changes and/or additions to the Program originate
+ from and are distributed by that particular Contributor. A
+ Contribution 'originates' from a Contributor if it was added to
+ the Program by such Contributor itself or anyone acting on such
+ Contributor's behalf. Contributions do not include additions to
+ the Program which: (i) are separate modules of software
+ distributed in conjunction with the Program under their own
+ license agreement, and (ii) are not derivative works of the
+ Program.
+
+"Contributor" means any person or entity that distributes the
+Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor
+which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with
+this Agreement.
+
+"Recipient" means anyone who receives the Program under this
+Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free copyright
+license to reproduce, prepare derivative works of, publicly display,
+publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and
+object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free patent
+license under Licensed Patents to make, use, sell, offer to sell,
+import and otherwise transfer the Contribution of such Contributor,
+if any, in source code and object code form. This patent license
+shall apply to the combination of the Contribution and the Program
+if, at the time the Contribution is added by the Contributor, such
+addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any
+other combinations which include the Contribution. No hardware per
+se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the
+licenses to its Contributions set forth herein, no assurances are
+provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other
+entity. Each Contributor disclaims any liability to Recipient for
+claims brought by any other entity based on infringement of
+intellectual property rights or otherwise. As a condition to
+exercising the rights and licenses granted hereunder, each Recipient
+hereby assumes sole responsibility to secure any other intellectual
+property rights needed, if any. For example, if a third party patent
+license is required to allow Recipient to distribute the Program, it
+is Recipient's responsibility to acquire that license before
+distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has
+sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:
+
+ a) it complies with the terms and conditions of this Agreement;
+ and
+
+ b) its license agreement:
+
+ i) effectively disclaims on behalf of all Contributors all
+ warranties and conditions, express and implied, including
+ warranties or conditions of title and non-infringement, and
+ implied warranties or conditions of merchantability and
+ fitness for a particular purpose;
+
+ ii) effectively excludes on behalf of all Contributors all
+ liability for damages, including direct, indirect, special,
+ incidental and consequential damages, such as lost profits;
+
+ iii) states that any provisions which differ from this
+ Agreement are offered by that Contributor alone and not by
+ any other party; and
+
+ iv) states that source code for the Program is available
+ from such Contributor, and informs licensees how to obtain
+ it in a reasonable manner on or through a medium customarily
+ used for software exchange.
+
+When the Program is made available in source code form:
+
+ a) it must be made available under this Agreement; and
+
+ b) a copy of this Agreement must be included with each copy of
+ the Program.
+
+Contributors may not remove or alter any copyright notices contained
+within the Program.
+
+Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and
+the like. While this license is intended to facilitate the
+commercial use of the Program, the Contributor who includes the
+Program in a commercial product offering should do so in a manner
+which does not create potential liability for other
+Contributors. Therefore, if a Contributor includes the Program in a
+commercial product offering, such Contributor ("Commercial
+Contributor") hereby agrees to defend and indemnify every other
+Contributor ("Indemnified Contributor") against any losses, damages
+and costs (collectively "Losses") arising from claims, lawsuits and
+other legal actions brought by a third party against the Indemnified
+Contributor to the extent caused by the acts or omissions of such
+Commercial Contributor in connection with its distribution of the
+Program in a commercial product offering. The obligations in this
+section do not apply to any claims or Losses relating to any actual
+or alleged intellectual property infringement. In order to qualify,
+an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial
+Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement
+negotiations. The Indemnified Contributor may participate in any
+such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's
+responsibility alone. Under this section, the Commercial Contributor
+would have to defend claims against the other Contributors related
+to those performance claims and warranties, and if a court requires
+any other Contributor to pay any damages as a result, the Commercial
+Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED 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. Each Recipient
+is solely responsible for determining the appropriateness of using
+and distributing the Program and assumes all risks associated with
+its exercise of rights under this Agreement , including but not
+limited to the risks and costs of program errors, compliance with
+applicable laws, damage to or loss of data, programs or equipment,
+and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability
+of the remainder of the terms of this Agreement, and without further
+action by the parties hereto, such provision shall be reformed to
+the minimum extent necessary to make such provision valid and
+enforceable.
+
+If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+the Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then
+such Recipient's rights granted under Section 2(b) shall terminate
+as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of
+time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use
+and distribution of the Program as soon as reasonably
+practicable. However, Recipient's obligations under this Agreement
+and any licenses granted by Recipient relating to the Program shall
+continue and survive.
+
+Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions
+(including revisions) of this Agreement from time to time. No one
+other than the Agreement Steward has the right to modify this
+Agreement. The Eclipse Foundation is the initial Agreement
+Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each
+new version of the Agreement will be given a distinguishing version
+number. The Program (including Contributions) may always be
+distributed subject to the version of the Agreement under which it
+was received. In addition, after a new version of the Agreement is
+published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives
+no rights or licenses to the intellectual property of any
+Contributor under this Agreement, whether expressly, by implication,
+estoppel or otherwise. All rights in the Program not expressly
+granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No
+party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each
+party waives its rights to a jury trial in any resulting litigation.
diff --git a/LICENSE_Ipopt.txt b/LICENSE_Ipopt.txt
new file mode 100644
index 0000000..16cc69a
--- /dev/null
+++ b/LICENSE_Ipopt.txt
@@ -0,0 +1,87 @@
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+
+b) in the case of each subsequent Contributor:
+
+i) changes to the Program, and
+
+ii) additions to the Program;
+
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED 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. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
diff --git a/LICENSE_MUMPS.txt b/LICENSE_MUMPS.txt
new file mode 100644
index 0000000..5512849
--- /dev/null
+++ b/LICENSE_MUMPS.txt
@@ -0,0 +1,44 @@
+
+ This version of MUMPS is provided to you free of charge. It is public
+ domain, based on public domain software developed during the Esprit IV
+ European project PARASOL (1996-1999). Since this first public domain
+ version in 1999, research and developments have been supported by the
+ following institutions: CERFACS, CNRS, ENS Lyon, INPT(ENSEEIHT)-IRIT,
+ INRIA, and University of Bordeaux.
+
+ The MUMPS team at the moment of releasing this version includes
+ Patrick Amestoy, Maurice Bremond, Alfredo Buttari, Abdou Guermouche,
+ Guillaume Joslin, Jean-Yves L'Excellent, Francois-Henry Rouet, Bora
+ Ucar and Clement Weisbecker.
+
+ We are also grateful to Emmanuel Agullo, Caroline Bousquet, Indranil
+ Chowdhury, Philippe Combes, Christophe Daniel, Iain Duff, Vincent Espirat,
+ Aurelia Fevre, Jacko Koster, Stephane Pralet, Chiara Puglisi, Gregoire
+ Richard, Tzvetomila Slavova, Miroslav Tuma and Christophe Voemel who
+ have been contributing to this project.
+
+ Up-to-date copies of the MUMPS package can be obtained
+ from the Web pages:
+ http://mumps.enseeiht.fr/ or http://graal.ens-lyon.fr/MUMPS
+
+
+ THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
+ EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
+
+
+ User documentation of any code that uses this software can
+ include this complete notice. You can acknowledge (using
+ references [1] and [2]) the contribution of this package
+ in any scientific publication dependent upon the use of the
+ package. You shall use reasonable endeavours to notify
+ the authors of the package of this publication.
+
+ [1] P. R. Amestoy, I. S. Duff, J. Koster and J.-Y. L'Excellent,
+ A fully asynchronous multifrontal solver using distributed dynamic
+ scheduling, SIAM Journal of Matrix Analysis and Applications,
+ Vol 23, No 1, pp 15-41 (2001).
+
+ [2] P. R. Amestoy and A. Guermouche and J.-Y. L'Excellent and
+ S. Pralet, Hybrid scheduling for the parallel solution of linear
+ systems. Parallel Computing Vol 32 (2), pp 136-156 (2006).
+
diff --git a/LICENSE_ORTOOLS.txt b/LICENSE_ORTOOLS.txt
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/LICENSE_ORTOOLS.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 [yyyy] [name of copyright owner]
+
+ 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/LICENSE_Osi.txt b/LICENSE_Osi.txt
new file mode 100644
index 0000000..744d6f3
--- /dev/null
+++ b/LICENSE_Osi.txt
@@ -0,0 +1,239 @@
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
+OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+ a) in the case of the initial Contributor, the initial code and
+ documentation distributed under this Agreement, and
+
+ b) in the case of each subsequent Contributor:
+
+ i) changes to the Program, and
+
+ ii) additions to the Program;
+
+ where such changes and/or additions to the Program originate
+ from and are distributed by that particular Contributor. A
+ Contribution 'originates' from a Contributor if it was added to
+ the Program by such Contributor itself or anyone acting on such
+ Contributor's behalf. Contributions do not include additions to
+ the Program which: (i) are separate modules of software
+ distributed in conjunction with the Program under their own
+ license agreement, and (ii) are not derivative works of the
+ Program.
+
+"Contributor" means any person or entity that distributes the
+Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor
+which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with
+this Agreement.
+
+"Recipient" means anyone who receives the Program under this
+Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free copyright
+license to reproduce, prepare derivative works of, publicly display,
+publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and
+object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free patent
+license under Licensed Patents to make, use, sell, offer to sell,
+import and otherwise transfer the Contribution of such Contributor,
+if any, in source code and object code form. This patent license
+shall apply to the combination of the Contribution and the Program
+if, at the time the Contribution is added by the Contributor, such
+addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any
+other combinations which include the Contribution. No hardware per
+se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the
+licenses to its Contributions set forth herein, no assurances are
+provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other
+entity. Each Contributor disclaims any liability to Recipient for
+claims brought by any other entity based on infringement of
+intellectual property rights or otherwise. As a condition to
+exercising the rights and licenses granted hereunder, each Recipient
+hereby assumes sole responsibility to secure any other intellectual
+property rights needed, if any. For example, if a third party patent
+license is required to allow Recipient to distribute the Program, it
+is Recipient's responsibility to acquire that license before
+distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has
+sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:
+
+ a) it complies with the terms and conditions of this Agreement;
+ and
+
+ b) its license agreement:
+
+ i) effectively disclaims on behalf of all Contributors all
+ warranties and conditions, express and implied, including
+ warranties or conditions of title and non-infringement, and
+ implied warranties or conditions of merchantability and
+ fitness for a particular purpose;
+
+ ii) effectively excludes on behalf of all Contributors all
+ liability for damages, including direct, indirect, special,
+ incidental and consequential damages, such as lost profits;
+
+ iii) states that any provisions which differ from this
+ Agreement are offered by that Contributor alone and not by
+ any other party; and
+
+ iv) states that source code for the Program is available
+ from such Contributor, and informs licensees how to obtain
+ it in a reasonable manner on or through a medium customarily
+ used for software exchange.
+
+When the Program is made available in source code form:
+
+ a) it must be made available under this Agreement; and
+
+ b) a copy of this Agreement must be included with each copy of
+ the Program.
+
+Contributors may not remove or alter any copyright notices contained
+within the Program.
+
+Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and
+the like. While this license is intended to facilitate the
+commercial use of the Program, the Contributor who includes the
+Program in a commercial product offering should do so in a manner
+which does not create potential liability for other
+Contributors. Therefore, if a Contributor includes the Program in a
+commercial product offering, such Contributor ("Commercial
+Contributor") hereby agrees to defend and indemnify every other
+Contributor ("Indemnified Contributor") against any losses, damages
+and costs (collectively "Losses") arising from claims, lawsuits and
+other legal actions brought by a third party against the Indemnified
+Contributor to the extent caused by the acts or omissions of such
+Commercial Contributor in connection with its distribution of the
+Program in a commercial product offering. The obligations in this
+section do not apply to any claims or Losses relating to any actual
+or alleged intellectual property infringement. In order to qualify,
+an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial
+Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement
+negotiations. The Indemnified Contributor may participate in any
+such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's
+responsibility alone. Under this section, the Commercial Contributor
+would have to defend claims against the other Contributors related
+to those performance claims and warranties, and if a court requires
+any other Contributor to pay any damages as a result, the Commercial
+Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED 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. Each Recipient
+is solely responsible for determining the appropriateness of using
+and distributing the Program and assumes all risks associated with
+its exercise of rights under this Agreement , including but not
+limited to the risks and costs of program errors, compliance with
+applicable laws, damage to or loss of data, programs or equipment,
+and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability
+of the remainder of the terms of this Agreement, and without further
+action by the parties hereto, such provision shall be reformed to
+the minimum extent necessary to make such provision valid and
+enforceable.
+
+If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+the Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then
+such Recipient's rights granted under Section 2(b) shall terminate
+as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of
+time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use
+and distribution of the Program as soon as reasonably
+practicable. However, Recipient's obligations under this Agreement
+and any licenses granted by Recipient relating to the Program shall
+continue and survive.
+
+Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions
+(including revisions) of this Agreement from time to time. No one
+other than the Agreement Steward has the right to modify this
+Agreement. The Eclipse Foundation is the initial Agreement
+Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each
+new version of the Agreement will be given a distinguishing version
+number. The Program (including Contributions) may always be
+distributed subject to the version of the Agreement under which it
+was received. In addition, after a new version of the Agreement is
+published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives
+no rights or licenses to the intellectual property of any
+Contributor under this Agreement, whether expressly, by implication,
+estoppel or otherwise. All rights in the Program not expressly
+granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No
+party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each
+party waives its rights to a jury trial in any resulting litigation.
diff --git a/builder.sce b/builder.sce
new file mode 100644
index 0000000..a1e8336
--- /dev/null
+++ b/builder.sce
@@ -0,0 +1,55 @@
+verboseMode = ilib_verbose();
+ilib_verbose(0);
+
+TOOLBOX_NAME = "Optimization_Toolbox";
+TOOLBOX_TITLE = "Optimization Toolbox";
+
+function main_builder()
+
+ toolbox_dir = get_absolute_file_path("builder.sce");
+
+ // Check Scilab version
+ try
+ v = getversion("scilab");
+ catch
+ error(gettext("Scilab 5.3 or more is required."));
+ end
+ if v(1) < 5 & v(2) < 3 then
+ // new API in scilab 5.3
+ error(gettext("Scilab 5.3 or more is required."));
+ end
+
+ // Check modules_manager module availability
+ if ~isdef("tbx_build_loader") then
+ error(msprintf(gettext("%s module not installed."), "modules_manager"));
+ end
+
+ // Build Macros, Source and Gateway
+ tbx_builder_macros(toolbox_dir);
+ // tbx_builder_src(toolbox_dir);
+ tbx_builder_gateway(toolbox_dir);
+
+ // Clear old Help & Demo files
+ fmnames = mopen("macros" + filesep() + "names", "r");
+ mnames = mgetl(fmnames);
+ for i = 1:size(mnames, "r")
+ mdelete("help" + filesep() + "en_US" + filesep() + mnames(i) + ".xml");
+ mdelete("demos" + filesep() + mnames(i) + ".dem.sce");
+ end
+ mclose(fmnames);
+
+ // Generate and Build Help
+ help_from_sci("macros", "help" + filesep() + "en_US", "demos");
+ tbx_builder_help(toolbox_dir);
+
+ // Build Loader & Cleaner
+ tbx_build_loader(TOOLBOX_NAME, toolbox_dir);
+ tbx_build_cleaner(TOOLBOX_NAME, toolbox_dir);
+
+endfunction
+
+main_builder();
+
+ilib_verbose(verboseMode);
+
+clear main_builder, TOOLBOX_NAME, TOOLBOX_TITLE, verboseMode;
diff --git a/demos/Checkdims.dem.sce b/demos/Checkdims.dem.sce
new file mode 100644
index 0000000..cc330cf
--- /dev/null
+++ b/demos/Checkdims.dem.sce
@@ -0,0 +1,19 @@
+mode(1)
+//
+// Demo of Checkdims.sci
+//
+
+// The function takes a 2 x 3 matrix of doubles.
+function y = myfunction ( x )
+Checkdims ( "myfunction" , x , "x" , 1 , [2 3] )
+y = x
+endfunction
+// Calling sequences which work
+y = myfunction ( ones(2,3) )
+y = myfunction ( zeros(2,3) )
+// Calling sequences which generate an error
+y = myfunction ( ones(1,3) )
+y = myfunction ( zeros(2,4) )
+halt() // Press return to continue
+
+//========= E N D === O F === D E M O =========//
diff --git a/demos/Checklhs.dem.sce b/demos/Checklhs.dem.sce
new file mode 100644
index 0000000..d8af9e6
--- /dev/null
+++ b/demos/Checklhs.dem.sce
@@ -0,0 +1,48 @@
+mode(1)
+//
+// Demo of Checklhs.sci
+//
+
+// The function takes 3 input arguments and 1/2 output arguments
+function varargout = myfunction ( x1 , x2 , x3 )
+[lhs, rhs] = argn()
+Checkrhs ( "myfunction" , rhs , 3 : 3 )
+Checklhs ( "myfunction" , lhs , 1 : 2 )
+y1 = x1 + x2
+y2 = x2 + x3
+varargout(1) = y1
+if ( lhs == 2 ) then
+varargout(2) = y2
+end
+endfunction
+// Calling sequences which work
+myfunction ( 1 , 2 , 3 )
+y1 = myfunction ( 1 , 2 , 3 )
+[ y1 , y2 ] = myfunction ( 1 , 2 , 3 )
+// Calling sequences which generate an error
+[ y1 , y2 , y3 ] = myfunction ( 1 , 2 , 3 )
+halt() // Press return to continue
+
+// The function takes 1 or 3 output arguments, but not 2
+function varargout = myfunction ( x1 , x2 , x3 )
+[lhs, rhs] = argn()
+Checkrhs ( "myfunction" , rhs , 3 : 3 )
+Checklhs ( "myfunction" , lhs , [1 3] )
+y1 = x1 + x2
+y2 = x2 + x3
+y3 = x1 + x3
+varargout(1) = y1
+if ( lhs == 3 ) then
+varargout(2) = y2
+varargout(3) = y3
+end
+endfunction
+// Calling sequences which work
+myfunction ( 1 , 2 , 3 )
+y1 = myfunction ( 1 , 2 , 3 )
+[ y1 , y2 , y3 ] = myfunction ( 1 , 2 , 3 )
+// Calling sequences which generate an error
+[y1 , y2] = myfunction ( 1 , 2 , 3 )
+halt() // Press return to continue
+
+//========= E N D === O F === D E M O =========//
diff --git a/demos/Checkrhs.dem.sce b/demos/Checkrhs.dem.sce
new file mode 100644
index 0000000..c0f3967
--- /dev/null
+++ b/demos/Checkrhs.dem.sce
@@ -0,0 +1,72 @@
+mode(1)
+//
+// Demo of Checkrhs.sci
+//
+
+// The function takes 2/3 input arguments and 1 output arguments
+function y = myfunction ( varargin )
+[lhs, rhs] = argn()
+Checkrhs ( "myfunction" , rhs , 2:3 )
+Checklhs ( "myfunction" , lhs , 1 )
+x1 = varargin(1)
+x2 = varargin(2)
+if ( rhs >= 3 ) then
+x3 = varargin(3)
+else
+x3 = 2
+end
+y = x1 + x2 + x3
+endfunction
+// Calling sequences which work
+y = myfunction ( 1 , 2 )
+y = myfunction ( 1 , 2 , 3 )
+// Calling sequences which generate an error
+y = myfunction ( 1 )
+y = myfunction ( 1 , 2 , 3 , 4 )
+halt() // Press return to continue
+
+// The function takes 2 or 4 input arguments, but not 3
+function y = myfunction ( varargin )
+[lhs, rhs] = argn()
+Checkrhs ( "myfunction" , rhs , [2 4] )
+Checklhs ( "myfunction" , lhs , 1 )
+x1 = varargin(1)
+x2 = varargin(2)
+if ( rhs >= 3 ) then
+x3 = varargin(3)
+x4 = varargin(4)
+else
+x3 = 2
+x4 = 3
+end
+y = x1 + x2 + x3 + x4
+endfunction
+// Calling sequences which work
+y = myfunction ( 1 , 2 )
+y = myfunction ( 1 , 2 , 3 , 4 )
+// Calling sequences which generate an error
+y = myfunction ( 1 )
+y = myfunction ( 1 , 2 , 3 )
+y = myfunction ( 1 , 2 , 3 , 4, 5 )
+halt() // Press return to continue
+
+// The function takes 2 input arguments and 0/1 output arguments.
+// Notice that if the checkrhs function is not called,
+// the variable x2 might be used from the user's context,
+// that is, if the caller has defined the variable x2, it
+// is used in the callee.
+// Here, we want to avoid this.
+function y = myfunction ( x1 , x2 )
+[lhs, rhs] = argn()
+Checkrhs ( "myfunction" , rhs , 2 )
+Checklhs ( "myfunction" , lhs , [0 1] )
+y = x1 + x2
+endfunction
+// Calling sequences which work
+y = myfunction ( 1 , 2 )
+// Calling sequences which generate an error
+y = myfunction ( 1 )
+y = myfunction ( 1 , 2 , 3 )
+halt() // Press return to continue
+
+//========= E N D === O F === D E M O =========//
diff --git a/demos/Checktype.dem.sce b/demos/Checktype.dem.sce
new file mode 100644
index 0000000..76a5edd
--- /dev/null
+++ b/demos/Checktype.dem.sce
@@ -0,0 +1,33 @@
+mode(1)
+//
+// Demo of Checktype.sci
+//
+
+// The function takes a string argument.
+function myfunction ( x )
+Checktype ( "myfunction" , x , "x" , 1 , "string" )
+disp("This is a string")
+endfunction
+// Calling sequences which work
+myfunction ( "Scilab" )
+// Calling sequences which generate an error
+myfunction ( 123456 )
+halt() // Press return to continue
+
+// The function takes a string or a matrix of doubles argument.
+function myfunction ( x )
+Checktype ( "myfunction" , x , "x" , 1 , [ "string" "constant" ] )
+if ( typeof(x) == "string" ) then
+disp("This is a matrix of strings")
+else
+disp("This is a matrix of doubles")
+end
+endfunction
+// Calling sequences which work
+myfunction ( "Scilab" )
+myfunction ( 123456 )
+// Calling sequences which generate an error
+myfunction ( uint8(2) )
+halt() // Press return to continue
+
+//========= E N D === O F === D E M O =========//
diff --git a/demos/Checkvector.dem.sce b/demos/Checkvector.dem.sce
new file mode 100644
index 0000000..689802e
--- /dev/null
+++ b/demos/Checkvector.dem.sce
@@ -0,0 +1,22 @@
+mode(1)
+//
+// Demo of Checkvector.sci
+//
+
+// The function takes a vector of 3 doubles.
+function y = myfunction ( x )
+Checkvector ( "myfunction" , x , "x" , 1 , 3 )
+y = x
+endfunction
+// Calling sequences which work
+y = myfunction ( ones(1,3) )
+y = myfunction ( zeros(3,1) )
+// Calling sequences which generate an error
+// The following are not vectors
+y = myfunction ( ones(2,3) )
+y = myfunction ( zeros(3,2) )
+// The following have the wrong number of entries
+y = myfunction ( ones(1,3) )
+halt() // Press return to continue
+
+//========= E N D === O F === D E M O =========//
diff --git a/demos/Filterdims.dem.sce b/demos/Filterdims.dem.sce
new file mode 100644
index 0000000..a14d7d6
--- /dev/null
+++ b/demos/Filterdims.dem.sce
@@ -0,0 +1,19 @@
+mode(1)
+//
+// Demo of Filterdims.sci
+//
+
+// The function takes a 2 x 3 matrix of doubles.
+function y = myfunction ( x )
+Filterdims ( "myfunction" , x , "x" , 1 , [2 3] )
+y = x
+endfunction
+// Calling sequences which work
+y = myfunction ( ones(2,3) )
+y = myfunction ( zeros(2,3) )
+// Calling sequences which generate an error
+y = myfunction ( ones(1,3) )
+y = myfunction ( zeros(2,4) )
+halt() // Press return to continue
+
+//========= E N D === O F === D E M O =========//
diff --git a/demos/Optimization_Toolbox.dem.gateway.sce b/demos/Optimization_Toolbox.dem.gateway.sce
new file mode 100644
index 0000000..b33d2c4
--- /dev/null
+++ b/demos/Optimization_Toolbox.dem.gateway.sce
@@ -0,0 +1,13 @@
+function subdemolist = demo_gateway()
+
+ demopath = get_absolute_file_path(TOOLBOX_NAME + ".dem.gateway.sce");
+
+ subdemolist = ["qcqpglob", "qcqpglob.dem.sce"];
+
+ subdemolist(:,2) = demopath + subdemolist(:,2);
+
+endfunction
+
+subdemolist = demo_gateway();
+
+clear demo_gateway;
diff --git a/demos/fmaxflow.dem.sce b/demos/fmaxflow.dem.sce
new file mode 100644
index 0000000..bc44661
--- /dev/null
+++ b/demos/fmaxflow.dem.sce
@@ -0,0 +1,76 @@
+mode(1)
+//
+// Demo of fmaxflow.sci
+//
+
+halt() // Press return to continue
+
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3]
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4]
+capacities = [20, 30, 10, 40, 30, 10, 20, 5, 20]
+st=[0,4]
+[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st)
+// Press Enter to continue
+//Output
+//Max flow = 60
+//Arc Flow Capacity
+//0->1 20 20
+//0->2 30 30
+//0->3 10 10
+//1->2 0 40
+//1->4 20 30
+//2->3 10 10
+//2->4 20 20
+//3->2 0 5
+//3->4 20 20
+halt() // Press return to continue
+
+//An optimal solution was found
+// status =
+//
+// 0
+// arcflows =
+//
+// 20 30 10 0 20 10 20 0 20
+// maxflow =
+//
+// 60
+halt() // Press return to continue
+
+halt() // Press return to continue
+
+halt() // Press return to continue
+
+start_nodes = [1, 1, 2, 2, 3, 3, 0]
+end_nodes = [2, 4, 3, 4, 2, 4, 5]
+capacities = [40, 30, 10, 20, 5, 20, 50]
+st=[0,4]
+[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st)
+//Press Enter to continue
+// Output
+// Max flow = 0
+//Arc Flow Capacity
+//1->2 0 40
+//1->4 0 30
+//2->3 0 10
+//2->4 0 20
+//3->2 0 5
+//3->4 0 20
+//0->5 0 50
+halt() // Press return to continue
+
+//There is no path connecting the specified source node : 0 and the specified target node : 4
+// status =
+//
+// 0
+// arcflows =
+//
+// []
+// maxflow =
+//
+// 0
+halt() // Press return to continue
+
+halt() // Press return to continue
+
+//========= E N D === O F === D E M O =========//
diff --git a/demos/fshortestpath.dem.sce b/demos/fshortestpath.dem.sce
new file mode 100644
index 0000000..93d4b4b
--- /dev/null
+++ b/demos/fshortestpath.dem.sce
@@ -0,0 +1,64 @@
+mode(1)
+//
+// Demo of fshortestpath.sci
+//
+
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3]
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4]
+weights = [20, 30, 10, 40, 30, 10, 20, 5, 20]
+st=[0,4]
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+//Press Enter to continue
+//Output :
+//Shortest path from start-node:0 to end-node:4 is :
+//0 -> 3 -> 4
+//Minumum cost (using the said path) :- 30.000000
+halt() // Press return to continue
+
+halt() // Press return to continue
+
+specifying disconnected-distance
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3]
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4]
+weights = [20, 30, 10, 10, 30, 10, 20, 5, 30]
+st=[0,4]
+disconnected_distance=30
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+//Press Enter to continue
+//Output
+//Shortest path from start-node:0 to end-node:4 is :
+//0 -> 3 -> 2 -> 4
+//Minumum cost (using the said path) :- 35.000000
+//Shortest/Lowest Cost Path found.
+halt() // Press return to continue
+
+halt() // Press return to continue
+
+start_nodes = [1, 1, 2, 2, 3, 3, 0]
+end_nodes = [2, 4, 3, 4, 2, 4, 5]
+weights = [40, 30, 10, 20, 5, 20, 30]
+st=[0,4]
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+//Press Enter to continue
+//No path connecting start-node: 0 and end-node=: 4.
+//No Solution![0 , 4]
+halt() // Press return to continue
+
+halt() // Press return to continue
+
+start_nodes=[ 0 0 1 1 2 4 5 4];
+end_nodes= [ 1 5 2 5 3 3 4 2];
+weights=[10 8 5 2 7 10 10 8];
+st=[0,3]
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+//Press Enter to continue
+//Output
+//Shortest path from start-node:0 to end-node:3 is :
+//0 -> 1 -> 2 -> 3
+//Minumum cost (using the said path) :- 22.000000
+// Shortest/Lowest Cost Path found.
+halt() // Press return to continue
+
+halt() // Press return to continue
+
+//========= E N D === O F === D E M O =========//
diff --git a/demos/jssp.dem.sce b/demos/jssp.dem.sce
new file mode 100644
index 0000000..f9b7390
--- /dev/null
+++ b/demos/jssp.dem.sce
@@ -0,0 +1,57 @@
+mode(1)
+//
+// Demo of jssp.sci
+//
+
+//INPUT :
+halt() // Press return to continue
+
+machines = 3;
+halt() // Press return to continue
+
+jobs = 3;
+halt() // Press return to continue
+
+jssp_mode = 0;
+halt() // Press return to continue
+
+tasks=[ 1 1 3;
+1 2 2;
+1 3 2;
+2 1 2;
+2 3 1;
+2 2 4;
+3 2 4;
+3 3 3;
+];
+halt() // Press return to continue
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, []);
+halt() // Press return to continue
+
+//INPUT:
+halt() // Press return to continue
+
+machines = 2;
+halt() // Press return to continue
+
+jobs = 5;
+halt() // Press return to continue
+
+jssp_mode = 0;
+halt() // Press return to continue
+
+tasks = [1 1 13;
+1 2 3;
+2 1 2;
+2 2 5;
+3 1 1;
+3 2 3;
+4 1 4;
+4 2 6;
+5 1 5;
+5 2 7];
+halt() // Press return to continue
+
+[makespan, schedule, status] = jssp (machines, jobs, jssp_mode, tasks, []);
+//========= E N D === O F === D E M O =========//
diff --git a/demos/linsum.dem.sce b/demos/linsum.dem.sce
new file mode 100644
index 0000000..28c90a1
--- /dev/null
+++ b/demos/linsum.dem.sce
@@ -0,0 +1,19 @@
+mode(1)
+//
+// Demo of linsum.sci
+//
+
+//Ref :
+//http://www.hungarianalgorithm.com/examplehungarianalgorithm.php
+halt() // Press return to continue
+
+kNumLeftNodes = 4;
+kNumRightNodes = 4;
+kCost = [82, 83, 69, 92; 77, 37, 49, 92; 11, 69, 5, 86; 8, 9, 98, 23];
+[cost, assignment, status] = linsum(kNumLeftNodes, kNumRightNodes, kCost);
+cost
+assignment
+status
+halt() // Press return to continue
+
+//========= E N D === O F === D E M O =========//
diff --git a/demos/min_cost_flow.dem.sce b/demos/min_cost_flow.dem.sce
new file mode 100644
index 0000000..8c6bd88
--- /dev/null
+++ b/demos/min_cost_flow.dem.sce
@@ -0,0 +1,33 @@
+mode(1)
+//
+// Demo of min_cost_flow.sci
+//
+
+//Ref : Example 2 :
+//http://www.yourarticlelibrary.com/ergonomics/operation-research/checking-for-optimality-transportation-problem/34743/
+halt() // Press return to continue
+
+// Before balancing (Infeasible):
+// kNumSources = 4;
+// kNumTargets = 4;
+// kCost = [4, 6, 8, 13; 13, 11, 10, 8; 14, 4, 10, 13; 9, 11, 13, 8];
+// kCapacity = [200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200];
+// kSupply = [50, 70, 30, 50];
+// kDemand = [25, 35, 105, 20];
+// [cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
+halt() // Press return to continue
+
+// After balancing (Optimal):
+kNumSources = 4;
+kNumTargets = 5;
+kCost = [4, 6, 8, 13, 0; 13, 11, 10, 8, 0; 14, 4, 10, 13, 0; 9, 11, 13, 8, 0];
+kCapacity = [200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200];
+kSupply = [50, 70, 30, 50];
+kDemand = [25, 35, 105, 20, 15];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
+cost
+flow
+status
+halt() // Press return to continue
+
+//========= E N D === O F === D E M O =========//
diff --git a/demos/qcqpglob.dem.sce b/demos/qcqpglob.dem.sce
new file mode 100644
index 0000000..433861b
--- /dev/null
+++ b/demos/qcqpglob.dem.sce
@@ -0,0 +1,34 @@
+mode(1)
+//
+// Demo of qcqpglob.sci
+//
+
+// Sample Only
+// Min. Z = 100 - x^2 + 2 * y^2 - 3 * x * y + 4 * x - 5 * y
+// Subject to:
+// 60 >= x^2 + y^2 - x - y >= -100
+// -10 <= x <= 6
+// -10 <= y <= 6
+halt() // Press return to continue
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
+kSoln
+kSolnVector
+status
+halt() // Press return to continue
+
+//========= E N D === O F === D E M O =========//
diff --git a/demos/tsp.dem.sce b/demos/tsp.dem.sce
new file mode 100644
index 0000000..a4976c4
--- /dev/null
+++ b/demos/tsp.dem.sce
@@ -0,0 +1,94 @@
+mode(1)
+//
+// Demo of tsp.sci
+//
+
+halt() // Press return to continue
+
+adj=[0 10 50 45;
+10 0 25 25;
+50 25 0 40;
+45 25 40 0];
+halt() // Press return to continue
+
+start_node=1;
+halt() // Press return to continue
+
+[mincost,path,status]=tsp(adj,start_node);
+//Press ENTER to continue
+halt() // Press return to continue
+
+//OUTPUT :
+//'ROUTING_SUCCESS' ; An optimal solution was found
+//Minimum cost -> 120
+//Optimal Path :-
+//1 ->2 ->3 ->4 ->1
+halt() // Press return to continue
+
+halt() // Press return to continue
+
+adj=[0 10 15 20;
+10 0 35 25;
+15 35 0 30;
+20 25 30 0];
+halt() // Press return to continue
+
+start_node=1;
+halt() // Press return to continue
+
+labels=['A' 'B' 'C' 'D'];
+[mincost,path,status]=tsp(adj,start_node,labels);
+//Press ENTER to continue
+//
+//OUTPUT :
+//'ROUTING_SUCCESS' ; An optimal solution was found
+//Minimum cost -> 80
+//Optimal Path :-
+// A (1) -> B (2) -> D (4) -> C (3) ->A (1)
+halt() // Press return to continue
+
+halt() // Press return to continue
+
+adj=[0 1 2 1 1;
+1 0 1 2 1;
+2 1 0 1 2;
+1 2 1 0 2;
+1 1 2 2 0];
+halt() // Press return to continue
+
+start_node=1;
+halt() // Press return to continue
+
+labels=['alpha' 'beta' 'gamma' 'theta' 'sigma'];
+halt() // Press return to continue
+
+[mincost,path,status]=tsp(adj,start_node,labels);
+//Press ENTER to continue
+halt() // Press return to continue
+
+//OUTPUT :
+//'ROUTING_SUCCESS' ; An optimal solution was found
+//Minimum cost -> 5
+//Optimal Path :-
+// alpha (1) -> sigma (5) -> beta (2) -> gamma (3) -> theta (4) ->alpha (1)
+halt() // Press return to continue
+
+halt() // Press return to continue
+
+adj=[0 10 -1 -2;
+10 0 35 25;
+-1 35 0 30;
+-1 25 30 0];
+halt() // Press return to continue
+
+start_node=1;
+halt() // Press return to continue
+
+[mincost,path,status]=tsp(adj,start_node);
+//Press ENTER to continue
+//
+//OUTPUT :
+//'ROUTING_FAIL' ; No optimal solution was found. No path starting and ending at the specified 'start node'(1) found.
+halt() // Press return to continue
+
+//========= E N D === O F === D E M O =========//
diff --git a/demos/vrp.dem.sce b/demos/vrp.dem.sce
new file mode 100644
index 0000000..f6d22a8
--- /dev/null
+++ b/demos/vrp.dem.sce
@@ -0,0 +1,81 @@
+mode(1)
+//
+// Demo of vrp.sci
+//
+
+//INPUT:
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+halt() // Press return to continue
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+halt() // Press return to continue
+
+start = 1;
+halt() // Press return to continue
+
+vehicles = 3;
+halt() // Press return to continue
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+halt() // Press return to continue
+
+service_time_per_demand=3;
+halt() // Press return to continue
+
+max_vehicle_capacity = 60;
+halt() // Press return to continue
+
+[total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand);
+halt() // Press return to continue
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+halt() // Press return to continue
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+halt() // Press return to continue
+
+start = [] ;
+halt() // Press return to continue
+
+vehicles = 3;
+halt() // Press return to continue
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+halt() // Press return to continue
+
+service_time_per_demand=3;
+halt() // Press return to continue
+
+max_vehicle_capacity = 60;
+halt() // Press return to continue
+
+[total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand);
+halt() // Press return to continue
+
+halt() // Press return to continue
+
+//========= E N D === O F === D E M O =========//
diff --git a/etc/Optimization_Toolbox.quit b/etc/Optimization_Toolbox.quit
new file mode 100644
index 0000000..fa8521b
--- /dev/null
+++ b/etc/Optimization_Toolbox.quit
@@ -0,0 +1,52 @@
+if ( isdef("toolbox_optimization") <> %t ) then
+ warning("Toolbox is not loaded. Please load to proceed!");
+end
+
+verboseMode = ilib_verbose();
+ilib_verbose(0);
+
+function quitModule()
+
+ TOOLBOX_NAME = "Optimization_Toolbox";
+ TOOLBOX_TITLE = "Optimization Toolbox";
+
+ mprintf("Stop " + TOOLBOX_NAME + "\n");
+
+ etc_tlbx = get_absolute_file_path(TOOLBOX_NAME + ".quit");
+ etc_tlbx = getshortpathname(etc_tlbx);
+ root_tlbx = strncpy( etc_tlbx, length(etc_tlbx) - 5 ); // length("\etc\") = 5
+
+ // Unlink Libraries
+ [bOK, ilib] = c_link("lib" + TOOLBOX_NAME + "_cpp");
+ if bOK then
+ ulink(ilib);
+ end
+ [bOK, ilib] = c_link("lib" + TOOLBOX_NAME + "_c");
+ if bOK then
+ ulink(ilib);
+ end
+ [bOK, ilib] = c_link("lib" + TOOLBOX_NAME + "_java");
+ if bOK then
+ ulink(ilib);
+ end
+ [bOK, ilib] = c_link("lib" + TOOLBOX_NAME + "_fortran");
+ if bOK then
+ ulink(ilib);
+ end
+ if isdef("optimization_libs") then
+ ulink(optimization_libs);
+ end
+
+ // Remove Preferences GUI
+ // =============================================================================
+ if getscilabmode() == "STD" then
+ removeModulePreferences(root_tlbx);
+ end
+
+endfunction
+
+quitModule();
+
+ilib_verbose(verboseMode);
+
+clear quitModule toolbox_optimization optimization_libs TOOLBOX_NAME TOOLBOX_TITLE verboseMode;
diff --git a/etc/Optimization_Toolbox.start b/etc/Optimization_Toolbox.start
new file mode 100644
index 0000000..699ae40
--- /dev/null
+++ b/etc/Optimization_Toolbox.start
@@ -0,0 +1,82 @@
+if isdef("toolbox_optimization") then
+ error("Toolbox is already loaded. Please unload to proceed!");
+end
+
+verboseMode = ilib_verbose();
+ilib_verbose(0);
+
+TOOLBOX_NAME = "Optimization_Toolbox";
+TOOLBOX_TITLE = "Optimization Toolbox";
+
+if (isdef("optimization_libs") <> %t) then
+ optimization_libs = [];
+end
+
+function [toolbox_optimization, optimization_libs] = startModule()
+
+ mprintf("Start " + TOOLBOX_NAME + "\n");
+
+ etc_tlbx = get_absolute_file_path(TOOLBOX_NAME + ".start");
+ etc_tlbx = getshortpathname(etc_tlbx);
+ root_tlbx = strncpy( etc_tlbx, length(etc_tlbx) - 5 ); // length("\etc\") = 5
+
+ // Load Macros
+ mprintf("\tLoad macros\n");
+ pathmacros = pathconvert( root_tlbx ) + "macros" + filesep();
+ toolbox_optimization = lib(pathmacros);
+
+ // Load Libraries
+ mprintf("\tLoad Libraries\n");
+ [a, opt] = getversion();
+ ARCH = opt(2);
+ if getos()=="Windows" then
+ // MSVS Shared DLL don't provide Native Support to Scilab.
+ else
+ lib_path = root_tlbx + filesep() + "thirdparty" + filesep() + "linux" + filesep() + "lib" + filesep() + ARCH + filesep();
+ optimization_libs($+1) = link(lib_path + "libCoinUtils.so");
+ optimization_libs($+1) = link(lib_path + "libOsi.so");
+ optimization_libs($+1) = link(lib_path + "libClp.so");
+ optimization_libs($+1) = link(lib_path + "libOsiClp.so");
+ optimization_libs($+1) = link(lib_path + "libClpSolver.so");
+ optimization_libs($+1) = link(lib_path + "libcoinmumps.so");
+ optimization_libs($+1) = link(lib_path + "libipopt.so");
+ optimization_libs($+1) = link(lib_path + "libminotaur.so");
+ optimization_libs($+1) = link(lib_path + "libmntrosilp.so");
+ optimization_libs($+1) = link(lib_path + "libmntripopt.so");
+ optimization_libs($+1) = link(lib_path + "libmntrengfac.so");
+ optimization_libs($+1) = link(lib_path + "libortools.so");
+ optimization_libs($+1) = link(lib_path + "libcvrptw_lib.so");
+ optimization_libs($+1) = link(lib_path + "libdimacs.so");
+ optimization_libs($+1) = link(lib_path + "libfap.so");
+ optimization_libs($+1) = link(lib_path + "libjniortools.so");
+ end
+
+ // Load Gateway
+ mprintf("\tLoad Gateway\n");
+ exec(pathconvert(root_tlbx + filesep() + "sci_gateway" + filesep() + "loader_gateway.sce", %f));
+
+ // Load and add help chapter
+ // =============================================================================
+ if or(getscilabmode() == ["NW";"STD"]) then
+ mprintf("\tLoad help\n");
+ path_addchapter = pathconvert(root_tlbx + filesep() + "jar");
+ if ( isdir(path_addchapter) <> [] ) then
+ add_help_chapter(TOOLBOX_NAME, path_addchapter, %F);
+ end
+ end
+
+ // Load demos
+ // =============================================================================
+ if or(getscilabmode() == ["NW";"STD"]) then
+ mprintf("\tLoad demos\n");
+ pathdemos = pathconvert(root_tlbx + filesep() + "demos" + filesep() + TOOLBOX_NAME + ".dem.gateway.sce", %F, %T);
+ add_demo(TOOLBOX_NAME, pathdemos);
+ end
+
+endfunction
+
+toolbox_optimization = startModule();
+
+ilib_verbose(verboseMode);
+
+clear startModule TOOLBOX_NAME TOOLBOX_TITLE verboseMode;
diff --git a/etc/README.rst b/etc/README.rst
new file mode 100644
index 0000000..2ffc09f
--- /dev/null
+++ b/etc/README.rst
@@ -0,0 +1,14 @@
+DEMOS Files
+===========
+
+Start and exit files of the toolbox.
+
+.start
+-------
+
+It will run a script when loader.sce is run from root toolbox directory. It will run loader files in all of the directories and link to important library.
+
+.quit
+-------
+
+It will run a script when unloader.sce is run from root toolbox directory. It will unlink all of the important library.
diff --git a/help/builder_help.sce b/help/builder_help.sce
new file mode 100644
index 0000000..e05af12
--- /dev/null
+++ b/help/builder_help.sce
@@ -0,0 +1,5 @@
+help_dir = get_absolute_file_path('builder_help.sce');
+
+tbx_builder_help_lang("en_US", help_dir);
+
+clear help_dir;
\ No newline at end of file
diff --git a/help/en_US/Checkdims.xml b/help/en_US/Checkdims.xml
new file mode 100644
index 0000000..df27a6e
--- /dev/null
+++ b/help/en_US/Checkdims.xml
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+ Checkdims
+ Generates an error if the variable has not the required size.
+
+
+
+
+ Calling Sequence
+
+ errmsg = Checkdims ( funname , var , varname , ivar , matdims )
+
+
+
+
+
+ Parameters
+
+ funname :
+ a 1 x 1 matrix of strings, the name of the calling function.
+ var :
+ a 1 x 1 matrix of valid Scilab data type, the variable
+ varname :
+ a 1 x 1 matrix of string, the name of the variable
+ ivar :
+ a 1 x 1 matrix of floating point integers, the index of the input argument in the calling sequence
+ matdims :
+ 1 x 2 matrix of floating point integers, the number of rows, columns for the variable #ivar
+ errmsg :
+ a 1 x 1 matrix of strings, the error message. If there was no error, the error message is the empty matrix.
+
+
+
+
+ Description
+
+This function is designed to be used to design functions where
+the input argument has a known shape.
+This function cannot be use when var is a function, or more
+generally, for any input argument for which the size function
+does not work.
+Last update : 05/08/2010.
+
+
+
+
+
+
+ Examples
+
+
+
+
+ Authors
+
+ Michael Baudin - 2010 - DIGITEO
+
+
+
diff --git a/help/en_US/Checklhs.xml b/help/en_US/Checklhs.xml
new file mode 100644
index 0000000..ce60ab8
--- /dev/null
+++ b/help/en_US/Checklhs.xml
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+ Checklhs
+ Generates an error if the number of LHS is not in given set.
+
+
+
+
+ Calling Sequence
+
+ errmsg = Checklhs ( funname , lhs , lhsset )
+
+
+
+
+
+ Parameters
+
+ funname :
+ a 1 x 1 matrix of strings, the name of the calling function.
+ lhs :
+ a 1 x 1 matrix of floating point integers, the actual number of output arguments
+ lhsset :
+ a 1 x n or n x 1 matrix of floating point integers, the authorized number of output arguments
+ errmsg :
+ a 1 x 1 matrix of strings, the error message. If there was no error, the error message is the empty matrix.
+
+
+
+
+ Description
+
+This function is designed to be used to design functions with
+variable number of output arguments.
+Notice that it is useless to call this function if the
+function definition does not use the varargout statement.
+Notice that a function as a minimum of 1 output argument.
+Last update : 29/07/2010.
+
+
+
+
+
+
+ Examples
+
+
+
+
+ Authors
+
+ Michael Baudin - 2010 - DIGITEO
+
+
+
diff --git a/help/en_US/Checkrhs.xml b/help/en_US/Checkrhs.xml
new file mode 100644
index 0000000..98e6244
--- /dev/null
+++ b/help/en_US/Checkrhs.xml
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+ Checkrhs
+ Generates an error if the number of RHS is not in given set.
+
+
+
+
+ Calling Sequence
+
+ errmsg = Checkrhs ( funname , rhs , rhsset )
+
+
+
+
+
+ Parameters
+
+ funname :
+ a 1 x 1 matrix of strings, the name of the calling function.
+ rhs :
+ a 1 x 1 matrix of floating point integers, the actual number of input arguments
+ rhsset :
+ a 1 x n or n x 1 matrix of floating point integers, the authorized number of input arguments
+ errmsg :
+ a 1 x 1 matrix of strings, the error message. If there was no error, the error message is the empty matrix.
+
+
+
+
+ Description
+
+This function is designed to be used to design functions with
+variable number of input arguments.
+Notice that it is useless to call this function if the
+function definition does not use the varargin statement.
+Last update : 05/08/2010.
+Last update : 29/07/2010.
+
+
+
+
+
+
+ Examples
+ = 3 ) then
+x3 = varargin(3)
+else
+x3 = 2
+end
+y = x1 + x2 + x3
+endfunction
+// Calling sequences which work
+y = myfunction ( 1 , 2 )
+y = myfunction ( 1 , 2 , 3 )
+// Calling sequences which generate an error
+y = myfunction ( 1 )
+y = myfunction ( 1 , 2 , 3 , 4 )
+
+// The function takes 2 or 4 input arguments, but not 3
+function y = myfunction ( varargin )
+[lhs, rhs] = argn()
+Checkrhs ( "myfunction" , rhs , [2 4] )
+Checklhs ( "myfunction" , lhs , 1 )
+x1 = varargin(1)
+x2 = varargin(2)
+if ( rhs >= 3 ) then
+x3 = varargin(3)
+x4 = varargin(4)
+else
+x3 = 2
+x4 = 3
+end
+y = x1 + x2 + x3 + x4
+endfunction
+// Calling sequences which work
+y = myfunction ( 1 , 2 )
+y = myfunction ( 1 , 2 , 3 , 4 )
+// Calling sequences which generate an error
+y = myfunction ( 1 )
+y = myfunction ( 1 , 2 , 3 )
+y = myfunction ( 1 , 2 , 3 , 4, 5 )
+
+// The function takes 2 input arguments and 0/1 output arguments.
+// Notice that if the checkrhs function is not called,
+// the variable x2 might be used from the user's context,
+// that is, if the caller has defined the variable x2, it
+// is used in the callee.
+// Here, we want to avoid this.
+function y = myfunction ( x1 , x2 )
+[lhs, rhs] = argn()
+Checkrhs ( "myfunction" , rhs , 2 )
+Checklhs ( "myfunction" , lhs , [0 1] )
+y = x1 + x2
+endfunction
+// Calling sequences which work
+y = myfunction ( 1 , 2 )
+// Calling sequences which generate an error
+y = myfunction ( 1 )
+y = myfunction ( 1 , 2 , 3 )
+
+ ]]>
+
+
+
+ Authors
+
+ Michael Baudin - 2010 - DIGITEO
+
+
+
diff --git a/help/en_US/Checktype.xml b/help/en_US/Checktype.xml
new file mode 100644
index 0000000..4e0fb9a
--- /dev/null
+++ b/help/en_US/Checktype.xml
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+ Checktype
+ Generates an error if the given variable is not of expected type.
+
+
+
+
+ Calling Sequence
+
+ errmsg = Checktype ( funname , var , varname , ivar , expectedtype )
+
+
+
+
+
+ Parameters
+
+ funname :
+ a 1 x 1 matrix of strings, the name of the calling function.
+ var :
+ a 1 x 1 matrix of valid Scilab data type, the variable
+ varname :
+ a 1 x 1 matrix of string, the name of the variable
+ ivar :
+ a 1 x 1 matrix of floating point integers, the index of the input argument in the calling sequence
+ expectedtype :
+ a n x 1 or 1 x n matrix of strings, the available types for the variable #ivar
+ errmsg :
+ a 1 x 1 matrix of strings, the error message. If there was no error, the error message is the empty matrix.
+
+
+
+
+ Description
+
+This function is designed to be used to design functions with
+input arguments with variable type.
+We use the typeof function to compute the type of the variable:
+see help typeof to get the list of all available values for expectedtype.
+Last update : 29/07/2010.
+
+
+
+
+
+
+ Examples
+
+
+
+
+ Authors
+
+ Michael Baudin - 2010 - DIGITEO
+
+
+
diff --git a/help/en_US/Checkvector.xml b/help/en_US/Checkvector.xml
new file mode 100644
index 0000000..7357075
--- /dev/null
+++ b/help/en_US/Checkvector.xml
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+ Checkvector
+ Generates an error if the variable is not a vector.
+
+
+
+
+ Calling Sequence
+
+ errmsg = Checkvector ( funname , var , varname , ivar )
+
+
+
+
+
+ Parameters
+
+ funname :
+ a 1 x 1 matrix of strings, the name of the calling function.
+ var :
+ a 1 x 1 matrix of valid Scilab data type, the variable
+ varname :
+ a 1 x 1 matrix of string, the name of the variable
+ ivar :
+ a 1 x 1 matrix of floating point integers, the index of the input argument in the calling sequence
+ nbval :
+ a 1 x 1 matrix of floating point integers, the number of entries in the vector.
+ errmsg :
+ a 1 x 1 matrix of strings, the error message. If there was no error, the error message is the empty matrix.
+
+
+
+
+ Description
+
+This function is designed to be used to design functions where
+the input argument is a vector, that is, a matrix for which
+nrows == 1 or ncols == 1.
+This function cannot be use when var is a function, or more
+generally, for any input argument for which the size function
+does not work.
+
+
+
+
+
+
+ Examples
+
+
+
+
+ Authors
+
+ Michael Baudin - 2010 - DIGITEO
+
+
+
diff --git a/help/en_US/Filterdims.xml b/help/en_US/Filterdims.xml
new file mode 100644
index 0000000..5b7c2ae
--- /dev/null
+++ b/help/en_US/Filterdims.xml
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+ Filterdims
+ Generates an error if the variable has not the required size.
+
+
+
+
+ Calling Sequence
+
+ errmsg = Filterdims ( funname , var , varname , ivar , matdims )
+
+
+
+
+
+ Parameters
+
+ funname :
+ a 1 x 1 matrix of strings, the name of the calling function.
+ var :
+ a 1 x 1 matrix of valid Scilab data type, the variable
+ varname :
+ a 1 x 1 matrix of string, the name of the variable
+ ivar :
+ a 1 x 1 matrix of floating point integers, the index of the input argument in the calling sequence
+ matdims :
+ 1 x 2 matrix of floating point integers, the number of rows, columns for the variable #ivar
+ errmsg :
+ a 1 x 1 matrix of strings, the error message. If there was no error, the error message is the empty matrix.
+
+
+
+
+ Description
+
+This function is designed to be used to design functions where
+the input argument has a known shape.
+This function cannot be use when var is a function, or more
+generally, for any input argument for which the size function
+does not work.
+Last update : 05/08/2010.
+
+
+
+
+
+
+ Examples
+
+
+
+
+ Authors
+
+ Michael Baudin - 2010 - DIGITEO
+
+
+
diff --git a/help/en_US/README.rst b/help/en_US/README.rst
new file mode 100644
index 0000000..95f8ace
--- /dev/null
+++ b/help/en_US/README.rst
@@ -0,0 +1,6 @@
+Help XML
+========
+
+This directory contains all of help files in XML. These files are automatically generated by help_from_sci function by the help of comments in Macro.
+
+By the help of this we can generate html and jar files.
diff --git a/help/en_US/build_help.sce b/help/en_US/build_help.sce
new file mode 100644
index 0000000..e883024
--- /dev/null
+++ b/help/en_US/build_help.sce
@@ -0,0 +1,5 @@
+help_lang_dir = get_absolute_file_path("build_help.sce");
+
+tbx_build_help(TOOLBOX_NAME, help_lang_dir);
+
+clear help_lang_dir;
diff --git a/help/en_US/fmaxflow.xml b/help/en_US/fmaxflow.xml
new file mode 100644
index 0000000..7f847fa
--- /dev/null
+++ b/help/en_US/fmaxflow.xml
@@ -0,0 +1,183 @@
+
+
+
+
+
+
+
+ fmaxflow
+ Solves the graph max-flow problem(a linear optimization problem) using an implementation of the push-relabel algorithm
+
+
+
+
+ Calling Sequence
+
+ [maxflow,arcflows]=fmaxflow(start_nodes,end_nodes,capacities,st)
+ [maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st)
+
+
+
+
+
+ Parameters
+
+ start_nodes :
+ a [1xn] vector (if the graph has 'n' arcs, for instance) of integral values which stores the numerical label of the start-nodes (tail-nodes) for each arc of the graph.
+ end_nodes :
+ a [1xn] vector of integral values which stores the value (numerical label) of the end-nodes(head-nodes) for each arc of the graph.
+ capacities :
+ a [1xn] vector of integral values which stores the capacities (max amount possible over a particular arc) of the respective arcs. Eg. The capacity at index 'i' of this matrix means the maximum amount possible over the arc defined by start_node[i]->end_node[i].
+ st :
+ a [1x2] vector which stores the numerical-label (value) of the source node and the target node, respectively.
+ maxflow :
+ a double representing the Maximum total Flow possible(i.e. Solution) through the system in the optimal solution, should there be one.
+ arcflows :
+ a [1xn] vector of double (if the graph has 'n' arcs, for instance) which represents the actual flow through the respective arcs in the optimal solution of the problem, should one exist.
+ status :
+ status flag returned by the Google OR-tools MaxFlow Solver function (details below)
+
+
+
+
+ Description
+
+
+\text{The \textbf{`Maximum-Flow' Problem } is a classic (linear) optimization problem for Flow Networks}^{*}\text{. Essentially a part of the class of \textbf{`Circulation Problems'}, it involves finding the maximum amount of flow possible from a specified (source) node to another (sink) node, in a given network.}\\
+\text{}\\
+^{*}\text{\underline{\textbf{Flow Network}} - A flow network (also called a `transportation network'), in graph theory, is essentially a directed graph with one (or more) \textbf{source} node(s) and one (or more) \textbf{sink} node(s) and several other standard nodes, connected by edges called \textbf{`arcs'}.}\\
+\text{\textbf{`Flow'} is any entity that circulates through the network, from the source to the sink. Eg. electric current in a printed circuit, water in a plumbing network, etc.}\\
+\text{}\\\\
+\text{}\\\\
+\text{\textbf{\underline{MATHEMATICAL STATEMENT} :}}\\
+\text{}\\
+\text{}\\
+
+
+\begin{math}
+\text{Let } N= \left(V,E\right) \text{ be a network with } s,t \in V \text{ denoting the source and sink nodes in } N\text{, respectively.}\\\\
+\text{Let } c_{uv} \text{ or } c\left(u,v\right) \text{ denote the capacity of the arc between node } u \text{ and } v.\\
+\text{capacity is a mapping } c:V\to R^{+} \\\\
+\text{Let } f_{uv} \text{ or } f\left(u,v)\right) \text{ denotes the flow between node } u \text{ and } v, \text{such that :}\\
+\text{ 1. } f_{uv} \leq c_{uv} \quad \forall \quad (u,v) \in E.\\
+\text{ 2. } \sum_{u:(u,v)\in E} f_{uv} = \sum_{u:(v,u) \in E} f_{vu}\quad \forall \quad v \in V \backslash \{s,t\}\quad\text{; conservation of flow}\\\\\\
+\text{}\\
+\text{}\\
+\text{}\\
+\textbf{\underline{Objective} :}
+\text{}\qquad\qquad\qquad Maximize \quad |f| = \sum_{v:(s,v) \in E}f_{sv} \text{,where }s\text{ is the source vertex for } N.\\\\
+\text{}\qquad\qquad\qquad\text{}\qquad\qquad\qquad |f| \text{ denotes the total amount of flow passing from the source to the sink}\\
+\end{math}
+\text{}\\
+\text{}\\
+\text{}\\
+\text{}\\
+
+
+
+status- the status of solution returned by the linked Google OR-Tools max-flow solver
+
+status=0 - OPTIMAL(An optimal solution was found)
+status=1 - INT_OVERFLOW(There is a feasible flow > max possible flow)
+status=2 - BAD_INPUT(The input is inconsistent)
+status=3 - BAD_RESULT (There was an error)
+
+
+
+
+
+
+
+
+
+ Examples
+ 1 20 20
+//0->2 30 30
+//0->3 10 10
+//1->2 0 40
+//1->4 20 30
+//2->3 10 10
+//2->4 20 20
+//3->2 0 5
+//3->4 20 20
+
+//An optimal solution was found
+// status =
+//
+// 0
+// arcflows =
+//
+// 20 30 10 0 20 10 20 0 20
+// maxflow =
+//
+// 60
+
+
+ ]]>
+
+
+
+ Examples
+ 2 0 40
+//1->4 0 30
+//2->3 0 10
+//2->4 0 20
+//3->2 0 5
+//3->4 0 20
+//0->5 0 50
+
+//There is no path connecting the specified source node : 0 and the specified target node : 4
+// status =
+//
+// 0
+// arcflows =
+//
+// []
+// maxflow =
+//
+// 0
+
+
+ ]]>
+
+
+
+ Authors
+
+ Samuel Wilson
+
+
+
diff --git a/help/en_US/fshortestpath.xml b/help/en_US/fshortestpath.xml
new file mode 100644
index 0000000..5492475
--- /dev/null
+++ b/help/en_US/fshortestpath.xml
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+
+ fshortestpath
+ Computes the shortest/minimum-cost path for a given graph using an implementation of the 'Bellman Ford' algorithm for weighted digraphs.
+
+
+
+
+ Calling Sequence
+
+ [mincost,shortestpath]=fshortestpath(start_nodes,end_nodes,weights,st)
+ [mincost,shortestpath]=fshortestpath(start_nodes,end_nodes,weights,st,disconnected_distance)
+ [mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+ [mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st,disconnected_distance)
+
+
+
+
+
+ Parameters
+
+ start_nodes :
+ a [1xn] vector (if the graph has 'n' arcs, for instance) of integral values which stores the numerical label of the start-nodes (tail-nodes) for each arc of the graph.
+ end_nodes :
+ a [1xn] vector of integral values which stores the numerical label of the end-nodes (head-nodes) for each arc of the graph.
+ weights :
+ a [1xn] vector of integral values which stores the weights/traversal costs for each of the edges/arcs of the given graph. Eg.-The weight at index 'i' of this vector refers to the cost/weight of the arc defined by start_node[i]->end_node[i].
+ st :
+ a [1x2] vector which stores the numerical-label of the source node and the target node respectively.
+ disconnected_distance :
+ a singular integral value which indicates that all the weight values greater than or equal to itself essentially mean a non-existent arc/edge/path, i.e. those edges of the given graph will not be considered for the current test. (allows testing with different threshold values if need be)
+ mincost :
+ an integral value denoting the minimum possible cost incurred in traversing from the source node to the target node (summation of weights/costs of all the edges/arcs included in the shortest path, if any)
+ shortestpath :
+ Returns a vector containing the nodes(the numerical tags thereof) lying on the shortest path from source to target, if one exists.
+ flag :
+ flag variable indicating if there exists a path between the given source and target nodes(0-> no path exists; 1-> path exists(ipso facto, a minimal-cost path exists)
+
+
+
+
+ Description
+
+\text{A staple of graph theory, the \textbf{`Shortest Path' problem } vies to find the least-cost, hence ``shortest" path between any two given nodes in a \textbf{weighted digraph}}^{*}\text{. Essentially a linear programming problem at its core, it is one of the most studied optimization problems.}
+\text{}\\
+\text{}\\
+\text{The routine uses an implementation of the `Bellman Ford single-source shortest path algorithm for weighted digraphs'(negative weights supported)}
+\text{}\\
+\text{Bellman–Ford is based on the principle of relaxation, in which an approximation to the correct distance is gradually replaced by more accurate values until eventually reaching the optimum solution.\\The approximate distance to each vertex is always an overestimate of the true distance, and is replaced by the minimum of its old value with the length of a newly found path.\\Bellman–Ford algorithm, unlike the contemporary Dijkstra's shortest path algorithm, simply relaxes all the edges, and does this (|V|-1) times, where |V| is the number of vertices in the graph. In each of these repetitions, the number of vertices with correctly calculated distances grows, from which it follows that eventually all vertices will have their correct distances.\\This method allows the Bellman–Ford algorithm to be applied to a wider class of inputs than Dijkstra's algorithm(Dijkstra's doesn't support negative edges).\\
+Bellman–Ford runs in O(|V|.|E|) time, where |V| and |E| are the number of vertices and edges respectively.}\\
+\text{}\\
+\text{}\\
+\text{}\\
+^{*}\text{\underline{\textbf{Weighted Digraph}} : A weighted digraph is a graph in which each edge has a ``weight" associated with it. The \textbf{``weight" } is any quantity of practical significance to the problem, like distance, electrical resistance, etc. Moreover, the edges of the graph are directionally constrained, i.e. an edge from node `a' to node `b' entails neither the existence of an edge from node `b' to node `a' nor the same weight.}\\
+\text{}\\
+\text{}\\
+\text{}\\
+\text{\textbf{\underline{MATHEMATICAL STATEMENT} :}}\\
+\text{}\\
+\text{}\\
+\text{}\\
+
+
+\begin{math}
+\text{Let } N= \left(V,E\right) \text{be a network with } s,t \in V \text{denoting the source and target nodes in } N\text{, respectively.}\\
+\text{Let } w_{ij} \text{ denote the cost for the edge } i \to j.\\\\
+\textbf{\underline{Objective} :}
+\text{}\quad Maximize \quad \sum_{i,j \in A} w_{ij}x_{ij} \text{ ;}\\\\
+\text{ } \qquad \hspace{4em} \text{ Subject to } x \geq 0.\\
+\text{ }\qquad \hspace{4em} \text{ Also, } \sum_{j}x_{ij} - \sum_{j} x_{ji} = \begin{cases}
+1, \quad if\text{ }i=s\text{;}\\
+-1, \quad if\text{ }i=t\text{;}\\
+0, \quad \text{ otherwise;}\\
+\end{cases} \quad \forall \quad i \text{ ;}\\
+\end{math}
+
+
+
+
+
+
+
+
+
+ Examples
+ 3 -> 4
+//Minumum cost (using the said path) :- 30.000000
+
+
+ ]]>
+
+
+
+ Examples
+ 3 -> 2 -> 4
+//Minumum cost (using the said path) :- 35.000000
+//Shortest/Lowest Cost Path found.
+
+
+ ]]>
+
+
+
+ Examples
+
+
+
+
+ Examples
+ 1 -> 2 -> 3
+//Minumum cost (using the said path) :- 22.000000
+// Shortest/Lowest Cost Path found.
+
+
+ ]]>
+
+
+
+ Authors
+
+ Samuel Wilson
+
+
+
diff --git a/help/en_US/jssp.xml b/help/en_US/jssp.xml
new file mode 100644
index 0000000..6a9cae2
--- /dev/null
+++ b/help/en_US/jssp.xml
@@ -0,0 +1,158 @@
+
+
+
+
+
+
+
+ jssp
+ Solves the popular 'Job-Shop Scheduling Problem' (JSSP for short), which aims to find an optimal plan to schedule a given number of jobs, each composed of one or more tasks to be performed in some specific logical order, on a given number of machines. The routine makes use of the 'constraint-solver' library from the Google OR-Tools framework.
+
+
+
+
+ Calling Sequence
+
+ [makespan,schedule] = jssp(machines, jobs, jmode, tasks)
+ [makespan, schedule] = jssp(machines, jobs, jmode, tasks, time_limit)
+ [makespan, schedule, status] = jssp(machines, jobs, jmode, tasks)
+ [makespan, schedule, status] = jssp(machines, jobs, jmode, tasks, time_limit)
+
+
+
+
+
+ Parameters
+
+ machines :
+ It is a single integral value specifying the total number of machines in the problem, on which the various tasks are to be scheduled.
+ jobs :
+ It is a single integral value specifying the total number of jobs in the problem. Each job is composed of one or more tasks which are to be scheduled on specific machines, in some logical order.
+ mode :
+ It is a single intergral value (either '0' or '1' only). It specifies one of the two modes for the solver, which are :-0-> Sequential - In this mode, the various tasks within a job are considered to be sequentially constrained i.e. task_1 must occur before task_2, task_2 before task_3 and so on.1-> Parallel - This mode allows the flexibility of some tasks being scheduled parallelly or independently of each other, if such a scenario is to be modelled. Eg. if a task 'x' can be performed any time after task_1 but must be performed before task_10. It requires 2 additional fields in the 'tasks' matrix, specifying 2 tasks (indices) between which the current task can be freely scheduled. One or both of these bounds can be done away with(no 'start_after' or 'end_before' constraints) by providing '-1' for the respective field.(These indices are the task indices WITHIN the job, ie.each job will have a task indexed '1', dor instance).
+ tasks :
+ It is an [AxB] matrix( A- total number of tasks in the problem. B- 3 or 5 depending on the mode). Each row corresponds to a task. The two variations are :-mode '0' -> An [Ax3] matrix. The 3 fields/columns are 'Job-Index', 'Machine-Index' and 'Task-Duration'. (The tasks for each job are ordered internally in the order they appear in this matrix)mode '1' -> An [Ax5] matrix. The 5 fields/columns are 'Job-Index, 'Machine-Index', 'Task-Duration', 'Start-After' and 'End-Before'. (order of the tasks doesn't matter in this case)\text{}\\\text{}\\\\More on the columns (let the current task(row) be 'x')'job-index' -> It is the index of the job to which 'x' belongs.'machine-index' -> It is the index of the machine on which 'x' is to be scheduled.'task-duration' -> It is the time required to perform 'x'.\text{}\\\text{}\\\\Only for mode '1' -'start-after' -> It is the index of the task, only after whose completion, 'x' can start.'end-before' -> It is the index of the task that can only start once 'x' is completed.
+ time_limit :
+ It is the maximum time (in milliseconds; integral value) for which the solver is allowed to run. If a solution is not found by then, a pertinent 'timed-out' error occurs.(Default Value - 10 seconds). Provide an empty matrix or omit the parameter if explicit time-limit is not required.
+ makespan :
+ It is the total duration of the schedule in the optimal solution, if one exists.
+ schedule :
+ Is is an [Ax5] matrix (A- no. of tasks) that gives the final schedule for the various tasks in the optimal solution, if one exists. The 5 fields/columns are 'Job-index', 'machine-index', 'task-duration', 'start-time' and 'end-time'.
+ status :
+ Is is an integral value representing the status of the solution as: '0'-> 'Solution Found' '1'-> 'Timed-out' - No solution was found within the specified/default time limit. '2'-> 'Problem-Infeasible' - No solution exists for the given problem.
+
+
+
+
+ Description
+
+
+\text{The Job-Shop Scheduling Problem (also called the \textbf{Resource Scheduling Problem}) is a linear optimization problem in Computer Science and Operations Research which vies to schedule a number of jobs, each composed of one or more tasks, on a specific number of machines, minimizing the total time for the enite schedule, called the \textbf{makespan}.\\The order in which the various tasks in a job are performed and the machines on which they must be scheduled are received as inputs.\\This particular implementation supports two variations :}\\
+\text{}\\
+\text{1. \textbf{`Sequential Mode'}(mode 0) : In this mode, all the tasks in a job are considered to be sequentially constrained ie. task 2 cannot occur before task 1 finishes, and so on.}\\
+\text{2. \textbf{`Parallel/Arbitrary Mode'}(mode 1) : In this mode, tasks within a job can occur parallelly ie. the order is arbitrary sans 2 \textbf{optional bounds}. \\These 2 ``bound'' values are specified for each task. They are :}\\
+\qquad\text{ - \textbf{`start-after'} : This is the index of the task that must finish before the current task can start}\\
+\qquad\text{ - \textbf{`end-before'} : This is the index of the task that cannot start before the current task finishes}\\
+\text{}\\
+\text{}\\
+\text{}\\
+\text{\textbf{\underline{MATHEMATICAL\textbf{ }STATEMENT} :}}\\
+\text{}\\
+\text{}\\
+\text{}\\
+
+
+
+
+\begin{math}
+\text{Let } M = \{M_{1}, M_{2},..., M_{m}\} \text{ and} \\
+\text{Let } J = \{J_{1}, J_{2},..., J_{j}\} \quad \text{be 2 finite sites representing the machines and the jobs respectively. }\\\\
+\end{math}
+\text{(the tasks are abstracted for simplicity. So whenever a Job is scheduled on a machine, it is assumed, the next task to be performed is the one scheduled).}\\\\
+\begin{math}
+\text{Let } X \text{ denote the set of assignment of all jobs on the machines}\\\\
+\text{Let } C \text{ be the \textbf{`cost function'} such that :}\\
+\text{}\\
+C:X \to [0, \infty^{+}] \quad \text{; which denotes the total processing time ie. makespan of schedule.}\\\\
+\textbf{\underline{Objective} :}\qquad \text{ To find an assignment of jobs }x \in X \text{ for which } C(x) \text{ is minimum, ie.}\\\\
+\text{ } \qquad \hspace{3em} \qquad \text{ } \text{ No }y \in X \text{ exists, such that } C(y) < C(x).\\
+\end{math}
+\text{}\\
+\text{}\\
+\text{}\\
+
+
+
+
+
+
+
+ Examples
+
+
+
+
+ Examples
+
+
+
+
+ Authors
+
+ Samuel Wilson
+
+
+
diff --git a/help/en_US/linsum.xml b/help/en_US/linsum.xml
new file mode 100644
index 0000000..aecc013
--- /dev/null
+++ b/help/en_US/linsum.xml
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+ linsum
+ Solves problem with finding minimum cost of assignment
+
+
+
+
+ Calling Sequence
+
+ [cost, assignment] = linsum(kNumLeftNodes, kNumRightNodes, kCost)
+ [cost, assignment, status] = linsum(kNumLeftNodes, kNumRightNodes, kCost)
+
+
+
+
+
+ Parameters
+
+ kNumLeftNodes :
+ a double, Number of Left Nodes / Jobs
+ kNumRightNodes :
+ a double, Number of Right Nodes / Workers
+ kCost :
+ a matrix of double, kNumLeftNodes x kNumRightNodes, represents Cost of assigning a Job to a Worker
+ cost :
+ a double, Optimal (minimum) Cost
+ assignment :
+ a matrix of boolean, kNumLeftNodes x kNumRightNodes, represents Optimal Assignment for the Problem
+ status :
+ contains the exit flag of Solver. Currently 0 for Not Optimal, 1 for Optimal.
+
+
+
+
+ Description
+
+Find the minimum cost and assignment for a given set of jobs and workers
+
+
+The routine uses Google ORtools for solving the quadratic problem, ORtools is a library written in C++.
+
+
+
+\text{}\\
+\begin{align}
+& \text{minimize} && \texttt{kCost}\text{ . }\texttt{assignment}\\
+& \text{subject to} && \sum_{i=0}^{\texttt{kNumLeftNodes}} \texttt{assignment}_{ij} = 1 \\
+&&& \sum_{j=0}^{\texttt{kNumRightNodes}} \texttt{assignment}_{ij} = 1
+\end{align}\\
+\text{}\\
+\text{}\\
+\text{}\\
+
+
+
+
+
+
+
+ Examples
+
+
+
+
+ Authors
+
+ Souvik Das
+
+
+
diff --git a/help/en_US/min_cost_flow.xml b/help/en_US/min_cost_flow.xml
new file mode 100644
index 0000000..a12d959
--- /dev/null
+++ b/help/en_US/min_cost_flow.xml
@@ -0,0 +1,131 @@
+
+
+
+
+
+
+
+ min_cost_flow
+ Solves problem with finding minimum cost of flow
+
+
+
+
+ Calling Sequence
+
+ [cost, flow] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand)
+ [cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand)
+
+
+
+
+
+ Parameters
+
+ kNumSources :
+ a double, Number of Sources / Suppliers
+ kNumTargets :
+ a double, Number of Targets / Demanders
+ kCost :
+ a matrix of double, kNumSources x kNumTargets, represents Cost of flow from a Source to Target
+ kCapacity :
+ a matrix of double, kNumSources x kNumTargets, represents Capacity of flow from a Source to Target
+ kSupply :
+ a vector of double, length kNumSources, contains Supply Quantity of Suppliers
+ kDemand :
+ a vector of double, length kNumTargets, contains Demand Quantity of Demanders
+ cost :
+ a double, Optimal (minimum) Cost
+ flow :
+ a matrix of double, kNumSources x kNumTargets, represents Optimal Flow for the Problem
+ status :
+ contains the exit flag of Solver. See below
+
+
+
+
+ Description
+
+Find the minimum cost and flow for a given set of sources and targets with limit on capacity per flow
+
+
+The routine uses Google ORtools for solving the quadratic problem, ORtools is a library written in C++.
+
+
+
+\text{}\\
+\begin{align}
+& \text{minimize} && \texttt{kCost}\text{ . }\texttt{flow}\\
+& \text{subject to} && \texttt{flow}_{ij} \leq \texttt{kSupply}_i \\
+&&& \texttt{flow}_{ij} \geq \texttt{kDemand}_j \\
+&&& \texttt{flow}_{ij} \leq \texttt{kCapacity}_{ij} \\
+&&& \sum_{i=1}^{\texttt{kNumSources}} \texttt{kSupply}_i = \sum_{j=1}^{\texttt{kNumTargets}} \texttt{kDemand}_j
+\end{align}\\
+\text{}\\
+\text{}\\
+\text{}\\
+
+
+
+The status allows to know the status of the optimization which is given back by ORtools.
+
+status=0 : Not Solved
+status=1 : Optimal
+status=2 : Feasible
+status=3 : Infeasible
+status=4 : Unbalanced
+status=5 : Bad Result
+
+
+
+
+
+
+
+ Examples
+
+
+
+
+ Authors
+
+ Souvik Das
+
+
+
diff --git a/help/en_US/qcqpglob.xml b/help/en_US/qcqpglob.xml
new file mode 100644
index 0000000..8862c33
--- /dev/null
+++ b/help/en_US/qcqpglob.xml
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+
+ qcqpglob
+ Solves problem with Convex/Non-Convex Quadratically Constrained Quadratic Programming Problems with Global Optimization (GLOB)
+
+
+
+
+ Calling Sequence
+
+ [kSoln, kSolnVector] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var);
+ [kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var);
+ [kSoln, kSolnVector] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
+ [kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
+
+
+
+
+
+ Parameters
+
+ n :
+ a double, represents number of Decision Variables
+ m :
+ a double, represents number of Constraints
+ h_obj :
+ a matrix of double, n x n, represents Coefficients of Quadratic in Objective Function
+ f_obj :
+ a vector of double, sized n, represents Coefficients of Linear in Objective Function
+ c_obj :
+ a double, represents Constant term in Objective Function
+ h_con :
+ an m sized list, contains matrices of double, n x n, represents Coefficients of Quadratic in Constraints
+ f_con :
+ an m sized list, contains vectors of double, sized n, represents Coefficients of Linear in Constraints
+ lb_con :
+ a vector of double, sized m, represents Lower Bound of Constraints
+ ub_con :
+ a vector of double, sized m, represents Upper Bound of Constraints
+ lb_var :
+ a vector of double, sized n, represents Lower Bound of Decision Variables
+ ub_var :
+ a vector of double, sized n, represents Upper Bound of Decision Variables
+ maxcputime :
+ a double, represents max. cpu time allotted to BnB Solver
+ kSoln :
+ a double, represents value of Objective Function at Optimal Point
+ kSolnVector :
+ a vector of double, sized n, represents values of Decision Variables at Optimal Point
+ status :
+ contains the exit flag of Solver. See below
+
+
+
+
+ Description
+
+Solves QCQP / Quadratically Constrained Quadratic Programming problems, especially those where local optimum is not the global optimum, i.e. when the problem is Non-Convex. Can solve Convex Problem as well.
+
+
+
+\text{}\\
+\begin{align}
+& \text{minimize} && \tfrac12 x^\mathrm{T} H_0 x + f_0^\mathrm{T} x + c \\
+& \text{subject to} && {LB}_i \leq \tfrac12 x^\mathrm{T} H_i x + f_i^\mathrm{T} x \leq {UB}_i \quad \text{for } i = 1,\dots,m \\
+&&& Ax = b
+\end{align}\\
+\text{}\\
+\text{}\\
+\text{}\\
+
+
+
+The status allows to know the status of the optimization which is given back by MINOTAUR.
+
+
+
+status=0 : Not started solving
+status=1 : Started solving
+status=2 : Restarted solving
+status=3 : Optimal solution found
+status=4 : Detected infeasibility
+status=5 : Detected unboundedness of relaxation
+status=6 : Reached limit on gap
+status=7 : Reached limit on number of solutions
+status=8 : Reached iteration limit
+status=9 : Interrupted
+status=10 : Reached time limit
+status=11 : Reached the limit on number of solutions
+status=12 : Finished for some other reason
+
+
+
+The routine uses Minotaur Library for solving the quadratic problem, Minotaur is a library written in C++.
+
+
+
+
+
+
+ Examples
+ = x^2 + y^2 - x - y >= -100
+// -10 <= x <= 6
+// -10 <= y <= 6
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
+kSoln
+kSolnVector
+status
+
+ ]]>
+
+
+
+ Authors
+
+ Souvik Das
+
+
+
diff --git a/help/en_US/tsp.xml b/help/en_US/tsp.xml
new file mode 100644
index 0000000..899df03
--- /dev/null
+++ b/help/en_US/tsp.xml
@@ -0,0 +1,221 @@
+
+
+
+
+
+
+
+ tsp
+ Solves the classic 'Travelling Salesman Problem' heuristically using the routing library from the Google-OR-tools framework. The algorithm first employs a cheapest path approach for an initial solution and then 'local search' heuristics to improve the initial solution toward an optimal one.
+
+
+
+
+ Calling Sequence
+
+ [mincost,path]=tsp(adj_matrix,start_node)
+ [mincost,path]=tsp(adj_matrix,start_node,labels)
+ [mincost,path,status]=tsp(adj_matrix,start_node)
+ [mincost,path,status]=tsp(adj_matrix,start_node, labels)
+
+
+
+
+
+ Parameters
+
+ adj_matrix :
+ It is an [nxn] Adjacency Matrix of integral values, representing the graph (having 'n' nodes, for instance, numbered from '1' to 'n') for which the Travelling Saleman Problem is to be solved. Value adj_matrix(i,j) represents the cost of travelling from node 'i' to node 'j' of the given graph. Asymmetric graphs are also supported, where adj(i,j) <> adj(j,i). A negative value for cost (adj_matrix(i,j)) is simply interpreted as the absence of an edge from node 'i' to node 'j'.
+ start_node :
+ It is the index of the starting node. The optimal path must start and end at this node.
+ labels :
+ Optional functionality to provide string labels to the nodes of the graph. It is a [1xn] vector of strings. (labels(i) is the label given to the node 'i' of the graph
+ time_limit :
+ It is the maximum time (in milliseconds; integral value) for which the optimizer is allowed to run. If by the end of this time, the engine is unable to find even an initial solution, a timeout error status is returned. If, however, an initial solution is found, but not fully optimized yet (in the process of heuristically improving it), it will return the current solution, albeit not optimal, as the final solution. This value cannot be zero. Default : 1 second.
+ mincost :
+ It is an integral value denoting the minimum cost incurred by the "salesman" in traversing the optimal path according to the solution, should one exist.)
+ path :
+ It is a [1x(n+1)] vector containing indices of nodes in the order of the path to be followed in the optimal solution, should one exist. The first and the last values in this vector are equal to the 'start_node' index provided.
+ status :
+ It is the enumerated "flag" value returned by the Google OR tools Routing Library, indicating the status of the solution.(Details in the description)
+
+
+
+
+ Description
+
+
+\text{The \textbf{`Travelling Salesman Problem' } is a classic optimization problem which, given a graph (wherein each edge has some cost/distance associated with it), and an arbitrary `starting node' , vies to find such a path over the said graph so as to visit every vertex exactly once and ending back at the `start\_node' \textbf{(Hamiltonian path) }, while minimizing the total cost/distance of the journey.\\This is aptly explained by the namesake analogy of a `salesman' who needs to decide upon a path through various cities (nodes) while minimizing his travel distance, hence the travel expenditures.\\Travelling salesman problem is essentially a special case of the \textbf{Vehicle Routing Problem}.\\This routine utlizes the 'Routing Model' from the Google OR Tools framework to solve the problem. A \textbf{`cheapest addition' } heuristic is applied to find the initial solution and then \textbf{`local search' } is used to improve it toward an optimal solution.\\\textbf{Asymmetric Travelling Saleman Problem } is also supported, where the cost of travelling from city `i' to city `j' is not the same as cost of travelling from city `j' to city `i' (In this case, the input adjacency matrix is simply not a symmetric matrix)}\\
+\text{}\\
+\text{}\\
+\text{}\\
+\text{\textbf{\underline{MATHEMATICAL\textbf{ }STATEMENT} :}}\\
+\text{}\\
+\text{}\\
+\text{}\\
+
+
+
+
+\begin{math}
+\text{Let }x_{ij} = \begin{cases}
+1 \quad \text{; if there exists a path from node i to j}\\
+0 \quad \text{; otherwise}\\
+\end{cases}\\\\
+\text{Let their be `n' nodes in the problem}\\
+\text{Let } c_{ij} \text{ be the distance from node i to node j}\\\\
+\text{Let }u_{i} \text{ be a dummy variable for } i=1,2,...,n \text{ ;}\\\\
+\textbf{\underline{Objective }:}\qquad Minimize \sum_{i=1}^{n} \sum_{j \neq i, j=1}^{n} c_{ij} x_{ij} \\\\
+\text{ Subject to :}
+\text{ }\qquad 0 \leq x_{ij} \leq 1 \text{ ;} \qquad i,j = 1,2,...,n \text{ ;}\qquad \hspace{3em} \qquad (1)\\\\
+\text{ }\qquad \hspace{3em} \text{ } \qquad u_{i} \in Z \text{ ; }\qquad \qquad i = 1,2,...,n \text{ ; }\qquad \hspace{3em} \qquad \text{ }(2)\\\\
+\text{ }\qquad \hspace{3em} \text{ } \qquad \sum_{i=1,i\neq j}^{n} x_{ij}=1 \text{ ; } j=1,2,...,n \text{ ; } \qquad \hspace{3em} \qquad (3)\\\\
+\text{ }\qquad \hspace{3em} \text{ } \qquad \sum_{j=1,j\neq i}^{n} x_{ij}=1 \text{ ; } i=1,2,...,n \text{ ; } \qquad \hspace{3em} \qquad (4)\\\\
+\text{ }\qquad \hspace{3em} \text{ } \qquad u_{i} - u_{j} + n x_{ij} \leq n-1 \text{ ; }\qquad 2\leq i\neq j \leq n \text{ ; } \qquad (5)\\\\
+\text{ (3),(4) enforce that each node can only be arrived from exactly one other node.}\\\\
+\text{ (5) enforces that there's only a single tour connecting all the node ( Hamiltonian cycle) }
+\end{math}
+\text{}\\
+\text{}\\
+\text{}\\
+\text{}\\
+
+
+
+Legend :
+
+
+status - Integral value returned by the Google OR Tools Routing library, indicating the status of the solution for the current TSP
+
+status=0 - ROUTING_NOT_SOLVED (Before the solver is invoked)
+status=1 - ROUTING_SUCCESS (TSP solved successfully(optimal solution found)
+status=2 - ROUTING_FAIL(No solution found)
+status=3 - ROUTING_FAIL_TIMEOUT (solution was taking too much time; Timed out)
+
+
+
+For more details, refer to : https://en.wikipedia.org/wiki/Travelling_salesman_problem
+
+
+or to : https://developers.google.com/optimization/routing/tsp/tsp
+
+
+The problem is also related to the HAMILTONIAN PATH problem : https://en.wikipedia.org/wiki/Hamiltonian_path
+
+
+
+
+
+
+
+
+ Examples
+ 120
+//Optimal Path :-
+//1 ->2 ->3 ->4 ->1
+
+ ]]>
+
+
+
+ Examples
+ 80
+//Optimal Path :-
+// A (1) -> B (2) -> D (4) -> C (3) ->A (1)
+
+ ]]>
+
+
+
+ Examples
+ 5
+//Optimal Path :-
+// alpha (1) -> sigma (5) -> beta (2) -> gamma (3) -> theta (4) ->alpha (1)
+
+ ]]>
+
+
+
+ Examples
+
+
+
+
+ Authors
+
+ Samuel Wilson
+
+
+
diff --git a/help/en_US/vrp.xml b/help/en_US/vrp.xml
new file mode 100644
index 0000000..e2aee08
--- /dev/null
+++ b/help/en_US/vrp.xml
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+ vrp
+ Solves the classic 'Vehicle Routing Problem' (VRP for short) heuristically to find the optimal set of routes for a fleet of vehicles delivering goods or services to various locations. The routine makes use of the routing library from the Google-OR-Tools framework. The algorithm first employs a cheapest path approach for an initial naive solution and then 'local search' heuristics to improve it toward an optimal solution.
+
+
+
+
+ Calling Sequence
+
+ [total_distance,routes] = vrp(adj_matrix,vehicles,start)
+ [total_distance,routes] = vrp(adj_matrix,vehicles,start,labels)
+ [total_distance,routes] = vrp(adj_matrix,vehicles,start,labels,demands,max_vehicle_capacity)
+ [total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand)
+ [total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand,time_windows)
+ [total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand,time_windows,speeds)
+ [total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand,time_windows,speeds,waiting_times)
+ [total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand,time_windows,speeds,waiting_times,refuel_flag,fuel_capacity,refuel_nodes)
+ [total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand,time_windows,speeds,waiting_times,refuel_flag,fuel_capacity,refuel_nodes,penalty)
+ [total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand,time_windows,speeds,waiting_times,refuel_flag,fuel_capacity,refuel_nodes,penalty,groups,group_penalty)
+ [total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand,time_windows,speeds,waiting_times,refuel_flag,fuel_capacity,refuel_nodes,penalty,groups,group_penalty,time_limit)
+ [total_distance,routes,distances] = vrp(...)
+ [total_distance,routes,distances,total_time] = vrp(...)
+ [total_distance,routes,distances,total_time,times] = vrp(...)
+ [total_distance,routes,distances,total_time,times,status] = vrp(...)
+
+
+
+
+
+ Parameters
+
+ **NOTE :
+ for the sake of simplicity, henceforth 'v' would denote the number of vehicles in the problem and 'n', the number of nodes in the graph
+ adj_matrix :
+ It is an [nxn] matrix of integral values, representing the graph (nodes indexed from '1' to 'n') for which the given VRP is to be solved. adj_matrix[i][j] gives the distance from node 'i' to 'j'.(can be different from adj_matrix[j][i]; asymmetric VRP). A negative value indicates the absence of a path from 'i' to 'j'.
+ vehicles :
+ It is an integral value representing the number of vehicles in the fleet, such that we need to find a optimum route for each vehicle, to minimize the total distance and total time.
+ start :
+ It is a matrix of integral values, pertaining to the index of the starting node(s) or depot(s). The dimensions of this matrix is germane to the type of VRP given, hence determines the pertinent solution strategy. The variations are :-[1x1] - A single integral value - indicating a single depot. All vehicles start and end their journey at this node.[ ] - Empty Matrix - indicating that the vehicle routes can start and end at any node, defining a taxi-service-like scenario.[vx2] - An integral matrix specifying particular start and end nodes for each vehicle ( multiple depot case). start[x][0] -> Start node index for vehicle 'x' ; start[x][1] -> End node for vehicle 'x'.
+ labels :
+ Optional functionality to provide string labels to the nodes of the graph. It is a [1xn] vector of strings.
+ demands :
+ It is a [1xn] vector of integral values indicating the demands for the various nodes to be fulfiled by the vehicles. demands[x] denotes the demand of node 'x'. (Demands obviously cannot be negative).
+ max_vehicle_capacity :
+ It is an integral value specifying the maximum capacity of each vehicle (same for all). If capacitated VRP (demands specified), this has to be provided and must be POSITIVE. Can be '0' or empty matrix for non-capacitated VRP.
+ service_time_per_demand :
+ It a single integral value indicating the time required to service one unit of demand in capacitated VRP.
+ time_windows :
+ It is an [nx2] matrix of integral values specifying particular windows of time only within which the different nodes can be serviced. time_windows[x][0]->start of service window for node x ; time_windows[x][1]->end of service window for node 'x'. Can be empty if no time-window constraints. If provided, for a node with no such restriction, provide '0' and '-1'. Time starts from '0' for the model.
+ speeds :
+ It is a matrix of integral values specifying the speed of the vehicles. The variations are :- empty matrix - Indicates that transit times are to be ignored while minimizing total-time for the optimal route. [1x1] - single value - Same avg. speed for all vehicles between any two nodes. [nxn] - A matrix specifying different avg.speeds between different nodes. speed[x][y]-> Gives the average speed while going from node 'x' to node 'y'. (Asymmetric speeds supported)
+ waiting_times :
+ a [1xn] vector of integral values containing the waiting times, if any, at the nodes. Could be empty if no waiting constraints.
+ refuel_flag :
+ a single integral value indicating if fuel constraints are to be considered or not.(Default : '0') '0'->No fuel constraints '1' ->Fuel constraints to be included in the model.
+ fuel_capacity :
+ a single integral value specifying the fuel capacity of the vehicles under consideration (same for all). Need to be provided if refueling constraints active. Needs to be positive.
+ refuel_nodes :
+ It is a [1xA] vector of integral values (A-> no. of refuel nodes), containing the indices of refueling nodes. Could be empty indicating the absence of refuel nodes.
+ penalty :
+ It is an [Ax2] matrix containing the cost penalties for skipping certain optional nodes (A->no. of optional nodes). penalty[x][0]-> The index of the optional node ; penalty[x][1]-> The cost penalty associated with that node.
+ groups :
+ It is an [AxB] matrix of integral values specifying groups of nodes that must lie on the same vehicle route. A-> No. of groups. B-> Size of the largest group. Each row contains the indices of a separate group. Smaller groups are padded with '0's on the right.
+ group_penalty :
+ It is a single integral value specifying the cost penalty incurred if a node from a group is unable to be serviced by the same vehicle in the optimal solution. This value is mandatory if group constraints are included in the model. (The model tends to minimize total distance and total time, while amassing minimal cost penalties ( legible tradeoffs to minimize distance ). USE -1, if the groups are to be strictly imposed (cannot exclude a node from a group while vying to minimize distance). This value CAN be zero, indicating that grouping constraints are purely optional. Default value : -1.
+ time_limit :
+ It is the maximum time (in milliseconds; integral value) for which the optimizer is allowed to run. If by the end of this time, the engine is unable to find even an initial solution, a timeout error status is returned. If, however, an initial solution is found, but not fully optimized yet (in the process of heuristically improving it), it will return the current solution, albeit not optimal, as the final solution. This value cannot be zero. Default : 10 seconds.
+ total_distance :
+ It is the summation of the total distance for all the routes in the optimal solution, if any.
+ routes :
+ It is a [vxn] matrix containing the routes for the vehicles in the optimal solution, if any. (padded with 0's on the right)
+ distances :
+ It is a [1xv] vector containing the distances covered by the various routes in the optimal solution.
+ total_time :
+ It is the summation of the times taken by the various vehicles to complete their journeys.
+ times :
+ It is a [1xv] vector containing the individual times taken by the vehicles to complete their routes.
+ status :
+ It is the enumerated "flag" value returned by the Google OR tools Routing Library, indicating the status of the solution.(Details in the description)
+
+
+
+
+ Description
+
+
+\text{The \textbf{`Vehicle Routing Problem' } is a combinatorial optimization and linear integer programming problem in graph theory.\\A superset of the well-known \textbf{Travelling Salesman Problem}, it vies to find an optimal set of non-overlapping routes for a fleet of vehicles (the anecdotal ``salesmen"), passing through a given set of cities(nodes in the graph) starting from one or more starting nodes called the \textbf{`depot(s)'}.\\In the pursuit of optimality, it tends to minimize the \textbf{total distance } across all the routes and/or other parameters specified by the user, like \textbf{`time'}, \textbf{`cost'}, etc.}\\
+\text{}\\
+\text{}\\
+\text{}\\
+\text{\textbf{\underline{MATHEMATICAL\textbf{ }STATEMENT} :}}\\
+\text{}\\
+\text{}\\
+\text{}\\
+
+
+\begin{math}
+\text{Let } N= \left(V,E\right) \text{denote the specified graph}\\
+\text{Let } c_{ij} \text{ denote the distance from } i \to j.\\\\
+\textbf{\underline{Objective} : }\quad Minimize \quad \sum_{i \in V} \sum_{j \in V} c_{ij} x_{ij} \\\\\\
+\text{Subject to :} \qquad
+\sum_{i\in V} x_{ij} = 1 \quad \forall \quad j \in V\backslash\{0\}\qquad (1) \\\\
+\text{}\\
+\text{}\qquad \hspace{3em} \qquad \sum_{j\in V} x_{ij} = 1 \quad \forall \quad i \in V\backslash\{0\}\qquad \text{ } (2) \\\\
+\text{}\\
+\text{}\qquad \hspace{3em} \qquad \sum_{i\in V} x_{i0} = K\quad \text{;} \qquad \hspace{3em} \qquad\text{ } (3)\\\\
+\text{}\\
+\text{}\qquad \hspace{3em} \qquad \sum_{j\in V} x_{0j} = K\quad \text{;} \qquad \hspace{3em} \qquad\text{ } (4)\\\\
+\text{}\\
+\text{}\qquad \hspace{3em} \qquad x_{ij} \in \{0,1\} \quad \forall \quad i,j \in V \text{ ; } \hspace{3em} \text{ } (5)\\\\
+\text{}\\
+\end{math}
+\text{}\\
+\text{}\\
+
+
+
+
+\text{}\\
+\text{}\\
+\text{(1), (2) specify that exactly one arc enters and one arc leaves each node in the solution.}\\
+\text{}\\
+\text{(3), (4) specify that the total number of leaving the depot is equal to the total number entering it(single depot mode).}
+\text{}\\
+\text{}\\
+\text{}\\
+
+
+
+Legend :
+
+
+status - Integral value returned by the Google OR Tools Routing library, indicating the status of the solution for the current VRP
+
+status=0 - ROUTING_NOT_SOLVED (Before the solver is invoked)
+status=1 - ROUTING_SUCCESS (TSP solved successfully(optimal solution found)
+status=2 - ROUTING_FAIL(No solution found)
+status=3 - ROUTING_FAIL_TIMEOUT (solution was taking too long; Timed out)
+
+
+
+For more details, refer to : https://en.wikipedia.org/wiki/Vehicle_routing_problem
+
+
+or to : https://developers.google.com/optimization/routing/tsp/vehicle_routing#cvrp
+
+
+The problem is also related to the HAMILTONIAN PATH problem : https://en.wikipedia.org/wiki/Hamiltonian_path
+
+
+
+
+
+
+
+
+ Examples
+
+
+
+
+ Examples
+
+
+
+
+ Authors
+
+ Samuel Wilson
+
+
+
diff --git a/macros/Checkdims.sci b/macros/Checkdims.sci
new file mode 100644
index 0000000..0936222
--- /dev/null
+++ b/macros/Checkdims.sci
@@ -0,0 +1,56 @@
+
+// Copyright (C) 2010 - DIGITEO - Michael Baudin
+//
+// This file must be used under the terms of the GNU LGPL license.
+
+function errmsg = Checkdims ( funname , var , varname , ivar , matdims )
+ // Generates an error if the variable has not the required size.
+ //
+ // Calling Sequence
+ // errmsg = Checkdims ( funname , var , varname , ivar , matdims )
+ //
+ // Parameters
+ // funname : a 1 x 1 matrix of strings, the name of the calling function.
+ // var : a 1 x 1 matrix of valid Scilab data type, the variable
+ // varname : a 1 x 1 matrix of string, the name of the variable
+ // ivar : a 1 x 1 matrix of floating point integers, the index of the input argument in the calling sequence
+ // matdims : 1 x 2 matrix of floating point integers, the number of rows, columns for the variable #ivar
+ // errmsg : a 1 x 1 matrix of strings, the error message. If there was no error, the error message is the empty matrix.
+ //
+ // Description
+ // This function is designed to be used to design functions where
+ // the input argument has a known shape.
+ // This function cannot be use when var is a function, or more
+ // generally, for any input argument for which the size function
+ // does not work.
+ // Last update : 05/08/2010.
+ //
+ // Examples
+ // // The function takes a 2 x 3 matrix of doubles.
+ // function y = myfunction ( x )
+ // Checkdims ( "myfunction" , x , "x" , 1 , [2 3] )
+ // y = x
+ // endfunction
+ // // Calling sequences which work
+ // y = myfunction ( ones(2,3) )
+ // y = myfunction ( zeros(2,3) )
+ // // Calling sequences which generate an error
+ // y = myfunction ( ones(1,3) )
+ // y = myfunction ( zeros(2,4) )
+ //
+ // Authors
+ // Michael Baudin - 2010 - DIGITEO
+ //
+
+ [lhs,rhs]=argn()
+ Checkrhs ( funname , rhs , 5 )
+ Checklhs ( funname , lhs , [0 1] )
+
+ errmsg = []
+ if ( or ( size(var) <> matdims ) ) then
+ strexp = strcat(string(matdims)," ")
+ strcomp = strcat(string(size(var))," ")
+ errmsg = msprintf(gettext("%s: Expected size [%s] for input argument %s at input #%d, but got [%s] instead."), funname, strexp, varname , ivar , strcomp );
+ error(errmsg)
+ end
+endfunction
diff --git a/macros/Checklhs.sci b/macros/Checklhs.sci
new file mode 100644
index 0000000..fd47b0c
--- /dev/null
+++ b/macros/Checklhs.sci
@@ -0,0 +1,79 @@
+// Copyright (C) 2010 - DIGITEO - Michael Baudin
+//
+// This file must be used under the terms of the GNU LGPL license.
+
+function errmsg = Checklhs ( funname , lhs , lhsset )
+ // Generates an error if the number of LHS is not in given set.
+ //
+ // Calling Sequence
+ // errmsg = Checklhs ( funname , lhs , lhsset )
+ //
+ // Parameters
+ // funname : a 1 x 1 matrix of strings, the name of the calling function.
+ // lhs : a 1 x 1 matrix of floating point integers, the actual number of output arguments
+ // lhsset : a 1 x n or n x 1 matrix of floating point integers, the authorized number of output arguments
+ // errmsg : a 1 x 1 matrix of strings, the error message. If there was no error, the error message is the empty matrix.
+ //
+ // Description
+ // This function is designed to be used to design functions with
+ // variable number of output arguments.
+ // Notice that it is useless to call this function if the
+ // function definition does not use the varargout statement.
+ // Notice that a function as a minimum of 1 output argument.
+ // Last update : 29/07/2010.
+ //
+ // Examples
+ // // The function takes 3 input arguments and 1/2 output arguments
+ // function varargout = myfunction ( x1 , x2 , x3 )
+ // [lhs, rhs] = argn()
+ // Checkrhs ( "myfunction" , rhs , 3 : 3 )
+ // Checklhs ( "myfunction" , lhs , 1 : 2 )
+ // y1 = x1 + x2
+ // y2 = x2 + x3
+ // varargout(1) = y1
+ // if ( lhs == 2 ) then
+ // varargout(2) = y2
+ // end
+ // endfunction
+ // // Calling sequences which work
+ // myfunction ( 1 , 2 , 3 )
+ // y1 = myfunction ( 1 , 2 , 3 )
+ // [ y1 , y2 ] = myfunction ( 1 , 2 , 3 )
+ // // Calling sequences which generate an error
+ // [ y1 , y2 , y3 ] = myfunction ( 1 , 2 , 3 )
+ //
+ // // The function takes 1 or 3 output arguments, but not 2
+ // function varargout = myfunction ( x1 , x2 , x3 )
+ // [lhs, rhs] = argn()
+ // Checkrhs ( "myfunction" , rhs , 3 : 3 )
+ // Checklhs ( "myfunction" , lhs , [1 3] )
+ // y1 = x1 + x2
+ // y2 = x2 + x3
+ // y3 = x1 + x3
+ // varargout(1) = y1
+ // if ( lhs == 3 ) then
+ // varargout(2) = y2
+ // varargout(3) = y3
+ // end
+ // endfunction
+ // // Calling sequences which work
+ // myfunction ( 1 , 2 , 3 )
+ // y1 = myfunction ( 1 , 2 , 3 )
+ // [ y1 , y2 , y3 ] = myfunction ( 1 , 2 , 3 )
+ // // Calling sequences which generate an error
+ // [y1 , y2] = myfunction ( 1 , 2 , 3 )
+ //
+ // Authors
+ // Michael Baudin - 2010 - DIGITEO
+ //
+
+ errmsg = []
+ if ( and ( lhs <> lhsset ) ) then
+ lhsstr = strcat(string(lhsset)," ")
+ errmsg = msprintf(gettext("%s: Unexpected number of output arguments : %d provided while the expected number of output arguments should be in the set [%s]."), funname , lhs , lhsstr );
+ error(errmsg)
+ end
+endfunction
+
+
+
diff --git a/macros/Checkrhs.sci b/macros/Checkrhs.sci
new file mode 100644
index 0000000..6b5cf5b
--- /dev/null
+++ b/macros/Checkrhs.sci
@@ -0,0 +1,102 @@
+// Copyright (C) 2010 - DIGITEO - Michael Baudin
+//
+// This file must be used under the terms of the GNU LGPL license.
+
+function errmsg = Checkrhs ( funname , rhs , rhsset )
+ // Generates an error if the number of RHS is not in given set.
+ //
+ // Calling Sequence
+ // errmsg = Checkrhs ( funname , rhs , rhsset )
+ //
+ // Parameters
+ // funname : a 1 x 1 matrix of strings, the name of the calling function.
+ // rhs : a 1 x 1 matrix of floating point integers, the actual number of input arguments
+ // rhsset : a 1 x n or n x 1 matrix of floating point integers, the authorized number of input arguments
+ // errmsg : a 1 x 1 matrix of strings, the error message. If there was no error, the error message is the empty matrix.
+ //
+ // Description
+ // This function is designed to be used to design functions with
+ // variable number of input arguments.
+ // Notice that it is useless to call this function if the
+ // function definition does not use the varargin statement.
+ // Last update : 05/08/2010.
+ // Last update : 29/07/2010.
+ //
+ // Examples
+ // // The function takes 2/3 input arguments and 1 output arguments
+ // function y = myfunction ( varargin )
+ // [lhs, rhs] = argn()
+ // Checkrhs ( "myfunction" , rhs , 2:3 )
+ // Checklhs ( "myfunction" , lhs , 1 )
+ // x1 = varargin(1)
+ // x2 = varargin(2)
+ // if ( rhs >= 3 ) then
+ // x3 = varargin(3)
+ // else
+ // x3 = 2
+ // end
+ // y = x1 + x2 + x3
+ // endfunction
+ // // Calling sequences which work
+ // y = myfunction ( 1 , 2 )
+ // y = myfunction ( 1 , 2 , 3 )
+ // // Calling sequences which generate an error
+ // y = myfunction ( 1 )
+ // y = myfunction ( 1 , 2 , 3 , 4 )
+ //
+ // // The function takes 2 or 4 input arguments, but not 3
+ // function y = myfunction ( varargin )
+ // [lhs, rhs] = argn()
+ // Checkrhs ( "myfunction" , rhs , [2 4] )
+ // Checklhs ( "myfunction" , lhs , 1 )
+ // x1 = varargin(1)
+ // x2 = varargin(2)
+ // if ( rhs >= 3 ) then
+ // x3 = varargin(3)
+ // x4 = varargin(4)
+ // else
+ // x3 = 2
+ // x4 = 3
+ // end
+ // y = x1 + x2 + x3 + x4
+ // endfunction
+ // // Calling sequences which work
+ // y = myfunction ( 1 , 2 )
+ // y = myfunction ( 1 , 2 , 3 , 4 )
+ // // Calling sequences which generate an error
+ // y = myfunction ( 1 )
+ // y = myfunction ( 1 , 2 , 3 )
+ // y = myfunction ( 1 , 2 , 3 , 4, 5 )
+ //
+ // // The function takes 2 input arguments and 0/1 output arguments.
+ // // Notice that if the checkrhs function is not called,
+ // // the variable x2 might be used from the user's context,
+ // // that is, if the caller has defined the variable x2, it
+ // // is used in the callee.
+ // // Here, we want to avoid this.
+ // function y = myfunction ( x1 , x2 )
+ // [lhs, rhs] = argn()
+ // Checkrhs ( "myfunction" , rhs , 2 )
+ // Checklhs ( "myfunction" , lhs , [0 1] )
+ // y = x1 + x2
+ // endfunction
+ // // Calling sequences which work
+ // y = myfunction ( 1 , 2 )
+ // // Calling sequences which generate an error
+ // y = myfunction ( 1 )
+ // y = myfunction ( 1 , 2 , 3 )
+ //
+ // Authors
+ // Michael Baudin - 2010 - DIGITEO
+ //
+
+ errmsg = []
+ if ( and(rhs <> rhsset) ) then
+ rhsstr = strcat(string(rhsset)," ")
+ errmsg = msprintf(gettext("%s: Unexpected number of input arguments : %d provided while the number of expected input arguments should be in the set [%s]."), funname , rhs , rhsstr );
+ error(errmsg)
+ end
+endfunction
+
+
+
diff --git a/macros/Checktype.sci b/macros/Checktype.sci
new file mode 100644
index 0000000..3f50fa2
--- /dev/null
+++ b/macros/Checktype.sci
@@ -0,0 +1,65 @@
+// Copyright (C) 2010 - DIGITEO - Michael Baudin
+//
+// This file must be used under the terms of the GNU LGPL license.
+
+function errmsg = Checktype ( funname , var , varname , ivar , expectedtype )
+ // Generates an error if the given variable is not of expected type.
+ //
+ // Calling Sequence
+ // errmsg = Checktype ( funname , var , varname , ivar , expectedtype )
+ //
+ // Parameters
+ // funname : a 1 x 1 matrix of strings, the name of the calling function.
+ // var : a 1 x 1 matrix of valid Scilab data type, the variable
+ // varname : a 1 x 1 matrix of string, the name of the variable
+ // ivar : a 1 x 1 matrix of floating point integers, the index of the input argument in the calling sequence
+ // expectedtype : a n x 1 or 1 x n matrix of strings, the available types for the variable #ivar
+ // errmsg : a 1 x 1 matrix of strings, the error message. If there was no error, the error message is the empty matrix.
+ //
+ // Description
+ // This function is designed to be used to design functions with
+ // input arguments with variable type.
+ // We use the typeof function to compute the type of the variable:
+ // see help typeof to get the list of all available values for expectedtype.
+ // Last update : 29/07/2010.
+ //
+ // Examples
+ // // The function takes a string argument.
+ // function myfunction ( x )
+ // Checktype ( "myfunction" , x , "x" , 1 , "string" )
+ // disp("This is a string")
+ // endfunction
+ // // Calling sequences which work
+ // myfunction ( "Scilab" )
+ // // Calling sequences which generate an error
+ // myfunction ( 123456 )
+ //
+ // // The function takes a string or a matrix of doubles argument.
+ // function myfunction ( x )
+ // Checktype ( "myfunction" , x , "x" , 1 , [ "string" "constant" ] )
+ // if ( typeof(x) == "string" ) then
+ // disp("This is a matrix of strings")
+ // else
+ // disp("This is a matrix of doubles")
+ // end
+ // endfunction
+ // // Calling sequences which work
+ // myfunction ( "Scilab" )
+ // myfunction ( 123456 )
+ // // Calling sequences which generate an error
+ // myfunction ( uint8(2) )
+ //
+ // Authors
+ // Michael Baudin - 2010 - DIGITEO
+ //
+
+ errmsg = []
+ if ( and ( typeof ( var ) <> expectedtype ) ) then
+ strexp = """" + strcat(expectedtype,""" or """) + """"
+ errmsg = msprintf(gettext("%s: Expected type [%s] for input argument %s at input #%d, but got ""%s"" instead."),funname, strexp, varname , ivar , typeof(var) );
+ error(errmsg);
+ end
+endfunction
+
+
+
diff --git a/macros/Checkvector.sci b/macros/Checkvector.sci
new file mode 100644
index 0000000..76bdcc6
--- /dev/null
+++ b/macros/Checkvector.sci
@@ -0,0 +1,63 @@
+// Copyright (C) 2010 - DIGITEO - Michael Baudin
+//
+// This file must be used under the terms of the GNU LGPL license.
+
+function errmsg = Checkvector ( funname , var , varname , ivar , nbval )
+ // Generates an error if the variable is not a vector.
+ //
+ // Calling Sequence
+ // errmsg = Checkvector ( funname , var , varname , ivar )
+ //
+ // Parameters
+ // funname : a 1 x 1 matrix of strings, the name of the calling function.
+ // var : a 1 x 1 matrix of valid Scilab data type, the variable
+ // varname : a 1 x 1 matrix of string, the name of the variable
+ // ivar : a 1 x 1 matrix of floating point integers, the index of the input argument in the calling sequence
+ // nbval : a 1 x 1 matrix of floating point integers, the number of entries in the vector.
+ // errmsg : a 1 x 1 matrix of strings, the error message. If there was no error, the error message is the empty matrix.
+ //
+ // Description
+ // This function is designed to be used to design functions where
+ // the input argument is a vector, that is, a matrix for which
+ // nrows == 1 or ncols == 1.
+ // This function cannot be use when var is a function, or more
+ // generally, for any input argument for which the size function
+ // does not work.
+ //
+ // Examples
+ // // The function takes a vector of 3 doubles.
+ // function y = myfunction ( x )
+ // Checkvector ( "myfunction" , x , "x" , 1 , 3 )
+ // y = x
+ // endfunction
+ // // Calling sequences which work
+ // y = myfunction ( ones(1,3) )
+ // y = myfunction ( zeros(3,1) )
+ // // Calling sequences which generate an error
+ // // The following are not vectors
+ // y = myfunction ( ones(2,3) )
+ // y = myfunction ( zeros(3,2) )
+ // // The following have the wrong number of entries
+ // y = myfunction ( ones(1,3) )
+ //
+ // Authors
+ // Michael Baudin - 2010 - DIGITEO
+ //
+
+ errmsg = []
+ nrows = size(var,"r")
+ ncols = size(var,"c")
+ if ( nrows <> 1 & ncols <> 1 ) then
+ strcomp = strcat(string(size(var))," ")
+ errmsg = msprintf(gettext("%s: Expected a vector matrix for input argument %s at input #%d, but got [%s] instead."), funname, varname , ivar , strcomp );
+ error(errmsg)
+ end
+ if ( ( nrows == 1 & ncols <> nbval ) | ( ncols == 1 & nrows <> nbval ) ) then
+ strcomp = strcat(string(size(var))," ")
+ errmsg = msprintf(gettext("%s: Expected %d entries for input argument %s at input #%d, but current dimensions are [%s] instead."), funname, nbval , varname , ivar , strcomp );
+ error(errmsg)
+ end
+endfunction
+
+
+
diff --git a/macros/Filterdims.sci b/macros/Filterdims.sci
new file mode 100644
index 0000000..49d2848
--- /dev/null
+++ b/macros/Filterdims.sci
@@ -0,0 +1,60 @@
+
+// Copyright (C) 2010 - DIGITEO - Michael Baudin
+//
+// This file must be used under the terms of the GNU LGPL license.
+
+function var = Filterdims ( funname , var , varname , ivar , matdims )
+ // Generates an error if the variable has not the required size.
+ //
+ // Calling Sequence
+ // errmsg = Filterdims ( funname , var , varname , ivar , matdims )
+ //
+ // Parameters
+ // funname : a 1 x 1 matrix of strings, the name of the calling function.
+ // var : a 1 x 1 matrix of valid Scilab data type, the variable
+ // varname : a 1 x 1 matrix of string, the name of the variable
+ // ivar : a 1 x 1 matrix of floating point integers, the index of the input argument in the calling sequence
+ // matdims : 1 x 2 matrix of floating point integers, the number of rows, columns for the variable #ivar
+ // errmsg : a 1 x 1 matrix of strings, the error message. If there was no error, the error message is the empty matrix.
+ //
+ // Description
+ // This function is designed to be used to design functions where
+ // the input argument has a known shape.
+ // This function cannot be use when var is a function, or more
+ // generally, for any input argument for which the size function
+ // does not work.
+ // Last update : 05/08/2010.
+ //
+ // Examples
+ // // The function takes a 2 x 3 matrix of doubles.
+ // function y = myfunction ( x )
+ // Filterdims ( "myfunction" , x , "x" , 1 , [2 3] )
+ // y = x
+ // endfunction
+ // // Calling sequences which work
+ // y = myfunction ( ones(2,3) )
+ // y = myfunction ( zeros(2,3) )
+ // // Calling sequences which generate an error
+ // y = myfunction ( ones(1,3) )
+ // y = myfunction ( zeros(2,4) )
+ //
+ // Authors
+ // Michael Baudin - 2010 - DIGITEO
+ //
+
+ [lhs,rhs]=argn()
+ Checkrhs ( funname , rhs , 5 )
+ Checklhs ( funname , lhs , [0 1] )
+
+ if ( or ( size(var) <> matdims ) ) then
+ if ( ( typeof(var) == "constant" ) & ( size(var, 'r') <> size(var, 'c') ) & ( size(var') == matdims ) ) then
+ var = var';
+ warning("Transposing vector/matrix ''" + varname + "'' to get compatible dimensions");
+ return;
+ end
+ strexp = strcat(string(matdims)," ")
+ strcomp = strcat(string(size(var))," ")
+ errmsg = msprintf(gettext("%s: Expected size [%s] for input argument %s at input #%d, but got [%s] instead."), funname, strexp, varname , ivar , strcomp );
+ error(errmsg)
+ end
+endfunction
diff --git a/macros/buildmacros.sce b/macros/buildmacros.sce
new file mode 100644
index 0000000..b3bcd2e
--- /dev/null
+++ b/macros/buildmacros.sce
@@ -0,0 +1 @@
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path("buildmacros.sce"));
diff --git a/macros/fmaxflow.sci b/macros/fmaxflow.sci
new file mode 100644
index 0000000..0f72695
--- /dev/null
+++ b/macros/fmaxflow.sci
@@ -0,0 +1,270 @@
+function [maxflow,arcflows,status] = fmaxflow(varargin)
+ //Solves the graph max-flow problem(a linear optimization problem) using an implementation of the push-relabel algorithm
+ //
+ //Calling Sequence
+ //[maxflow,arcflows]=fmaxflow(start_nodes,end_nodes,capacities,st)
+ //[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st)
+ //
+ //Parameters
+ //start_nodes : a [1xn] vector (if the graph has 'n' arcs, for instance) of integral values which stores the numerical label of the start-nodes (tail-nodes) for each arc of the graph.
+ //end_nodes : a [1xn] vector of integral values which stores the value (numerical label) of the end-nodes(head-nodes) for each arc of the graph.
+ //capacities : a [1xn] vector of integral values which stores the capacities (max amount possible over a particular arc) of the respective arcs. Eg. The capacity at index 'i' of this matrix means the maximum amount possible over the arc defined by start_node[i]->end_node[i].
+ //st : a [1x2] vector which stores the numerical-label (value) of the source node and the target node, respectively.
+ //maxflow : a double representing the Maximum total Flow possible(i.e. Solution) through the system in the optimal solution, should there be one.
+ //arcflows : a [1xn] vector of double (if the graph has 'n' arcs, for instance) which represents the actual flow through the respective arcs in the optimal solution of the problem, should one exist.
+ //status : status flag returned by the Google OR-tools MaxFlow Solver function (details below)
+ //
+ //Description
+ //
+ //\text{The \textbf{`Maximum-Flow' Problem } is a classic (linear) optimization problem for Flow Networks}^{*}\text{. Essentially a part of the class of \textbf{`Circulation Problems'}, it involves finding the maximum amount of flow possible from a specified (source) node to another (sink) node, in a given network.}\\
+ //\text{}\\
+ //^{*}\text{\underline{\textbf{Flow Network}} - A flow network (also called a `transportation network'), in graph theory, is essentially a directed graph with one (or more) \textbf{source} node(s) and one (or more) \textbf{sink} node(s) and several other standard nodes, connected by edges called \textbf{`arcs'}.}\\
+ //\text{\textbf{`Flow'} is any entity that circulates through the network, from the source to the sink. Eg. electric current in a printed circuit, water in a plumbing network, etc.}\\
+ //\text{}\\\\
+ //\text{}\\\\
+ //\text{\textbf{\underline{MATHEMATICAL STATEMENT} :}}\\
+ //\text{}\\
+ //\text{}\\
+ //
+ //
+ //\begin{math}
+ //\text{Let } N= \left(V,E\right) \text{ be a network with } s,t \in V \text{ denoting the source and sink nodes in } N\text{, respectively.}\\\\
+ //\text{Let } c_{uv} \text{ or } c\left(u,v\right) \text{ denote the capacity of the arc between node } u \text{ and } v.\\
+ //\text{capacity is a mapping } c:V\to R^{+} \\\\
+ //\text{Let } f_{uv} \text{ or } f\left(u,v)\right) \text{ denotes the flow between node } u \text{ and } v, \text{such that :}\\
+ //\text{ 1. } f_{uv} \leq c_{uv} \quad \forall \quad (u,v) \in E.\\
+ //\text{ 2. } \sum_{u:(u,v)\in E} f_{uv} = \sum_{u:(v,u) \in E} f_{vu}\quad \forall \quad v \in V \backslash \{s,t\}\quad\text{; conservation of flow}\\\\\\
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //\textbf{\underline{Objective} :}
+ //\text{}\qquad\qquad\qquad Maximize \quad |f| = \sum_{v:(s,v) \in E}f_{sv} \text{,where }s\text{ is the source vertex for } N.\\\\
+ //\text{}\qquad\qquad\qquad\text{}\qquad\qquad\qquad |f| \text{ denotes the total amount of flow passing from the source to the sink}\\
+ //\end{math}
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //
+ //
+ //status- the status of solution returned by the linked Google OR-Tools max-flow solver
+ //
+ //status=0 - OPTIMAL(An optimal solution was found)
+ //status=1 - INT_OVERFLOW(There is a feasible flow > max possible flow)
+ //status=2 - BAD_INPUT(The input is inconsistent)
+ //status=3 - BAD_RESULT (There was an error)
+ //
+ //
+ //
+ //Examples
+ //
+ //start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3]
+ //end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4]
+ //capacities = [20, 30, 10, 40, 30, 10, 20, 5, 20]
+ //st=[0,4]
+ //[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st)
+ //// Press Enter to continue
+ ////Output
+ ////Max flow = 60
+ ////Arc Flow Capacity
+ ////0->1 20 20
+ ////0->2 30 30
+ ////0->3 10 10
+ ////1->2 0 40
+ ////1->4 20 30
+ ////2->3 10 10
+ ////2->4 20 20
+ ////3->2 0 5
+ ////3->4 20 20
+ //
+ ////An optimal solution was found
+ //// status =
+ ////
+ //// 0
+ //// arcflows =
+ ////
+ //// 20 30 10 0 20 10 20 0 20
+ //// maxflow =
+ ////
+ //// 60
+ //
+ //
+ //Examples
+ //
+ //start_nodes = [1, 1, 2, 2, 3, 3, 0]
+ //end_nodes = [2, 4, 3, 4, 2, 4, 5]
+ //capacities = [40, 30, 10, 20, 5, 20, 50]
+ //st=[0,4]
+ //[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st)
+ ////Press Enter to continue
+ //// Output
+ //// Max flow = 0
+ ////Arc Flow Capacity
+ ////1->2 0 40
+ ////1->4 0 30
+ ////2->3 0 10
+ ////2->4 0 20
+ ////3->2 0 5
+ ////3->4 0 20
+ ////0->5 0 50
+ //
+ ////There is no path connecting the specified source node : 0 and the specified target node : 4
+ //// status =
+ ////
+ //// 0
+ //// arcflows =
+ ////
+ //// []
+ //// maxflow =
+ ////
+ //// 0
+ //
+ //
+ //Authors
+ //Samuel Wilson
+
+
+
+ //Checking the number of input and output arguments
+
+ [lhs , rhs] = argn();
+
+ //Checking the number of input arguments entered by the user
+
+ if (rhs<>4) then
+ errmsg=msprintf(gettext("%s : Wrong number of input arguments (%d). This function expects 4 arguments. Refer to help/FOT documentation for more details"),"fmaxflow",rhs);
+ error(errmsg);
+ end
+
+ //Checking the number of output parameters specified by the user
+
+ if(lhs<2 | lhs>3) then
+ errmsg=msprintf(gettext("%s : Wrong number of output arguments(%d). This function can deliver 2/3 outputs. Refer to help/FOT documentation for further details"),"fmaxflow",lhs);
+ error(errmsg);
+ end
+
+
+ //storing the input parameters
+
+ start_nodes=varargin(1);
+ end_nodes=varargin(2);
+ capacities=varargin(3);
+ st=varargin(4);
+
+
+ //Checking the types of the input arguments
+
+ Checktype("fmaxflow",start_nodes,"start_nodes",1,"constant");
+ Checktype("fmaxflow",end_nodes,"end_nodes",2,"constant");
+ Checktype("fmaxflow",capacities,"capacities",3,"constant");
+ Checktype("fmaxflow",st,"st",4,"constant");
+
+ //Checking the dimensions of the input arguments
+ m1=size(start_nodes,"r");
+ n1=size(start_nodes,"c");
+ m2=size(end_nodes,"r");
+ n2=size(end_nodes,"c");
+ m3=size(capacities,"r");
+ n3=size(capacities,"c");
+
+
+ if (m1<>1) then
+ errmsg=msprintf(gettext("%s : Wrong Input Size. The input argument #1 is expected to be a matrix of dimension of the form 1xn (%dx%d obtained instead)"),"fmaxflow",m1,n1);
+ error(errmsg);
+ end
+
+ if (m2<>1) then
+ errmsg=msprintf(gettext("%s : Wrong Input Size. The input argument #2 is expected to be a matrix of dimension of the form 1xn (%dx%d obtained instead)"),"fmaxflow",m2,n2);
+ error(errmsg);
+ end
+
+ if (m3<>1) then
+ errmsg=msprintf(gettext("%s : Wrong Input Size. The input argument #3 is expected to be a matrix of dimension of the form 1xn (%dx%d obtained instead)"),"fmaxflow",m3,n3);
+ error(errmsg);
+ end
+
+ if ((n1<>n2)|(n2<>n3)) then
+ errmsg=msprintf(gettext("%s : Unequal dimensions of the 3 input vectors (%d %d %d). The 3 are expected to be of equal lengths."),"fmaxflow",n1,n2,n3);
+ error(errmsg);
+ end
+
+ Checkdims("fmaxflow",st,"st",4,[1 2]);
+
+ clear ['n1' 'n2' 'n3' 'm1' 'm2' 'm3'];
+
+
+
+ //checking if all the input values are indeed integral(no fractional part(or =0))
+ //NOTE- x.0 is considered INTEGRAL!
+
+
+ if (~(and(start_nodes==(int(start_nodes))))) then
+ errmsg=msprintf(gettext("%s : The values in the ''start_nodes'' vector(input argument #%d) are expected to be integral.\n"),"fmaxflow",1);
+ error(errmsg);
+ end
+
+ if (~(and(end_nodes==(int(end_nodes))))) then
+ errmsg=msprintf(gettext("%s : The values in the ''end_nodes'' vector(input argument #%d) are expected to be integral.\n"),"fmaxflow",2);
+ error(errmsg);
+ end
+
+ if (~(and(capacities==(int(capacities))))) then
+ errmsg=msprintf(gettext("%s : The values in the ''capacities'' vector(input argument #%d) are expected to be integral.\n"),"fmaxflow",3);
+ error(errmsg);
+ end
+
+ if (~(and(st==(int(st))))) then
+ errmsg=msprintf(gettext("%s : The source and target node value(s)(input argument #%d) are expected to be integral.\n"),"fmaxflow",4);
+ error(errmsg);
+ end
+
+
+
+
+
+
+ //Checking if the source and target node values are valid i.e. they are actual nodes in the specified graph or not
+
+ if (~(or(st(1)==start_nodes))) then
+ errmsg=msprintf(gettext("%s : Invalid source node(%d)- The specified source node does not exist in the given graph\n"),"fmaxflow",st(1));
+ error(errmsg);
+ end
+
+ if (~(or(st(2)==end_nodes))) then
+ errmsg=msprintf(gettext("%s : Invalid target node(%d)- The specified target node does not exist in the given graph\n"),"fmaxflow",st(2));
+ error(errmsg);
+ end
+
+
+
+ //Solving the problem by invoking the gateway function
+
+ [maxflow,arcflows,status]=MaxFlow(start_nodes,end_nodes,capacities,st);
+
+ if (maxflow==0) then
+ printf("\nThere is no path connecting the specified source node : %d and the specified target node : %d\n",st(1),st(2));
+ arcflows=[];
+ else
+ select status
+ case 0 then
+ printf("\nAn optimal solution was found\n");
+ case 1 then
+ printf("\nINT_OVERFLOW(There is a feasible flow > max possible flow)\n");
+ case 2 then
+ printf("\nBAD_INPUT(The input is inconsistent)\n");
+ case 3 then
+ printf("\nBAD_RESULT (There was an error)\n");
+ else
+ printf("\nUnrecognized return status. Notify the toolox authors\n");
+ break;
+
+ end
+ end
+endfunction
+
+
+
+
+
+
+
diff --git a/macros/fshortestpath.sci b/macros/fshortestpath.sci
new file mode 100644
index 0000000..ab65f9d
--- /dev/null
+++ b/macros/fshortestpath.sci
@@ -0,0 +1,303 @@
+
+
+function [mincost,shortestpath,flag]=fshortestpath(varargin)
+ //Computes the shortest/minimum-cost path for a given graph using an implementation of the 'Bellman Ford' algorithm for weighted digraphs.
+ //
+ //Calling Sequence
+ //[mincost,shortestpath]=fshortestpath(start_nodes,end_nodes,weights,st)
+ //[mincost,shortestpath]=fshortestpath(start_nodes,end_nodes,weights,st,disconnected_distance)
+ //[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+ //[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st,disconnected_distance)
+ //
+ //Parameters
+ //start_nodes : a [1xn] vector (if the graph has 'n' arcs, for instance) of integral values which stores the numerical label of the start-nodes (tail-nodes) for each arc of the graph.
+ //end_nodes : a [1xn] vector of integral values which stores the numerical label of the end-nodes (head-nodes) for each arc of the graph.
+ //weights : a [1xn] vector of integral values which stores the weights/traversal costs for each of the edges/arcs of the given graph. Eg.-The weight at index 'i' of this vector refers to the cost/weight of the arc defined by start_node[i]->end_node[i].
+ //st : a [1x2] vector which stores the numerical-label of the source node and the target node respectively.
+ //disconnected_distance : a singular integral value which indicates that all the weight values greater than or equal to itself essentially mean a non-existent arc/edge/path, i.e. those edges of the given graph will not be considered for the current test. (allows testing with different threshold values if need be)
+ //mincost : an integral value denoting the minimum possible cost incurred in traversing from the source node to the target node (summation of weights/costs of all the edges/arcs included in the shortest path, if any)
+ //shortestpath : Returns a vector containing the nodes(the numerical tags thereof) lying on the shortest path from source to target, if one exists.
+ //flag : flag variable indicating if there exists a path between the given source and target nodes(0-> no path exists; 1-> path exists(ipso facto, a minimal-cost path exists)
+ //
+ //Description
+ //\text{A staple of graph theory, the \textbf{`Shortest Path' problem } vies to find the least-cost, hence ``shortest" path between any two given nodes in a \textbf{weighted digraph}}^{*}\text{. Essentially a linear programming problem at its core, it is one of the most studied optimization problems.}
+ //\text{}\\
+ //\text{}\\
+ //\text{The routine uses an implementation of the `Bellman Ford single-source shortest path algorithm for weighted digraphs'(negative weights supported)}
+ //\text{}\\
+ //\text{Bellman–Ford is based on the principle of relaxation, in which an approximation to the correct distance is gradually replaced by more accurate values until eventually reaching the optimum solution.\\The approximate distance to each vertex is always an overestimate of the true distance, and is replaced by the minimum of its old value with the length of a newly found path.\\Bellman–Ford algorithm, unlike the contemporary Dijkstra's shortest path algorithm, simply relaxes all the edges, and does this (|V|-1) times, where |V| is the number of vertices in the graph. In each of these repetitions, the number of vertices with correctly calculated distances grows, from which it follows that eventually all vertices will have their correct distances.\\This method allows the Bellman–Ford algorithm to be applied to a wider class of inputs than Dijkstra's algorithm(Dijkstra's doesn't support negative edges).\\
+ //Bellman–Ford runs in O(|V|.|E|) time, where |V| and |E| are the number of vertices and edges respectively.}\\
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //^{*}\text{\underline{\textbf{Weighted Digraph}} : A weighted digraph is a graph in which each edge has a ``weight" associated with it. The \textbf{``weight" } is any quantity of practical significance to the problem, like distance, electrical resistance, etc. Moreover, the edges of the graph are directionally constrained, i.e. an edge from node `a' to node `b' entails neither the existence of an edge from node `b' to node `a' nor the same weight.}\\
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //\text{\textbf{\underline{MATHEMATICAL STATEMENT} :}}\\
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //
+ //
+ //\begin{math}
+ //\text{Let } N= \left(V,E\right) \text{be a network with } s,t \in V \text{denoting the source and target nodes in } N\text{, respectively.}\\
+ //\text{Let } w_{ij} \text{ denote the cost for the edge } i \to j.\\\\
+ //\textbf{\underline{Objective} :}
+ //\text{}\quad Maximize \quad \sum_{i,j \in A} w_{ij}x_{ij} \text{ ;}\\\\
+ //\text{ } \qquad \hspace{4em} \text{ Subject to } x \geq 0.\\
+ //\text{ }\qquad \hspace{4em} \text{ Also, } \sum_{j}x_{ij} - \sum_{j} x_{ji} = \begin{cases}
+ //1, \quad if\text{ }i=s\text{;}\\
+ //-1, \quad if\text{ }i=t\text{;}\\
+ //0, \quad \text{ otherwise;}\\
+ //\end{cases} \quad \forall \quad i \text{ ;}\\
+ //\end{math}
+ //
+ //
+ //
+ //Examples
+ //start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3]
+ //end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4]
+ //weights = [20, 30, 10, 40, 30, 10, 20, 5, 20]
+ //st=[0,4]
+ //[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+ ////Press Enter to continue
+ ////Output :
+ ////Shortest path from start-node:0 to end-node:4 is :
+ ////0 -> 3 -> 4
+ ////Minumum cost (using the said path) :- 30.000000
+ //
+ //
+ //Examples
+ //specifying disconnected-distance
+ //start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3]
+ //end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4]
+ //weights = [20, 30, 10, 10, 30, 10, 20, 5, 30]
+ //st=[0,4]
+ //disconnected_distance=30
+ //[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+ ////Press Enter to continue
+ ////Output
+ ////Shortest path from start-node:0 to end-node:4 is :
+ ////0 -> 3 -> 2 -> 4
+ ////Minumum cost (using the said path) :- 35.000000
+ ////Shortest/Lowest Cost Path found.
+ //
+ //
+ //Examples
+ //start_nodes = [1, 1, 2, 2, 3, 3, 0]
+ //end_nodes = [2, 4, 3, 4, 2, 4, 5]
+ //weights = [40, 30, 10, 20, 5, 20, 30]
+ //st=[0,4]
+ //[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+ ////Press Enter to continue
+ ////No path connecting start-node: 0 and end-node=: 4.
+ ////No Solution![0 , 4]
+ //
+ //
+ //Examples
+ //start_nodes=[ 0 0 1 1 2 4 5 4];
+ //end_nodes= [ 1 5 2 5 3 3 4 2];
+ //weights=[10 8 5 2 7 10 10 8];
+ //st=[0,3]
+ //[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+ ////Press Enter to continue
+ ////Output
+ ////Shortest path from start-node:0 to end-node:3 is :
+ ////0 -> 1 -> 2 -> 3
+ ////Minumum cost (using the said path) :- 22.000000
+ //// Shortest/Lowest Cost Path found.
+ //
+ //
+ //Authors
+ //Samuel Wilson
+
+
+
+ //obtaining the number of input and output arguments
+
+ [lhs,rhs]=argn();
+
+
+ //checking the number of input arguments
+
+ if (rhs<4 | rhs>5) then
+ errmsg=msprintf(gettext("%s : Number of input arguments is expected to be 4 or 5. Found %d. Refer to help/FOT documentation for more details.\n"),"fshortestpath",rhs);
+ error(errmsg);
+ end
+
+
+ //checking the number of output arguments
+ if (lhs<2 | lhs >3) then
+ errmsg=msprintf(gettext("%s : Unexpected number of output parameters( Found %d). This routine expects 2 or 3 output parameters. Refer to help/FOT documentation for more details.\n"),"fshortestpath",lhs);
+ error(errmsg);
+ end
+
+
+ //storing the input arguments
+
+ start_nodes=varargin(1);
+ end_nodes=varargin(2);
+ weights=varargin(3);
+ st=varargin(4);
+
+
+
+ // checking if the 'disconnected distance' is specified by the user and initilaizing it accordingly
+ if (rhs==5) then
+ disconnected_distance=varargin(5);
+ else
+ disconnected_distance=[2147483647];
+ end
+
+
+ //checking the types of the input arguments
+
+ Checktype("fshortestpath",start_nodes,"start_nodes",1,"constant");
+ Checktype("fshortestpath",end_nodes,"end_nodes",2,"constant");
+ Checktype("fshortestpath",weights,"weights",3,"constant");
+ Checktype("fshortestpath",st,"st",4,"constant");
+
+ if (rhs == 5) then
+ Checktype("fshortestpath",disconnected_distance,"disconnected_distance",5,"constant");
+ end
+
+
+
+ //Checking the dimensions of the input arguments
+
+ m1=size(start_nodes,"r");
+ n1=size(start_nodes,"c");
+ m2=size(end_nodes,"r");
+ n2=size(end_nodes,"c");
+ m3=size(weights,"r");
+ n3=size(weights,"c");
+
+ if (m1<>1) then
+ errmsg=msprintf(gettext("%s : Wrong Input Size. The input argument #1 is expected to be a matrix of dimensions of the form 1xn (%dx%d obtained instead)"),"fshortestpath",m1,n1);
+ error(errmsg);
+ end
+
+ if (m2<>1) then
+ errmsg=msprintf(gettext("%s : Wrong Input Size. The input argument #2 is expected to be a matrix of dimensions of the form 1xn (%dx%d obtained instead)"),"fshortestpath",m2,n2);
+ error(errmsg);
+ end
+
+ if (m3<>1) then
+ errmsg=msprintf(gettext("%s : Wrong Input Size. The input argument #3 is expected to be a matrix of dimensions of the form 1xn (%dx%d obtained instead)"),"fshortestpath",m3,n3);
+ error(errmsg);
+ end
+
+ if ((n1<>n2)|(n2<>n3)) then
+ errmsg=msprintf(gettext("%s : Unequal dimensions of the 3 input vectors (%d %d %d). The 3 are expected to be of equal lengths."),"fshortestpath",n1,n2,n3);
+ error(errmsg);
+ end
+
+ Checkdims("fshortestpath",st,"st",4,[1 2]);
+
+ if (rhs==5) then
+ Checkdims("fshortestpath",disconnected_distance,"disconnected_distance",5,[1 1]);
+ end
+
+ clear ['n1' 'n2' 'n3' 'm1' 'm2' 'm3'];
+
+
+ //checking if all the input values are indeed integral(no fractional part(or =0))
+ //NOTE- x.0 is considered INTEGRAL!
+
+
+ if (~(and(start_nodes==(int(start_nodes))))) then
+ errmsg=msprintf(gettext("%s : The values in the ''start_nodes'' vector(input argument #%d) are expected to be integral.\n"),"fshortestpath",1);
+ error(errmsg);
+ end
+
+ if (~(and(end_nodes==(int(end_nodes))))) then
+ errmsg=msprintf(gettext("%s : The values in the ''end_nodes'' vector(input argument #%d) are expected to be integral.\n"),"fshortestpath",2);
+ error(errmsg);
+ end
+
+ if (~(and(weights==(int(weights))))) then
+ errmsg=msprintf(gettext("%s : The values in the ''weights'' vector(input argument #%d) are expected to be integral.\n"),"fshortestpath",3);
+ error(errmsg);
+ end
+
+ if (~(and(st==(int(st))))) then
+ errmsg=msprintf(gettext("%s : The source and target node value(s)(input argument #%d) are expected to be integral.\n"),"fshortestpath",4);
+ error(errmsg);
+ end
+
+
+ if (rhs==5) then
+ if (disconnected_distance<>(int(disconnected_distance))) then
+ errmsg=msprintf(gettext("%s : The ''disconnected distance'' value(input argument #%d) is expected to be integral.\n"),"fshortestpath",5);
+ error(errmsg)
+ end
+
+ end
+
+
+
+
+ //Checking if the source and target node values are valid i.e. they are actual nodes in the specified graph or not
+
+ if (~(or(st(1)==start_nodes))) then
+ errmsg=msprintf(gettext("%s : Invalid source node(%d)- The specified source node does not exist in the given graph\n"),"fshortestpath",st(1));
+ error(errmsg);
+ end
+
+ if (~(or(st(2)==end_nodes))) then
+ errmsg=msprintf(gettext("%s : Invalid target node(%d)- The specified target node does not exist in the given graph\n"),"fshortestpath",st(2));
+ error(errmsg);
+ end
+
+
+ //Solving the problem by invoking the pertinent gateway function
+
+
+ [mincost,shortestpath,flag]=BellmanFordShortestPath(start_nodes,end_nodes,weights,st,disconnected_distance,1);
+
+
+ if (~exists('flag')) then
+ flag=0;
+ end
+
+ if (rhs==5 & flag==0) then // disconnected_distance was specified by the user
+ [mincost2,shortestpath2,flag2]=BellmanFordShortestPath(start_nodes,end_nodes,weights,st,[2147483647],0);
+ flag=0;
+ if (~exists('flag2')) then
+ flag2=0;
+ end
+ clear 'mincost2'
+ clear 'shortestpath2'
+ end
+
+
+ select flag
+ case 0 then
+ printf("\nNo Solution![%d , %d] \n", st(1),st(2));
+ mincost=[];
+ shortestpath=[];
+ if (rhs==5) then
+
+ if (flag2==0) then
+ printf("No path exists(despite disregarding the specified ''disconnected_distance'' value. Please check the graph or the source/target\n");
+ else
+ printf("No effective path exists with weights within the specified ''disconnected_distance''(i.e. there is at least 1 path between the given source and target which is not considered due to given constraint on the weight(disconected_distance)). Try increasing the thresholing value, if the problem allows.\n");
+ end
+ end
+
+ case 1 then
+ printf("\n Shortest/Lowest Cost Path found. \n");
+ else
+ printf("\nUnrecognized return status. Notify the toolox authors\n");
+ break;
+
+ end
+endfunction
+
+
+
+
+
+
+
diff --git a/macros/jssp.sci b/macros/jssp.sci
new file mode 100644
index 0000000..601312b
--- /dev/null
+++ b/macros/jssp.sci
@@ -0,0 +1,432 @@
+function [makespan, schedule, status] = jssp(varargin)
+ //Solves the popular 'Job-Shop Scheduling Problem' (JSSP for short), which aims to find an optimal plan to schedule a given number of jobs, each composed of one or more tasks to be performed in some specific logical order, on a given number of machines. The routine makes use of the 'constraint-solver' library from the Google OR-Tools framework.
+ //
+ //Calling Sequence
+ //[makespan,schedule] = jssp(machines, jobs, jmode, tasks)
+ //[makespan, schedule] = jssp(machines, jobs, jmode, tasks, time_limit)
+ //[makespan, schedule, status] = jssp(machines, jobs, jmode, tasks)
+ //[makespan, schedule, status] = jssp(machines, jobs, jmode, tasks, time_limit)
+ //
+ //Parameters
+ //
+ //machines : It is a single integral value specifying the total number of machines in the problem, on which the various tasks are to be scheduled.
+ //jobs : It is a single integral value specifying the total number of jobs in the problem. Each job is composed of one or more tasks which are to be scheduled on specific machines, in some logical order.
+ //mode : It is a single intergral value (either '0' or '1' only). It specifies one of the two modes for the solver, which are :-0-> Sequential - In this mode, the various tasks within a job are considered to be sequentially constrained i.e. task_1 must occur before task_2, task_2 before task_3 and so on.1-> Parallel - This mode allows the flexibility of some tasks being scheduled parallelly or independently of each other, if such a scenario is to be modelled. Eg. if a task 'x' can be performed any time after task_1 but must be performed before task_10. It requires 2 additional fields in the 'tasks' matrix, specifying 2 tasks (indices) between which the current task can be freely scheduled. One or both of these bounds can be done away with(no 'start_after' or 'end_before' constraints) by providing '-1' for the respective field.(These indices are the task indices WITHIN the job, ie.each job will have a task indexed '1', dor instance).
+ //tasks : It is an [AxB] matrix( A- total number of tasks in the problem. B- 3 or 5 depending on the mode). Each row corresponds to a task. The two variations are :-mode '0' -> An [Ax3] matrix. The 3 fields/columns are 'Job-Index', 'Machine-Index' and 'Task-Duration'. (The tasks for each job are ordered internally in the order they appear in this matrix)mode '1' -> An [Ax5] matrix. The 5 fields/columns are 'Job-Index, 'Machine-Index', 'Task-Duration', 'Start-After' and 'End-Before'. (order of the tasks doesn't matter in this case)\text{}\\\text{}\\\\More on the columns (let the current task(row) be 'x')'job-index' -> It is the index of the job to which 'x' belongs.'machine-index' -> It is the index of the machine on which 'x' is to be scheduled.'task-duration' -> It is the time required to perform 'x'.\text{}\\\text{}\\\\Only for mode '1' -'start-after' -> It is the index of the task, only after whose completion, 'x' can start.'end-before' -> It is the index of the task that can only start once 'x' is completed.
+ //time_limit : It is the maximum time (in milliseconds; integral value) for which the solver is allowed to run. If a solution is not found by then, a pertinent 'timed-out' error occurs.(Default Value - 10 seconds). Provide an empty matrix or omit the parameter if explicit time-limit is not required.
+ //makespan : It is the total duration of the schedule in the optimal solution, if one exists.
+ //schedule : Is is an [Ax5] matrix (A- no. of tasks) that gives the final schedule for the various tasks in the optimal solution, if one exists. The 5 fields/columns are 'Job-index', 'machine-index', 'task-duration', 'start-time' and 'end-time'.
+ //status : Is is an integral value representing the status of the solution as: '0'-> 'Solution Found' '1'-> 'Timed-out' - No solution was found within the specified/default time limit. '2'-> 'Problem-Infeasible' - No solution exists for the given problem.
+ //Description
+ //
+ //\text{The Job-Shop Scheduling Problem (also called the \textbf{Resource Scheduling Problem}) is a linear optimization problem in Computer Science and Operations Research which vies to schedule a number of jobs, each composed of one or more tasks, on a specific number of machines, minimizing the total time for the enite schedule, called the \textbf{makespan}.\\The order in which the various tasks in a job are performed and the machines on which they must be scheduled are received as inputs.\\This particular implementation supports two variations :}\\
+ //\text{}\\
+ //\text{1. \textbf{`Sequential Mode'}(mode 0) : In this mode, all the tasks in a job are considered to be sequentially constrained ie. task 2 cannot occur before task 1 finishes, and so on.}\\
+ //\text{2. \textbf{`Parallel/Arbitrary Mode'}(mode 1) : In this mode, tasks within a job can occur parallelly ie. the order is arbitrary sans 2 \textbf{optional bounds}. \\These 2 ``bound'' values are specified for each task. They are :}\\
+ //\qquad\text{ - \textbf{`start-after'} : This is the index of the task that must finish before the current task can start}\\
+ //\qquad\text{ - \textbf{`end-before'} : This is the index of the task that cannot start before the current task finishes}\\
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //\text{\textbf{\underline{MATHEMATICAL\textbf{ }STATEMENT} :}}\\
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //
+ //
+ //
+ //\begin{math}
+ //\text{Let } M = \{M_{1}, M_{2},..., M_{m}\} \text{ and} \\
+ //\text{Let } J = \{J_{1}, J_{2},..., J_{j}\} \quad \text{be 2 finite sites representing the machines and the jobs respectively. }\\\\
+ //\end{math}
+ //\text{(the tasks are abstracted for simplicity. So whenever a Job is scheduled on a machine, it is assumed, the next task to be performed is the one scheduled).}\\\\
+ //\begin{math}
+ //\text{Let } X \text{ denote the set of assignment of all jobs on the machines}\\\\
+ //\text{Let } C \text{ be the \textbf{`cost function'} such that :}\\
+ //\text{}\\
+ //C:X \to [0, \infty^{+}] \quad \text{; which denotes the total processing time ie. makespan of schedule.}\\\\
+ //\textbf{\underline{Objective} :}\qquad \text{ To find an assignment of jobs }x \in X \text{ for which } C(x) \text{ is minimum, ie.}\\\\
+ //\text{ } \qquad \hspace{3em} \qquad \text{ } \text{ No }y \in X \text{ exists, such that } C(y) < C(x).\\
+ //\end{math}
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //
+ //
+ //Examples
+ // //INPUT :
+ //
+ //machines = 3;
+ //
+ //jobs = 3;
+ //
+ //jssp_mode = 0;
+ //
+ //tasks=[ 1 1 3;
+ // 1 2 2;
+ // 1 3 2;
+ // 2 1 2;
+ // 2 3 1;
+ // 2 2 4;
+ // 3 2 4;
+ // 3 3 3;
+ // ];
+ //
+ //[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, []);
+ //
+ //Examples
+ // //INPUT:
+ //
+ //machines = 2;
+ //
+ //jobs = 5;
+ //
+ //jssp_mode = 0;
+ //
+ //tasks = [1 1 13;
+ // 1 2 3;
+ // 2 1 2;
+ // 2 2 5;
+ // 3 1 1;
+ // 3 2 3;
+ // 4 1 4;
+ // 4 2 6;
+ // 5 1 5;
+ // 5 2 7];
+ //
+ //[makespan, schedule, status] = jssp (machines, jobs, jssp_mode, tasks, []);
+ //Authors
+ //Samuel Wilson
+
+
+
+
+ //obtaining the number of inputs and outputs
+
+ [lhs, rhs] = argn();
+
+ //checking the number of input arguments
+
+ if ( rhs<4 | rhs>5) then
+ errmsg = msprintf(gettext("%s : Unexpected number of input arguments. ''4'' or ''5'' expected. Refer to help/FOT Documentation for more details.\n"),"jssp");
+ error(errmsg);
+ end
+
+
+ //checking the number of output parameters
+
+ if ( lhs<2 | lhs>3) then
+ errmsg = msprintf( gettext("%s : Unexpected number of output parameters. ''2'' or ''3'' expected. Refer to help/FOT Documentation for more details.\n"),"jssp");
+ error(errmsg);
+ end
+
+
+
+ //storing the input arguments
+
+ machines = varargin(1);
+ jobs = varargin(2);
+ jmode = varargin(3);
+ tasks = varargin(4);
+
+ if (rhs == 5) then
+ time_limit = varargin(5);
+ else
+ time_limit = []; // the gateway automatically uses default value upon receiving an empty matrix
+ end
+
+
+
+
+ //Checking the type of all input arguments
+
+ Checktype("jssp",machines,"machines",1,"constant");
+ Checktype("jssp",jobs,"jobs",2,"constant");
+ Checktype("jssp",jmode,"jmode",3,"constant");
+ Checktype("jssp",tasks,"tasks",4,"constant");
+ Checktype("jssp",time_limit,"time_limit",5,"constant");
+
+
+
+
+ ///////////Checking the dimensions of all the inputs///////////
+
+
+ //checking 'machines'
+
+ m=size(machines,"r");
+ n=size(machines,"c");
+
+ if (m<>1 | n<>1) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for input argument #1 (''machines''). Single integral value [1x1] expected.\n"),"jssp");
+ error(errmsg);
+ end
+
+
+
+ //checking 'jobs'
+
+
+ m = size(jobs,"r");
+ n = size(jobs, "c");
+
+ if ( m<>1 | n<>1) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for input argument #2 (''jobs''). Single integral value [1x1] expected.\n"),"jssp");
+ error(errmsg);
+ end
+
+
+ //checking 'jmode'
+
+ m = size(jmode, "r");
+ n = size(jmode, "c");
+
+ if ( m<>1 | n<>1 ) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for input argument #3 (''jmode''). Single integral value [1x1] expected.\n"),"jssp");
+ error(errmsg);
+ end
+
+ //checking jmode value as well(as 'twill be needed to check the dimensions of 'tasks'
+
+ if ( jmode<>0 & jmode<>1) then
+ errmsg = msprintf(gettext("%s : Input argument #3(''jmode'') can only take the value ''0'' or ''1'' (details in help/FOT documentation).\n"),"jssp");
+ error(errmsg);
+ end
+
+
+
+ //checking 'tasks'
+
+ m=size(tasks,"r");
+ n=size(tasks,"c");
+
+ num_tasks = m;
+
+
+ if (jmode == 0) then
+ if ( n<>3 ) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for input argument #4( ''tasks''). [%dx3] expected.\n"),"jssp",num_tasks);
+ error(errmsg);
+ end
+
+ else
+ if ( n<>5 ) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for input argument #4(''tasks''). [%dx5] expected.\n"),"jssp",num_tasks);
+ error(errmsg);
+ end
+ end
+
+
+
+ //checking 'time_limit'
+
+ m = size(time_limit,"r");
+ n = size(time_limit,"c");
+
+
+ if ( ~((m==0 & n==0) | (m==1 & n==1)) ) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for input argument #5(''time_limit''). Single integral value [1x1] or an empty matrix expected.\n"),"jssp");
+ error(errmsg);
+ end
+
+
+
+ /////Dimensions verified/////
+
+
+
+ ////////// Checking if all the inputs are integral (ie. No fractional part)(NOTE -> x.0 is considered inherently integral as fractional part is '0'//////////////
+
+ //checking 'machines'
+
+ if ( ~(and(machines==(int(machines)))) ) then
+ errmsg = msprintf(gettext("%s : Number of machines ( ''machines'' ; argument #1) is expected to be an integral value.\n"),"jssp");
+ error(errmsg);
+ end
+
+
+ //checking 'jobs'
+
+ if ( ~(and(jobs == (int(jobs)))) ) then
+ errmsg = msprintf(gettext("%s : Number of jobs ( ''jobs'' ; argument #2) is expected to be an integral value.\n"),"jssp");
+ error(errmsg);
+ end
+
+
+ //jmode has already been checked for '0' or '1' value
+
+
+ //checking 'tasks'
+
+ if ( ~(and(tasks == (int(tasks)))) ) then
+ errmsg = msprintf(gettext("%s : All the values in the ''tasks'' matrix (argument #4) are expected to be integral.\n"),"jssp");
+ error(errmsg);
+ end
+
+
+ //checking 'time_limit'
+
+ if ( ~(and(time_limit == (int(time_limit)))) ) then
+ errmsg = msprintf(gettext("%s : Time Limit ( ''time_limit'' ; argument #5 ) is expected to be an integral value.\n"),"jssp");
+ error(errmsg);
+ end
+
+
+ //-----------------------------------------------LOGICAL CHECKS---------------------------------------------------------//
+
+
+ //checking if number of machines ('machines') is a valid(positive) value
+
+ if ( machines < 1) then
+ errmsg = msprintf(gettext("%s : Invalid value for arguement #1 (''machines''). A positive, integral value expected.\n"),"jssp");
+ error(errmsg);
+ end
+
+
+ //checking if the number of jobs ('jobs') is a valid(positive) value
+
+ if ( jobs < 1) then
+ errmsg = msprintf(gettext("%s : Invalid value for argument #2 (''jobs''). A positive, integral value expected. \n"),"jssp");
+ error(errmsg);
+ end
+
+ //checking if the time-limt ('time_limit') is a valid(positive) value, if 'tis provided
+
+ if ( rhs == 5) then
+ if ( time_limit <1) then
+ errmsg = msprintf(gettext("%s : Invalid value for argument #5 (''time_limit''). A positive, integral value expected. \n"),"jssp");
+ error(errmsg);
+ end
+ end
+
+
+ //checking if no 'job' index values in the 'tasks' matrix are invalid
+
+ if ( (or(tasks(:,1)< 1)) | (or(tasks(:,1)>jobs)) ) then
+ errmsg = msprintf(gettext("%s : One or more job-index values in the ''tasks'' matrix (argument #4) are invalid. Job indices can only take values from ''1'' to ''%d''.\n"),"jssp",jobs);
+ error(errmsg);
+ end
+
+
+ //checking if no 'machine' index values in the 'tasks' matrix are invalid
+
+ if ( (or(tasks(:,2) < 1)) | (or(tasks(:,2) > machines)) ) then
+ errmsg = msprintf(gettext("%s : One or more machine-index values in the ''tasks'' matrix (argument #4) are invalid. Machine indices can only take values from ''1'' to ''%d''.\n"),"jssp",machines);
+ error(errmsg);
+ end
+
+
+ //checking if no 'duration' values in the 'tasks' matrix are invalid
+
+
+ if ( or(tasks(:,3) < 0) ) then
+ errmsg = msprintf(gettext("%s : One or more ''duration'' values in the ''tasks'' matrix (argument #4) are invalid. Duration values cannot be negative.\n"),"jssp");
+ error(errmsg);
+ end
+
+
+
+
+
+
+ if ( jmode == 1) then
+
+ for i = 1:size(tasks,"r")
+
+ //checking if no 'start_after' values are invalid
+
+ if ( ~((tasks(i,4) == -1 ) | ((tasks(i,4) > 0) & (tasks(i,4)<=(length(tasks(:,1) == i))))) ) then
+ errmsg = msprintf(gettext("%s : One or more job-index values in the ''start-after'' column ( column 4) in the ''tasks'' matrix (argument #4) are invalid. Expected - either ''-1'' or a value from ''1'' to ''%d''.\n"),"jssp",jobs);
+ error(errmsg);
+ end
+
+
+ //checking if no 'start_after' values are invalid
+
+ if ( ~((tasks(i,5) == -1 ) | ((tasks(i,5) > 0) & (tasks(i,5)<=(length(tasks(:,1) == i))))) ) then
+ errmsg = msprintf(gettext("%s : One or more job-index values in the ''end-before'' column (column 5) in the ''tasks'' matrix (argument #4) are invalid. Expected - either ''-1'' or a value from ''1'' to ''%d''.\n"),"jssp",jobs);
+ error(errmsg);
+ end
+
+ end
+
+ end
+
+
+
+ if ( jmode == 1) then
+
+ for i = 1 : jobs
+
+ // In case of mode '1', checking if each job has at least one task with no 'end-before' defined ie. open-ended(otherwise no task can be the last task in the schedule for that job, which is a logical fallacy. (Infeasible problem)
+ if ( ~(or(tasks(find(tasks(:,1) == i),5) == -1)) ) then
+ errmsg = msprintf(gettext("%s : At least one task in every job must be free from an ''end-before'' constraint ( = -1), to serve as a potential last task for that job. No such tasks found in job #%d.\n"),"jssp",i);
+ error(errmsg);
+ end
+
+
+ // also checking if each job has at least one task with no 'start-after' defined (otherwise no task can be the first task in the schedule for that job, which is a logical fallacy. (Infeasible problem)
+ if ( ~(or(tasks(find(tasks(:,1) == i),4) == -1)) ) then
+ errmsg = msprintf(gettext("%s : At least one task in every job must be free from a ''start-after'' constraint ( = -1), to serve as a potential first task for that job. No such tasks found in job #%d.\n"),"jssp",i);
+ error(errmsg);
+ end
+
+ //Also checking for the condition where there's only one task free from 'start-after' and 'end-before' constraints. The model is still wrong as the same task cannot be both the first and last task for the job.
+
+ temp = tasks(find(tasks(:,1) == i),:)
+ if ( (length(temp(:,4) == -1) == 1) & (length(temp(:,5 ) == -1) == 1) & ( length(find(temp(:,4)==-1 & temp(:,5)==-1)) ) ) then
+ errmsg = msprintf(gettext("%s : Only one task in job %d free from ''start-after'' and ''end-before'' constraints. Each job must have at least one potential first and one potential last task for the problem to be feasible.\n"),"jssp",i);
+ error(errmsg);
+ end
+
+
+ end
+ end
+
+
+
+
+
+
+
+ //-----------------------------------------SOLUTION--------------------------------------------------------//
+
+
+ //solving the JSSP by calling the gateway function
+
+ [makespan, schedule, status] = JSSP( machines, jobs, jmode, tasks, time_limit);
+
+
+
+ select status
+
+ case 0 then
+
+ case 1 then
+ if (time_limit <> []) then
+ errmsg = msprintf(gettext("%s : ''TIMED_OUT'' : The solver failed to find an optimal solution within the specified time limit (%d milliseconds). Try specifying a longer limit, if the problem allows.\n"),"jssp",time_limit);
+ error(errmsg);
+ else
+ errmsg = msprintf(gettext("%s : ''TIMED_OUT'' : The solver failed to find an optimal solution within the default time limit (10 seconds). Try explicitly specifying a higher time-limit.\n"),"jssp");
+ error(errmsg);
+ end
+
+ case 2 then
+ errmsg = msprintf(gettext("%s : ''PROBLEM_INFEASIBLE'' : No solution exists for the specified problem. If solution expected, please check the inputs.\n"),"jssp");
+ error(errmsg);
+
+ else
+ printf("\nUnexpected return status. Notify the toolbox authors.\n");
+ break;
+
+ end
+
+endfunction
+
+
+
+
+
+
+
+
diff --git a/macros/linsum.sci b/macros/linsum.sci
new file mode 100644
index 0000000..bb95fe0
--- /dev/null
+++ b/macros/linsum.sci
@@ -0,0 +1,91 @@
+function [cost, assignment, status] = linsum(varargin)
+ // Solves problem with finding minimum cost of assignment
+ //
+ // Calling Sequence
+ // [cost, assignment] = linsum(kNumLeftNodes, kNumRightNodes, kCost)
+ // [cost, assignment, status] = linsum(kNumLeftNodes, kNumRightNodes, kCost)
+ //
+ // Parameters
+ // kNumLeftNodes : a double, Number of Left Nodes / Jobs
+ // kNumRightNodes : a double, Number of Right Nodes / Workers
+ // kCost : a matrix of double, kNumLeftNodes x kNumRightNodes, represents Cost of assigning a Job to a Worker
+ // cost : a double, Optimal (minimum) Cost
+ // assignment : a matrix of boolean, kNumLeftNodes x kNumRightNodes, represents Optimal Assignment for the Problem
+ // status : contains the exit flag of Solver. Currently 0 for Not Optimal, 1 for Optimal.
+ //
+ // Description
+ // Find the minimum cost and assignment for a given set of jobs and workers
+ //
+ // The routine uses Google ORtools for solving the quadratic problem, ORtools is a library written in C++.
+ //
+ //
+ // \text{}\\
+ // \begin{align}
+ // & \text{minimize} && \texttt{kCost}\text{ . }\texttt{assignment}\\
+ // & \text{subject to} && \sum_{i=0}^{\texttt{kNumLeftNodes}} \texttt{assignment}_{ij} = 1 \\
+ // &&& \sum_{j=0}^{\texttt{kNumRightNodes}} \texttt{assignment}_{ij} = 1
+ // \end{align}\\
+ // \text{}\\
+ // \text{}\\
+ // \text{}\\
+ //
+ //
+ // Examples
+ // //Ref :
+ // //http://www.hungarianalgorithm.com/examplehungarianalgorithm.php
+ //
+ // kNumLeftNodes = 4;
+ // kNumRightNodes = 4;
+ // kCost = [82, 83, 69, 92; 77, 37, 49, 92; 11, 69, 5, 86; 8, 9, 98, 23];
+ // [cost, assignment, status] = linsum(kNumLeftNodes, kNumRightNodes, kCost);
+ // cost
+ // assignment
+ // status
+ //
+ // Authors
+ // Souvik Das
+
+ [lhs, rhs] = argn();
+ Checklhs("linsum", lhs, [2, 3]);
+ Checkrhs("linsum", rhs, 3);
+
+ kNumLeftNodes = varargin(1);
+ kNumRightNodes = varargin(2);
+ kCost = varargin(3);
+
+ Checktype("linsum", kNumLeftNodes, "kNumLeftNodes", 1, "constant");
+ Checktype("linsum", kNumRightNodes, "kNumRightNodes", 2, "constant");
+
+ Checkdims("linsum", kNumLeftNodes, "kNumLeftNodes", 1, [1 1]);
+ Checkdims("linsum", kNumRightNodes, "kNumRightNodes", 2, [1 1]);
+
+ if(kNumLeftNodes <= 0) then
+ errmsg = msprintf(gettext("%s: Number of Left Nodes should be > 0. Check input #1\n"), "linsum");
+ error(errmsg);
+ end
+
+ if(kNumRightNodes <= 0) then
+ errmsg = msprintf(gettext("%s: Number of Right Nodes should be > 0. Check input #2\n"), "linsum");
+ error(errmsg);
+ end
+
+ if(kNumLeftNodes <> kNumRightNodes) then
+ errmsg = msprintf(gettext("%s: Number of Left Nodes should be EQUAL to Number of Right Nodes\n"), "linsum");
+ error(errmsg);
+ end
+
+ Checktype("linsum", kCost, "kCost", 3, "constant");
+ Checkdims("linsum", kCost, "kCost", 3, [kNumLeftNodes kNumRightNodes]);
+
+ [cost, assignment, status] = solve_linsumassignment(kNumLeftNodes, kNumRightNodes, kCost);
+
+ select status
+ case 0 then
+ printf("\nOptimal Solution not Found\n");
+ case 1 then
+ printf("\nOptimal Solution Found.\n");
+ else
+ printf("\nSomething went wrong. Retry later or Notify the Toolbox author(s)\n");
+ break;
+ end
+endfunction
diff --git a/macros/min_cost_flow.sci b/macros/min_cost_flow.sci
new file mode 100644
index 0000000..6ceae8a
--- /dev/null
+++ b/macros/min_cost_flow.sci
@@ -0,0 +1,154 @@
+function [cost, flow, status] = min_cost_flow(varargin)
+ // Solves problem with finding minimum cost of flow
+ //
+ // Calling Sequence
+ // [cost, flow] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand)
+ // [cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand)
+ //
+ // Parameters
+ // kNumSources : a double, Number of Sources / Suppliers
+ // kNumTargets : a double, Number of Targets / Demanders
+ // kCost : a matrix of double, kNumSources x kNumTargets, represents Cost of flow from a Source to Target
+ // kCapacity : a matrix of double, kNumSources x kNumTargets, represents Capacity of flow from a Source to Target
+ // kSupply : a vector of double, length kNumSources, contains Supply Quantity of Suppliers
+ // kDemand : a vector of double, length kNumTargets, contains Demand Quantity of Demanders
+ // cost : a double, Optimal (minimum) Cost
+ // flow : a matrix of double, kNumSources x kNumTargets, represents Optimal Flow for the Problem
+ // status : contains the exit flag of Solver. See below
+ //
+ // Description
+ // Find the minimum cost and flow for a given set of sources and targets with limit on capacity per flow
+ //
+ // The routine uses Google ORtools for solving the quadratic problem, ORtools is a library written in C++.
+ //
+ //
+ // \text{}\\
+ // \begin{align}
+ // & \text{minimize} && \texttt{kCost}\text{ . }\texttt{flow}\\
+ // & \text{subject to} && \texttt{flow}_{ij} \leq \texttt{kSupply}_i \\
+ // &&& \texttt{flow}_{ij} \geq \texttt{kDemand}_j \\
+ // &&& \texttt{flow}_{ij} \leq \texttt{kCapacity}_{ij} \\
+ // &&& \sum_{i=1}^{\texttt{kNumSources}} \texttt{kSupply}_i = \sum_{j=1}^{\texttt{kNumTargets}} \texttt{kDemand}_j
+ // \end{align}\\
+ // \text{}\\
+ // \text{}\\
+ // \text{}\\
+ //
+ //
+ // The status allows to know the status of the optimization which is given back by ORtools.
+ //
+ // status=0 : Not Solved
+ // status=1 : Optimal
+ // status=2 : Feasible
+ // status=3 : Infeasible
+ // status=4 : Unbalanced
+ // status=5 : Bad Result
+ //
+ //
+ // Examples
+ // //Ref : Example 2 :
+ // //http://www.yourarticlelibrary.com/ergonomics/operation-research/checking-for-optimality-transportation-problem/34743/
+ //
+ // // Before balancing (Infeasible):
+ // // kNumSources = 4;
+ // // kNumTargets = 4;
+ // // kCost = [4, 6, 8, 13; 13, 11, 10, 8; 14, 4, 10, 13; 9, 11, 13, 8];
+ // // kCapacity = [200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200];
+ // // kSupply = [50, 70, 30, 50];
+ // // kDemand = [25, 35, 105, 20];
+ // // [cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
+ //
+ // // After balancing (Optimal):
+ // kNumSources = 4;
+ // kNumTargets = 5;
+ // kCost = [4, 6, 8, 13, 0; 13, 11, 10, 8, 0; 14, 4, 10, 13, 0; 9, 11, 13, 8, 0];
+ // kCapacity = [200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200];
+ // kSupply = [50, 70, 30, 50];
+ // kDemand = [25, 35, 105, 20, 15];
+ // [cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
+ // cost
+ // flow
+ // status
+ //
+ // Authors
+ // Souvik Das
+
+ [lhs, rhs] = argn();
+ Checklhs("min_cost_flow", lhs, [2, 3]);
+ Checkrhs("min_cost_flow", rhs, 6);
+
+ kNumSources = varargin(1);
+ kNumTargets = varargin(2);
+ kCost = varargin(3);
+ kCapacity = varargin(4);
+ kSupply = varargin(5);
+ kDemand = varargin(6);
+
+ Checktype("min_cost_flow", kNumSources, "kNumSources", 1, "constant");
+ Checktype("min_cost_flow", kNumTargets, "kNumTargets", 2, "constant");
+
+ Checkdims("min_cost_flow", kNumSources, "kNumSources", 1, [1 1]);
+ Checkdims("min_cost_flow", kNumTargets, "kNumTargets", 2, [1 1]);
+
+ if(kNumSources <= 0) then
+ errmsg = msprintf(gettext("%s: Number of Sources should be > 0. Check input #1\n"), "min_cost_flow");
+ error(errmsg);
+ end
+
+ if(kNumTargets <= 0) then
+ errmsg = msprintf(gettext("%s: Number of Targets should be > 0. Check input #2\n"), "min_cost_flow");
+ error(errmsg);
+ end
+
+ Checktype("min_cost_flow", kCost, "kCost", 3, "constant");
+ Checkdims("min_cost_flow", kCost, "kCost", 3, [kNumSources kNumTargets]);
+
+ Checktype("min_cost_flow", kCapacity, "kCapacity", 4, "constant");
+ Checkdims("min_cost_flow", kCapacity, "kCapacity", 4, [kNumSources kNumTargets]);
+
+ if(or(kCapacity < 0) == %t) then
+ errmsg = msprintf(gettext("%s: Capacity should be >= 0. Check input #4\n"), "min_cost_flow");
+ error(errmsg);
+ end
+
+ Checktype("min_cost_flow", kSupply, "kSupply", 5, "constant");
+ Checkdims("min_cost_flow", kSupply, "kSupply", 5, [1 kNumSources]);
+
+ if(or(kSupply < 0) == %t) then
+ errmsg = msprintf(gettext("%s: Supply should be >= 0. Check input #5\n"), "min_cost_flow");
+ error(errmsg);
+ end
+
+ Checktype("min_cost_flow", kDemand, "kDemand", 6, "constant");
+ Checkdims("min_cost_flow", kDemand, "kDemand", 6, [1 kNumTargets]);
+
+ if(or(kDemand < 0) == %t) then
+ errmsg = msprintf(gettext("%s: Demand should be >= 0. Check input #6\n"), "min_cost_flow");
+ error(errmsg);
+ end
+
+ if(sum(kSupply) <> sum(kDemand)) then
+ errmsg = msprintf(gettext("%s: Unbalanced Supply and Demand\n"), "min_cost_flow");
+ error(errmsg);
+ end
+
+ [cost, flow, status] = solve_mincostflow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
+
+ select status
+ case 0 then
+ printf("\nProblem Not Solved.\n");
+ case 1 then
+ printf("\nOptimal Solution Found.\n");
+ case 2 then
+ printf("\nFeasible Solution Found.\n");
+ case 3 then
+ printf("\nProblem is Infeasible.\n");
+ case 4 then
+ printf("\nProblem is Unbalanced.\n");
+ case 5 then
+ printf("\nBad Result. Retry later or Notify the Toolbox author(s)\n");
+ else
+ printf("\nSomething went wrong. Retry later or Notify the Toolbox author(s)\n");
+ break;
+ end
+endfunction
diff --git a/macros/names b/macros/names
new file mode 100644
index 0000000..cc37b3e
--- /dev/null
+++ b/macros/names
@@ -0,0 +1,14 @@
+Checkdims
+Checklhs
+Checkrhs
+Checktype
+Checkvector
+Filterdims
+fmaxflow
+fshortestpath
+jssp
+linsum
+min_cost_flow
+qcqpglob
+tsp
+vrp
diff --git a/macros/qcqpglob.sci b/macros/qcqpglob.sci
new file mode 100644
index 0000000..b335dec
--- /dev/null
+++ b/macros/qcqpglob.sci
@@ -0,0 +1,218 @@
+function [kSoln, kSolnVector, status] = qcqpglob(varargin)
+ // Solves problem with Convex/Non-Convex Quadratically Constrained Quadratic Programming Problems with Global Optimization (GLOB)
+ //
+ // Calling Sequence
+ // [kSoln, kSolnVector] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var);
+ // [kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var);
+ // [kSoln, kSolnVector] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
+ // [kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
+ //
+ // Parameters
+ // n : a double, represents number of Decision Variables
+ // m : a double, represents number of Constraints
+ // h_obj : a matrix of double, n x n, represents Coefficients of Quadratic in Objective Function
+ // f_obj : a vector of double, sized n, represents Coefficients of Linear in Objective Function
+ // c_obj : a double, represents Constant term in Objective Function
+ // h_con : an m sized list, contains matrices of double, n x n, represents Coefficients of Quadratic in Constraints
+ // f_con : an m sized list, contains vectors of double, sized n, represents Coefficients of Linear in Constraints
+ // lb_con : a vector of double, sized m, represents Lower Bound of Constraints
+ // ub_con : a vector of double, sized m, represents Upper Bound of Constraints
+ // lb_var : a vector of double, sized n, represents Lower Bound of Decision Variables
+ // ub_var : a vector of double, sized n, represents Upper Bound of Decision Variables
+ // maxcputime : a double, represents max. cpu time allotted to BnB Solver
+ // kSoln : a double, represents value of Objective Function at Optimal Point
+ // kSolnVector : a vector of double, sized n, represents values of Decision Variables at Optimal Point
+ // status : contains the exit flag of Solver. See below
+ //
+ // Description
+ // Solves QCQP / Quadratically Constrained Quadratic Programming problems, especially those where local optimum is not the global optimum, i.e. when the problem is Non-Convex. Can solve Convex Problem as well.
+ //
+ //
+ // \text{}\\
+ // \begin{align}
+ // & \text{minimize} && \tfrac12 x^\mathrm{T} H_0 x + f_0^\mathrm{T} x + c \\
+ // & \text{subject to} && {LB}_i \leq \tfrac12 x^\mathrm{T} H_i x + f_i^\mathrm{T} x \leq {UB}_i \quad \text{for } i = 1,\dots,m \\
+ // &&& Ax = b
+ // \end{align}\\
+ // \text{}\\
+ // \text{}\\
+ // \text{}\\
+ //
+ //
+ // The status allows to know the status of the optimization which is given back by MINOTAUR.
+ //
+ //
+ // status=0 : Not started solving
+ // status=1 : Started solving
+ // status=2 : Restarted solving
+ // status=3 : Optimal solution found
+ // status=4 : Detected infeasibility
+ // status=5 : Detected unboundedness of relaxation
+ // status=6 : Reached limit on gap
+ // status=7 : Reached limit on number of solutions
+ // status=8 : Reached iteration limit
+ // status=9 : Interrupted
+ // status=10 : Reached time limit
+ // status=11 : Reached the limit on number of solutions
+ // status=12 : Finished for some other reason
+ //
+ //
+ // The routine uses Minotaur Library for solving the quadratic problem, Minotaur is a library written in C++.
+ //
+ // Examples
+ // // Sample Only
+ // // Min. Z = 100 - x^2 + 2 * y^2 - 3 * x * y + 4 * x - 5 * y
+ // // Subject to:
+ // // 60 >= x^2 + y^2 - x - y >= -100
+ // // -10 <= x <= 6
+ // // -10 <= y <= 6
+ //
+ // n = 2;
+ // m = 1;
+ // h_obj = [-2, -1; -2, 4];
+ // f_obj = [4, -5];
+ // c_obj = 100;
+ // h_con = list();
+ // h_con(1) = [2, 0; 0, 2];
+ // f_con = list();
+ // f_con(1) = [-1, -1];
+ // lb_con = [-100];
+ // ub_con = [60];
+ // maxcputime = 600;
+ // lb_var = [-10, -10];
+ // ub_var = [6, 6];
+ // [kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
+ // kSoln
+ // kSolnVector
+ // status
+ //
+ // Authors
+ // Souvik Das
+
+ // Validate Input & Output Arguments
+ [lhs, rhs] = argn();
+ Checklhs("qcqpglob", lhs, [2 3]);
+ Checkrhs("qcqpglob", rhs, [11 12]);
+
+ // Get Input
+ n = varargin(1);
+ m = varargin(2);
+ h_obj = varargin(3);
+ f_obj = varargin(4);
+ c_obj = varargin(5);
+ h_con = varargin(6);
+ f_con = varargin(7);
+ lb_con = varargin(8);
+ ub_con = varargin(9);
+ lb_var = varargin(10);
+ ub_var = varargin(11);
+ if(rhs > 11) then
+ maxcputime = varargin(12);
+ else
+ maxcputime = 600; // Default
+ end
+
+ // Validate Input
+ Checktype("qcqpglob", n, "n", 1, "constant");
+ Checkdims("qcqpglob", n, "n", 1, [1 1]);
+ if(n <= 0) then
+ errmsg = msprintf(gettext("%s: Number of Decision Variables should be > 0. Check input #1\n"), "qcqpglob");
+ error(errmsg);
+ end
+
+ Checktype("qcqpglob", m, "m", 2, "constant");
+ Checkdims("qcqpglob", m, "m", 2, [1 1]);
+ if(m < 0) then
+ errmsg = msprintf(gettext("%s: Number of Constraints should be >= 0. Check input #2\n"), "qcqpglob");
+ error(errmsg);
+ end
+
+ Checktype("qcqpglob", h_obj, "h_obj", 3, "constant");
+ Checkdims("qcqpglob", h_obj, "h_obj", 3, [n n]);
+
+ Checktype("qcqpglob", f_obj, "f_obj", 4, "constant");
+ f_obj = Filterdims("qcqpglob", f_obj, "f_obj", 4, [1 n]);
+
+ Checktype("qcqpglob", c_obj, "c_obj", 5, "constant");
+ Checkdims("qcqpglob", c_obj, "c_obj", 5, [1 1]);
+
+ Checktype("qcqpglob", h_con, "h_con", 6, "list");
+ Checkdims("qcqpglob", h_con, "h_con", 6, [m]);
+ for i = 1:m
+ Checktype("qcqpglob", h_con(i), "h_con(" + string(i) + ")", 6, "constant");
+ Checkdims("qcqpglob", h_con(i), "h_con(" + string(i) + ")", 6, [n n]);
+ end
+
+ Checktype("qcqpglob", f_con, "f_con", 7, "list");
+ Checkdims("qcqpglob", f_con, "f_con", 7, [m]);
+ for i = 1:m
+ Checktype("qcqpglob", f_con(i), "f_con(" + string(i) + ")", 7, "constant");
+ f_con(i) = Filterdims("qcqpglob", f_con(i), "f_con(" + string(i) + ")", 7, [1 n]);
+ end
+
+ Checktype("qcqpglob", lb_con, "lb_con", 8, "constant");
+ if(m <> 0) then
+ lb_con = Filterdims("qcqpglob", lb_con, "lb_con", 8, [1 m]);
+ else
+ lb_con = [];
+ end
+
+ Checktype("qcqpglob", ub_con, "ub_con", 9, "constant");
+ if(m <> 0) then
+ ub_con = Filterdims("qcqpglob", ub_con, "ub_con", 9, [1 m]);
+ else
+ ub_con = [];
+ end
+
+ Checktype("qcqpglob", lb_var, "lb_var", 10, "constant");
+ lb_var = Filterdims("qcqpglob", lb_var, "lb_var", 10, [1 n]);
+
+ Checktype("qcqpglob", ub_var, "ub_var", 11, "constant");
+ ub_var = Filterdims("qcqpglob", ub_var, "ub_var", 11, [1 n]);
+
+ if(maxcputime <= 0) then
+ errmsg = msprintf(gettext("%s: ''maxcputime'' should be > 0. Check input #12"), "qcqpglob");
+ error(errmsg);
+ end
+
+ // Default Output
+ kSoln = 0;
+ kSolnVector = [];
+ status = 0;
+
+ // Solve
+ [kSoln, kSolnVector, status] = solve_qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
+
+ // Print Status
+ select status
+ case 0 then
+ printf("\nNot started solving\n");
+ case 1 then
+ printf("\nStarted solving\n");
+ case 2 then
+ printf("\nRestarted solving\n");
+ case 3 then
+ printf("\nOptimal solution found\n");
+ case 4 then
+ printf("\nDetected infeasibility\n");
+ case 5 then
+ printf("\nDetected unboundedness of relaxation\n");
+ case 6 then
+ printf("\nReached limit on gap\n");
+ case 7 then
+ printf("\nReached limit on number of solutions\n");
+ case 8 then
+ printf("\nReached iteration limit\n");
+ case 9 then
+ printf("\nInterrupted\n");
+ case 10 then
+ printf("\nReached time limit\n");
+ case 11 then
+ printf("\nReached the limit on number of solutions\n");
+ case 12 then
+ printf("\nFinished for some other reason\n");
+ else
+ printf("\nUnknown solve status\n");
+ end
+
+endfunction
diff --git a/macros/tsp.sci b/macros/tsp.sci
new file mode 100644
index 0000000..102cd6a
--- /dev/null
+++ b/macros/tsp.sci
@@ -0,0 +1,373 @@
+function [mincost,path,status] = tsp(varargin)
+ //Solves the classic 'Travelling Salesman Problem' heuristically using the routing library from the Google-OR-tools framework. The algorithm first employs a cheapest path approach for an initial solution and then 'local search' heuristics to improve the initial solution toward an optimal one.
+ //
+ //Calling Sequence
+ //[mincost,path]=tsp(adj_matrix,start_node)
+ //[mincost,path]=tsp(adj_matrix,start_node,labels)
+ //[mincost,path,status]=tsp(adj_matrix,start_node)
+ //[mincost,path,status]=tsp(adj_matrix,start_node, labels)
+ //
+ //Parameters
+ //adj_matrix : It is an [nxn] Adjacency Matrix of integral values, representing the graph (having 'n' nodes, for instance, numbered from '1' to 'n') for which the Travelling Saleman Problem is to be solved. Value adj_matrix(i,j) represents the cost of travelling from node 'i' to node 'j' of the given graph. Asymmetric graphs are also supported, where adj(i,j) <> adj(j,i). A negative value for cost (adj_matrix(i,j)) is simply interpreted as the absence of an edge from node 'i' to node 'j'.
+ //start_node : It is the index of the starting node. The optimal path must start and end at this node.
+ //labels : Optional functionality to provide string labels to the nodes of the graph. It is a [1xn] vector of strings. (labels(i) is the label given to the node 'i' of the graph
+ //time_limit : It is the maximum time (in milliseconds; integral value) for which the optimizer is allowed to run. If by the end of this time, the engine is unable to find even an initial solution, a timeout error status is returned. If, however, an initial solution is found, but not fully optimized yet (in the process of heuristically improving it), it will return the current solution, albeit not optimal, as the final solution. This value cannot be zero. Default : 1 second.
+ //mincost : It is an integral value denoting the minimum cost incurred by the "salesman" in traversing the optimal path according to the solution, should one exist.)
+ //path : It is a [1x(n+1)] vector containing indices of nodes in the order of the path to be followed in the optimal solution, should one exist. The first and the last values in this vector are equal to the 'start_node' index provided.
+ //status : It is the enumerated "flag" value returned by the Google OR tools Routing Library, indicating the status of the solution.(Details in the description)
+ //
+ //Description
+ //
+ //\text{The \textbf{`Travelling Salesman Problem' } is a classic optimization problem which, given a graph (wherein each edge has some cost/distance associated with it), and an arbitrary `starting node' , vies to find such a path over the said graph so as to visit every vertex exactly once and ending back at the `start\_node' \textbf{(Hamiltonian path) }, while minimizing the total cost/distance of the journey.\\This is aptly explained by the namesake analogy of a `salesman' who needs to decide upon a path through various cities (nodes) while minimizing his travel distance, hence the travel expenditures.\\Travelling salesman problem is essentially a special case of the \textbf{Vehicle Routing Problem}.\\This routine utlizes the 'Routing Model' from the Google OR Tools framework to solve the problem. A \textbf{`cheapest addition' } heuristic is applied to find the initial solution and then \textbf{`local search' } is used to improve it toward an optimal solution.\\\textbf{Asymmetric Travelling Saleman Problem } is also supported, where the cost of travelling from city `i' to city `j' is not the same as cost of travelling from city `j' to city `i' (In this case, the input adjacency matrix is simply not a symmetric matrix)}\\
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //\text{\textbf{\underline{MATHEMATICAL\textbf{ }STATEMENT} :}}\\
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //
+ //
+ //
+ //\begin{math}
+ //\text{Let }x_{ij} = \begin{cases}
+ //1 \quad \text{; if there exists a path from node i to j}\\
+ //0 \quad \text{; otherwise}\\
+ //\end{cases}\\\\
+ //\text{Let their be `n' nodes in the problem}\\
+ //\text{Let } c_{ij} \text{ be the distance from node i to node j}\\\\
+ //\text{Let }u_{i} \text{ be a dummy variable for } i=1,2,...,n \text{ ;}\\\\
+ //\textbf{\underline{Objective }:}\qquad Minimize \sum_{i=1}^{n} \sum_{j \neq i, j=1}^{n} c_{ij} x_{ij} \\\\
+ //\text{ Subject to :}
+ //\text{ }\qquad 0 \leq x_{ij} \leq 1 \text{ ;} \qquad i,j = 1,2,...,n \text{ ;}\qquad \hspace{3em} \qquad (1)\\\\
+ //\text{ }\qquad \hspace{3em} \text{ } \qquad u_{i} \in Z \text{ ; }\qquad \qquad i = 1,2,...,n \text{ ; }\qquad \hspace{3em} \qquad \text{ }(2)\\\\
+ //\text{ }\qquad \hspace{3em} \text{ } \qquad \sum_{i=1,i\neq j}^{n} x_{ij}=1 \text{ ; } j=1,2,...,n \text{ ; } \qquad \hspace{3em} \qquad (3)\\\\
+ //\text{ }\qquad \hspace{3em} \text{ } \qquad \sum_{j=1,j\neq i}^{n} x_{ij}=1 \text{ ; } i=1,2,...,n \text{ ; } \qquad \hspace{3em} \qquad (4)\\\\
+ //\text{ }\qquad \hspace{3em} \text{ } \qquad u_{i} - u_{j} + n x_{ij} \leq n-1 \text{ ; }\qquad 2\leq i\neq j \leq n \text{ ; } \qquad (5)\\\\
+ //\text{ (3),(4) enforce that each node can only be arrived from exactly one other node.}\\\\
+ //\text{ (5) enforces that there's only a single tour connecting all the node ( Hamiltonian cycle) }
+ //\end{math}
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //
+ //
+ //Legend :
+ //
+ //status - Integral value returned by the Google OR Tools Routing library, indicating the status of the solution for the current TSP
+ //
+ //status=0 - ROUTING_NOT_SOLVED (Before the solver is invoked)
+ //status=1 - ROUTING_SUCCESS (TSP solved successfully(optimal solution found)
+ //status=2 - ROUTING_FAIL(No solution found)
+ //status=3 - ROUTING_FAIL_TIMEOUT (solution was taking too much time; Timed out)
+ //
+ //
+ // For more details, refer to : https://en.wikipedia.org/wiki/Travelling_salesman_problem
+ //
+ // or to : https://developers.google.com/optimization/routing/tsp/tsp
+ //
+ // The problem is also related to the HAMILTONIAN PATH problem : https://en.wikipedia.org/wiki/Hamiltonian_path
+ //
+ //
+ //Examples
+ //
+ //adj=[0 10 50 45;
+ //10 0 25 25;
+ //50 25 0 40;
+ //45 25 40 0];
+ //
+ //start_node=1;
+ //
+ //[mincost,path,status]=tsp(adj,start_node);
+ ////Press ENTER to continue
+ //
+ ////OUTPUT :
+ ////'ROUTING_SUCCESS' ; An optimal solution was found
+ ////Minimum cost -> 120
+ ////Optimal Path :-
+ ////1 ->2 ->3 ->4 ->1
+ //
+ //Examples
+ //
+ //adj=[0 10 15 20;
+ //10 0 35 25;
+ //15 35 0 30;
+ //20 25 30 0];
+ //
+ //start_node=1;
+ //
+ //labels=['A' 'B' 'C' 'D'];
+ //[mincost,path,status]=tsp(adj,start_node,labels);
+ ////Press ENTER to continue
+ ////
+ ////OUTPUT :
+ ////'ROUTING_SUCCESS' ; An optimal solution was found
+ ////Minimum cost -> 80
+ ////Optimal Path :-
+ //// A (1) -> B (2) -> D (4) -> C (3) ->A (1)
+ //
+ //Examples
+ //
+ //adj=[0 1 2 1 1;
+ //1 0 1 2 1;
+ //2 1 0 1 2;
+ //1 2 1 0 2;
+ //1 1 2 2 0];
+ //
+ //start_node=1;
+ //
+ //labels=['alpha' 'beta' 'gamma' 'theta' 'sigma'];
+ //
+ //[mincost,path,status]=tsp(adj,start_node,labels);
+ ////Press ENTER to continue
+ //
+ ////OUTPUT :
+ ////'ROUTING_SUCCESS' ; An optimal solution was found
+ ////Minimum cost -> 5
+ ////Optimal Path :-
+ //// alpha (1) -> sigma (5) -> beta (2) -> gamma (3) -> theta (4) ->alpha (1)
+ //
+ //Examples
+ //
+ //adj=[0 10 -1 -2;
+ //10 0 35 25;
+ //-1 35 0 30;
+ //-1 25 30 0];
+ //
+ //start_node=1;
+ //
+ //[mincost,path,status]=tsp(adj,start_node);
+ ////Press ENTER to continue
+ ////
+ ////OUTPUT :
+ ////'ROUTING_FAIL' ; No optimal solution was found. No path starting and ending at the specified 'start node'(1) found.
+ //
+ //Authors
+ //Samuel Wilson
+
+
+
+
+
+
+ //obtaining the number of inputs and outputs
+
+ [lhs,rhs]=argn();
+
+
+
+ //checking the number of input arguments
+
+ if (rhs<2 | rhs>4) then
+ errmsg=msprintf(gettext("%s : Number of input arguments is expected to be 2 - 4. Found %d. Refer to help/FOT documentation for more details.\n"),"tsp",rhs);
+ error(errmsg);
+ end
+
+ //checking the number of output arguments
+
+ if (lhs<2 | lhs>3) then
+ errmsg=msprintf(gettext("%s : Number of output arguments is expected to be to 2 or 3. Found %d. Refer to the help/FOT documentation for more details.\n"),"tsp",lhs);
+ error(errmsg);
+ end
+
+
+ //storing the input arguments
+
+ adj_matrix=varargin(1);
+ start_node=varargin(2);
+
+ time_limit = 1000;
+ labels = ""; //NOTE- the size of labels ( ie. "") is actually '1', not '0'
+
+ if (rhs > 2) then
+ if ( varargin(3)<>[] ) then
+ labels = varargin(3);
+ end
+ end
+
+ if ( rhs > 3 ) then
+ if (varargin(4) <> []) then
+ time_limit = varargin(4);
+ end
+ end
+
+
+
+ //checking the types of the input arguments
+
+ Checktype("tsp",adj_matrix,"adj_matrix",1,"constant");
+ Checktype("tsp",start_node,"start_node",2,"constant");
+
+
+ if (rhs > 2) then
+ Checktype("tsp",labels,"labels",3,"string");
+ end
+
+ if ( rhs > 3) then
+ Checktype("tsp",time_limit,"time_limit",4,"constant");
+ end
+
+
+
+ //getting the number of rows and columns in the given adjacency matrix
+ m=size(adj_matrix,"r");
+ n=size(adj_matrix,"c");
+
+
+ //checking the dimensions of the adjacency matrix
+ if (m <> n) then
+ errmsg=msprintf(gettext("%s : The dimensions of the given adjacency matrix are erroneous [%d x %d]. Number of rows and columns has to be equal(square matrix) ( = no. of nodes in the graph).\n"),"tsp",m,n);
+ error(errmsg);
+ end
+
+
+ //checking if all the diagonal elements of the given adjacency matrix are zero
+
+ if (~(and(diag(adj_matrix)==0))) then
+ errmsg=msprintf(gettext("%s : All leading diagonal elements of the adjacency matrix need to be 0\n"),"tsp");
+ error(errmsg);
+ end
+
+
+ //checking if the 'start_node' value is a singular value(1 x 1 matrix)
+ if ((size(start_node,"r")>1) | (size(start_node,"c")>1)) then
+ errmsg=msprintf(gettext("%s : Invalid start_node index value. Singlular value indicating the index of the node from where the journey is to begin expected\n"),"tsp");
+ error(errmsg);
+ end
+
+
+
+ //Checking if all the values in the adjacency matrix and the start node index are integral(no fractional part(or =0))
+ //NOTE- x.0 is considered INTEGRAL!
+
+ if (~(and(adj_matrix==(int(adj_matrix))))) then
+ errmsg=msprintf(gettext("% s : All values in the adjacency matrix ( input argument #%d) are expected to be integral\n"),"tsp",1);
+ error(errmsg);
+ end
+
+ if(~(and(start_node==(int(start_node))))) then
+ errmsg=msprintf(gettext("%s : The start_node index ( input argument #%d) is expected to be integral\n"),"tsp",2);
+ error(errmsg);
+ end
+
+
+
+
+ //checking if the value of the given 'start_node' is valid(exists in the graph)
+ if (start_node<=0 | start_node>m) then
+ errmsg=msprintf(gettext("%s : Invalid ''start node'' index (%d). It is expected to be between ''1'' and ''%d''(no. of nodes in the given graph).\n"),"tsp",start_node,m);
+ error(errmsg);
+ end
+
+
+
+
+ //checking the dimensions of the 'labels' matrix, if 'tis specified
+
+ if (labels <> "") then
+ if ((size(labels,"r")>1) | (size(labels, "c")<> m)) then
+ if ((size(labels,"r")>1) & (~(size(labels,"c")<>m))) then
+ errmsg=msprintf(gettext("%s : The ''labels'' matrix (input argument #%d) must have only one row, ie., it must be vector\n"),"tsp",3);
+ elseif ((~(size(labels,"r")>1)) & (size(labels, "c")<> m)) then
+ errmsg=msprintf(gettext("%s : The number of elements ''labels'' vector (input argument #%d) must be equal to the number of nodes in the graph.(found %d)\n"),"tsp",3,size(labels,"c"));
+ else
+ errmsg=msprintf(gettext("%s : Invalid dimensions for ''labels'' vector(input argument #%d). [1 x %d] vector expected. (Found [%d x %d]. \n"),"tsp",3,m,size(labels,"r"),size(labels,"c"));
+
+ end
+ error(errmsg);
+ end
+ end
+
+ //checking if all the 'label' values are unique
+ if (labels <>"") then
+ if (length(labels) <> length(unique(labels))) then
+ errmsg=msprintf(gettext("%s : The entries in the ''label'' matrix should be unique ( no 2 nodes can have the same label)\n"),"tsp");
+ error(errmsg);
+ end
+ end
+
+ //Checking the dimensions of 'time_limit', if given
+ if ( rhs > 3 ) then
+ m = size(time_limit,"r");
+ n = size(time_limit, "c");
+
+ if ( ~(m==1 & n==1) ) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for input argument #4(''time_limit''). A single, positive, integral value expected.\n"),"tsp");
+ error(errmsg);
+ end
+
+ clear m;
+ clear n;
+ end
+
+
+ //Checking if the 'time-limit' value, if given, is valid(>0) and integral
+
+ if ( rhs > 3) then
+ if( ~(and(time_limit ==(int(time_limit))))) then
+ errmsg = msprintf(gettext("%s : The time limit value (argument #4) is expected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+ if ( ~(time_limit > 0) ) then
+ errmsg = msprintf(gettext("%s : The given time-limit is invalid. Positive Value expected.\n"),"tsp");
+ error(errmsg);
+ end
+ end
+
+
+ //Solving the TSP by invoking the gateway function
+
+ [mincost,path,status]=TSP(adj_matrix,(start_node-1), time_limit); // 'path' contains the C++ indices(i.e. starting from 0)
+
+
+ select status
+ case 0 then
+ printf("\n''ROUTING_NOT_SOLVED'' ; The solver-module invocation failed. If the problem persists, notify the toolbox authors.\n");
+ case 1 then
+ printf("\n ''ROUTING_SUCCESS'' ; An optimal solution was found\n");
+ printf("Minimum cost -> %d\n\n",mincost);
+ printf("Optimal Path :- \n");
+ temp=size(path,"c");
+
+ if ( length(labels)<>0 ) then //labels were provided
+ for i = 1 : (temp-1)
+ printf(" %s (%d) ->",labels(path(i)+1),(path(i)+1));
+ end
+ printf("%s (%d)",labels(path(temp)+1),(path(temp)+1));
+ else
+ for i = 1 : (temp-1)
+ printf("%d ->",(path(i)+1));
+ end
+ printf("%d ",(path(temp)+1));
+ end
+
+ clear 'temp';
+
+ case 2 then
+ printf("\n ''ROUTING_FAIL'' ; No optimal solution was found. No path starting and ending at the specified ''start node''(%d) found.\n", start_node);
+
+ case 3 then
+ if ( path <> []) then
+ printf("\n''ROUTING_FAIL_TIMEOUT''\n ; The time limit was reached before the model converged to the optimal solution. The returned solution CAN be further optimized; Try increasing the time-limit for a better solution.\n");
+ else
+ printf("\n''ROUTING_FAIL_TIMEOUT''\n ; No solution was found within the stipulated the time-limit. Try increasing the time-limit.\n");
+ end
+
+ else
+ printf("\nUnexpected return status. Notify the toolbox authors.\n");
+ break;
+
+ end
+
+ endfunction
+
+
+
+
+
+
+
+
+
diff --git a/macros/vrp.sci b/macros/vrp.sci
new file mode 100644
index 0000000..b5956b3
--- /dev/null
+++ b/macros/vrp.sci
@@ -0,0 +1,1183 @@
+function [total_distance,routes,distances,total_time,times,status] = vrp(varargin)
+ //Solves the classic 'Vehicle Routing Problem' (VRP for short) heuristically to find the optimal set of routes for a fleet of vehicles delivering goods or services to various locations. The routine makes use of the routing library from the Google-OR-Tools framework. The algorithm first employs a cheapest path approach for an initial naive solution and then 'local search' heuristics to improve it toward an optimal solution.
+ //
+ //Calling Sequence
+ //[total_distance,routes] = vrp(adj_matrix,vehicles,start)
+ //[total_distance,routes] = vrp(adj_matrix,vehicles,start,labels)
+ //[total_distance,routes] = vrp(adj_matrix,vehicles,start,labels,demands,max_vehicle_capacity)
+ //[total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand)
+ //[total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand,time_windows)
+ //[total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand,time_windows,speeds)
+ //[total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand,time_windows,speeds,waiting_times)
+ //[total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand,time_windows,speeds,waiting_times,refuel_flag,fuel_capacity,refuel_nodes)
+ //[total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand,time_windows,speeds,waiting_times,refuel_flag,fuel_capacity,refuel_nodes,penalty)
+ //[total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand,time_windows,speeds,waiting_times,refuel_flag,fuel_capacity,refuel_nodes,penalty,groups,group_penalty)
+ //[total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand,time_windows,speeds,waiting_times,refuel_flag,fuel_capacity,refuel_nodes,penalty,groups,group_penalty,time_limit)
+ //[total_distance,routes,distances] = vrp(...)
+ //[total_distance,routes,distances,total_time] = vrp(...)
+ //[total_distance,routes,distances,total_time,times] = vrp(...)
+ //[total_distance,routes,distances,total_time,times,status] = vrp(...)
+ //
+ //Parameters
+ // **NOTE : for the sake of simplicity, henceforth 'v' would denote the number of vehicles in the problem and 'n', the number of nodes in the graph
+ //adj_matrix : It is an [nxn] matrix of integral values, representing the graph (nodes indexed from '1' to 'n') for which the given VRP is to be solved. adj_matrix[i][j] gives the distance from node 'i' to 'j'.(can be different from adj_matrix[j][i]; asymmetric VRP). A negative value indicates the absence of a path from 'i' to 'j'.
+ //vehicles : It is an integral value representing the number of vehicles in the fleet, such that we need to find a optimum route for each vehicle, to minimize the total distance and total time.
+ //start : It is a matrix of integral values, pertaining to the index of the starting node(s) or depot(s). The dimensions of this matrix is germane to the type of VRP given, hence determines the pertinent solution strategy. The variations are :-[1x1] - A single integral value - indicating a single depot. All vehicles start and end their journey at this node.[ ] - Empty Matrix - indicating that the vehicle routes can start and end at any node, defining a taxi-service-like scenario.[vx2] - An integral matrix specifying particular start and end nodes for each vehicle ( multiple depot case). start[x][0] -> Start node index for vehicle 'x' ; start[x][1] -> End node for vehicle 'x'.
+ //labels : Optional functionality to provide string labels to the nodes of the graph. It is a [1xn] vector of strings.
+ //labels(i) is the label given to the node 'i' of the graph. Give an empty matrix if labels are not to be provided.
+ //demands : It is a [1xn] vector of integral values indicating the demands for the various nodes to be fulfiled by the vehicles. demands[x] denotes the demand of node 'x'. (Demands obviously cannot be negative).
+ //If empty, it denotes a non-capacitated VRP, with no demand constraints.
+ //max_vehicle_capacity : It is an integral value specifying the maximum capacity of each vehicle (same for all). If capacitated VRP (demands specified), this has to be provided and must be POSITIVE. Can be '0' or empty matrix for non-capacitated VRP.
+ //service_time_per_demand : It a single integral value indicating the time required to service one unit of demand in capacitated VRP.
+ //time_windows : It is an [nx2] matrix of integral values specifying particular windows of time only within which the different nodes can be serviced. time_windows[x][0]->start of service window for node x ; time_windows[x][1]->end of service window for node 'x'. Can be empty if no time-window constraints. If provided, for a node with no such restriction, provide '0' and '-1'. Time starts from '0' for the model.
+ //speeds : It is a matrix of integral values specifying the speed of the vehicles. The variations are :- empty matrix - Indicates that transit times are to be ignored while minimizing total-time for the optimal route. [1x1] - single value - Same avg. speed for all vehicles between any two nodes. [nxn] - A matrix specifying different avg.speeds between different nodes. speed[x][y]-> Gives the average speed while going from node 'x' to node 'y'. (Asymmetric speeds supported)
+ //waiting_times : a [1xn] vector of integral values containing the waiting times, if any, at the nodes. Could be empty if no waiting constraints.
+ //refuel_flag : a single integral value indicating if fuel constraints are to be considered or not.(Default : '0') '0'->No fuel constraints '1' ->Fuel constraints to be included in the model.
+ //fuel_capacity : a single integral value specifying the fuel capacity of the vehicles under consideration (same for all). Need to be provided if refueling constraints active. Needs to be positive.
+ //refuel_nodes : It is a [1xA] vector of integral values (A-> no. of refuel nodes), containing the indices of refueling nodes. Could be empty indicating the absence of refuel nodes.
+ //penalty : It is an [Ax2] matrix containing the cost penalties for skipping certain optional nodes (A->no. of optional nodes). penalty[x][0]-> The index of the optional node ; penalty[x][1]-> The cost penalty associated with that node.
+ //groups : It is an [AxB] matrix of integral values specifying groups of nodes that must lie on the same vehicle route. A-> No. of groups. B-> Size of the largest group. Each row contains the indices of a separate group. Smaller groups are padded with '0's on the right.
+ //group_penalty : It is a single integral value specifying the cost penalty incurred if a node from a group is unable to be serviced by the same vehicle in the optimal solution. This value is mandatory if group constraints are included in the model. (The model tends to minimize total distance and total time, while amassing minimal cost penalties ( legible tradeoffs to minimize distance ). USE -1, if the groups are to be strictly imposed (cannot exclude a node from a group while vying to minimize distance). This value CAN be zero, indicating that grouping constraints are purely optional. Default value : -1.
+ //time_limit : It is the maximum time (in milliseconds; integral value) for which the optimizer is allowed to run. If by the end of this time, the engine is unable to find even an initial solution, a timeout error status is returned. If, however, an initial solution is found, but not fully optimized yet (in the process of heuristically improving it), it will return the current solution, albeit not optimal, as the final solution. This value cannot be zero. Default : 10 seconds.
+ //
+ //total_distance : It is the summation of the total distance for all the routes in the optimal solution, if any.
+ //routes : It is a [vxn] matrix containing the routes for the vehicles in the optimal solution, if any. (padded with 0's on the right)
+ //distances : It is a [1xv] vector containing the distances covered by the various routes in the optimal solution.
+ //total_time : It is the summation of the times taken by the various vehicles to complete their journeys.
+ //times : It is a [1xv] vector containing the individual times taken by the vehicles to complete their routes.
+ //status : It is the enumerated "flag" value returned by the Google OR tools Routing Library, indicating the status of the solution.(Details in the description)
+ //
+ //Description
+ //
+ //\text{The \textbf{`Vehicle Routing Problem' } is a combinatorial optimization and linear integer programming problem in graph theory.\\A superset of the well-known \textbf{Travelling Salesman Problem}, it vies to find an optimal set of non-overlapping routes for a fleet of vehicles (the anecdotal ``salesmen"), passing through a given set of cities(nodes in the graph) starting from one or more starting nodes called the \textbf{`depot(s)'}.\\In the pursuit of optimality, it tends to minimize the \textbf{total distance } across all the routes and/or other parameters specified by the user, like \textbf{`time'}, \textbf{`cost'}, etc.}\\
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //\text{\textbf{\underline{MATHEMATICAL\textbf{ }STATEMENT} :}}\\
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //
+ //
+ //\begin{math}
+ //\text{Let } N= \left(V,E\right) \text{denote the specified graph}\\
+ //\text{Let } c_{ij} \text{ denote the distance from } i \to j.\\\\
+ //\textbf{\underline{Objective} : }\quad Minimize \quad \sum_{i \in V} \sum_{j \in V} c_{ij} x_{ij} \\\\\\
+ //\text{Subject to :} \qquad
+ //\sum_{i\in V} x_{ij} = 1 \quad \forall \quad j \in V\backslash\{0\}\qquad (1) \\\\
+ //\text{}\\
+ //\text{}\qquad \hspace{3em} \qquad \sum_{j\in V} x_{ij} = 1 \quad \forall \quad i \in V\backslash\{0\}\qquad \text{ } (2) \\\\
+ //\text{}\\
+ //\text{}\qquad \hspace{3em} \qquad \sum_{i\in V} x_{i0} = K\quad \text{;} \qquad \hspace{3em} \qquad\text{ } (3)\\\\
+ //\text{}\\
+ //\text{}\qquad \hspace{3em} \qquad \sum_{j\in V} x_{0j} = K\quad \text{;} \qquad \hspace{3em} \qquad\text{ } (4)\\\\
+ //\text{}\\
+ //\text{}\qquad \hspace{3em} \qquad x_{ij} \in \{0,1\} \quad \forall \quad i,j \in V \text{ ; } \hspace{3em} \text{ } (5)\\\\
+ //\text{}\\
+ //\end{math}
+ //\text{}\\
+ //\text{}\\
+ //
+ //
+ //
+ //\text{}\\
+ //\text{}\\
+ //\text{(1), (2) specify that exactly one arc enters and one arc leaves each node in the solution.}\\
+ //\text{}\\
+ //\text{(3), (4) specify that the total number of leaving the depot is equal to the total number entering it(single depot mode).}
+ //\text{}\\
+ //\text{}\\
+ //\text{}\\
+ //
+ //
+ //Legend :
+ //
+ //status - Integral value returned by the Google OR Tools Routing library, indicating the status of the solution for the current VRP
+ //
+ //status=0 - ROUTING_NOT_SOLVED (Before the solver is invoked)
+ //status=1 - ROUTING_SUCCESS (TSP solved successfully(optimal solution found)
+ //status=2 - ROUTING_FAIL(No solution found)
+ //status=3 - ROUTING_FAIL_TIMEOUT (solution was taking too long; Timed out)
+ //
+ //
+ // For more details, refer to : https://en.wikipedia.org/wiki/Vehicle_routing_problem
+ //
+ // or to : https://developers.google.com/optimization/routing/tsp/vehicle_routing#cvrp
+ //
+ // The problem is also related to the HAMILTONIAN PATH problem : https://en.wikipedia.org/wiki/Hamiltonian_path
+ //
+ //
+ //Examples
+ // //INPUT:
+ //adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ // 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ // 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ // 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ // 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ // 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ // 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ // 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ // 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ // 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ // 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ // 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ // 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+ //
+ //labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+ //
+ //start = 1;
+ //
+ //vehicles = 3;
+ //
+ //demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+ //
+ //service_time_per_demand=3;
+ //
+ //max_vehicle_capacity = 60;
+ //
+ //[total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand);
+ //
+ //Examples
+ //adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ // 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ // 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ // 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ // 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ // 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ // 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ // 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ // 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ // 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ // 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ // 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ // 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+ //
+ //labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+ //
+ //start = [] ;
+ //
+ //vehicles = 3;
+ //
+ //demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+ //
+ //service_time_per_demand=3;
+ //
+ //max_vehicle_capacity = 60;
+ //
+ //[total_distance,routes] = vrp(adj_matrix, vehicles,start,labels,demands,max_vehicle_capacity,service_time_per_demand);
+ //
+ //
+ //Authors
+ //Samuel Wilson
+
+
+
+
+
+
+ //obtaining the number of inputs and outputs
+
+ [lhs,rhs]=argn();
+
+
+ //checking the number of output arguments
+
+ if (lhs < 2 | lhs > 6) then
+ errmsg = msprintf(gettext("%s : Number of output parameters is expected to be ''2'' to ''6''. Found %d. Refer to help/FOT Documentation for more details\n"),"vrp",lhs);
+ error(errmsg);
+ end
+
+
+
+
+ //checking the number of input arguments
+
+ if (rhs < 3 | rhs > 17) then
+ errmsg = msprintf(gettext("%s : Number of input parameters is expected to be 3-16 (3,4,6,7,8,9,10,13,14, 16 or 17 only). Found %d. Refer to help/FOT Documentation for more details\n"),"vrp",rhs);
+ errro(errmsg);
+ end
+
+
+ //storing and further checking the number of input arguments
+
+ adj_matrix = varargin(1);
+ vehicles = varargin(2);
+ start = varargin(3);
+
+
+
+ ///////initializing all the optional parameters(before checking if corresponding input is provided)///////
+ labels = ""; //NOTE- the size of labels ( ie. "") is actually '1', not '0'
+ demands = [];
+ max_vehicle_capacity = 0;
+ service_time_per_demand = 0; // default = 0, ie.service times to be ignored for time minimization
+ time_windows = [];
+ speeds = [];
+ waiting_times = [];
+ refuel_flag = 0;
+ fuel_capacity = [];
+ refuel_nodes = [];
+ penalty = [];
+ groups = [];
+ group_penalty=-1; // default = -1, ie. Grouping is strictly imposed.
+ time_limit = 10000; // default = empty, ie. No time limit imposed
+
+
+
+ //Note, for an empty string a="", in scilab, 'length(a) returns 'zero' but the size if [1x1]
+
+
+ if (rhs > 3) then
+ if ( varargin(4)<>[] ) then
+ labels = varargin(4);
+ end
+ end
+
+
+
+
+ if (rhs > 4) then
+ if (rhs == 5) then
+ errmsg = msprintf(gettext("%s : Unexpected number of input arguments (5). ''Max Vehicle Capacity'' (argument #6) mandatory when ''demands'' (argument #5) specified.\n"),"vrp");
+ error(errmsg);
+ else
+ demands = varargin(5);
+ max_vehicle_capacity = varargin(6);
+ end
+ end
+
+
+ if (rhs > 6) then
+ if (length(varargin(7))<>0) then
+ service_time_per_demand = varargin(7);
+ end
+ end
+
+
+ if (rhs > 7) then
+ time_windows = varargin(8);
+ end
+
+ if (rhs > 8) then
+ speeds = varargin(9);
+ end
+
+ if (rhs > 9) then
+ waiting_times = varargin(10);
+ end
+
+
+ if (rhs > 10) then
+ if (length(varargin(11)<>0)) then
+ refuel_flag = varargin(11);
+ end
+
+ if ( rhs < 13) then
+ if ( refuel_flag == 1) then
+ errmsg = msprintf(gettext("%s : Unexpected number of input arguments (%d). Number of input parameters can be 3,4,6,7,8,9,10,13,14, 16 or 17 only. ''fuel_capacity'' (argument #12) and ''fuel_nodes'' (argument #13) are required to be given if ''refuel_flag'' (argument #10) is given. Refer to help/FOT Documentation for more details.\n"),"vrp",rhs);
+ error(errmsg);
+ end
+ else
+ fuel_capacity = varargin(12);
+ refuel_nodes = varargin(13);
+
+ end
+ end
+
+ if (rhs > 13) then
+ penalty = varargin(14);
+ end
+
+
+ if (rhs > 14) then
+ groups = varargin(15);
+ if (rhs < 16) then
+ errmsg = msprintf(gettext("%s : Unexpected number of input arguments (%d). Number of input parameters can only be 3,4,6,7,8,9,10,13,14, 16 or 17. ''group_penalty'' (argument #16) must be provided with ''groups'' (argument #15). Refer to help/FOT Documentation for more details.\n"),"vrp",rhs);
+ error(errmsg);
+
+ else
+ if (length(varargin(16))<>0) then
+ group_penalty = varargin(16);
+ end
+ end
+ end
+
+ if (rhs > 16) then
+ if (varargin(17) <> []) then
+ time_limit = varargin(17);
+ else
+ time_limit = 1000;
+ end
+ end
+
+ //All inputs stored; optional inputs which weren't provided, initialized
+
+
+
+ ////////Checking the type of all input arguments//////
+
+ Checktype("vrp",adj_matrix,"adj_matrix",1,"constant");
+ Checktype("vrp",vehicles,"vehicles",2,"constant");
+ Checktype("vrp",start,"start",3,"constant");
+
+ //empty matrix is also of type - "constant" so we can directly check without conditions if the optional parameter was actually provided
+
+ Checktype("vrp",labels,"labels",4,"string");
+ Checktype("vrp",demands,"demands",5,"constant");
+ Checktype("vrp",max_vehicle_capacity,"max_vehicle_capacity",6,"constant");
+ Checktype("vrp",service_time_per_demand,"service_time_per_demand",7,"constant");
+ Checktype("vrp",time_windows,"time_windows",8,"constant");
+ Checktype("vrp",speeds,"speeds",9,"constant");
+ Checktype("vrp",waiting_times,"waiting_times",10,"constant");
+ Checktype("vrp",refuel_flag,"refuel_flag",11,"constant");
+ Checktype("vrp",fuel_capacity,"fuel_capacity",12,"constant");
+ Checktype("vrp",refuel_nodes,"refuel_nodes",13,"constant");
+ Checktype("vrp",penalty,"penalty",14,"constant");
+ Checktype("vrp",groups,"groups",15,"constant");
+ Checktype("vrp",group_penalty,"group_penalty",16,"constant");
+ Checktype("vrp",time_limit,"time_limit",17,"constant");
+
+
+
+
+ ///////Checking the dimensions of all the inputs///////
+
+ //checking 'adj_matrix'
+
+ m=size(adj_matrix,"r");
+ n=size(adj_matrix,"c");
+
+
+ if (m <> n) then
+ errmsg = msprintf(gettext("%s : The dimensions of the given adjacency matrix ''adj_matrix'' (argument #1) are erroneous [%d %d]. Number of rows and columns are to be equal (square matrix) (=no. of nodes of the graph). \n"),"vrp",m,n);
+ error(errmsg);
+ end
+
+ nodes = m; //number of nodes in the graph
+
+
+ //checking 'vehicles'
+
+ mode_flag= [];
+
+ m = size(vehicles,"r");
+ n = size(vehicles,"c");
+
+
+ if ( ~(m==1 & n==1)) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions [%dx%d] for input argument #2 ( ''vehicles''). Single integral value expected (ie. [1x1]).\n"),"vrp",m,n);
+ error(errmsg);
+ end
+
+
+ //checking 'start' and setting mode_flag accordingly
+
+ m = size(start,"r");
+ n = size(start,"c");
+
+ if ( (m == 1) & (n == 1) ) then
+ mode_flag = 0;
+ elseif ( (m == 0) & (n == 0) ) then
+ mode_flag = 1;
+ elseif ( (m == vehicles) & (n == 2) ) then
+ mode_flag = 2;
+ else
+ errmsg = msprintf(gettext("%s : Wrong dimensions for input argument #3 (''start''). Expected to be either [1x1], (empty matrix) or [vx2] ( v->number of vehicles). Refer to help/FOT Documentation for more details.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+
+ //checking 'demands'
+
+ m=size(demands,"r");
+ n=size(demands,"c");
+
+
+ if ( ~((m==0 & n==0) | (m==1 & n==nodes)) ) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for the input argument #5 (''demands''). Expected to be either an empty matrix or one with dimensions [1x%d]. \n"),"vrp",nodes);
+ error(errmsg);
+ end
+
+
+
+
+ //checking labels
+
+ m=size(labels,"r");
+ n=size(labels,"c");
+
+
+ if ( labels <> "") then
+ if ( ~(m==1 & n==nodes) ) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for the input argument #4 ( ''labels''). Expected to be an empty matrix or one with dimensions [1x%d]. \n"),"vrp",nodes);
+ error(errmsg);
+ end
+ end
+
+
+
+ //checking 'max_vehicle_capacity'
+
+ m = size(max_vehicle_capacity,"r");
+ n = size(max_vehicle_capacity,"c");
+
+ if ( ~((m==0 & n==0) | (m==1 & n==1)) ) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for the input argument #6 ( ''max_vehicle_capacity''). Expected to be either an empty matrix or a singular integral value[1x1].\n"),"vrp");
+ error(errmsg);
+ end
+
+
+
+
+ //checking 'service_time_per_demand'
+
+ m = size(service_time_per_demand,"r");
+ n = size(service_time_per_demand,"c");
+
+
+ if ( ~((m==1) & (n==1))) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for the input argument #7 (''service_time_per_demand''). Expected to be either an empty matrix or a singular integral value[1x1].\n"),"vrp");
+ error(errmsg);
+ end
+
+
+
+ //checking 'time_windows'
+
+ m = size(time_windows,"r");
+ n = size(time_windows,"c");
+
+ if ( ~((m==0 & n==0) | (m==nodes & n==2))) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for the input argument #8 (''time_windows''). Expected to be either an empty matrix or one with dimensions [%dx2].\n"),"vrp",nodes);
+ error(errmsg);
+ end
+
+
+
+
+ //checking 'speeds'
+
+ m = size(speeds,"r");
+ n = size(speeds,"c");
+
+ if ( ~((m==0 & n==0) | (m==1 & n==1) | (m==nodes & n==nodes))) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for the input argument #9 ( ''speeds''). Expected to be either [1x1], [%dx%d] or an empty matrix.\n"),"vrp",nodes,nodes);
+ error(errmsg);
+ end
+
+
+ //checking 'waiting_times'
+
+ m = size(waiting_times,"r");
+ n = size(waiting_times,"c");
+
+ if ( ~((m==0 & n==0) | (m==1 & n==nodes)) ) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for the input argument #10 (''waiting_times''). Expected to be either an empty matrix or one with dimensions [1x%d].\n"),"vrp",nodes);
+ error(errmsg);
+ end
+
+
+
+ //checking 'refuel_flag'
+
+ m = size(refuel_flag,"r");
+ n = size(refuel_flag,"c");
+
+ if ( ~(m==1 & n==1)) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for the input argument #11 (''refuel_flag''). Expected either a singular 0/1 value or an empty matrix.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+ //checking 'fuel_capacity'
+
+ m = size(fuel_capacity,"r");
+ n = size(fuel_capacity,"c");
+
+ if ( refuel_flag == 1) then
+ if ( ~(m==1 & n==1)) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for the input argument #12 (''fuel_capacity''). Expected a singular integral value.\n"),"vrp");
+ error(errmsg);
+ end
+ else
+ if ( ~(m == 0 & n == 0) ) then
+ errmsg = msprintf(gettext("%s : Empty matrix expected for the input argument #12 (''fuel_capacity''), when ''refuel flag'' is 0.\n"),"vrp");
+ error(errmsg);
+ end
+ end
+
+
+
+ //checking 'refuel_nodes'
+
+ m = size(refuel_nodes, "r");
+ n = size(refuel_nodes,"c");
+
+ if ( refuel_flag == 1)
+ if ( ~((m==0 & n==0) | (m==1 & n<=nodes))) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for the input argument #13 (''refuel_nodes''). Expected a vector or an empty matrix.\n"),"vrp");
+ error(errmsg);
+ end
+ else
+ if ( ~(m == 0 & n == 0) ) then
+ errmsg = msprintf(gettext("%s : Empty matrix expected for the input argument #13 (''refuel_nodes''), when ''refuel flag'' is 0.\n"),"vrp");
+ error(errmsg);
+ end
+ end
+
+
+ //checking 'penalty'
+
+ m = size(penalty,"r");
+ n = size(penalty,"c");
+
+
+ if ( ~((m==0 & n==0) | (m<=nodes & n==2)) ) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for the input argument #14 (''penalty''). Expected an [Ax2] matrix (A->number of skippable nodes) or an empty matrix. \n"),"vrp");
+ error(errmsg);
+ end
+
+
+ //checking 'groups'
+
+ m = size(groups,"r");
+ n = size(groups,"c");
+
+ if ( ~((m==0 & n==0) | (m<=nodes & n<=nodes))) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for the input argument #15 (''groups''). Expected an empty matrix or one whose size cannot exceed the number of nodes.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+ //checking 'group_penalty'
+
+ m = size(group_penalty,"r");
+ n = size(group_penalty,"c");
+
+ if ( ~(m==1 & n==1)) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for the input argument #16 (''group_penalty''). Expected a singular integral value or an empty matrix.\n"),"vrp");
+ error(errmsg);
+ end
+
+ //checking 'time_limit'
+
+ m = size(time_limit,"r");
+ n = size(time_limit,"c");
+
+
+ if ( ~((m==1 & n==1))) then
+ errmsg = msprintf(gettext("%s : Wrong dimensions for the input argument #17 (''time_limit''). Expected a singular, integral, positive value.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+
+ /////Dimensions verified/////
+
+
+
+
+
+ ///////Checking if all the inputs are integral(ie. No fractional part)(NOTE -> x.0 is considered inherently integral as fractional part is '0'////////
+
+
+ if ( ~(and(adj_matrix==(int(adj_matrix))))) then
+ errmsg = msprintf(gettext("%s : All values in argument #1 (''adj_matrix'') are expected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+
+ if( ~(and(vehicles ==(int(vehicles))))) then
+ errmsg = msprintf(gettext("%s : Number of vehicles ( argument #2) is expected to be an integral value.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+ if( ~(and(start ==(int(start))))) then
+ errmsg = msprintf(gettext("%s : The value(s) for argument #3 ( ''start'') is (are) expected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+ if( ~(and( demands==(int(demands))))) then
+ errmsg = msprintf(gettext("%s : All values in argument #5 (''demands'') are expected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+ if( ~(and(max_vehicle_capacity == (int(max_vehicle_capacity))))) then
+ errmsg = msprintf(gettext("%s : Max Vehicle Capacity value (argument #6) is expected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+ if( ~(and(service_time_per_demand ==(int(service_time_per_demand))))) then
+ errmsg = msprintf(gettext("%s : The value for servive-time-per-demand (argument #7) is expected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+ if( ~(and( time_windows==(int(time_windows))))) then
+ errmsg = msprintf(gettext("%s : All values in argument #8 (''time_windows'') are expected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+ if( ~(and(speeds ==(int(speeds))))) then
+ errmsg = msprintf(gettext("%s : The value(s) for argument #9 (''speeds'') is (are) expected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+ if( ~(and(waiting_times ==(int(waiting_times))))) then
+ errmsg = msprintf(gettext("%s : The values in argument #10 (''waiting_times'') are expected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+ if( ~(and(refuel_flag ==(int(refuel_flag))))) then
+ errmsg = msprintf(gettext("%s : The Refuel Flag value (argument #11) is expected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+ if( ~(and(fuel_capacity==(int(fuel_capacity))))) then
+ errmsg = msprintf(gettext("%s : The fuel capacity value for the vehicles (argument #12) is expected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+ if( ~(and(refuel_nodes ==(int(refuel_nodes))))) then
+ errmsg = msprintf(gettext("%s : All values in argument #13 (''refuel_nodes'') are expected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+ if( ~(and(penalty ==(int(penalty))))) then
+ errmsg = msprintf(gettext("%s : All values in argument #14 (''penalty'') are expected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+ if( ~(and(groups==(int(groups))))) then
+ errmsg = msprintf(gettext("%s : All values in argument #15 (''groups'') are expected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+ if( ~(and(group_penalty ==(int(group_penalty))))) then
+ errmsg = msprintf(gettext("%s : The group-penalty value (argument #16) is exected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+ if( ~(and(time_limit ==(int(time_limit))))) then
+ errmsg = msprintf(gettext("%s : The time limit value (argument #17) is expected to be integral.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+
+ //-----------------------------------------------LOGICAL CHECKS---------------------------------------------------------//
+
+
+ ////////Checking 'adj_matrix' (argument #1) /////////
+
+
+ //checking if all the diagonal values in adj_matrix are 0's
+
+ if (~(and(diag(adj_matrix)==0))) then
+ errmsg=msprintf(gettext("%s : All leading diagonal elements of the adjacency matrix need to be 0\n"),"tsp");
+ error(errmsg);
+ end
+
+
+
+ ////////// Checking 'vehicles'(argument #2) //////////
+
+ //checking if the value of 'vehicles' is positive
+
+ if ( ~(vehicles > 0) ) then
+ errmsg = msprintf(gettext("%s : The number of vehicles in the fleet must be a positive value.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+ ////////// Checking 'start'(argument #3) //////////
+
+
+ //if 'start' ain't null, checking if all the values are valid indices (indices go from '1' to 'nodes')
+ if ( start<>[]) then
+ if ( (or(start>nodes)) | (or(start<1)) ) then // one or more index values exceed 'nodes'
+ if (length(start) <> 1) then
+ errmsg = msprintf(gettext("%s : One or more index values in ''start'' are invalid. Indices can only go from ''1'' to ''%d'' for the given problem\n"),"vrp",nodes);
+ else
+ errmsg = msprintf(gettext("%s : The given ''start'' value is not a valid node index. Indices can only go from ''1'' to ''%d'' for the given problem\n"),"vrp",nodes);
+ end
+ error(errmsg);
+ end
+ end
+
+
+
+
+
+ ////////// Checking 'labels'(argument #4) //////////
+
+ if ( length(labels) <> (length(unique(labels))) ) then
+ errmsg = msprintf(gettext("%s : The entries in the ''label'' matrix need to be unique (no 2 nodes can have the same labels).\n"),"vrp");
+ error(errmsg);
+ end
+
+
+
+
+ ////////// Checking 'max_vehicle_capacity'(argument #6) ////////// (needs to be checked before the demands)
+
+
+ //Checking if the max_vehicle_capacity value is specified(not empty matrix) is demands are given
+
+ if (demands <> []) then
+ if ( max_vehicle_capacity == []) then
+ errmsg = msprintf(gettext("%s : For a capacitate VRP, the max_vehicle_capacity cannot be exclude(cannot be an empty matrix).\n"),"vrp");
+ error(errmsg);
+ end
+ end
+
+
+
+ //if the problem is a capacitated VRP(demands specified), checking if the value is positive
+
+
+ if (demands <> []) then
+ if ( max_vehicle_capacity<1) then
+ errmsg = msprintf(gettext("%s : The maximum-vehicle-capacity value needs to be positive.\n"),"vrp");
+ error(errmsg);
+ end
+ end
+
+
+
+
+
+
+
+
+
+ ////////// Checking 'demands'(argument #5) //////////
+
+ if ( demands <>[]) then
+
+ //checking if no values are negative
+
+ if ( or(demands<0)) then
+ errmsg = msprintf(gettext("%s : One or more values in the ''demands'' vector are negative.\n"),"vrp");
+ error(errmsg);
+ end
+
+ //checking if no demand value exceeds the max_vehicle_capacity value
+
+ if ( or(demands > max_vehicle_capacity) ) then
+ errmsg = msprintf(gettext("%s : The demand values for one or more nodes exceed the maximum capacity for the vehicles in question, rendering them unserviceable.\n"),"vrp");
+ error(errmsg);
+ end
+
+ //checking that the total demand doesn't exceed the total capacity
+
+ if ( (sum(demands))>(vehicles*max_vehicle_capacity) ) then
+ errmsg = msprintf(gettext("%s : The total demand exceeds the total capacity of the vehicles in the fleet. The scenario is inherently unserviceable.\n"),"vrp");
+ error(errmsg);
+ end
+ //we do not consider the case of skip-penalties here as that is only a tradeoff vying for optimality, not an inherent mechanism to conpensate for the handicap of demands exceeding the capacity. The model is essentially impractical in this situation.
+
+
+
+ //checking if the demand values for the depot(s) is(are) zero.
+ if (mode_flag == 0) then
+ if ( demands(start) <> 0 ) then
+ errmsg = msprintf(gettext("%s : The demand for the depot node has to be zero.\n"),"vrp");
+ error(errmsg);
+ end
+ elseif (mode_flag == 2) then
+ deps = start(:,1);
+ for i = 1: length(deps)
+ if ( demands(deps(i)) <> 0 ) then
+ errmsg = msprintf(gettext("%s : The demand for all the depot (start) nodes must be zero.\n"),"vrp");
+ end
+ end
+ clear deps;
+ end
+
+
+
+
+
+ end
+
+
+
+
+ ////////// Checking 'service_time_per_demand'(argument #7) //////////
+
+ if ( service_time_per_demand < 0 ) then
+ errmsg = msprintf(gettext("%s : The value for argument #7 (''service_time_per_demand'') cannot be negative.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+ ////////// Checking 'time_windows'(argument #8) //////////
+
+ if ( time_windows<> []) then
+
+ //converting all '-1's from the second column, if any, to INT_MAX
+ temp = time_windows(:,2); //seconds column extracted
+
+ for i=1:nodes
+ if ( temp(i)=='-1' ) then
+ time_windows(i,2) = 2147483647;
+ end
+ end
+
+
+ //checking if all values are non-negative now
+
+ if ( or(time_windows <0) ) then
+ errmsg = msprintf(gettext("%s : Values in ''time_windows'' matrix cannot be negative (except ''-1'' for end times indicating no upper bound for the corresponding node).\n"),"vrp");
+ error(errmsg);
+ end
+
+
+ //checking if all the end times are greater than or equal to the corresponding start times
+
+ if ( ~(and(time_windows(:,1)<=time_windows(:,2))) ) then
+ errmsg = msprintf(gettext("%s : Invalid time-window values : The end-time for service window for one or more nodes in less than the corresponding start-time.\n"),"vrp");
+ error(errmsg);
+ end
+
+ //checking if the windows are wide enough to be serviceable i.e. the window size if greater than or equal to the total service time. Service time is zero by default for when 'tis to be ignored in time minimization so we don't need to demarcate that case(0 will always be less than or equal to the window size(>=0)). This is only to be done is demands are given(ie.e 'tis a capacitated VRP)
+
+// if ( demands <> []) then
+// if ( or((time_windows(:,2)-time_windows(:,1)) >= (((demands*service_time_per_demand)') + waiting_times)) ) then
+// errmsg = msprintf(gettext("%s : The time-window for one or more nodes is not wide enough to be serviceable(i.e. the duration of the time-window is smaller than the time required to service that node.\n"),"vrp");
+// error(errmsg);
+// end
+//
+// end
+ end
+
+
+
+
+ ////////// Checking 'speeds'(argument #9) //////////
+
+ if ( speeds <> []) then
+ if (length(speeds)==1) then
+ if (speeds(1,1)<1) then
+ errmsg = msprintf(gettext("%s : The avg.speeds value thus provided must be POSITIVE.\n"),"vrp");
+ error(errmsg);
+ end
+ else //[nxn] matrix given
+
+ //first off, all the diagonal values need to be zero
+
+ if ( ~(and(diag(speeds) == 0)) ) then
+ errmsg = msprintf(gettext("%s : All the diagonal values in the given ''speeds'' matrix (argument #9) need to be ''0''.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+ for i = 1:nodes
+ for j = 1:nodes
+ if ( (speeds(i,j)<1) & (i<>j)) then
+ errmsg = msprintf(gettext("%s : Speed values need to be POSITIVE. \n"),"vrp");
+ error(errmsg);
+ end
+ end
+ end
+
+ end
+
+ end
+
+
+
+
+
+
+
+ ////////// Checking 'waiting_times'(argument #10) //////////
+
+ //checking if waiting times are non-negative
+
+ if ( waiting_times <>[]) then
+ if ( or(waiting_times < 0) ) then
+ errmsg = msprintf(gettext("%s : Waiting time values cannot be negative. \n"),"vrp");
+ error(errmsg);
+ end
+
+ end
+
+
+
+
+
+ ////////// Checking 'refuel_flag'(argument #11) //////////
+
+ //checking if the value is only either '0' or '1'
+
+ if ( (refuel_flag<>1) & (refuel_flag<>0) ) then
+ errmsg= msprintf(gettext("%s : The refuel flag can only take the value ''0'' or ''1''. Check the FOT documentation for details.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+
+
+
+
+ ////////// Checking 'fuel_capacity'(argument #12) //////////
+
+
+ //checking if the fuel_capacity value is positive
+
+ if ( rhs > 10 ) then
+ if ( fuel_capacity<1 ) then
+ errmsg = msprintf(gettext("%s : Fuel Capacity value is expected to be positive.\n"),"vrp");
+ error(errmsg);
+ end
+ end
+
+
+
+
+ ////////// Checking 'refuel_nodes'(argument #13) //////////
+
+
+ //checking if all the indices are valid
+
+ if ( refuel_nodes<>[]) then
+ if ( (or(refuel_nodes<1)) | (or(refuel_nodes>nodes)) ) then
+ errmsg = msprintf(gettext("%s : One or more fuel node index values are invalid. Valid indices for the current model - ''1'' to ''%d''. \n"),"vrp",nodes);
+ error(errmsg);
+ end
+ end
+
+
+
+
+
+ ////////// Checking 'penalty'(argument #14) //////////
+
+ if ( penalty <> [] ) then
+ if ( (or(penalty(:,1)<1)) | (or(penalty(:,1)>nodes)) ) then
+ errmsg = msprintf(gettext("%s : One or more node indices provided in the ''penalty'' matrix ( argument #14) are invalid. Valid indices for the current model- ''1'' to ''%d''. \n"),"vrp",nodes);
+ error(errmsg);
+ end
+
+ if ( or(penalty(:,2)<0) ) then
+ errmsg = msprintf(gettext("%s : Cost penalty values in the ''penalty'' matrix (argument #14) cannot be negative.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+ if ( start <> []) then
+ if ( length(start)==1 ) then
+ if ( or(penalty(:,1)==start) ) then
+ errmsg = msprintf(gettext("%s : The depot cannot be provided as an optional node.\n"),"vrp");
+ error(errmsg);
+ end
+ else
+ for i= 1:(size(penalty,"r"))
+ if ( (or(start(:,1) == penalty(i,1))) | (or(start(:,2) == penalty(i,1))) ) then
+ errmsg = msprintf(gettext("%s Node of the start/end nodes can be specified as optional in the ''penalty'' matrix.\n"),"vrp");
+ error(errmsg);
+ end
+ end
+ end
+ end
+ end
+
+
+
+
+
+ ////////// Checking 'groups'(argument #15) //////////
+
+ if ( groups <>[] ) then
+ if ( (or(groups < 0)) | (or(groups>nodes)) ) then
+ errmsg = msprintf(gettext("%s : One or more node index values in argument #15 ( ''groups'') is invalid. Valid indices for this model - ''1'' to ''%d''.\n"),"vrp",nodes);
+ error(errmsg);
+ end
+
+
+ num_groups = size(groups,"r");
+ groups_cols = size(groups,"c");
+
+ num_zeroes=0;
+
+ for i = 1:num_groups
+ num_zeroes= num_zeroes + length(find(groups(i,:)==0));
+ if ( ((min(find(groups(i,:)==0)))) <> [] ) then
+ if ( (groups_cols-length(find(groups(i,:)==0))+1) <> ((min(find(groups(i,:)==0)))) ) then // indicates that there's a zero somewhere between the other indices in the current group, i.e. an index of '0' is specified
+ errmsg = msprintf(gettext("%s : Index value for a node cannot be ''0''. Zero''s are only used for right-padding in the ''groups'' matrix. Check row %d.\n"),"vrp",i);
+ error(errmsg);
+ end
+ end
+ end
+
+
+ if ( num_zeroes == 0 ) then
+ if ( (length(unique(groups)))<>length(groups) ) then
+ errmsg = msprintf(gettext("%s : One or more node index values in the ''groups'' matrix (argument #15) are repeated. No index can occur twice in a group. Also, no node can be a part of 2 groups.\n"),"vrp");
+ error(errmsg);
+ end
+ else
+ if ( (length(unique(groups)) + num_zeroes - 1) <> length(groups) ) then
+ errmsg = msprintf(gettext("%s : One or more node index values in the ''groups'' matrix (argument #15) are repeated. No index can occur twice in a group. Also, no node can be a part of 2 groups.\n"),"vrp");
+ error(errmsg);
+ end
+ end
+
+ clear num_zeroes;
+ clear num_groups;
+ clear groups_cols;
+
+ end
+
+ ////////// Checking 'group_penalty'(argument #16) //////////
+
+
+ //checking if the value is permissible(-1,0, or positive)
+
+ if ( group_penalty < -1 ) then
+ errmsg = msprintf(gettext("%s : Forbidden value for ''group_penalty'' (argument #16). Expected- -1, 0, or any positive value.\n"),"vrp");
+ error(errmsg);
+ end
+
+
+
+ ////////// Checking 'time_limit'(argument #17) //////////
+
+
+ //checking is time limit positive
+
+ if ( time_limit < 1 ) then
+ errmsg = msprintf(gettext("%s : Positive value expected for the ''time_limit'' (argument #17). \n"),"vrp");
+ error(errmsg);
+ end
+
+
+
+ //---------------------------------END OF LOGICAL CHECKS---------------------------------------------------//
+
+
+
+
+
+ //-----------------------------------------SOLUTION--------------------------------------------------------//
+
+
+ //Solving the given VRP by calling the gateway function
+
+
+ [total_distance, routes, distances, total_time, times, status] = VRP(adj_matrix, vehicles, mode_flag, start, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds, waiting_times, refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
+ select status
+
+ case 0 then
+ printf("\n''ROUTING_NOT_SOLVED'' ; The solver-module invocation failed. If the problem persists, notify the toolbox authors.\n");
+ case 1 then
+
+
+ if ( lhs > 5) then
+ printf( "Status :- %d\n",status);
+ end
+ printf("\n ''ROUTING_SUCCESS'' ; An optimal solution was found for the given model!\n");
+ printf("Total Distance -> %d\n",total_distance);
+
+ if ( lhs>3) then
+ printf("Total time -> %d\n",total_time);
+ end
+
+ printf("\n Optimal Routes :- \n");
+
+ for i = 1:vehicles
+ temp = routes(i,:);
+ if ( find(temp==0)<>[]) then
+ temp = temp(1:(min(find(temp==0))-1)); // returns the row sans the zero padding, if any
+ end
+
+
+ if ( temp(1)==temp(2) ) then
+ printf("Vehicle #%d - Not Deployed!\n", i);
+ else
+
+ printf("\n\n\nRoute for vehicle #%d : - \n",i);
+
+
+ tt=1;
+
+ if ( length(labels)<>0) then
+ for j = 1 : (length(temp)-1)
+ printf(" %s (%d) ->", labels(temp(j)),temp(j));
+ tt=j+1;
+ end
+
+ if ( length(temp) == nodes ) then //when all nodes are mapped to a single route(or when no. of vehicles is '1')
+ printf(" %s (%d) ->",labels(temp(tt)),temp(tt));
+ printf(" %s (%d) \n",labels(temp(1)),temp(1));
+ else
+ printf(" %s (%d) \n",labels(temp(tt)),temp(tt));
+ end
+
+
+ else
+ for j= 1 : (length(temp)-1)
+ printf(" %d ->", temp(j));
+ end
+ if ( length(temp) == nodes ) then //when all nodes are mapped to a single route(or when no. of vehicles is '1')
+ printf(" %d ->",temp($));
+ printf(" %d \n",temp(1));
+ else
+ printf(" %d \n",temp($));
+ end
+
+ end
+
+
+ if ( lhs > 2) then
+ printf( "The total-distance for route #%d = %d\n",i,distances(i));
+
+ if ( lhs > 4) then
+ printf( " The time taken for route #%d = %d\n",i,times(i));
+ end
+
+ end
+
+ end
+
+ end
+
+ clear 'temp';
+ clear 'tt';
+
+
+
+
+ case 2 then
+ printf("\n''ROUTING_FAIL''\n ; No optimal solution was found for the given model.\n");
+
+ case 3 then
+ if ( routes <> []) then
+ printf("\n''ROUTING_FAIL_TIMEOUT''\n ; The time limit was reached before the model converged to the optimal solution. The returned solution CAN be further optimized; Try increasing the time-limit for a better solution.\n");
+ else
+ printf("\n''ROUTING_FAIL_TIMEOUT''\n ; No solution was found within the stipulated the time-limit. Try increasing the time-limit.\n");
+ end
+
+ else
+ printf("\nUnexpected return status. Notify the toolbox authors.\n");
+ break;
+
+ end
+
+endfunction
+
+
+
+
+
diff --git a/sci_gateway/builder_gateway.sce b/sci_gateway/builder_gateway.sce
new file mode 100644
index 0000000..6fe5d0f
--- /dev/null
+++ b/sci_gateway/builder_gateway.sce
@@ -0,0 +1,7 @@
+sci_gateway_dir = get_absolute_file_path('builder_gateway.sce');
+
+tbx_builder_gateway_lang('cpp', sci_gateway_dir);
+
+tbx_build_gateway_loader(['cpp'], sci_gateway_dir);
+
+clear sci_gateway_dir;
diff --git a/sci_gateway/cpp/builder_gateway_cpp.sce b/sci_gateway/cpp/builder_gateway_cpp.sce
new file mode 100644
index 0000000..4998a24
--- /dev/null
+++ b/sci_gateway/cpp/builder_gateway_cpp.sce
@@ -0,0 +1,145 @@
+function startGateway()
+
+ path_builder = get_absolute_file_path("builder_gateway_cpp.sce");
+
+ third_party_dir = path_builder + filesep() + ".." + filesep() + ".." + filesep() + "thirdparty";
+
+ // Library Name
+ if isdef("TOOLBOX_NAME") then
+ LIBRARY_NAME = TOOLBOX_NAME + "_cpp";
+ else
+ LIBRARY_NAME = "Optimization_Toolbox_cpp";
+ end
+
+ // Function Names
+ FUNC_NAMES = [
+ "solve_qcqpglob","sci_qcqpglob"
+ "solve_mincostflow","sci_min_cost_flow";
+ "solve_linsumassignment","sci_linear_sum_assignment";
+ "MaxFlow","sci_max_flow";
+ "BellmanFordShortestPath","sci_BellmanFord_shortestPath";
+ "TSP","sci_tsp";
+ "VRP","sci_vrp";
+ "JSSP","sci_jssp"
+ ];
+
+ // File Names
+ FILES = [
+ "sci_iofunc.cpp",
+ "sci_qcqpglob.cpp",
+ "sci_min_cost_flow.cpp",
+ "sci_linear_sum_assignment.cpp",
+ "sci_max_flow.cpp",
+ "sci_BellmanFord_shortestPath.cpp",
+ "sci_tsp.cpp",
+ "sci_vrp.cpp",
+ "sci_jssp.cpp"
+ ];
+
+ // Get Platform Arch
+ [a, opt] = getversion();
+ Arch = opt(2);
+
+ // Default Compiler Flags
+ CXX_FLAGS = "-std=c++0x -D__USE_DEPRECATED_STACK_FUNCTIONS__ -w -fpermissive ";
+ LD_FLAGS = [];
+
+ // OS Specific Compiler Configuration
+ if (getos() == "Windows") then
+ INC_DIR = third_party_dir + filesep() + "Windows" + filesep() + "include";
+ LIB_DIR = third_party_dir + filesep() + "Windows" + filesep() + "lib" + filesep() + Arch;
+
+ MINOTAUR_INC_DIR = INC_DIR + filesep() + "minotaur";
+
+ CXX_FLAGS = CXX_FLAGS + "-I""" + path_builder + """ ";
+ CXX_FLAGS = CXX_FLAGS + "-I""" + INC_DIR + """ ";
+ CXX_FLAGS = CXX_FLAGS + "-I""" + MINOTAUR_INC_DIR + """ ";
+
+ LIB_COINUTILS = "libCoinUtils.lib";
+ LIB_OSI = "libOsi.lib";
+ LIB_CLP = "libClp.lib";
+ LIB_OSICLP = "libOsiClp.lib";
+ LIB_CLPSOLVER = "libClpSolver.lib";
+ LIB_COINMUMPS = "libcoinmumps.lib";
+ LIB_IPOPT = "libipopt.lib";
+ LIB_MINOTAUR = "libminotaur.lib";
+ LIB_MNTROSILP = "libmntrosilp.lib";
+ LIB_MNTRIPOPT = "libmntripopt.lib";
+ LIB_MNTRENGFAC = "libmntrengfac.lib";
+ LIB_CVRPTW = "libcvrptw_lib.lib";
+ LIB_DIMACS = "libdimacs.lib";
+ LIB_FAP = "libfap.lib";
+ LIB_JNIORTOOLS = "libjniortools.lib";
+ LIB_ORTOOLS = "libortools.lib";
+
+ LD_FLAGS = LD_FLAGS + "/LIBPATH:""" + LIB_DIR + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_COINUTILS + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_OSI + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_CLP + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_OSICLP + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_CLPSOLVER + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_COINMUMPS + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_IPOPT + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_MINOTAUR + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_MNTROSILP + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_MNTRIPOPT + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_MNTRENGFAC + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_CVRPTW + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_DIMACS + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_FAP + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_JNIORTOOLS + """ ";
+ LD_FLAGS = LD_FLAGS + """" + LIB_ORTOOLS + """ ";
+ else
+ INC_DIR = third_party_dir + filesep() + "linux" + filesep() + "include";
+ LIB_DIR = third_party_dir + filesep() + "linux" + filesep() + "lib" + filesep() + Arch;
+
+ MINOTAUR_INC_DIR = INC_DIR + filesep() + "minotaur";
+
+ CXX_FLAGS = CXX_FLAGS + "-I""" + path_builder + """ ";
+ CXX_FLAGS = CXX_FLAGS + "-I""" + INC_DIR + """ ";
+ CXX_FLAGS = CXX_FLAGS + "-I""" + MINOTAUR_INC_DIR + """ ";
+ CXX_FLAGS = CXX_FLAGS + "-Wl,-rpath=""" + LIB_DIR + """ ";
+
+ LIB_COINUTILS = "CoinUtils";
+ LIB_OSI = "Osi";
+ LIB_CLP = "Clp";
+ LIB_OSICLP = "OsiClp";
+ LIB_CLPSOLVER = "ClpSolver";
+ LIB_COINMUMPS = "coinmumps";
+ LIB_IPOPT = "ipopt";
+ LIB_MINOTAUR = "minotaur";
+ LIB_MNTROSILP = "mntrosilp";
+ LIB_MNTRIPOPT = "mntripopt";
+ LIB_MNTRENGFAC = "mntrengfac";
+ LIB_CVRPTW = "cvrptw_lib";
+ LIB_DIMACS = "dimacs";
+ LIB_FAP = "fap";
+ LIB_JNIORTOOLS = "jniortools";
+ LIB_ORTOOLS = "ortools";
+
+ LD_FLAGS = LD_FLAGS + "-L""" + LIB_DIR + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_COINUTILS + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_OSI + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_CLP + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_OSICLP + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_CLPSOLVER + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_COINMUMPS + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_IPOPT + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_MINOTAUR + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_MNTROSILP + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_MNTRIPOPT + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_MNTRENGFAC + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_CVRPTW + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_DIMACS + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_FAP + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_JNIORTOOLS + """ ";
+ LD_FLAGS = LD_FLAGS + "-l""" + LIB_ORTOOLS + """ ";
+ end
+
+ tbx_build_gateway(LIBRARY_NAME, FUNC_NAMES, FILES, path_builder, [], LD_FLAGS, CXX_FLAGS);
+
+endfunction
+
+startGateway();
+
+clear startGateway;
diff --git a/sci_gateway/cpp/misc.hpp b/sci_gateway/cpp/misc.hpp
new file mode 100644
index 0000000..22051f5
--- /dev/null
+++ b/sci_gateway/cpp/misc.hpp
@@ -0,0 +1,20 @@
+#ifndef MISCHEADER
+#define MISCHEADER
+
+#include
+
+template T* ArrConvertMajor(T* src, unsigned int rows, unsigned int cols)
+{
+ unsigned int i, j;
+ T* dest = (T*)malloc(sizeof(T) * rows * cols);
+ for(i = 0; i < rows; ++i)
+ {
+ for(j = 0; j < cols; ++j)
+ {
+ dest[i * cols + j] = src[j * rows + i];
+ }
+ }
+ return dest;
+}
+
+#endif //MISCHEADER
diff --git a/sci_gateway/cpp/sci_BellmanFord_shortestPath.cpp b/sci_gateway/cpp/sci_BellmanFord_shortestPath.cpp
new file mode 100644
index 0000000..98cbb10
--- /dev/null
+++ b/sci_gateway/cpp/sci_BellmanFord_shortestPath.cpp
@@ -0,0 +1,424 @@
+#include "ortools/graph/shortestpaths.h"
+extern "C"{
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+using namespace operations_research;
+
+/*
+Naming suffixes(also, the respective order) for inputs :-
+1->tails/start_nodes
+2->heads/end_nodes
+3->weights(for the arc head[i]->tail[i]
+4->[source,target]
+5->user-defined value for disconnected-distance(default is INT_MAX)
+6->0/1 value indicating if output(messages and shortest path, if it exists) is to be displayed or not, i.e. 0->internal test(obscured from the user); 1-> user test, pertinent outputs expected.
+*/
+
+/*
+
+Naming suffixes(also, the respective order) for outputs :-
+1->The minimun cost incurrred in reaching the end node(following the shortest path); NULL if the start and end nodes are not connection
+2->The vector containing the shortest path from the start to the end node. empty vector if the start and end nodes are not connected
+
+*/
+
+double *sp_piVar1=NULL,*sp_piVar2=NULL,*sp_piVar3=NULL,*sp_piVar4=NULL,*sp_piVar5=NULL, *sp_piVar6=NULL;
+int sp_num_arcs;
+int disconnected_distance=INT_MAX;
+
+
+long long retrieve(int u, int v) // Returns the weight corresponding to the arc going from node u(tail) to node v(head). IF MORE THAN ONE ARCS JOINING THE SAME 2 NODES, THIS FUNCTION RETURNS THE SMALLER OF THE 2 WEIGHTS
+{
+ int temp=INT_MIN;
+ int flag=0;
+
+ for(int i=0;itemp))
+ {
+ temp=sp_piVar3[i];
+ flag=1;
+ }
+
+ if(flag)
+ return temp;
+ else
+ return disconnected_distance;
+
+}
+
+
+int sci_BellmanFord_shortestPath(char *fname)
+{
+
+ SciErr scierror;
+
+ int iType1=0,iType2=0,iType3=0,iType4=0,iType5=0,iType6=0;
+
+ int m1=0,n1=0,m2=0,n2=0,m3=0,n3=0,m4=0,n4=0,m5=0,n5=0,m6=0,n6=0;
+
+
+ int *piAddressVar1=NULL,*piAddressVar2=NULL,*piAddressVar3=NULL,*piAddressVar4=NULL,*piAddressVar5=NULL,*piAddressVar6=NULL;
+
+ double *piReal1=NULL;
+ int *piReal2=NULL;
+ int flag;
+
+
+ int start_node;
+ int end_node;
+
+
+ std::vector nodes;
+
+
+ CheckInputArgument(pvApiCtx,6,6);
+ CheckOutputArgument(pvApiCtx,3,3);
+
+
+
+ // GETTING ADDRESSES OF THE INPUT MATRICES
+
+ scierror=getVarAddressFromPosition(pvApiCtx,1,&piAddressVar1);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+ scierror=getVarAddressFromPosition(pvApiCtx,2,&piAddressVar2);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+ scierror=getVarAddressFromPosition(pvApiCtx,3,&piAddressVar3);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,4,&piAddressVar4);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,5,&piAddressVar5);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,6,&piAddressVar6);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+
+
+ //GETTING AND CHECKING THE TYPES OF THE INPUT MATRICES
+
+ scierror=getVarType(pvApiCtx,piAddressVar1,&iType1);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar2,&iType2);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar3,&iType3);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar4,&iType4);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar5,&iType5);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar6,&iType6);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+ if(iType1!=sci_matrix ||iType2!=sci_matrix ||iType3!=sci_matrix ||iType4!=sci_matrix ||iType5!=sci_matrix||iType6!=sci_matrix)
+ {
+
+ if(iType1!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #1. Matrix Expected.\n");
+
+ if(iType2!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #2. Matrix Expected.\n");
+
+ if(iType3!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #3. Matrix Expected.\n");
+
+
+ if(iType4!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #4. Matrix Expected.\n");
+
+ if(iType5!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #5. Matrix Expected.\n");
+
+ if(iType6!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #6. Matrix Expected.\n");
+
+ return 0;
+ }
+
+
+ //GETTING ACTUAL MATRICES
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar1,&m1,&n1,&sp_piVar1);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar2,&m2,&n2,&sp_piVar2);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar3,&m3,&n3,&sp_piVar3);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar4,&m4,&n4,&sp_piVar4);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar5,&m5,&n5,&sp_piVar5);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar6,&m6,&n6,&sp_piVar6);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+ //checking if the first 3 inputs are indeed 1-d arrays(in 1xn matrix form)
+
+ if((m1!=1)||(m2!=1)||(m3!=1))
+ {
+ Scierror(787,"Invalid Input(s)! The graph needs to be in the form of 3 arrays(1xn Matrices), viz tail[],head[],weight[]\n");
+ return 0;
+ }
+
+ //checking if the size of the 3 matrices describing the graph is equal
+
+ if(n1!=n2||n1!=n3)
+ {
+ Scierror(788,"Wrong Input(s)! The input graph is erroneous. The three matrcies describing the graph aren't of the same size\n");
+ return 0;
+ }
+
+ //checking if the start node and end node values are of the correct form(1x2 matrix)
+
+ if(m4!=1||n4!=2)
+ {
+
+ Scierror(789,"Wrong Input #4! Required- a 1x2 matrix containing 2 values viz. the source and target nodes, in that order\n");
+ return 0;
+
+ }
+
+
+ //checking if the specified value for disconnected-distance is a 1x1 matrix(singular value)
+ if(m5!=1||n5!=1)
+ {
+ Scierror(789,"Wrong Input #5! Required - a singular value(integral) for the 'disconnected-distance'(i.e. any arcs/edges with weigths >=disconnected-distance are ignored i.e. no path. \n");
+ return 0;
+ }
+
+
+
+ //no check needed for argument 6 as it ain't a user provided value
+
+
+ sp_num_arcs=n1;
+ start_node=sp_piVar4[0];
+ end_node=sp_piVar4[1];
+ disconnected_distance=sp_piVar5[0];
+
+ int abstraction=sp_piVar6[0];
+
+
+
+ int sflag=0;
+ int eflag=0;
+
+ //checking if the start node and end node values are valid(i.e. nodes corresponding to these values do indeed exist in the given graph or not)
+
+ for(int i=0;(i=0;i--)
+ {
+ sciprint(" -> %d", nodes.at(i));
+ cost+=retrieve(nodes.at(i+1),nodes.at(i));
+ piReal2[nodes.size()-i-1]=nodes.at(i);
+ }
+
+ sciprint("\n");
+
+ sciprint("Minumum cost (using the said path) :- %f\n",(piReal1[0]=cost));
+ }
+
+
+
+ scierror=createMatrixOfDouble(pvApiCtx,nbInputArgument(pvApiCtx)+1,1,1,piReal1);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=createMatrixOfInteger32(pvApiCtx,nbInputArgument(pvApiCtx)+2,1,nodes.size(),piReal2);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=createMatrixOfInteger32(pvApiCtx,nbInputArgument(pvApiCtx)+3,1,1,&flag);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+
+
+ AssignOutputVariable(pvApiCtx,1)=nbInputArgument(pvApiCtx)+1;
+ AssignOutputVariable(pvApiCtx,2)=nbInputArgument(pvApiCtx)+2;
+ AssignOutputVariable(pvApiCtx,3)=nbInputArgument(pvApiCtx)+3;
+
+}
+
+}
+
+
+
+
+
\ No newline at end of file
diff --git a/sci_gateway/cpp/sci_iofunc.cpp b/sci_gateway/cpp/sci_iofunc.cpp
new file mode 100644
index 0000000..f02b23a
--- /dev/null
+++ b/sci_gateway/cpp/sci_iofunc.cpp
@@ -0,0 +1,450 @@
+#include "api_scilab.h"
+#include "Scierror.h"
+#include "sciprint.h"
+#include "BOOL.h"
+#include
+
+#define isDoubleIntegerType(x, y) ((double)((y)x)==x)
+
+int getInt32FromScilab(int argNum, int* dest)
+{
+ SciErr sciErr;
+ int iRet = 0;
+ int *varAddress = NULL;
+ double inputDouble = 0;
+ const char errMsg[] = "Wrong type for input argument #%d: An Integer is expected.\n";
+ const int errNum = 999;
+ sciErr = getVarAddressFromPosition(pvApiCtx, argNum, &varAddress);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ if (!isDoubleType(pvApiCtx, varAddress) || isVarComplex(pvApiCtx, varAddress))
+ {
+ Scierror(errNum, errMsg, argNum);
+ return 1;
+ }
+ iRet = getScalarDouble(pvApiCtx, varAddress, &inputDouble);
+ if(iRet || !isDoubleIntegerType(inputDouble, int))
+ {
+ Scierror(errNum, errMsg, argNum);
+ return 1;
+ }
+ *dest = (int)inputDouble;
+ return 0;
+}
+
+int getInt32MatrixFromScilab(int argNum, int *rows, int *cols, int **dest)
+{
+ SciErr sciErr;
+ int* varAddress = NULL;
+ double* destDouble = NULL;
+ const char errMsg[] = "Wrong type for input argument #%d: A matrix of Integer is expected.\n";
+ const int errNum = 999;
+ sciErr = getVarAddressFromPosition(pvApiCtx, argNum, &varAddress);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ if (!isDoubleType(pvApiCtx, varAddress) || isVarComplex(pvApiCtx, varAddress))
+ {
+ Scierror(errNum, errMsg, argNum);
+ return 1;
+ }
+ sciErr = getMatrixOfDouble(pvApiCtx, varAddress, rows, cols, &destDouble);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ int i;
+ *dest = (int*)malloc(sizeof(int) * (*rows) * (*cols));
+ for(i = 0; i < (*rows) * (*cols); ++i)
+ {
+ if(!isDoubleIntegerType(destDouble[i], int))
+ {
+ Scierror(errNum, errMsg, argNum);
+ return 1;
+ }
+ (*dest)[i] = (int)destDouble[i];
+ }
+ return 0;
+}
+
+int getFixedSizeInt32MatrixFromScilab(int argNum, int rows, int cols, int **dest)
+{
+ SciErr sciErr;
+ int* varAddress = NULL;
+ int inputMatrixRows = 0, inputMatrixCols = 0;
+ double* destDouble = NULL;
+ const char errMsg[] = "Wrong type for input argument #%d: A matrix of Integer of size %d by %d is expected.\n";
+ const int errNum = 999;
+ sciErr = getVarAddressFromPosition(pvApiCtx, argNum, &varAddress);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ if (!isDoubleType(pvApiCtx, varAddress) || isVarComplex(pvApiCtx, varAddress))
+ {
+ Scierror(errNum, errMsg, argNum, rows, cols);
+ return 1;
+ }
+ sciErr = getMatrixOfDouble(pvApiCtx, varAddress, &inputMatrixRows, &inputMatrixCols, &destDouble);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ if(inputMatrixRows != rows || inputMatrixCols != cols)
+ {
+ Scierror(errNum, errMsg, argNum, rows, cols);
+ return 1;
+ }
+ int i;
+ *dest = (int*)malloc(sizeof(int) * rows * cols);
+ for(i = 0; i < rows * cols; ++i)
+ {
+ if(!isDoubleIntegerType(destDouble[i], int))
+ {
+ Scierror(errNum, errMsg, argNum, rows, cols);
+ return 1;
+ }
+ (*dest)[i] = (int)destDouble[i];
+ }
+ return 0;
+}
+
+int returnInt32ToScilab(int itemPos, int retVal)
+{
+ int iRet;
+ iRet = createScalarDouble(pvApiCtx, nbInputArgument(pvApiCtx)+itemPos, (double)retVal);
+ if(iRet)
+ {
+ AssignOutputVariable(pvApiCtx, itemPos) = 0;
+ return 1;
+ }
+ AssignOutputVariable(pvApiCtx, itemPos) = nbInputArgument(pvApiCtx)+itemPos;
+ return 0;
+}
+
+int returnInt32MatrixToScilab(int itemPos, int rows, int cols, int *dest)
+{
+ SciErr sciErr;
+ double* destDouble = NULL;
+ int i;
+ destDouble = (double*)malloc(sizeof(double) * rows * cols);
+ for(i = 0; i < rows * cols; ++i)
+ {
+ destDouble[i] = (double)dest[i];
+ }
+ sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + itemPos, rows, cols, destDouble);
+ free(destDouble);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ AssignOutputVariable(pvApiCtx, itemPos) = nbInputArgument(pvApiCtx)+itemPos;
+ return 0;
+}
+
+int getInt64FromScilab(int argNum, long long* dest)
+{
+ SciErr sciErr;
+ int iRet = 0;
+ int *varAddress = NULL;
+ double inputDouble = 0;
+ const char errMsg[] = "Wrong type for input argument #%d: An Integer is expected.\n";
+ const int errNum = 999;
+ sciErr = getVarAddressFromPosition(pvApiCtx, argNum, &varAddress);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ if (!isDoubleType(pvApiCtx, varAddress) || isVarComplex(pvApiCtx, varAddress))
+ {
+ Scierror(errNum, errMsg, argNum);
+ return 1;
+ }
+ iRet = getScalarDouble(pvApiCtx, varAddress, &inputDouble);
+ if(iRet || !isDoubleIntegerType(inputDouble, long long))
+ {
+ Scierror(errNum, errMsg, argNum);
+ return 1;
+ }
+ *dest = (long long)inputDouble;
+ return 0;
+}
+
+int getInt64MatrixFromScilab(int argNum, int *rows, int *cols, long long **dest)
+{
+ SciErr sciErr;
+ int* varAddress = NULL;
+ double* destDouble = NULL;
+ const char errMsg[] = "Wrong type for input argument #%d: A matrix of Integer is expected.\n";
+ const int errNum = 999;
+ sciErr = getVarAddressFromPosition(pvApiCtx, argNum, &varAddress);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ if (!isDoubleType(pvApiCtx, varAddress) || isVarComplex(pvApiCtx, varAddress))
+ {
+ Scierror(errNum, errMsg, argNum);
+ return 1;
+ }
+ sciErr = getMatrixOfDouble(pvApiCtx, varAddress, rows, cols, &destDouble);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ int i;
+ *dest = (long long*)malloc(sizeof(long long) * (*rows) * (*cols));
+ for(i = 0; i < (*rows) * (*cols); ++i)
+ {
+ if(!isDoubleIntegerType(destDouble[i], long long))
+ {
+ Scierror(errNum, errMsg, argNum);
+ return 1;
+ }
+ (*dest)[i] = (long long)destDouble[i];
+ }
+ return 0;
+}
+
+int getFixedSizeInt64MatrixFromScilab(int argNum, int rows, int cols, long long** dest)
+{
+ SciErr sciErr;
+ int* varAddress = NULL;
+ int inputMatrixRows = 0, inputMatrixCols = 0;
+ double* destDouble = NULL;
+ const char errMsg[] = "Wrong type for input argument #%d: A matrix of Integer of size %d by %d is expected.\n";
+ const int errNum = 999;
+ sciErr = getVarAddressFromPosition(pvApiCtx, argNum, &varAddress);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ if (!isDoubleType(pvApiCtx, varAddress) || isVarComplex(pvApiCtx, varAddress))
+ {
+ Scierror(errNum, errMsg, argNum, rows, cols);
+ return 1;
+ }
+ sciErr = getMatrixOfDouble(pvApiCtx, varAddress, &inputMatrixRows, &inputMatrixCols, &destDouble);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ if(inputMatrixRows != rows || inputMatrixCols != cols)
+ {
+ Scierror(errNum, errMsg, argNum, rows, cols);
+ return 1;
+ }
+ int i;
+ *dest = (long long*)malloc(sizeof(long long) * rows * cols);
+ for(i = 0; i < rows * cols; ++i)
+ {
+ if(!isDoubleIntegerType(destDouble[i], long long))
+ {
+ Scierror(errNum, errMsg, argNum, rows, cols);
+ return 1;
+ }
+ (*dest)[i] = (long long)destDouble[i];
+ }
+ return 0;
+}
+
+int returnInt64ToScilab(int itemPos, long long retVal)
+{
+ int iRet;
+ iRet = createScalarDouble(pvApiCtx, nbInputArgument(pvApiCtx)+itemPos, (double)retVal);
+ if(iRet)
+ {
+ AssignOutputVariable(pvApiCtx, itemPos) = 0;
+ return 1;
+ }
+ AssignOutputVariable(pvApiCtx, itemPos) = nbInputArgument(pvApiCtx)+itemPos;
+ return 0;
+}
+
+int returnInt64MatrixToScilab(int itemPos, int rows, int cols, long long *dest)
+{
+ SciErr sciErr;
+ double* destDouble = NULL;
+ int i;
+ destDouble = (double*)malloc(sizeof(double) * rows * cols);
+ for(i = 0; i < rows * cols; ++i)
+ {
+ destDouble[i] = (double)dest[i];
+ }
+ sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + itemPos, rows, cols, destDouble);
+ free(destDouble);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ AssignOutputVariable(pvApiCtx, itemPos) = nbInputArgument(pvApiCtx)+itemPos;
+ return 0;
+}
+
+int returnBooleanMatrixToScilab(int itemPos, int rows, int cols, BOOL* dest)
+{
+ SciErr sciErr;
+ sciErr = createMatrixOfBoolean(pvApiCtx, nbInputArgument(pvApiCtx) + itemPos, rows, cols, (const int*)dest);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ AssignOutputVariable(pvApiCtx, itemPos) = nbInputArgument(pvApiCtx)+itemPos;
+ return 0;
+}
+
+int getDoubleFromScilab(int argNum, double* dest)
+{
+ SciErr sciErr;
+ int iRet = 0;
+ int *varAddress = NULL;
+ const char errMsg[] = "Wrong type for input argument #%d: An Integer is expected.\n";
+ const int errNum = 999;
+ sciErr = getVarAddressFromPosition(pvApiCtx, argNum, &varAddress);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ if (!isDoubleType(pvApiCtx, varAddress) || isVarComplex(pvApiCtx, varAddress))
+ {
+ Scierror(errNum, errMsg, argNum);
+ return 1;
+ }
+ iRet = getScalarDouble(pvApiCtx, varAddress, dest);
+ return 0;
+}
+
+int getFixedSizeDoubleMatrixFromScilab(int argNum, int rows, int cols, double** dest)
+{
+ SciErr sciErr;
+ int* varAddress = NULL;
+ int inputMatrixRows = 0, inputMatrixCols = 0;
+ const char errMsg[] = "Wrong type for input argument #%d: A matrix of Double of size %d by %d is expected.\n";
+ const int errNum = 999;
+ sciErr = getVarAddressFromPosition(pvApiCtx, argNum, &varAddress);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ if (!isDoubleType(pvApiCtx, varAddress) || isVarComplex(pvApiCtx, varAddress))
+ {
+ Scierror(errNum, errMsg, argNum, rows, cols);
+ return 1;
+ }
+ sciErr = getMatrixOfDouble(pvApiCtx, varAddress, &inputMatrixRows, &inputMatrixCols, dest);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ if(inputMatrixRows != rows || inputMatrixCols != cols)
+ {
+ Scierror(errNum, errMsg, argNum, rows, cols);
+ return 1;
+ }
+ return 0;
+}
+
+int getFixedSizeListOfFixedSizeDoubleMatrixFromScilab(int argNum, int rows, int cols, double*** dest, int len)
+{
+ SciErr sciErr;
+ int i;
+ int* varAddress = NULL;
+ int* varItemAddress = NULL;
+ int inputMatrixRows = 0, inputMatrixCols = 0, inputListLen = 0;
+ const char errMsg[] = "Wrong type for input argument #%d: A List of length %d containing matrix of Double of size %d by %d is expected.\n";
+ const int errNum = 999;
+ sciErr = getVarAddressFromPosition(pvApiCtx, argNum, &varAddress);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ if (!isListType(pvApiCtx, varAddress))
+ {
+ Scierror(errNum, errMsg, argNum, len, rows, cols);
+ return 1;
+ }
+ sciErr = getListItemNumber(pvApiCtx, varAddress, &inputListLen);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ if (inputListLen != len)
+ {
+ Scierror(errNum, errMsg, argNum, len, rows, cols);
+ return 1;
+ }
+ *dest = (double**)malloc(sizeof(double**) * len);
+ for(i = 1; i <= len; ++i)
+ {
+ sciErr = getListItemAddress(pvApiCtx, varAddress, i, &varItemAddress);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ if (!isDoubleType(pvApiCtx, varItemAddress) || isVarComplex(pvApiCtx, varItemAddress))
+ {
+ Scierror(errNum, errMsg, argNum, len, rows, cols);
+ return 1;
+ }
+ sciErr = getMatrixOfDouble(pvApiCtx, varItemAddress, &inputMatrixRows, &inputMatrixCols, &((*dest)[i - 1]));
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ if(inputMatrixRows != rows || inputMatrixCols != cols)
+ {
+ Scierror(errNum, errMsg, argNum, len, rows, cols);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+int returnDoubleToScilab(int itemPos, double retVal)
+{
+ int iRet;
+ iRet = createScalarDouble(pvApiCtx, nbInputArgument(pvApiCtx)+itemPos,retVal);
+ if(iRet)
+ {
+ AssignOutputVariable(pvApiCtx, itemPos) = 0;
+ return 1;
+ }
+ AssignOutputVariable(pvApiCtx, itemPos) = nbInputArgument(pvApiCtx)+itemPos;
+ return 0;
+}
+
+int returnDoubleMatrixToScilab(int itemPos, int rows, int cols, double *dest)
+{
+ SciErr sciErr;
+ sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + itemPos, rows, cols, dest);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 1;
+ }
+ AssignOutputVariable(pvApiCtx, itemPos) = nbInputArgument(pvApiCtx)+itemPos;
+ return 0;
+}
\ No newline at end of file
diff --git a/sci_gateway/cpp/sci_iofunc.hpp b/sci_gateway/cpp/sci_iofunc.hpp
new file mode 100644
index 0000000..49e5341
--- /dev/null
+++ b/sci_gateway/cpp/sci_iofunc.hpp
@@ -0,0 +1,24 @@
+#ifndef SCI_IOFUNCHEADER
+#define SCI_IOFUNCHEADER
+
+int getInt32FromScilab(int argNum, int* dest);
+int getInt32MatrixFromScilab(int argNum, int* rows, int* cols, long** dest);
+int getFixedSizeInt32MatrixFromScilab(int argNum, int rows, int cols, long** dest);
+int returnInt32ToScilab(int itemPos, int retVal);
+int returnInt32MatrixToScilab(int itemPos, int rows, int cols, int* dest);
+
+int getInt64FromScilab(int argNum, long long* dest);
+int getInt64MatrixFromScilab(int argNum, int* rows, int* cols, long long** dest);
+int getFixedSizeInt64MatrixFromScilab(int argNum, int rows, int cols, long long** dest);
+int returnInt64ToScilab(int itemPos, long long retVal);
+int returnInt64MatrixToScilab(int itemPos, int rows, int cols, long long* dest);
+
+int returnBooleanMatrixToScilab(int itemPos, int rows, int cols, BOOL *dest);
+
+int getDoubleFromScilab(int argNum, double* dest);
+int getFixedSizeDoubleMatrixFromScilab(int argNum, int rows, int cols, double** dest);
+int getFixedSizeListOfFixedSizeDoubleMatrixFromScilab(int argNum, int rows, int cols, double*** dest, int len);
+int returnDoubleToScilab(int itemPos, double retVal);
+int returnDoubleMatrixToScilab(int itemPos, int rows, int cols, double* dest);
+
+#endif //SCI_IOFUNCHEADER
diff --git a/sci_gateway/cpp/sci_jssp.cpp b/sci_gateway/cpp/sci_jssp.cpp
new file mode 100755
index 0000000..30f760a
--- /dev/null
+++ b/sci_gateway/cpp/sci_jssp.cpp
@@ -0,0 +1,754 @@
+#include "ortools/base/commandlineflags.h"
+#include "ortools/base/commandlineflags.h"
+#include "ortools/base/integral_types.h"
+#include "ortools/base/logging.h"
+#include "ortools/base/join.h"
+#include "ortools/base/stringprintf.h"
+#include "ortools/constraint_solver/constraint_solver.h"
+
+extern "C" {
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+using namespace operations_research;
+
+
+
+/*
+Naming suffixes(also, the respective order) for inputs :-
+
+1-> "machines" -> Number of machines in the problem, on which the various tasks in the given jobs are to be scheduled.
+2-> "jobs" ->Number of jobs in the problem. Each job consists of one or more tasks that are to be scheduled on the various machines. The tasks have certain ordering constraints that they have to follow(if mode is '0', all tasks follow a sequetial order, ie. task 1 must occur before task '2' can start adn so on. For mode '1', however, order ain't linear by default. Each task is given 2 task indices, first corresponding to the task only after whose completion, the task in question can start and the second idnex corresponding to the task which cannot start before the task in question ends.
+3-> "mode" -> 0/1 values; 0-> sequential mode- All taks must occur in sequence, i.e. task 1 must end before task 2 can start and so on for all tasks WITHIN THE JOB in question. 1-> parallel mode - Some tasks can occur parallelly, or completely independent of each other. 2 additional constrains need to be specified for each task in this mode viz.(say, the task in question is 'x') one being the task after whose end 'x' can start and the other being the task which can only occur after 'x' has ended.('-1' if the corresponding restriction is not imposed, i.e. if the task can start whenever, the we give '-1' for the first argument.
+4-> "tasks" -> The matrix containing details of all the tasks. Say, the number of tasks is 'A'. For mode '0' 'tis a [Ax3] matrix and for mode '1' 'tis a [Ax5] matrix. The first 3 columns are common to both cases. The 5 columns are - 'job_index' , 'machine_index', 'task_duration', 'start_after','end_before', in that ORDER. The last 2 are only applicable for mode '1'.
+5-> "time_limit" -> The user-specified upper bound in milliseconds for which the solver will run. Solution obviously ain't guaranteed. Default value is 10000(10s). This value has to be greater than 0.
+
+*/
+
+/*
+Naming suffixes(also, the respective order) for outputs :-
+1->"makespan" -> The total time taken to complete all the tasks, in the optimal solution, should one exist
+2->"schedule" -> A schedule matrix [Ax5] (A- number of tasks). The first 3 columns are the same as in 'tasks' matrix in the inputs. The last two indicate the start and end times for the respective tasks, in the optimal solution, should one be found.
+3->"status" -> 0->Solved. 1-> timed out. 2->problem infeasible.
+
+*/
+
+
+
+struct TTask {
+ TTask(int j, int m, int d) : job_id(j), machine_id(m), duration(d) {}
+ int job_id;
+ int machine_id;
+ int duration;
+ };
+
+
+int **tasks=NULL;
+
+int machines;
+int jobs;
+int mode;
+
+
+
+
+
+
+
+int sci_jssp(char *fname)
+{
+
+
+ int time_limit= 10000; //default - 10s
+
+ SciErr scierror;
+
+ int iType1=0, iType2=0, iType3=0, iType4=0, iType5=0;
+
+ int *piAddressVar1=NULL, *piAddressVar2=NULL, *piAddressVar3=NULL, *piAddressVar4=NULL, *piAddressVar5=NULL;
+
+ double *jssp_piVar1=NULL, *jssp_piVar2=NULL, *jssp_piVar3=NULL, *jssp_piVar4=NULL, *jssp_piVar5=NULL;
+
+ int m1=0,n1=0,m2=0,n2=0,m3=0,n3=0,m4=0,n4=0,m5=0,n5=0;
+
+ int status; //output #3
+
+
+ int num_tasks;
+
+
+ CheckInputArgument(pvApiCtx,5,5);
+ CheckOutputArgument(pvApiCtx,3,3);
+
+
+ //GETTING THE ADDRESSES OF THE INPUT MATRICES
+
+
+ scierror = getVarAddressFromPosition(pvApiCtx,1,&piAddressVar1);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror = getVarAddressFromPosition(pvApiCtx,2,&piAddressVar2);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror = getVarAddressFromPosition(pvApiCtx,3,&piAddressVar3);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror = getVarAddressFromPosition(pvApiCtx,4,&piAddressVar4);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror = getVarAddressFromPosition(pvApiCtx,5,&piAddressVar5);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+
+ //RETRIEVING AND CHECKING THE TYPES OF THE INPUTS
+
+
+
+ scierror=getVarType(pvApiCtx,piAddressVar1,&iType1);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar2,&iType2);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar3,&iType3);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar4,&iType4);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar5,&iType5);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+
+
+ if(iType1!=sci_matrix || iType2!=sci_matrix || iType3!=sci_matrix || iType4!=sci_matrix || iType5!=sci_matrix)
+ {
+
+ if(iType1!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #1. Matrix Expected! \n");
+
+ if(iType2!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #2. Matrix Expected! \n");
+
+ if(iType3!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #3. Matrix Expected! \n");
+
+ if(iType4!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #4. Matrix Expected! \n");
+
+ if(iType5!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #5. Matrix Expected! \n");
+
+ return 0;
+
+ }
+
+
+
+
+
+ //GETTING THE ACTUAL INPUT MATRICES
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar1,&m1,&n1,&jssp_piVar1);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar2,&m2,&n2,&jssp_piVar2);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar3,&m3,&n3,&jssp_piVar3);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar4,&m4,&n4,&jssp_piVar4);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar5,&m5,&n5,&jssp_piVar5);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+
+ //////--------------------------LOGIC-------------------------------/////////
+
+
+
+ //assignments
+
+ num_tasks = m4;
+
+ machines = jssp_piVar1[0];
+ jobs = jssp_piVar2[0];
+
+ mode = jssp_piVar3[0];
+
+ if( m5!=0)
+ time_limit = jssp_piVar5[0];
+
+
+
+ // constructing the 'tasks' matrix
+
+ tasks=(int **)malloc(sizeof(int*)*num_tasks);
+
+ if( mode==0)
+ {
+
+ for(int i=0;i > alltasks(jobs);
+
+ for(int i=0;i > jobs_to_tasks(jobs);
+ std::vector< std::vector > machines_to_tasks(machines);
+
+
+
+
+ //Creating the solver
+
+ Solver solver("Job-Shop");
+
+
+
+ //Creating the interval variables
+
+ int absindex=-1;
+
+ for(int i=0;iname());
+ std::string token;
+
+ std::getline(ss, token, ';');
+
+ int ind = std::stoi(token); //This is the index corresponding to the task (row) in the 'tasks' matrix
+
+
+ if(tasks[ind][3] !=-1)
+ {
+ IntervalVar* const t2 = jobs_to_tasks[i][tasks[ind][3]];
+
+ Constraint* const precedence = solver.MakeIntervalVarRelation(t1, Solver::STARTS_AFTER_END, t2);
+
+ solver.AddConstraint(precedence);
+ }
+
+ if(tasks[ind][4]!=-1)
+ {
+ IntervalVar* const t2 = jobs_to_tasks[i][tasks[ind][4]];
+
+ Constraint* const precedence =solver.MakeIntervalVarRelation( t2, Solver::STARTS_AFTER_END, t1);
+
+ solver.AddConstraint(precedence);
+
+ }
+
+ }
+ }
+
+ }
+
+
+
+ //Creating the disjunctive constrains(NO tasks on the same machine can overlap)
+ //These constraints are stored in Sequence Variables - a separate sequence variable to be defined for each sequence constraint. So, in our model, no. of sequence variables = No. of Machines.
+
+ std::vector sequences;
+
+ for(int i=0;iMakeSequenceVar());
+
+ }
+
+
+ //Creating a vector of End-time expressions(and casting them into Interval Variables) for the various jobs( only the logically last tasks in each job are needed to generate this expression(to minimize) as the various tasks within the same job are already constrained by precendence.
+ //This vector is then fed to the solver
+
+ std::vector ends;
+
+ for(int i=0; iEndExpr()->Var());
+
+ }
+ else //in this case, we cannot be sure which will be last job in the job. So, we simply add all the potential tasks(those with 'end_before' values equal to '-1') to the 'ends' vector. Later on, the solver will pick the one with the latest end-time among these to minimize the same, for that particular solution
+ {
+
+ for(int j=0;jname());
+
+ std::string token;
+
+ std::getline(ss,token, ';');
+
+ int ind = std::stoi(token);
+
+ if( tasks[ind][4]==-1)
+ ends.push_back(task->EndExpr()->Var());
+
+ }
+
+
+
+ }
+
+ }
+
+
+
+ //Setting the objective for the solver
+
+ IntVar* const objective_var = solver.MakeMax(ends)->Var(); //Basically, we single out the Maximum of all the end times for the jobs, for each solution - this is actually equal to the makespan for that solution and then feed THIS as the objective variable to be minimized across all the solutions.
+
+ OptimizeVar* const objective_monitor = solver.MakeMinimize(objective_var, 1);
+
+
+ //Creating the Decision builder. Two decision builders, one to rank the tasks and one to minimize the objective variable, will be created. Then, one Min decion builder will be made to "compose" the decision builder tree, over these 2 decision builders
+
+ DecisionBuilder* const sequence_phase = solver.MakePhase(sequences, Solver::SEQUENCE_DEFAULT);
+
+ DecisionBuilder* const obj_phase = solver.MakePhase(objective_var, Solver::CHOOSE_FIRST_UNBOUND, Solver::ASSIGN_MIN_VALUE);
+
+ // The main decision builder (ranks all tasks, then fixes the objective_variable)
+
+ DecisionBuilder* const main_phase = solver.Compose( sequence_phase, obj_phase);
+
+
+
+
+ //Setting the time limit
+
+ SearchLimit* limit = nullptr;
+
+ limit = solver.MakeTimeLimit(time_limit);
+
+
+
+
+ //Defining the solution collectors
+
+ SolutionCollector* const collector = solver.MakeLastSolutionCollector();
+
+ collector->Add(sequences);
+
+ collector->AddObjective(objective_var);
+
+
+
+ //adding the start and end times for each task( machine-wise) to the solution collector
+
+ for(int i=0; isize();
+
+ for(int j=0; jInterval(j);
+
+ collector->Add(ss->StartExpr()->Var());
+ collector->Add(ss->EndExpr()->Var());
+
+ }
+
+ }
+
+
+
+ //Solving and returning values
+
+
+ //the solve() function returns true if a solution is obtained. It returns false if our model times out before we obtain a soluion.
+
+ if(solver.Solve(main_phase, objective_monitor, limit, collector))
+ {
+ //solution found
+
+ int status = 0 ; //output #3
+
+ int makespan = collector->objective_value(0);
+
+ int **schedule = (int **) malloc(sizeof(int*)*num_tasks);
+
+ sciprint("Optimal Solution Found!\n");
+
+ sciprint("Optimal Makespan : %d\n", makespan);
+
+
+
+ for(int i=0; iname().c_str());
+ sciprint(":\t");
+
+ std::vector sequence = collector ->ForwardSequence(0,seq);
+
+
+ for(int j=0; jInterval(sequence[j]); //the integral representation of 'temp->name()' will give us the index of the task in the respective job(ie. if a job has 4 tasks, indexing for it will go from 0 to 3)
+
+ std::istringstream ss(temp->name());
+
+ std::string token;
+
+ std::getline(ss,token,';');
+
+
+ int ind = std::stoi(token);
+
+ schedule[ind][3]= collector->Value(0, temp->StartExpr()->Var());
+ schedule[ind][4]= collector->Value(0, temp->EndExpr()->Var());
+
+
+ std::getline(ss,token,';');
+ sciprint("Job- %d, ",std::stoi(token) +1);
+
+ std::getline(ss,token,';');
+ sciprint("Task- %d",std::stoi(token) +1);
+
+ sciprint("[%d, %d]\t",schedule[ind][3],schedule[ind][4]);
+
+
+ }
+
+ IntervalVar* const temp = seq->Interval(sequence.back());
+
+
+ std::istringstream ss (temp->name());
+
+ std::string token;
+
+ std::getline(ss,token, ';');
+
+ int ind = std::stoi(token);
+
+ schedule[ind][3] = collector->Value(0, temp->StartExpr()->Var());
+ schedule[ind][4] = collector->Value(0, temp->EndExpr()->Var());
+
+ std::getline(ss, token, ';');
+ sciprint("Job- %d, ",std::stoi(token) +1);
+
+ std::getline(ss, token, ';');
+ sciprint("Task- %d",std::stoi(token) +1);
+
+
+ sciprint("[%d, %d]\n",schedule[ind][3],schedule[ind][4]);
+
+ }
+
+
+ //converting 'schedule' to a linear array (column major)
+
+ int *scischedule = (int *)malloc(sizeof(int)*num_tasks*5);
+
+ for(int i=0;i
+ #include
+ #include
+ #include
+ #include
+
+ int sci_linear_sum_assignment(const char* fname, unsigned long fname_len);
+}
+
+#include "sci_iofunc.hpp"
+
+using namespace operations_research;
+
+int sci_linear_sum_assignment(const char* fname, unsigned long fname_len)
+{
+ CheckInputArgument(pvApiCtx, 3, 3);
+ CheckOutputArgument(pvApiCtx, 2, 3);
+
+ // Input Args
+ int kNumLeftNodes = 0;
+ int kNumRightNodes = 0;
+ long long* kCost = NULL;
+
+ // Output Args
+ long long OptimalCost = 0;
+ BOOL* AssignmentMatrix = NULL;
+ int Status = 0;
+
+ // Input from Scilab
+ if(getInt32FromScilab(1, &kNumLeftNodes))
+ {
+ return 1;
+ }
+ if(getInt32FromScilab(2, &kNumRightNodes))
+ {
+ return 1;
+ }
+ if(getFixedSizeInt64MatrixFromScilab(3, kNumLeftNodes, kNumRightNodes, &kCost))
+ {
+ return 1;
+ }
+
+ // Solve
+ ForwardStarGraph graph(kNumLeftNodes + kNumRightNodes, kNumLeftNodes * kNumRightNodes);
+ LinearSumAssignment obj(graph, kNumLeftNodes);
+ for (NodeIndex leftnode = 0; leftnode < kNumLeftNodes; ++leftnode)
+ {
+ for (NodeIndex rightnode = 0; rightnode < kNumRightNodes; ++rightnode)
+ {
+ ArcIndex arc = graph.AddArc(leftnode, kNumLeftNodes + rightnode);
+ // sciprint("Cost: %ld\n", kCost[rightnode * kNumLeftNodes + leftnode]);
+ // obj.SetArcCost(arc, kCost[leftnode * kNumRightNodes + rightnode]);
+ obj.SetArcCost(arc, kCost[rightnode * kNumLeftNodes + leftnode]);
+ }
+ }
+ Status = (int)(obj.ComputeAssignment());
+
+ // Format Solution
+ OptimalCost = (long long)obj.GetCost();
+ AssignmentMatrix = (BOOL*)malloc(sizeof(BOOL) * kNumLeftNodes * kNumRightNodes);
+ for (int leftnode = 0; leftnode < kNumLeftNodes; ++leftnode)
+ {
+ for (int rightnode = 0; rightnode < kNumRightNodes; ++rightnode)
+ {
+ // AssignmentMatrix[leftnode * kNumRightNodes + rightnode]
+ AssignmentMatrix[rightnode * kNumLeftNodes + leftnode] = \
+ (kNumLeftNodes + rightnode == (int)(obj.GetMate(leftnode))) ? TRUE : FALSE;
+ }
+ }
+
+ // Output
+ if (returnInt64ToScilab(1, OptimalCost))
+ {
+ return 1;
+ }
+ if (returnBooleanMatrixToScilab(2, kNumLeftNodes, kNumRightNodes, AssignmentMatrix))
+ {
+ return 1;
+ }
+ if (returnInt32ToScilab(3, Status))
+ {
+ return 1;
+ }
+
+ // Cleanup
+ free(kCost);
+ free(AssignmentMatrix);
+
+ return 0;
+}
\ No newline at end of file
diff --git a/sci_gateway/cpp/sci_max_flow.cpp b/sci_gateway/cpp/sci_max_flow.cpp
new file mode 100755
index 0000000..bc324f6
--- /dev/null
+++ b/sci_gateway/cpp/sci_max_flow.cpp
@@ -0,0 +1,345 @@
+#include "ortools/graph/max_flow.h"
+extern "C" {
+#include
+#include
+#include
+#include
+#include
+
+using namespace operations_research;
+
+int sci_max_flow(char *fname) //error check to check if values exceed 32 bit ints, before passing ????
+{
+ SciErr scierror;
+
+ int iType1=0;
+ int iType2=0;
+ int iType3=0;
+ int iType4=0;
+
+ int m1=0,n1=0,m2=0,n2=0,m3=0,n3=0,m4=0,n4=0;
+
+ double *pdVarOne=NULL,*pdVarTwo=NULL,*pdVarThree=NULL,*pdVarFour=NULL;
+ int *piAddressVarOne=NULL,*piAddressVarTwo=NULL,*piAddressVarThree=NULL,*piAddressVarFour=NULL;
+
+
+ int *pdblReal1; //actually FlowQuantity(enum value for int64); int used owing to no 64-bit support in scilab yet
+ int *pdblReal2;
+
+ //CheckRhs(4,4);
+ //CheckLhs(0,2);
+
+ CheckInputArgument(pvApiCtx,4,4);
+ CheckOutputArgument(pvApiCtx,3,3);
+
+ //Getting Addresses of the input matrices
+
+ scierror=getVarAddressFromPosition(pvApiCtx,1,&piAddressVarOne);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,2,&piAddressVarTwo);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,3,&piAddressVarThree);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,4,&piAddressVarFour);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+ //Getting the input types and checking if they are matrices
+
+ scierror=getVarType(pvApiCtx,piAddressVarOne,&iType1);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+
+ }
+
+ if(iType1!=sci_matrix)
+ {
+
+ Scierror(999,"%s : Wrong input argument type for argument #%d. Try Again!\n ",fname,1);
+
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVarTwo,&iType2);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ if(iType2!=sci_matrix)
+ {
+ Scierror(999,"%s : Wrong input argument type for argument #%d. Try Again!\n",fname,2);
+
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVarThree,&iType3);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+
+ }
+
+ if(iType1!=sci_matrix)
+ {
+
+ Scierror(999,"%s : Wrong input argument type for argument #%d. Try Again!\n ",fname,3);
+
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVarFour,&iType4);
+
+ if(scierror.iErr)
+ {
+ Scierror(999,"%s : Wrong input argument type for argument #%d. Try Again!\n",fname,4);
+ return 0;
+ }
+
+
+
+ //Getting the actual matrices
+
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVarOne,&m1,&n1,&pdVarOne);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVarTwo,&m2,&n2,&pdVarTwo);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVarThree,&m3,&n3,&pdVarThree);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVarFour,&m4,&n4,&pdVarFour);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+
+ if((m1!=1)||(m2!=1)||(m3!=1)||(n1!=n2)||(n1!=n3)) //The three matrices need to be vectors(only one row) and must have the same size
+ {
+ Scierror(787,"Invalid Input(s)\n");
+ return 0;
+ }
+
+
+
+
+ //pdVarOne ->array of start/tail nodes
+ //pdVarTwo ->array of end/head nodes
+ //pdVarThree ->array of capacities(corresponding to the arc index
+ //pdVarFour ->array(1x2) containing the indices of the source and destination nodes
+
+
+
+
+ SimpleMaxFlow smf;
+ SimpleMaxFlow::Status stat;
+ ArcIndex arcIndex=0;
+
+ for(int i=0;i=smf.NumNodes())
+ {
+ Scierror(788,"Invalid Source Index!\n");
+ return 0;
+ }
+
+ if(pdVarFour[1]>=smf.NumNodes())
+ {
+ Scierror(788,"Invalid Destination Index!\n");
+ return 0;
+ }*/
+
+
+ int eflag=0,sflag=0;
+
+ for(int i=0;(istores the max flow(1x1 matrix)
+ //pdblReal2 ->stores the flow for each arc in the optimal solution
+
+
+ //scierror=allocMatrixOfDouble(pvApiCtx,nbInputArgument(pvApiCtx)+1,1,1,&pdblReal1);
+ //scierror=allocMatrixOfDouble(pvApiCtx,nbInputArgument(pvApiCtx)+2,1,n1,&pdblReal2);
+
+ pdblReal1=(int *)malloc(sizeof(int));
+
+ *pdblReal1=smf.OptimalFlow();
+
+ scierror=createMatrixOfInteger32(pvApiCtx,nbInputArgument(pvApiCtx)+1,1,1,pdblReal1);
+
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+
+ pdblReal2=(int *)malloc(sizeof(int)*smf.NumArcs());
+
+ for(int i=0;i%d\t%d\t%d\n",smf.Tail(i),smf.Head(i),smf.Flow(i),smf.Capacity(i)); //sciprint("%d->%d\t%lld\t%lld\n",smf.Tail(i),smf.Head(i),smf.Flow(i),smf.Capacity(i));
+
+
+ //LhsVar(1)=5;
+ //LhsVar(2)=6;
+
+ AssignOutputVariable(pvApiCtx,1)=nbInputArgument(pvApiCtx)+1;
+ AssignOutputVariable(pvApiCtx,2)=nbInputArgument(pvApiCtx)+2;
+ AssignOutputVariable(pvApiCtx,3)=nbInputArgument(pvApiCtx)+3;
+
+
+ //ReturnArguments(pvApiCtx);
+
+
+
+ return 0;
+
+
+
+}
+}
+
+/*using namespace operations_research;
+int main()
+{
+ int start_nodes[] = {0, 0, 0, 1, 1, 2, 2, 3, 3};
+ int end_nodes[] = {1, 2, 3, 2, 4, 3, 4, 2, 4};
+ int capacities []= {20, 30, 10, 40, 30, 10, 20, 5, 20};
+
+ SimpleMaxFlow smf;
+ SimpleMaxFlow::Status stat;
+ ArcIndex arcIndex=0;
+
+ int n=9;
+
+ for(int i=0;i%d\t%d\t%d\n",smf.Tail(i),smf.Head(i),smf.Flow(i),smf.Capacity(i));
+
+ return 0;
+
+
+}*/
+
+
+
\ No newline at end of file
diff --git a/sci_gateway/cpp/sci_min_cost_flow.cpp b/sci_gateway/cpp/sci_min_cost_flow.cpp
new file mode 100644
index 0000000..7981869
--- /dev/null
+++ b/sci_gateway/cpp/sci_min_cost_flow.cpp
@@ -0,0 +1,148 @@
+/*
+ Sample:
+
+ Source: Ex.2: http://www.yourarticlelibrary.com/ergonomics/operation-research/checking-for-optimality-transportation-problem/34743/
+
+ // Doesn't Work (Unbalanced)
+ a = 4;
+ b = 4;
+ c = [4, 6, 8, 13; 13, 11, 10, 8; 14, 4, 10, 13; 9, 11, 13, 8];
+ d = [200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200];
+ e = [50, 70, 30, 50];
+ f = [25, 35, 105, 20];
+ [x, y] = solve_mincostflow(a, b, c, d, e, f);
+
+ // Works (Balanced)
+ a = 4;
+ b = 5;
+ c = [4, 6, 8, 13, 0; 13, 11, 10, 8, 0; 14, 4, 10, 13, 0; 9, 11, 13, 8, 0];
+ d = [200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200];
+ e = [50, 70, 30, 50];
+ f = [25, 35, 105, 20, 15];
+ [x, y] = solve_mincostflow(a, b, c, d, e, f);
+*/
+#include "ortools/graph/min_cost_flow.h"
+
+extern "C"{
+ #include
+ #include
+ #include
+ #include
+ #include
+
+ int sci_min_cost_flow(const char* fname, unsigned long fname_len);
+}
+
+#include "sci_iofunc.hpp"
+
+using namespace operations_research;
+
+int sci_min_cost_flow(const char* fname, unsigned long fname_len)
+{
+ CheckInputArgument(pvApiCtx, 6, 6);
+ CheckOutputArgument(pvApiCtx, 2, 3);
+
+ // Input Args
+ int kNumSources = 0;
+ int kNumTargets = 0;
+ long long* kCost = NULL;
+ long long* kCapacity = NULL;
+ long long* kSupply = NULL;
+ long long* kDemand = NULL;
+
+ // Output Args
+ long long OptimalCost = 0;
+ long long* FlowMatrix = NULL;
+ int Status = 0;
+
+ // Input from Scilab
+ if(getInt32FromScilab(1, &kNumSources))
+ {
+ return 1;
+ }
+ if(getInt32FromScilab(2, &kNumTargets))
+ {
+ return 1;
+ }
+ if(getFixedSizeInt64MatrixFromScilab(3, kNumSources, kNumTargets, &kCost))
+ {
+ return 1;
+ }
+ if(getFixedSizeInt64MatrixFromScilab(4, kNumSources, kNumTargets, &kCapacity))
+ {
+ return 1;
+ }
+ if(getFixedSizeInt64MatrixFromScilab(5, 1, kNumSources, &kSupply))
+ {
+ return 1;
+ }
+ if(getFixedSizeInt64MatrixFromScilab(6, 1, kNumTargets, &kDemand))
+ {
+ return 1;
+ }
+
+ // Solve
+ StarGraph graph(kNumSources + kNumTargets, kNumSources * kNumTargets);
+ MinCostFlow obj(&graph);
+ for (NodeIndex source = 0; source < kNumSources; ++source)
+ {
+ for (NodeIndex target = 0; target < kNumTargets; ++target)
+ {
+ ArcIndex arc = graph.AddArc(source, kNumSources + target);
+ // sciprint("Cost: %ld\n", kCost[target * kNumSources + source]);
+ // obj.SetArcUnitCost(arc, *kCost[source * kNumTargets + target]);
+ obj.SetArcUnitCost(arc, (CostValue)kCost[target * kNumSources + source]);
+ // sciprint("Capacity: %ld\n", kCapacity[target * kNumSources + source]);
+ // obj.SetArcCapacity(arc, *kCapacity[source * kNumTargets + target]);
+ obj.SetArcCapacity(arc, (FlowQuantity)kCapacity[target * kNumSources + source]);
+ }
+ }
+ for (NodeIndex source = 0; source < kNumSources; ++source)
+ {
+ // sciprint("Supply: %ld\n", kSupply[source]);
+ obj.SetNodeSupply(source, (FlowQuantity)(1 * kSupply[source]));
+ }
+ for (NodeIndex target = 0; target < kNumTargets; ++target)
+ {
+ // sciprint("Demand: %ld\n", kDemand[target]);
+ obj.SetNodeSupply(kNumSources + target, (FlowQuantity)(-1 * kDemand[target]));
+ }
+ obj.Solve();
+
+ // Format Solution
+ OptimalCost = (long long)obj.GetOptimalCost();
+ FlowMatrix = (long long*)malloc(sizeof(long long) * kNumSources * kNumTargets);
+ for (int source = 0; source < kNumSources; ++source)
+ {
+ for (int target = 0; target < kNumTargets; ++target)
+ {
+ int arc = source * kNumTargets + target;
+ // FlowMatrix[source * kNumTargets + target] = (long long)(obj.Flow(arc));
+ FlowMatrix[target * kNumSources + source] = (long long)(obj.Flow(arc));
+ }
+ }
+ Status = (int)(obj.status());
+
+ // Output
+ if (returnInt64ToScilab(1, OptimalCost))
+ {
+ return 1;
+ }
+ if (returnInt64MatrixToScilab(2, kNumSources, kNumTargets, FlowMatrix))
+ {
+ return 1;
+ }
+ if (returnInt32ToScilab(3, Status))
+ {
+ return 1;
+ }
+
+ // Cleanup
+ free(kCost);
+ free(kCapacity);
+ free(kSupply);
+ free(kDemand);
+ free(FlowMatrix);
+
+ return 0;
+}
\ No newline at end of file
diff --git a/sci_gateway/cpp/sci_qcqpglob.cpp b/sci_gateway/cpp/sci_qcqpglob.cpp
new file mode 100644
index 0000000..0b13ded
--- /dev/null
+++ b/sci_gateway/cpp/sci_qcqpglob.cpp
@@ -0,0 +1,519 @@
+// Glob QCQP Minotaur Scilab Interface Gateway
+//
+// qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_bar, maxcputime);
+//
+// n -> no. of variables
+// m -> no. of constraints
+// h_obj -> n x n matrix
+// f_obj -> n x 1 matrix or n-column-vector
+// c_obj -> 1 x 1 constant
+// h_con -> m sized list of n x n matrices or m x n x n 3D-matrix
+// f_con -> m sized list of n-column-vector or m x n matrix
+// lb_con -> m x 1 matrix or m-column-vector
+// ub_con -> m x 1 matrix or m-column-vector
+// lb_var -> n x 1 matrix or n-column-vector
+// ub_var -> n x 1 matrix or n-column-vector
+// maxcputime -> timeout in seconds for solving
+//
+//
+#include
+
+#include "MinotaurConfig.h"
+#include "BranchAndBound.h"
+#include "Engine.h"
+#include "EngineFactory.h"
+#include "Environment.h"
+#include "LexicoBrancher.h"
+#include "LinearHandler.h"
+#include "Logger.h"
+#include "LPEngine.h"
+#include "MaxVioBrancher.h"
+#include "NodeIncRelaxer.h"
+#include "NLPEngine.h"
+#include "NLPMultiStart.h"
+#include "NlPresHandler.h"
+#include "Objective.h"
+#include "Option.h"
+#include "PCBProcessor.h"
+#include "Presolver.h"
+#include "ProblemSize.h"
+#include "Problem.h"
+#include "Relaxation.h"
+#include "ReliabilityBrancher.h"
+#include "SimpleTransformer.h"
+#include "Solution.h"
+#include "Timer.h"
+#include "Transformer.h"
+#include "TreeManager.h"
+#include "CGraph.h"
+#include "CNode.h"
+#include "Variable.h"
+#include "Function.h"
+#include "LinearFunction.h"
+#include "QuadraticFunction.h"
+
+extern "C"{
+ #include
+ #include
+ #include
+ #include
+ #include
+
+ int sci_qcqpglob(const char* fname, unsigned long fname_len); // Main
+}
+
+#include "sci_iofunc.hpp"
+#include "misc.hpp"
+
+using namespace Minotaur;
+
+// Declarations
+int Transform(EnvPtr env, ProblemPtr p_orig, ProblemPtr &p_new, HandlerVector &handlers);
+PresolverPtr CreatePresolver(ProblemPtr p, EnvPtr env, HandlerVector &handlers, size_t numVars = 0);
+BranchAndBound* CreateBranchAndBound(EnvPtr env, ProblemPtr p, EnginePtr e, HandlerVector &handlers);
+double* GetSolution(PresolverPtr pres, SolutionPtr sol, int n);
+void GLOB_addObjective(ProblemPtr& p, double* H, double* f, double c);
+void GLOB_addConstraint(ProblemPtr& p, double* H, double* f, double lb, double ub);
+
+// Definitions
+int Transform(EnvPtr env, ProblemPtr p_orig, ProblemPtr &p_new, HandlerVector &handlers)
+{
+ // Init Vars
+ SimpTranPtr trans = SimpTranPtr(); // NULL
+ int status = 0;
+
+ // Process
+ handlers.clear();
+ trans = (SimpTranPtr) new SimpleTransformer(env, p_orig);
+ trans->reformulate(p_new, handlers, status);
+
+ return status;
+}
+
+PresolverPtr CreatePresolver(ProblemPtr p, EnvPtr env, HandlerVector &handlers, size_t numVars = 0)
+{
+ // Init Vars
+ PresolverPtr pres = PresolverPtr(); // NULL
+ LinearHandlerPtr lhandler = LinearHandlerPtr(); // NULL
+ NlPresHandlerPtr nlhand = NlPresHandlerPtr(); // NULL
+
+ // Process
+ p->calculateSize();
+ if (env->getOptions()->findBool("presolve")->getValue() == true)
+ {
+ if (env->getOptions()->findBool("lin_presolve")->getValue() == true)
+ {
+ lhandler = (LinearHandlerPtr) new LinearHandler(env, p);
+ handlers.push_back(lhandler);
+
+ if (p->isQP() ||
+ p->isQuadratic() ||
+ p->isLinear() ||
+ env->getOptions()->findBool("use_native_cgraph")->getValue() == true)
+ {
+ lhandler->setPreOptPurgeVars(true);
+ lhandler->setPreOptPurgeCons(true);
+ lhandler->setPreOptCoeffImp(true);
+ }
+ else
+ {
+ lhandler->setPreOptPurgeVars(false);
+ lhandler->setPreOptPurgeCons(false);
+ lhandler->setPreOptCoeffImp(false);
+ }
+
+ if (numVars > 0)
+ {
+ lhandler->setPreOptDualFix(false);
+ }
+ else
+ {
+ lhandler->setPreOptDualFix(true);
+ }
+ }
+
+ if (env->getOptions()->findBool("nl_presolve")->getValue() == true &&
+ !p->isLinear() &&
+ env->getOptions()->findBool("use_native_cgraph")->getValue() == true)
+ {
+ nlhand = (NlPresHandlerPtr) new NlPresHandler(env, p);
+ handlers.push_back(nlhand);
+ }
+ }
+ pres = (PresolverPtr) new Presolver(p, env, handlers);
+
+ return pres;
+}
+
+BranchAndBound* CreateBranchAndBound(EnvPtr env, ProblemPtr p, EnginePtr e, HandlerVector &handlers)
+{
+ // Init Vars
+ BranchAndBound* bab = new BranchAndBound(env, p);
+ PCBProcessorPtr nproc = PCBProcessorPtr(); // NULL
+ NodeIncRelaxerPtr nr = NodeIncRelaxerPtr(); // NULL
+ RelaxationPtr rel = RelaxationPtr(); // NULL
+ BrancherPtr br = BrancherPtr(); // NULL
+
+ if (env->getOptions()->findString("brancher")->getValue() == "rel")
+ {
+ UInt t;
+ ReliabilityBrancherPtr rel_br = (ReliabilityBrancherPtr) new ReliabilityBrancher(env, handlers);
+ rel_br->setEngine(e);
+ t = (p->getSize()->ints + p->getSize()->bins)/10;
+ t = std::max(t, (UInt) 2);
+ t = std::min(t, (UInt) 4);
+ rel_br->setThresh(t);
+ t = (UInt) p->getSize()->ints + p->getSize()->bins/20+2;
+ t = std::min(t, (UInt) 10);
+ rel_br->setMaxDepth(t);
+ br = rel_br;
+ }
+ else if (env->getOptions()->findString("brancher")->getValue() == "maxvio")
+ {
+ MaxVioBrancherPtr mbr = (MaxVioBrancherPtr) new MaxVioBrancher(env, handlers);
+ br = mbr;
+ }
+ else if (env->getOptions()->findString("brancher")->getValue() == "lex")
+ {
+ LexicoBrancherPtr lbr = (LexicoBrancherPtr) new LexicoBrancher(env, handlers);
+ br = lbr;
+ }
+
+ nproc = (PCBProcessorPtr) new PCBProcessor(env, e, handlers);
+ nproc->setBrancher(br);
+ bab->setNodeProcessor(nproc);
+
+ nr = (NodeIncRelaxerPtr) new NodeIncRelaxer(env, handlers);
+ nr->setProblem(p);
+ nr->setRelaxation(rel);
+ nr->setEngine(e);
+ bab->setNodeRelaxer(nr);
+ bab->shouldCreateRoot(true);
+
+ if (env->getOptions()->findBool("msheur")->getValue() == true &&
+ (p->getSize()->bins == 0 && p->getSize()->ints == 0))
+ {
+ EngineFactory* efac = new EngineFactory(env);
+ NLPEnginePtr nlp_e = efac->getNLPEngine();
+ p->setNativeDer();
+ NLPMSPtr ms_heur = (NLPMSPtr) new NLPMultiStart(env, p, nlp_e);
+ bab->addPreRootHeur(ms_heur);
+ delete efac;
+ }
+
+ return bab;
+}
+
+double* GetSolution(PresolverPtr pres, SolutionPtr sol, int n)
+{
+ const double* exSoln = NULL;
+ double* ret = (double*)malloc(sizeof(double) * n);;
+ UInt i;
+
+ if (sol != SolutionPtr())
+ {
+ sol = pres->getPostSol(sol);
+ if (sol != SolutionPtr())
+ exSoln = sol->getPrimal();
+ }
+
+ if(exSoln != NULL)
+ {
+ for(i = 0; i < n; ++i)
+ ret[i] = exSoln[i];
+ }
+ else // Fail Safe
+ {
+ for(i = 0; i < n; ++i)
+ ret[i] = 0.0;
+ }
+
+ return ret;
+}
+
+void GLOB_addObjective(ProblemPtr& p, double* H, double* f, double c)
+{
+ VariableConstIterator vbeg = p->varsBegin();
+ VariableConstIterator vend = p->varsEnd();
+ CGraphPtr cg = CGraphPtr(); // NULL
+ FunctionPtr fun = FunctionPtr(); // NULL
+
+ QuadraticFunctionPtr qf = (QuadraticFunctionPtr) new QuadraticFunction(H, vbeg, vend);
+ LinearFunctionPtr lf = (LinearFunctionPtr) new LinearFunction(f, vbeg, vend, 1e-9);
+
+ if(qf->getNumTerms() + lf->getNumTerms() == 0)
+ {
+ // Not an Objective!
+ return;
+ }
+
+ if(qf->getNumTerms() == 0)
+ {
+ fun = (FunctionPtr) new Function(lf);
+ }
+ else
+ {
+ cg = (CGraphPtr) new CGraph(qf, lf);
+ cg->finalize();
+ fun = (FunctionPtr) new Function(cg);
+ }
+
+ p->newObjective(fun, c, Minimize);
+}
+
+void GLOB_addConstraint(ProblemPtr& p, double* H, double* f, double lb, double ub)
+{
+ VariableConstIterator vbeg = p->varsBegin();
+ VariableConstIterator vend = p->varsEnd();
+ CGraphPtr cg = CGraphPtr(); // NULL
+ FunctionPtr fun = FunctionPtr(); // NULL
+
+ QuadraticFunctionPtr qf = (QuadraticFunctionPtr) new QuadraticFunction(H, vbeg, vend);
+ LinearFunctionPtr lf = (LinearFunctionPtr) new LinearFunction(f, vbeg, vend, 1e-9);
+
+ if(qf->getNumTerms() + lf->getNumTerms() == 0)
+ {
+ // Not a Constraint!
+ return;
+ }
+
+ if(qf->getNumTerms() == 0)
+ {
+ fun = (FunctionPtr) new Function(lf);
+ }
+ else
+ {
+ cg = (CGraphPtr) new CGraph(qf, lf);
+ cg->finalize();
+ fun = (FunctionPtr) new Function(cg);
+ }
+
+ p->newConstraint(fun, lb, ub);
+}
+
+int sci_qcqpglob(const char* fname, unsigned long fname_len)
+{
+ //////////////////
+ // Vars Declare //
+ //////////////////
+
+ // General Vars
+ UInt i, j;
+
+ // Solver Vars
+ EnvPtr env = EnvPtr(); // NULL
+ HandlerVector handlers;
+ int err = 0;
+ ProblemPtr p_orig = ProblemPtr(); // NULL
+ ProblemPtr p_new = ProblemPtr(); // NULL
+ EngineFactory* efac = NULL;
+ LPEnginePtr lp_e = LPEnginePtr(); // NULL
+ BranchAndBound* bab = NULL;
+ SimpTranPtr trans = SimpTranPtr(); // NULL
+ PresolverPtr pres_orig = PresolverPtr(); // NULL
+ PresolverPtr pres_new = PresolverPtr(); // NULL
+ VarVector orig_v;
+
+ // Input Vars
+ int n = 0;
+ int m = 0;
+ double* h_obj = NULL;
+ double* f_obj = NULL;
+ double c_obj = 0;
+ double** h_con = NULL;
+ double** f_con = NULL;
+ double* lb_con = NULL;
+ double* ub_con = NULL;
+ double* lb_var = NULL;
+ double* ub_var = NULL;
+ double maxcputime = 0;
+
+ // Output Vars
+ double* kSolnVector = NULL;
+ double kSoln = 0;
+ int status = 0;
+
+ // Extra Vars
+ double* h_obj_rowm = NULL; // Row Major
+ double** h_con_rowm = NULL; // Row Major
+
+ //////////////////////
+ // Scilab API Begin //
+ //////////////////////
+
+ // Check Arguments
+ CheckInputArgument(pvApiCtx, 12, 12);
+ CheckOutputArgument(pvApiCtx, 3, 3);
+
+ // Input
+ if(getInt32FromScilab(1, &n))
+ {
+ return 1;
+ }
+ if(getInt32FromScilab(2, &m))
+ {
+ return 1;
+ }
+ if(getFixedSizeDoubleMatrixFromScilab(3, n, n, &h_obj))
+ {
+ return 1;
+ }
+ if(getFixedSizeDoubleMatrixFromScilab(4, 1, n, &f_obj))
+ {
+ return 1;
+ }
+ if(getDoubleFromScilab(5, &c_obj))
+ {
+ return 1;
+ }
+ if(getFixedSizeListOfFixedSizeDoubleMatrixFromScilab(6, n, n, &h_con, m))
+ {
+ return 1;
+ }
+ if(getFixedSizeListOfFixedSizeDoubleMatrixFromScilab(7, 1, n, &f_con, m))
+ {
+ return 1;
+ }
+ if(getFixedSizeDoubleMatrixFromScilab(8, m ? 1 : 0, m, &lb_con))
+ {
+ return 1;
+ }
+ if(getFixedSizeDoubleMatrixFromScilab(9, m ? 1 : 0, m, &ub_con))
+ {
+ return 1;
+ }
+ if(getFixedSizeDoubleMatrixFromScilab(10, 1, n, &lb_var))
+ {
+ return 1;
+ }
+ if(getFixedSizeDoubleMatrixFromScilab(11, 1, n, &ub_var))
+ {
+ return 1;
+ }
+ if(getDoubleFromScilab(12, &maxcputime))
+ {
+ return 1;
+ }
+
+ // Convert Column Major to Row Major
+ h_obj_rowm = ArrConvertMajor(h_obj, n, n);
+ h_con_rowm = (double**)malloc(sizeof(double**) * m);
+ for(i = 0; i < m; ++i)
+ h_con_rowm[i] = ArrConvertMajor(h_con[i], n, n);
+
+ ////////////////////////////////
+ // Setup Minotaur Environment //
+ ////////////////////////////////
+
+ // Initialize Environment
+ env = (EnvPtr) new Environment();
+
+ // Set Fixed Options
+ env->getOptions()->findBool("use_native_cgraph")->setValue(true);
+ env->getOptions()->findBool("presolve")->setValue(true);
+ env->getOptions()->findBool("nl_presolve")->setValue(true);
+ env->getOptions()->findBool("lin_presolve")->setValue(true);
+ env->getOptions()->findString("brancher")->setValue("maxvio");
+ env->getOptions()->findBool("msheur")->setValue(true);
+ env->getOptions()->findInt("pres_freq")->setValue(1);
+ env->getOptions()->findString("lp_engine")->setValue("OsiClp");
+ env->getOptions()->findString("nlp_engine")->setValue("IPOPT");
+
+ // Set User-defined Options
+ env->getOptions()->findDouble("bnb_time_limit")->setValue(maxcputime);
+
+ //////////////////
+ // Read Problem //
+ //////////////////
+
+ // Declare Problem Pointer
+ p_orig = (ProblemPtr) new Problem();
+
+ // Add Variables
+ for(i = 0; i < n; ++i)
+ {
+ // Library Limits. Need Warning?
+ orig_v.push_back(p_orig->newVariable(std::max(lb_var[i], -1e6), std::min(ub_var[i], 1e6), Integer));
+ }
+
+ // Add Objective
+ GLOB_addObjective(p_orig, h_obj_rowm, f_obj, c_obj);
+
+ // Add Constraints
+ for(i = 0; i < m; ++i)
+ {
+ GLOB_addConstraint(p_orig, h_con_rowm[i], f_con[i], lb_con[i], ub_con[i]);
+ }
+
+ // Set Native Derivatives
+ p_orig->setNativeDer();
+
+ ///////////
+ // Solve //
+ ///////////
+
+ // Start timer
+ env->startTimer(err); assert(err==0);
+
+ // Presolve Original Problem
+ handlers.clear();
+ pres_orig = CreatePresolver(p_orig, env, handlers, orig_v.size());
+ if (env->getOptions()->findBool("presolve")->getValue() == true)
+ {
+ pres_orig->solve();
+ }
+ handlers.clear();
+
+ // Transform (KKT & Reformulate)
+ err = Transform(env, p_orig, p_new, handlers); assert(0==err);
+
+ // Presolve Transformed Problem
+ pres_new = (PresolverPtr) new Presolver(p_new, env, handlers);
+ pres_new->solve();
+
+ // Get LP Engine for Solving
+ efac = new EngineFactory(env);
+ lp_e = efac->getLPEngine();
+
+ // Create Branch and Bound Object
+ bab = CreateBranchAndBound(env, p_new, lp_e, handlers);
+
+ // Start Solving
+ bab->solve();
+
+ // Get Solution
+ status = bab->getStatus();
+ kSoln = bab->getUb();
+ kSolnVector = GetSolution(pres_orig, bab->getSolution(), n);
+ kSoln += c_obj; // Problem with Library?
+
+ // Clean
+ delete bab;
+ delete efac;
+
+ ////////////////////
+ // Scilab API End //
+ ////////////////////
+
+ // Output
+ if (returnDoubleToScilab(1, kSoln))
+ {
+ return 1;
+ }
+ if (returnDoubleMatrixToScilab(2, 1, n, kSolnVector))
+ {
+ return 1;
+ }
+ if (returnInt32ToScilab(3, status))
+ {
+ return 1;
+ }
+
+ // Cleanup
+ free(h_obj_rowm);
+ for(i = 0; i < m; ++i)
+ free(h_con_rowm[i]);
+ free(h_con_rowm);
+
+ return 0;
+}
\ No newline at end of file
diff --git a/sci_gateway/cpp/sci_tsp.cpp b/sci_gateway/cpp/sci_tsp.cpp
new file mode 100644
index 0000000..a4774f2
--- /dev/null
+++ b/sci_gateway/cpp/sci_tsp.cpp
@@ -0,0 +1,367 @@
+#include "ortools/base/callback.h"
+#include "ortools/base/commandlineflags.h"
+#include "ortools/base/commandlineflags.h"
+#include "ortools/base/integral_types.h"
+#include "ortools/base/join.h"
+#include "ortools/base/join.h"
+#include "ortools/constraint_solver/routing.h"
+#include "ortools/constraint_solver/routing_enums.pb.h"
+#include "ortools/constraint_solver/routing_flags.h"
+
+
+
+extern "C"{
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+using namespace operations_research;
+
+
+
+
+
+/*
+Naming suffixes(also, the respective order) for inputs :-
+1-> The adjacency matrix representing the graph(The cell values are the costs associated with the respective edge defined by (row index)->(column index) ) cost values>=0. Negative cost values simply mean 'no edge' i.e. no edge connects node 'i' to node 'j'(u-> row index; j-> column index)
+2-> The index of the start node i.e the node from which the travelling salesman starts his journey(and also where the journey is to end)
+3-> The time_limit for the solver(in milliseconds).
+*/
+
+
+/*
+Naming suffixes(also, the respective order) for outputs :-
+1-> The total path cost(for the optimal route) (integral)
+2-> The actual optimal path( as a [1xn] integral matrix(vector) where n is the number of tsp_nodes+1(as the starting node is included twice, once at the start and once at the end.
+3-> The OR-Tools solution status (enum defined in 'routing.h')
+*/
+
+
+double *tsp_piVar1=NULL,*tsp_piVar2=NULL,*tsp_piVar3=NULL;
+int tsp_nodes; // stores the number of tsp_nodes in the specified graph
+
+
+
+
+long long matrixIndex(RoutingModel::NodeIndex from, RoutingModel::NodeIndex to)
+{
+ return (to*tsp_nodes+from).value(); // As scilab stores matrices in Column-Major format
+}
+
+
+long long distance(RoutingModel::NodeIndex from, RoutingModel::NodeIndex to)
+{
+
+ return tsp_piVar1[matrixIndex(from,to)];
+
+
+}
+
+
+
+
+int sci_tsp(char *fname)
+{
+
+ SciErr scierror;
+
+ int iType1=0,iType2=0,iType3=0;
+
+ int *piAddressVar1=NULL,*piAddressVar2=NULL,*piAddressVar3=NULL;
+ int m1=0,n1=0,m2=0,n2=0,m3=0,n3=0;
+
+ int *piReal1=NULL,*piReal2=NULL,*piReal3=NULL;
+ int status;
+
+ int time_limit;
+
+
+ CheckInputArgument(pvApiCtx,3,3);
+ CheckOutputArgument(pvApiCtx,3,3);
+
+
+ //GETTING THE ADDRESSES OF THE INPUT MATRICES
+
+
+ //first input matrix(adjacency matrix)
+
+ scierror=getVarAddressFromPosition(pvApiCtx,1,&piAddressVar1);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+ //second input matrix([1x1] containing the index of the start node("depot"))
+ scierror=getVarAddressFromPosition(pvApiCtx,2,&piAddressVar2);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,3,&piAddressVar3);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+ //RETRIEVING AND CHECKING THE TYPES OF THE INPUTS
+
+ scierror=getVarType(pvApiCtx,piAddressVar1,&iType1);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+ scierror=getVarType(pvApiCtx,piAddressVar2,&iType2);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar3,&iType3);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ if(iType1!=sci_matrix||iType2!=sci_matrix||iType3!=sci_matrix)
+ {
+ if(iType1!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #1. Matrix Expected! \n");
+
+ if(iType2!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #2. Matric Expected! \n");
+
+ if(iType3!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #3. Matric Expected! \n");
+
+ return 0;
+ }
+
+
+
+ //GETTING THE ACTUAL INPUT MATRICES
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar1,&m1,&n1,&tsp_piVar1);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar2,&m2,&n2,&tsp_piVar2);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar3,&m3,&n3,&tsp_piVar3);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+ //the adjacency matrix has to be a square matrix. Checking for the same
+
+ if(m1!=n1)
+ {
+ Scierror(787,"Invalid/Erroneous Adjacency matrix size. Adjacency matrices need to be square matrices.\n");
+ return 0;
+ }
+
+
+
+ //Checking if the second input argument is a singular value(1x1 matrix)
+
+ if(m2!=1||n2!=1)
+ {
+ Scierror(789,"Wrong input #2! Required- A singlular value for the index of the start-node(the node where the salesman begins his journey) \n");
+ return 0;
+
+ }
+
+
+
+ //Checking if the 'start-node' index value is valid(existent in the adjacency matrix)
+
+ if(tsp_piVar2[0]>=m1)
+ {
+ Scierror(791,"Invalid input #2! The index value for the 'start-node' doesn't exist in the given graph(The tsp_nodes are indexed from '0' to 'n-1'(n->no. of tsp_nodes, say). (Start-node index) < n \n");
+ return 0;
+ }
+
+
+ if(m3!=0)
+ time_limit = tsp_piVar3[0];
+ else
+ time_limit = 1000;
+
+ tsp_nodes=m1; // no. of tsp_nodes in the graph
+
+
+
+ //Initializing the Routing Model for TSP(default parameters and the specified starting node)
+
+ RoutingModel routing(tsp_nodes,1,RoutingModel::NodeIndex(tsp_piVar2[0]));
+
+ RoutingSearchParameters parameters=BuildSearchParametersFromFlags();
+ parameters.set_first_solution_strategy(FirstSolutionStrategy::PATH_CHEAPEST_ARC);
+
+ routing.SetArcCostEvaluatorOfAllVehicles(NewPermanentCallback(distance));
+
+
+ parameters.set_time_limit_ms(time_limit);
+
+
+ //checking for proper initialization of the model
+
+ if((status=routing.status())!=0)
+ {
+ Scierror(801,"Error initializing the Routing model\n");
+
+ scierror=createMatrixOfInteger32(pvApiCtx,nbInputArgument(pvApiCtx)+1,0,0,piReal1);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=createMatrixOfInteger32(pvApiCtx,nbInputArgument(pvApiCtx)+2,0,0,piReal2);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=createMatrixOfInteger32(pvApiCtx,nbInputArgument(pvApiCtx)+3,1,1,&status);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ AssignOutputVariable(pvApiCtx,1)=nbInputArgument(pvApiCtx)+1;
+ AssignOutputVariable(pvApiCtx,2)=nbInputArgument(pvApiCtx)+2;
+ AssignOutputVariable(pvApiCtx,3)=nbInputArgument(pvApiCtx)+3;
+
+
+ return 0;
+
+
+
+ }
+
+ //Solving the model
+
+ const Assignment* solution=routing.SolveWithParameters(parameters);
+
+ status=routing.status();
+
+
+ if(solution==nullptr) // portends one of 3 situations viz. status(enum) values -> ROUTING_FAIL(no solution possible/found) , ROUTING_FAIL_TIMEOUT or ROUTING_INVALID(not possible in TSP as default parameters used for initialization)
+ {
+
+
+ //piReal1=(int *)malloc(0);
+
+
+ scierror=createMatrixOfInteger32(pvApiCtx,nbInputArgument(pvApiCtx)+1,0,0,piReal1);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=createMatrixOfInteger32(pvApiCtx,nbInputArgument(pvApiCtx)+2,0,0,piReal2);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=createMatrixOfInteger32(pvApiCtx,nbInputArgument(pvApiCtx)+3,1,1,&status);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ AssignOutputVariable(pvApiCtx,1)=nbInputArgument(pvApiCtx)+1;
+ AssignOutputVariable(pvApiCtx,2)=nbInputArgument(pvApiCtx)+2;
+ AssignOutputVariable(pvApiCtx,3)=nbInputArgument(pvApiCtx)+3;
+
+
+ return 0;
+
+ // pertinent errors and their messages will be handled by the macro based on the status value
+ }
+ else // solution found
+ {
+
+
+ piReal1=(int *)malloc(sizeof(int));
+ piReal2=(int *)malloc(sizeof(int)*(m1+1));
+
+ piReal1[0]=solution->ObjectiveValue();
+
+ int i=0;
+
+
+ for(int node=routing.Start(0);!routing.IsEnd(node);node=solution->Value(routing.NextVar(node)), i++)
+ piReal2[i]=routing.IndexToNode(node).value();
+
+ piReal2[i]=routing.IndexToNode(routing.End(0)).value();
+
+ scierror=createMatrixOfInteger32(pvApiCtx,nbInputArgument(pvApiCtx)+1,1,1,piReal1);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=createMatrixOfInteger32(pvApiCtx,nbInputArgument(pvApiCtx)+2,1,(m1+1),piReal2);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=createMatrixOfInteger32(pvApiCtx,nbInputArgument(pvApiCtx)+3,1,1,&status);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+ AssignOutputVariable(pvApiCtx,1)=nbInputArgument(pvApiCtx)+1;
+ AssignOutputVariable(pvApiCtx,2)=nbInputArgument(pvApiCtx)+2;
+ AssignOutputVariable(pvApiCtx,3)=nbInputArgument(pvApiCtx)+3;
+
+ return 0;
+ }
+
+
+
+
+}
+}
+
+
+
diff --git a/sci_gateway/cpp/sci_vrp.cpp b/sci_gateway/cpp/sci_vrp.cpp
new file mode 100644
index 0000000..97f8797
--- /dev/null
+++ b/sci_gateway/cpp/sci_vrp.cpp
@@ -0,0 +1,1360 @@
+#include "ortools/base/callback.h"
+#include "ortools/base/commandlineflags.h"
+#include "ortools/base/commandlineflags.h"
+#include "ortools/base/integral_types.h"
+#include "ortools/base/logging.h"
+#include "ortools/constraint_solver/routing.h"
+#include "ortools/constraint_solver/routing_enums.pb.h"
+#include "ortools/constraint_solver/routing_flags.h"
+
+
+
+extern "C"{
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+using namespace operations_research;
+
+
+//THIS MODEL TENDS TO MINIMIZE THE TOTAL DISTANCE COVERED BY ALL THE VEHICLES COMBINED WHILE ALSO MINIMIZING THE TOTAL TIME TAKEN FOR ALL THE TRIPS
+
+
+/* (Note- for the sake of explanation, let the number of nodes be represented by 'n' and the number of vedicles in the fleet, by 'v')
+Naming suffixes(also, the respective order) for inputs :-
+1-> "adj_matrix" - The given Adjacency matrix representing the intended graph([nxn]). The cell values represent the distance between 2 nodes(cities/locations to be serviced), ie. (adj_matrix[i][j]) represents the disatnce between cities 'i' and 'j'. The solver also supports asymmetrix distances i.e. cases where the distance from node'i' to node'j' is not the same as distance from node'j' to node'i'. Also, negative distance values indicate the absence of an edge/path. ie. if adj[i][j]<0, then there's no path between nodes 'i' and 'j'.
+2-> "vehicles" - The number of vehicles/routes in the given Vehicle Routing Problem
+3-> "mode_flag"- Indicates the solver mode for the given problem. 3 modes possible : 0-> Single depot node- All vehicles start and end their routes at this node ; 1-> The vehicles can start and end their routes anywhere( modelling a taxi-service scenario) ; 2-> The start and end nodes are specified for all the vehicles by the user )
+4-> "start" - Matrix containing info about the start/depot node(s), depending on the mode in the current instance. [1x1] matrix(single numerical value) for mode '0'. Empty matrix(0x0 or []) for mode '1'. [vx2] matrix for mode '2'.
+5-> "demands" - Matrix containing the demands of the different nodes that have to be met, in the capacitated VRP.[1xn] expected, but could be NULL([]) in case the problem is not a capacitated VRP(simple visitation problem).
+6-> "max_vehicle_capacity" - In case of capacitated VRP, it is the maximum capacity of a vehicle(capacity and demands are to be of the same unit). It is the maximum total demand a vehicle can fulfil in it's route.
+7-> "service_time_per_demand_unit" - It is the time required to satisfy a unit demand, i.e. if the node has a demand of 'x', then it will take a vehicle (servtime_per_demand*x) units of time to serve that node. It is '0' if the serive times of nodes are to be ignored in the time-constraint(time minimization)
+8-> "time_windows" - A matrix ([nx2]) indicating the time windows for each node such that the node can only be serviced during that window. (can be NULL , if no time windows needed). If provided, then for any node that does not have a time-window constraint, this will have values, '0' and 'INT_MAX' for the row corresponding to that node.
+9-> "speeds" - A matrix indicating the vehicle speeds. Options - 1.[1x1] matrix indicating a single avg. speed for all vehicles on all arcs. 2.NULL, if the transit times between the nodes are to be ignored, in the time minimization. 3.[nxn] matrix when the avg. speed of the vehicles is different between different nodes(different on differnt arcs).
+10-> "waiting_time" - Matrix indicating the waiting times, if any, at the nodes. Either NULL, if no waiting times(or they are ot be ignored during time minimization) or a [1xn] matrix.
+11-> "refuel_flag" - flag indicating if fuel constraint is to be considered for the given VRP; 0-> NO fuel constraints ; 1-> fuel constraints to be considered( fuel consumption is minimized with vehicles having a fixed fuel capacity and certain specified refueling nodes only. Each transit costs fuel(here, equal to the distance covered as fuel is assumed to be specified in terms of the units of distance(mileage, is you will)
+12-> "fuel_capacity_per_vehicle" - If fuel constraint is considered, this indicates the fuel capacity of a vehicle(same for all vehicles). Initially, the amount of fuel in each vehicle is equal to this value. Each transit deducts a corresponding amount of fuel from this value, unless the current node is a refuel node, in which case the fuel supply is replenished.
+13-> "fuel_nodes" - Matrix specifying the refuel node indices(if fuel constraint is to be considered i.e. refuel_flag==1). Expected -vector [1xA] where A is the number of fuel nodes. Could also be an empty matrix(or NULL) even when fuel constraints are considered, indicating a situation where the fuel is limited but there are no refueling nodes.
+14-> "skip_penalties" - an [Ax2] matrix specifying the node index(first column) and the corresponding cost penalty associated if that node were to be skipped( It basically marks that node as optional, albeit with a monetary penalty. This could be NULL if no penalty constraints are specified i.e. ALL NODES ARE MANDATORY!
+15-> "groups" - Matrix specifying node groups such that nodes in the same group have to be serviced by the same vehicle i.e. they must lie on the same route.( [AxB] matrix where A is the number of groups and B is the number of nodes in the largest group. Smaller group rows are padded with 0's on the right end(as Scilab does not support variable length rows in matrices)
+16-> "same_vehicle_penalty" - single numerical value specifying the cost penalty if a certain node in a predefined group(see above) is unable to be serviced by the same vehicle(or it ain't optimal to do so). If =-1, it indicates that all groups are strictly imposed ie. we cannot optionally skip a node from a group as a tradeoff to optimize distance and time.
+17-> "time_limit" - Time limit for the solver in milliseconds. It may or may not find a solution within the limit. If it does, it may not be the most optimal, but as optimal as the engine could optimize it within the limit given.( As it first finds a naive solution through a greedy strategy and then iteratively optimizes it heuristically toward an optimal solution)
+
+NOTE:- All indices specified in the inputs(eg. in 'start' matrices are actually Scilab indices, i.e. starting with '1'. Pertinent adjustments to be made.
+
+
+*/
+
+
+/*
+Naming suffixes(also, the respective order) for outputs :-
+1->Total Distance- single numeric value
+2->Total Time - single numeric value
+3->Distance Matrix- [1xv]
+4->Time Matrix -[1xv]
+5->Vehicle routes - [vxn] matrix. As route will always be less than or equal to 'n', the routes will be padded with 0's on the right end(node indices returned are Scilab Indices(start with 1) so, 0's are not a problem for padding)
+6->status flag -The OR-Tools solution status (enum defined in 'routing.h')
+*/
+
+
+
+
+double *vrp_piVar1=NULL,*vrp_piVar2=NULL,*vrp_piVar3=NULL,*vrp_piVar4=NULL,*vrp_piVar5=NULL,*vrp_piVar6=NULL,*vrp_piVar7=NULL,*vrp_piVar8=NULL,*vrp_piVar9=NULL,*vrp_piVar10=NULL,*vrp_piVar11=NULL,*vrp_piVar12=NULL,*vrp_piVar13=NULL,*vrp_piVar14=NULL,*vrp_piVar15=NULL,*vrp_piVar16=NULL,*vrp_piVar17=NULL;
+int nodes; //stores the number of nodes in the given graph(VRP)
+int vehicles; //stores the number of vehicles/routes in the given VRP(input argument #2)
+int mode_flag; //stores the mode flag value (input argument #3)
+
+int **start=NULL;
+
+
+int **adj_matrix=NULL;
+int *demands=NULL;
+
+
+long long max_vehicle_capacity;
+
+long long service_time_per_demand_unit;
+
+const long long time_ub=INT_MAX; //upper bound on the total time a route can take(INT_MAX and not int64-max as 'tis the max that we can receive from scilab). Also, taken max possible to actually forego imposing any such limiation as we are also minimizing the total time taken by the route apart from the distance(Adding variable moinimized by the finalizer), thus rendering it pointless
+
+
+int **time_windows=NULL; // [nx2] matrix, specifying the time windows for each node. If a node does not need a constraint of time windows, this has '0' for start time and 'INT_MAX' for end times(was input as '-1' but converted to INT_MAX before being fed to this gateway)
+
+int *waiting_times=NULL;
+
+int *fuel_nodes=NULL; //Depot nodes are NOT inehrently considered refuel nodes. THEY HAVE TO BE SPECIFIED IN THIS ARRAY IN ORDER TO BE CONSIDERED! [1xA] Vector expected(A-> number of refuel nodes)
+int refuel_flag=0; //0->No refuelling constraints; 1->Refuelling to be considered; This could be '1' and the fuel_nodes array could still be empty(NULL) indicating that there will be fuel constraints but NO REFUELLING NODES!!!!.
+int fuel_capacity_per_vehicle; // Only specified when refuelling is to be considered.
+
+
+int **penalty=NULL; // Ax2 matrix( A-> no. of optional nodes with some penalties for skipping them); First column-> index of the optional node; Second column-> the corresponding penalty)
+
+ // The speed variable is either a 1x1 matrix holding a single int value(avg.speed for all arcs) or an nxn matrix(double int pointer) when different speeds are speicified for different arcs
+int **speeds=NULL;
+
+
+int speeds_flag=0; //0-> No speed specified 1-> single avg speed; 2-> different speeds for different arcs
+
+int **groups=NULL; //AxB matrix, where each row indicated a new group of nodes that need to be on the same vehicle route. Each element of this matrix needs to be unique and the total number of elements(A*B) cannot exceed the total number of node('nodes)
+
+long long kSameVehiclePenalty=-1; //user input value- a penalty imposed if the nodes in a specified group cannot be put on the same route
+
+int time_limit;
+
+const char* kkTime = "Time";
+const char* kkCapacity = "Capacity";
+const char* kkFuel = "Fuel";
+
+
+//distance callback
+
+long long distancecallback(RoutingModel::NodeIndex from,RoutingModel::NodeIndex to)
+{
+
+ return adj_matrix[from.value()][to.value()];
+
+}
+
+
+//negative distance callback(for refuelling mode)
+long long negdistance(RoutingModel::NodeIndex from, RoutingModel::NodeIndex to)
+{
+
+ return adj_matrix[from.value()][to.value()]<0?adj_matrix[from.value()][to.value()]:-adj_matrix[from.value()][to.value()]; // return negative if the value is initially negative(indicating no edge)
+
+}
+
+
+
+int isRefuelNode(int n,int size) //size-> number of values in the refuel_nodes array;
+{
+ // This method returns 1(true) if the node with index 'n' if a refuel node
+
+ for(int i=0;i 1) When no speed is specified; 2)A single avg. speed is specified for all the edges/arcs ; 3) Separate avg. speeds are speeds are specified for each arc/edge of the given graph
+
+long long timecallback(RoutingModel::NodeIndex from, RoutingModel::NodeIndex to)
+{
+ long long temp=0;
+
+ if(demands!=NULL && service_time_per_demand_unit!=0)
+ temp+=(service_time_per_demand_unit*demandscallback(from,to));
+
+
+ if(speeds!=NULL)
+ {
+ if(speeds_flag==1)
+ temp+=(distancecallback(from,to)/ (speeds[0][0]));
+ else if(speeds_flag==2)
+ {
+ if(mode_flag==1)
+ temp+=(distancecallback(from,to)/speeds[from.value()-1][to.value()-1]); //accounting for the dummy node in mode '1'
+ else
+ temp+=(distancecallback(from,to)/speeds[from.value()][to.value()]);
+ }
+ }
+
+ return temp;
+}
+
+
+
+
+
+int sci_vrp(char *fname)
+{
+
+ SciErr scierror;
+
+ int iType1=0,iType2=0,iType3=0,iType4=0,iType5=0,iType6=0,iType7=0,iType8=0,iType9=0,iType10=0,iType11=0,iType12=0,iType13=0,iType14=0,iType15=0,iType16=0,iType17=0;
+
+ int *piAddressVar1=NULL,*piAddressVar2=NULL,*piAddressVar3=NULL,*piAddressVar4=NULL,*piAddressVar5=NULL,*piAddressVar6=NULL,*piAddressVar7=NULL,*piAddressVar8=NULL,*piAddressVar9=NULL,*piAddressVar10=NULL,*piAddressVar11=NULL,*piAddressVar12=NULL,*piAddressVar13=NULL,*piAddressVar14=NULL,*piAddressVar15=NULL,*piAddressVar16=NULL,*piAddressVar17=NULL;
+
+ int m1=0,m2=0,m3=0,m4=0,m5=0,m6=0,m7=0,m8=0,m9=0,m10=0,m11=0,m12=0,m13=0,m14=0,m15=0,m16=0,m17=0;
+ int n1=0,n2=0,n3=0,n4=0,n5=0,n6=0,n7=0,n8=0,n9=0,n10=0,n11=0,n12=0,n13=0,n14=0,n15=0,n16=0,n17=0;
+
+ int status; //output #6
+
+ CheckInputArgument(pvApiCtx,17,17);
+ CheckOutputArgument(pvApiCtx,6,6);
+
+
+
+ //GETTING THE ADDRESSES OF THE INPUT MATRICES
+
+
+
+
+
+
+ scierror=getVarAddressFromPosition(pvApiCtx,1,&piAddressVar1);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,2,&piAddressVar2);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,3,&piAddressVar3);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,4,&piAddressVar4);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,5,&piAddressVar5);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,6,&piAddressVar6);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,7,&piAddressVar7);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,8,&piAddressVar8);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,9,&piAddressVar9);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,10,&piAddressVar10);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,11,&piAddressVar11);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,12,&piAddressVar12);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,13,&piAddressVar13);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,14,&piAddressVar14);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,15,&piAddressVar15);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,16,&piAddressVar16);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarAddressFromPosition(pvApiCtx,17,&piAddressVar17);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+
+
+
+ //RETRIEVING AND CHECKING THE TYPES OF THE INPUTS
+
+
+
+ scierror=getVarType(pvApiCtx,piAddressVar1,&iType1);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar2,&iType2);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar3,&iType3);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar4,&iType4);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar5,&iType5);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar6,&iType6);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar7,&iType7);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar8,&iType8);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar9,&iType9);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar10,&iType10);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar11,&iType11);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar12,&iType12);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar13,&iType13);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar14,&iType14);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar15,&iType15);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar16,&iType16);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getVarType(pvApiCtx,piAddressVar17,&iType17);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+
+ if(iType1!=sci_matrix || iType2!=sci_matrix || iType3!=sci_matrix || iType4!=sci_matrix || iType5!=sci_matrix || iType6!=sci_matrix || iType7!=sci_matrix || iType8!=sci_matrix || iType9!=sci_matrix || iType10!=sci_matrix || iType11!=sci_matrix || iType12!=sci_matrix || iType13!=sci_matrix || iType14!=sci_matrix || iType15!=sci_matrix || iType16!=sci_matrix|| iType17!=sci_matrix)
+ {
+ if(iType1!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #1. Matrix Expected! \n");
+
+ if(iType2!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #2. Matrix Expected! \n");
+
+ if(iType3!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #3. Matrix Expected! \n");
+
+ if(iType4!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #4. Matrix Expected! \n");
+
+ if(iType5!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #5. Matrix Expected! \n");
+
+ if(iType6!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #6. Matrix Expected! \n");
+
+ if(iType7!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #7. Matrix Expected! \n");
+
+ if(iType8!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #8. Matrix Expected! \n");
+
+ if(iType9!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #9. Matrix Expected! \n");
+
+ if(iType10!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #10. Matrix Expected! \n");
+
+ if(iType11!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #11. Matrix Expected! \n");
+
+ if(iType12!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #12. Matrix Expected! \n");
+
+ if(iType13!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #13. Matrix Expected! \n");
+
+ if(iType14!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #14. Matrix Expected! \n");
+
+ if(iType15!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #15. Matrix Expected! \n");
+
+ if(iType16!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #16. Matrix Expected! \n");
+
+ if(iType17!=sci_matrix)
+ Scierror(999,"Wrong Input Type for Argument #16. Matrix Expected! \n");
+
+ return 0;
+
+ }
+
+
+
+ //GETTING THE ACTUAL INPUT MATRICES
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar1,&m1,&n1,&vrp_piVar1);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar2,&m2,&n2,&vrp_piVar2);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar3,&m3,&n3,&vrp_piVar3);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar4,&m4,&n4,&vrp_piVar4);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar5,&m5,&n5,&vrp_piVar5);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar6,&m6,&n6,&vrp_piVar6);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar7,&m7,&n7,&vrp_piVar7);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar8,&m8,&n8,&vrp_piVar8);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar9,&m9,&n9,&vrp_piVar9);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar10,&m10,&n10,&vrp_piVar10);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar11,&m11,&n11,&vrp_piVar11);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar12,&m12,&n12,&vrp_piVar12);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar13,&m13,&n13,&vrp_piVar13);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar14,&m14,&n14,&vrp_piVar14);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar15,&m15,&n15,&vrp_piVar15);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar16,&m16,&n16,&vrp_piVar16);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=getMatrixOfDouble(pvApiCtx,piAddressVar17,&m17,&n17,&vrp_piVar17);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+
+
+
+ //////--------------------------LOGIC-------------------------------/////////
+
+
+
+ //assignments
+
+ RoutingModel *routing; //Will store the RoutingModel Object later
+
+ vehicles=vrp_piVar2[0];
+ mode_flag=vrp_piVar3[0];
+ nodes=m1;
+
+ if(mode_flag!=1)
+ {
+ start=(int **)malloc(sizeof(int *)*m4);
+
+ for(int i=0;i0) // as it could be negative as well- to be ignored
+ total_distance+=vrp_piVar5[i];
+
+
+
+
+
+ std::vector< std::pair > start_end; // needed for mode '2'
+
+
+
+ if(mode_flag==0)
+ {
+
+ const RoutingModel::NodeIndex kDepot(start[0][0]-1); // subtract 1 to get the C++ index from the Scilab index
+
+
+ adj_matrix=(int **)malloc(sizeof(int *)*nodes);
+
+ if(m5!=0)
+ demands=(int *)malloc(sizeof(int)*nodes);
+
+
+
+ for(int i=0;i(RoutingModel::NodeIndex(start[i][0]-1),RoutingModel::NodeIndex(start[i][1]-1)));
+
+
+ routing= new RoutingModel(nodes,vehicles,start_end);
+
+
+ }
+
+
+ RoutingSearchParameters parameters=BuildSearchParametersFromFlags();
+
+ parameters.set_first_solution_strategy(FirstSolutionStrategy::PATH_CHEAPEST_ARC);
+ parameters.mutable_local_search_operators()->set_use_path_lns(false);
+
+ if(m17!=0)
+ parameters.set_time_limit_ms(time_limit);
+
+
+
+
+ //Setting the distance function
+
+ routing->SetArcCostEvaluatorOfAllVehicles(NewPermanentCallback(distancecallback));
+
+
+ //Adding group constraints for sets of nodes to be on the same route(servicesd by the same vehicle)
+
+
+ if(groups!=NULL)
+ {
+ //indices given in the groups array are scvilab indices(start with 0). Pertinent Adjustment to be made if mode<>2
+
+ int x=sizeof(groups)/sizeof(groups[0]); //no. of rows i.e. the no. of groups
+ int y= sizeof(groups[0])/sizeof(int); // no. of columns. (different groups can be different sizes, but all padded with zeroes to equalize the number of columns)
+
+ //normalizing and converting the given SameVehiclePenalty into a relative distance penalty value to be congrous with the 'distance interpretation' of our minimization model
+
+ int count;
+
+
+ for(int i=0;i group;
+ for(int j=0;jAddSoftSameVehicleConstraint(group,0);
+ else if(kSameVehiclePenalty > 0)
+ routing->AddSoftSameVehicleConstraint(group,kSameVehiclePenalty);
+
+
+
+ }
+
+ }
+
+
+ //setting the speed flag
+
+ if(speeds!=NULL)
+ {
+ //if(sizeof(speeds)==sizeof(int)) //single avg. speed case
+ if(m9==1 && n9==1)
+ speeds_flag=1;
+ else speeds_flag=2;
+ }
+
+
+
+ //Adding the capacity dimension constraints
+ if(demands!=NULL)
+ {
+ const long long kNullCapacitySlack=0;
+
+ routing->AddDimension(NewPermanentCallback(demandscallback),kNullCapacitySlack, max_vehicle_capacity, /* fix_start_cumul_to_zero */ true, kkCapacity);
+
+ const RoutingDimension& capacity_dimension = routing->GetDimensionOrDie(kkCapacity);
+ }
+
+
+
+ //Adding Time Dimension constraints
+
+ routing->AddDimension(NewPermanentCallback(timecallback),time_ub,time_ub,true, kkTime);
+
+ const RoutingDimension& time_dimension=routing->GetDimensionOrDie(kkTime);
+
+
+
+ //Adding time windows
+
+ if(time_windows!=NULL)
+ {
+ if(mode_flag==1)
+ {
+ time_dimension.CumulVar(0)->SetRange(0,INT_MAX);
+ for(int i=1;i<=nodes;i++)
+ time_dimension.CumulVar(i)->SetRange(time_windows[i-1][0],time_windows[i-1][1]);
+ }
+ else
+ {
+ for(int i=1;iSetRange(time_windows[i][0],time_windows[i][1]);
+ }
+
+
+
+ }
+
+
+ //Adding Waiting Times
+
+ if(waiting_times!=NULL)
+ {
+ if(mode_flag==1)
+ {
+
+ time_dimension.SlackVar(0)->SetValue(0);
+ for(int i=1;i<=nodes;i++)
+ time_dimension.SlackVar(i)->SetValue(waiting_times[i-1]);
+ }
+ else
+ {
+ for(int i=0;iSetValue(waiting_times[i]);
+ }
+
+ }
+
+
+
+
+ int num_penalty=m14;
+
+ //converting the penalty values into relative distance values to be germane to the interpretation of our model that minimizes distance
+
+ if(penalty!=NULL)
+ {
+
+ int total_penalty=0;
+
+ for(int i=0;i optnode(1,temp);
+ routing->AddDisjunction(optnode,penalty[i][1]);
+ }
+
+ }
+
+
+
+
+ //Adding Refuelling parameters
+ //Depots are NOT assumed to be fuel nodes by default.
+
+ if(refuel_flag)
+ {
+ int fsize=0; //number of refuel nodes
+
+ if(fuel_nodes!=NULL)
+ fsize=n13;
+
+
+ routing->AddDimension(NewPermanentCallback(negdistance),fuel_capacity_per_vehicle,fuel_capacity_per_vehicle, /*fix_start_cumul_to_zero*/false,kkFuel);
+
+ const RoutingDimension& fuel_dimension=routing->GetDimensionOrDie(kkFuel);
+
+ for(int i=1;i<=nodes;i++) // As the 'fuel_nodes' array contains the SCILAB INDICES for the nodes
+ {
+ if(mode_flag==1)
+ {
+ if(!isRefuelNode(i,fsize))
+ fuel_dimension.SlackVar(i)->SetValue(0);
+
+ routing->AddVariableMinimizedByFinalizer(fuel_dimension.CumulVar(i));
+ }
+ else
+ {
+ if(!isRefuelNode(i,fsize))
+ fuel_dimension.SlackVar(i-1)->SetValue(0);
+
+ routing->AddVariableMinimizedByFinalizer(fuel_dimension.CumulVar(i-1));
+ }
+
+
+ }
+
+ //sciprint("Slack - %d\n",fuel_dimension.SlackVar(1));
+ //sciprint("Cumul - %d\n",fuel_dimension.CumulVar(1));
+
+
+
+ }
+
+
+
+ //Solving the Model
+
+ //status=routing->status();
+ //sciprint("Status - %d\n",status);
+
+ const Assignment * solution= routing->SolveWithParameters(parameters);
+
+
+ status=routing->status();
+
+
+ if(solution==nullptr) // portends one of 3 situations viz. status(enum) values -> ROUTING_FAIL(no solution possible/found) , ROUTING_FAIL_TIMEOUT or ROUTING_INVALID(not possible in TSP as default parameters used for initialization)
+ {
+ scierror=createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx)+1,0,0,NULL);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx)+2,0,0,NULL);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx)+3,0,0,NULL);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;scierror=createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx)+1,0,0,NULL);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+ }
+
+ scierror=createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx)+4,0,0,NULL);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+ scierror=createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx)+5,0,0,NULL);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+ scierror=createMatrixOfInteger32(pvApiCtx,nbInputArgument(pvApiCtx)+6,1,1,&status);
+ if(scierror.iErr)
+ {
+ printError(&scierror,0);
+ return 0;
+ }
+
+
+ }
+ else //solution found!
+ {
+ int total_time=0; //output #2
+
+ int total_distance=solution->ObjectiveValue(); //output #1
+
+ int *distances=(int *)malloc(sizeof(int)*vehicles); //output #3
+ int *times=(int *)malloc(sizeof(int)*vehicles); //output #4
+
+ std::fill(distances,distances+sizeof(distances),0);
+ std::fill(times,times+sizeof(times),0);
+
+
+ int **routes=(int **)malloc(sizeof(int *)*vehicles); //[vxn] matrix ; output #5 ; Will have to converted to single dimensional array before mapping
+
+
+
+ for(int i=0;iValue(routing->NextVar(routing->Start(i)));!routing->IsEnd(node);node=solution->Value(routing->NextVar(node)),j++) //skipping the first node(dummy)
+ {
+ routes[i][j]=routing->IndexToNode(node).value(); // Scilab indices(start with '1') as dummy node '0' was added
+ if(j!=0)
+ {
+ distances[i]+=distancecallback(RoutingModel::NodeIndex(routes[i][j-1]),RoutingModel::NodeIndex(routes[i][j]));
+ times[i]+=timecallback(RoutingModel::NodeIndex(routes[i][j-1]),RoutingModel::NodeIndex(routes[i][j]));
+ }
+
+ }
+
+ //padding with zeroes
+ for(int k=j;kStart(i);!routing->IsEnd(node);node=solution->Value(routing->NextVar(node)),j++)
+ {
+ routes[i][j]=(routing->IndexToNode(node).value()) +1; // '1' to be added to convert to the Scilab index convention(starting with '1')
+
+ if(j!=0)
+ {
+ distances[i]+=distancecallback(RoutingModel::NodeIndex(routes[i][j-1]-1),RoutingModel::NodeIndex(routes[i][j]-1));
+ times[i]+=timecallback(RoutingModel::NodeIndex(routes[i][j-1]-1),RoutingModel::NodeIndex(routes[i][j]-1));
+ }
+
+
+
+ }
+
+ //mapping the last node
+ routes[i][j]=(routing->IndexToNode(routing->End(i)).value()) +1;
+
+ //sciprint("\n\n\n Last :- %d\n\n\n",routes[i][j]);
+
+
+ //padding with zeroes
+ for(int k=j+1;k1 0 10
+//0->5 0 8
+//2->1 0 5
+//1->5 0 2
+//2->3 0 7
+//4->3 0 10
+//4->5 0 10
+//4->2 0 8
+
+//There is no path connecting the specified source node : 0 and the specified target node : 3
+
+
+
+[maxflow,arcflows,status] = fmaxflow(start_nodes,end_nodes,capacities,st);
diff --git a/tests/general_tests/fmaxflow/fmaxflow_output1.sce b/tests/general_tests/fmaxflow/fmaxflow_output1.sce
new file mode 100644
index 0000000..690c9d1
--- /dev/null
+++ b/tests/general_tests/fmaxflow/fmaxflow_output1.sce
@@ -0,0 +1,15 @@
+//Check for the admissible number of output parameters( 2 or 3)
+
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3];
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4];
+capacities = [20, 30, 10, 40, 30, 10, 20, 5, 20];
+st=[0,4];
+
+//Error
+//fmaxflow : Wrong number of output arguments(1). This function can deliver 2/3 outputs. Refer to help/FOT documentation for further details
+//at line 158 of function fmaxflow called by :
+//[maxflow] = fmaxflow(start_nodes,end_nodes,capacities,st);
+
+
+
+[maxflow] = fmaxflow(start_nodes,end_nodes,capacities,st);
diff --git a/tests/general_tests/fmaxflow/fmaxflow_output2.sce b/tests/general_tests/fmaxflow/fmaxflow_output2.sce
new file mode 100644
index 0000000..4591c4d
--- /dev/null
+++ b/tests/general_tests/fmaxflow/fmaxflow_output2.sce
@@ -0,0 +1,13 @@
+//Check for the admissible number of output parameters( 2 or 3)
+
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3];
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4];
+capacities = [20, 30, 10, 40, 30, 10, 20, 5, 20];
+st=[0,4];
+
+
+//Error
+//Wrong number of output arguments.
+
+
+[maxflow,arcflows,status,bleh] = fmaxflow(start_nodes,end_nodes,capacities,st);
diff --git a/tests/general_tests/fmaxflow/fmaxflow_sourceChk.sce b/tests/general_tests/fmaxflow/fmaxflow_sourceChk.sce
new file mode 100644
index 0000000..ad413fd
--- /dev/null
+++ b/tests/general_tests/fmaxflow/fmaxflow_sourceChk.sce
@@ -0,0 +1,14 @@
+//Check the existence of the specified source node in the given graph
+
+
+start_nodes=[ 0 0 1 1 2 4 5 4];
+end_nodes= [ 1 5 2 5 3 3 4 2];
+capacities=[10 8 5 2 7 10 10 8];
+st=[6,3]; // node 6 doesn't exist in the graph
+
+//Error
+//fshortestpath : Invalid source node(6)- The specified source node does not exist in the given graph
+//at line 215 of function fmaxflow called by :
+//[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st);
+
+[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st);
diff --git a/tests/general_tests/fmaxflow/fmaxflow_st_dim.sce b/tests/general_tests/fmaxflow/fmaxflow_st_dim.sce
new file mode 100644
index 0000000..bf9ca44
--- /dev/null
+++ b/tests/general_tests/fmaxflow/fmaxflow_st_dim.sce
@@ -0,0 +1,16 @@
+//Check for the dimensions of the row matrix/vector 'st'(representing the 2 values for source node and target node respectively)- expected dimensions - 1x2
+
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3];
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4];
+capacities = [20, 30, 10, 40, 30, 10, 20, 5, 20];
+st=[0,4,5];
+
+//Error
+//fmaxflow: Expected size [1 2] for input argument st at input #4, but got [1 3] instead.
+//at line 49 of function Checkdims called by :
+//at line 206 of function fmaxflow called by :
+//[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st);
+
+
+[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st);
+
diff --git a/tests/general_tests/fmaxflow/fmaxflow_startendnodes_integral.sce b/tests/general_tests/fmaxflow/fmaxflow_startendnodes_integral.sce
new file mode 100644
index 0000000..ed25789
--- /dev/null
+++ b/tests/general_tests/fmaxflow/fmaxflow_startendnodes_integral.sce
@@ -0,0 +1,15 @@
+//Check if all the capacity values are integral(however, 'tis not mandatory for them to be stored in a matrix integer type)
+
+start_nodes=[ 0 0 1 1 2 4 5 4];
+end_nodes= [ 1 5 2 5 3 3 4 2];
+capacities=[10 8 5 2 7 10 10 8];
+
+st=[0.5 2.4]
+
+//Error
+//fmaxflow : The source and target node value(s)(input argument #4) are expected to be integral.
+//at line 232 of function fmaxflow called by :
+//[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st);
+
+
+[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st);
diff --git a/tests/general_tests/fmaxflow/fmaxflow_startnodes_dim.sce b/tests/general_tests/fmaxflow/fmaxflow_startnodes_dim.sce
new file mode 100644
index 0000000..122c89c
--- /dev/null
+++ b/tests/general_tests/fmaxflow/fmaxflow_startnodes_dim.sce
@@ -0,0 +1,15 @@
+//Check for the dimensions of the 'start_nodes' vector(expected - 1xn form matrix)
+
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3;
+ 0, 0, 0, 0, 0, 0, 0, 0, 0];
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4];
+capacities = [20, 30, 10, 40, 30, 10, 20, 5, 20];
+st=[0,4];
+
+//Error
+//fmaxflow : Wrong Input Size. The input argument #1 is expected to be a matrix of dimension of the form 1xn (2x9 obtained instead)
+//at line 188 of function fmaxflow called by :
+//[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st)
+
+
+[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st);
diff --git a/tests/general_tests/fmaxflow/fmaxflow_startnodes_integral.sce b/tests/general_tests/fmaxflow/fmaxflow_startnodes_integral.sce
new file mode 100644
index 0000000..23d6ecb
--- /dev/null
+++ b/tests/general_tests/fmaxflow/fmaxflow_startnodes_integral.sce
@@ -0,0 +1,14 @@
+//Check if all the start nodes' values are integral(however, 'tis not mandatory to store them in a matrix integer type)
+
+start_nodes=[ 0.8 0.3 1.5 1 2 4 5 4];
+end_nodes= [ 1 5 2 5 3 3 4 2];
+capacities=[10 8 5 2 7 10 10 8];
+st=[0,3];
+
+//Error
+//fmaxflow : The values in the 'start_nodes' vector(input argument #1) are expected to be integral.
+//at line 217 of function fmaxflow called by :
+//[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st);
+
+
+[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st);
diff --git a/tests/general_tests/fmaxflow/fmaxflow_targetChk.sce b/tests/general_tests/fmaxflow/fmaxflow_targetChk.sce
new file mode 100644
index 0000000..3159b5a
--- /dev/null
+++ b/tests/general_tests/fmaxflow/fmaxflow_targetChk.sce
@@ -0,0 +1,14 @@
+//Check for the validity of the specified target node in the given graph
+
+
+start_nodes=[ 0 0 1 1 2 4 5 4];
+end_nodes= [ 1 5 2 5 3 3 4 2];
+capacities=[10 8 5 2 7 10 10 8];
+st=[0,9]; // node 9 doesn't exist in the graph
+
+//Error
+//fshortestpath : Invalid target node(9)- The specified target node does not exist in the given graph
+//at line 220 of function fmaxflow called by :
+//[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st);
+
+[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st);
diff --git a/tests/general_tests/fshortestpath/fshortestpath_discondist_dim.sce b/tests/general_tests/fshortestpath/fshortestpath_discondist_dim.sce
new file mode 100644
index 0000000..beb99c2
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_discondist_dim.sce
@@ -0,0 +1,18 @@
+//Check if the value of 'disconnected_distance is a singular numerical value(1x1 matrix form)
+
+start_nodes=[ 0 0 1 1 2 4 5 4];
+end_nodes= [ 1 5 2 5 3 3 4 2];
+weights=[10 8 5 2 7 10 10 8];
+st=[0,3]
+
+disconnected_distance=[0,4]
+
+//Error
+//fshortestpath: Expected size [1 1] for input argument disconnected_distance at input #5, but got [1 2] instead.
+//at line 49 of function Checkdims called by :
+//at line 144 of function fshortestpath called by :
+//[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st,disconnected_distance)
+
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st,disconnected_distance)
diff --git a/tests/general_tests/fshortestpath/fshortestpath_discondist_integral.sce b/tests/general_tests/fshortestpath/fshortestpath_discondist_integral.sce
new file mode 100644
index 0000000..979a227
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_discondist_integral.sce
@@ -0,0 +1,18 @@
+//Check if the value of 'disconnected_distance' is integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+start_nodes=[ 0 0 1 1 2 4 5 4];
+end_nodes= [ 1 5 2 5 3 3 4 2];
+weights=[10 8 5 2 7 10 10 8];
+st=[0,3]
+
+disconnected_distance=5.3;
+
+//Error
+//fshortestpath : The 'disconnected distance' value(input argument #5) is expected to be integral.
+//at line 178 of function fshortestpath called by :
+//[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st,disconnected_distance)
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st,disconnected_distance)
+
+
diff --git a/tests/general_tests/fshortestpath/fshortestpath_endnodes_dim.sce b/tests/general_tests/fshortestpath/fshortestpath_endnodes_dim.sce
new file mode 100644
index 0000000..7bd3d41
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_endnodes_dim.sce
@@ -0,0 +1,17 @@
+//Check the dimensions of the 'end_nodes' vector(expected - 1xn matrix)
+
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3];
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4;
+ 1, 1, 1, 1, 1, 1, 1, 1, 1;
+ 7, 5, 3, 2, 7, 2, 1, 3, 5;];
+weights = [20, 30, 10, 40, 30, 10, 20, 5, 20];
+st=[0,4];
+
+
+//Error
+//fshortestpath : Wrong Input Size. The input argument #2 is expected to be a matrix of dimensions of the form 1xn (3x9 obtained instead)
+//at line 128 of function fshortestpath called by :
+//[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
diff --git a/tests/general_tests/fshortestpath/fshortestpath_endnodes_integral.sce b/tests/general_tests/fshortestpath/fshortestpath_endnodes_integral.sce
new file mode 100644
index 0000000..2e00c13
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_endnodes_integral.sce
@@ -0,0 +1,14 @@
+//Check if all the end nodes' values are integral(however, 'tis not mandatory to store them in a matrix integer type)
+
+start_nodes=[ 0 0 1 1 2 4 5 4];
+end_nodes= [ 1 5.5 2 5 3 3 4 2];
+weights=[10 8 5 2 7 10 10 8];
+st=[0,3];
+
+//Error
+//fshortestpath : The values in the 'end_nodes' vector(input argument #2) are expected to be integral.
+//at line 161 of function fshortestpath called by :
+//[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
diff --git a/tests/general_tests/fshortestpath/fshortestpath_equalvectorlength.sce b/tests/general_tests/fshortestpath/fshortestpath_equalvectorlength.sce
new file mode 100644
index 0000000..9675198
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_equalvectorlength.sce
@@ -0,0 +1,14 @@
+//Check to ensure that the 3 input vectors viz. 'start_nodes', 'end_nodes' and 'weights' are of equal length(as they define the arcs of the graph- each index across the 3 representing one unique arc)
+
+start_nodes=[ 0 0 1 1 2 4 5 4 6];
+end_nodes= [ 1 5 2 5 3 3 4 2];
+weights=[10 8 5 2 7 10 10 8 4];
+st=[0,3]
+
+//Error
+//fshortestpath : Unequal dimensions of the 3 input vectors (9 8 9). The 3 are expected to be of equal lengths.
+//at line 138 of function fshortestpath called by :
+//[mincost,shortestpath,flag] = fshortestpath(start_nodes,end_nodes,weights,st);
+
+
+[mincost,shortestpath,flag] = fshortestpath(start_nodes,end_nodes,weights,st);
diff --git a/tests/general_tests/fshortestpath/fshortestpath_input1.sce b/tests/general_tests/fshortestpath/fshortestpath_input1.sce
new file mode 100644
index 0000000..c75025a
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_input1.sce
@@ -0,0 +1,15 @@
+//Check for the admissible number of input arguments(4-5)
+
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3];
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4];
+weights = [20, 30, 10, 40, 30, 10, 20, 5, 20];
+st=[0,4];
+
+
+//Error
+//fshortestpath : Number of input arguments is expected to be 4 or 5. Found 3. Refer to help/FOT documentation for more details.
+//at line 71 of function fshortestpath called by :
+//[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights)
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights);
diff --git a/tests/general_tests/fshortestpath/fshortestpath_input2.sce b/tests/general_tests/fshortestpath/fshortestpath_input2.sce
new file mode 100644
index 0000000..c8032b5
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_input2.sce
@@ -0,0 +1,15 @@
+//Check for the admissible number of input arguments(4-5)
+
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3];
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4];
+weights = [20, 30, 10, 40, 30, 10, 20, 5, 20];
+st=[0,4];
+
+//Error
+//fshortestpath : Number of input arguments is expected to be 4 or 5. Found 6. Refer to help/FOT documentation for more details.
+//at line 71 of function fshortestpath called by :
+//[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st,40,1)
+
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st,40,1);
diff --git a/tests/general_tests/fshortestpath/fshortestpath_nopath1.sce b/tests/general_tests/fshortestpath/fshortestpath_nopath1.sce
new file mode 100644
index 0000000..89a5989
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_nopath1.sce
@@ -0,0 +1,16 @@
+//Check to see if there is indeed a path between the specified source and target nodes in the given graph ( Here, no 'disconnected_distance' value is specified)
+
+start_nodes=[0 0 2 1 2 4 4 4]
+end_nodes=[1 5 1 5 3 3 5 2]
+weights=[10 8 5 2 7 10 10 8]
+st=[0,3]
+
+
+//Error
+//No path connecting start-node: 0 and end-node=: 3.
+
+// No Solution![0 , 3]
+
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
diff --git a/tests/general_tests/fshortestpath/fshortestpath_nopath2.sce b/tests/general_tests/fshortestpath/fshortestpath_nopath2.sce
new file mode 100644
index 0000000..571c929
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_nopath2.sce
@@ -0,0 +1,11 @@
+//Check to see if there is an actual path between the specified source and taget nodes. In this case, there IS a path but it is ignored due to the the weight value of one or more arcs being more than the threashold value('disconnected distance) specified by the user. The routine internally checks a second time without the restriction of the threashold to provide a pertinent error regarding the same.
+
+start_nodes=[ 0 0 0 1 1 2 2 3 3 ];
+end_nodes=[ 1 2 3 2 4 3 4 2 4 ];
+weights= [ 20 30 10 40 30 10 20 5 20 ];
+st= [ 0 4];
+disconnected_distance=20;
+
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st,disconnected_distance)
diff --git a/tests/general_tests/fshortestpath/fshortestpath_nopath3.sce b/tests/general_tests/fshortestpath/fshortestpath_nopath3.sce
new file mode 100644
index 0000000..af9a5d5
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_nopath3.sce
@@ -0,0 +1,11 @@
+//Check to see if there is indeed a path between the specified source and target nodes in the given graph ( Here, a 'disconnected_distance' value is specified by the user, yet there is actually no path possible ie. the path ain't obscured due to thresholding by the 'disconnected_distance' value(double checks with max possible distance value and throws a pertinent error about the blockade of a path, if there was one)
+
+start_nodes=[0 0 2 1 2 4 4 4]
+end_nodes=[1 5 1 5 3 3 5 2]
+weights=[10 8 5 2 7 10 10 8]
+st=[0,3]
+
+
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st,50)
diff --git a/tests/general_tests/fshortestpath/fshortestpath_output1.sce b/tests/general_tests/fshortestpath/fshortestpath_output1.sce
new file mode 100644
index 0000000..67ddd4e
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_output1.sce
@@ -0,0 +1,16 @@
+//Check for the admissible number of output parameters( 2 or 3)
+
+
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3];
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4];
+weights = [20, 30, 10, 40, 30, 10, 20, 5, 20];
+st=[0,4];
+
+//Error
+//fshortestpath : Unexpected number of output parameters( Found 1). This routine expects 2 or 3 output parameters. Refer to help/FOT documentation for more details.
+//at line 78 of function fshortestpath called by :
+//[mincost]=fshortestpath(start_nodes,end_nodes,weights,st);
+
+
+
+[mincost]=fshortestpath(start_nodes,end_nodes,weights,st);
diff --git a/tests/general_tests/fshortestpath/fshortestpath_output2.sce b/tests/general_tests/fshortestpath/fshortestpath_output2.sce
new file mode 100644
index 0000000..23b36fb
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_output2.sce
@@ -0,0 +1,13 @@
+//Check for the admissible number of output parameters( 2 or 3)
+
+
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3];
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4];
+weights = [20, 30, 10, 40, 30, 10, 20, 5, 20];
+st=[0,4];
+
+//Error
+//Wrong number of output arguments.
+
+
+[mincost,shortestpath,flag,bleh]=fshortestpath(start_nodes,end_nodes,weights,st);
diff --git a/tests/general_tests/fshortestpath/fshortestpath_sourceChk.sce b/tests/general_tests/fshortestpath/fshortestpath_sourceChk.sce
new file mode 100644
index 0000000..94247bb
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_sourceChk.sce
@@ -0,0 +1,16 @@
+//Check for the validity of the specified source node in the given graph
+
+start_nodes=[ 0 0 1 1 2 4 5 4];
+end_nodes= [ 1 5 2 5 3 3 4 2];
+weights=[10 8 5 2 7 10 10 8];
+
+st=[6,4]
+
+//Error
+//fshortestpath : Invalid source node(6)- The specified source node does not exist in the given graph
+//at line 190 of function fshortestpath called by :
+//[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
diff --git a/tests/general_tests/fshortestpath/fshortestpath_st_dim.sce b/tests/general_tests/fshortestpath/fshortestpath_st_dim.sce
new file mode 100644
index 0000000..5ac8299
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_st_dim.sce
@@ -0,0 +1,17 @@
+//Check the dimensions of input matrix 'st'(expected- 1x2 ; representing the source and target nodes respectively)
+
+
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3];
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4];
+weights = [20, 30, 10, 40, 30, 10, 20, 5, 20];
+
+st=[0,4,8];
+
+//Error
+//fshortestpath: Expected size [1 2] for input argument st at input #4, but got [1 3] instead.
+//at line 49 of function Checkdims called by :
+//at line 141 of function fshortestpath called by :
+//[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
diff --git a/tests/general_tests/fshortestpath/fshortestpath_startend_integral.sce b/tests/general_tests/fshortestpath/fshortestpath_startend_integral.sce
new file mode 100644
index 0000000..f2ecd6e
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_startend_integral.sce
@@ -0,0 +1,16 @@
+//Check if start node and target node values are integral(however, 'tis not mandatory to store them in a matrix integer type)
+
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3];
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4];
+weights = [20, 30, 10, 40, 30, 10, 20, 5, 20];
+
+st=[0.4, 5.5]
+
+
+//Error
+//fshortestpath : The source and target node value(s)(input argument #4) are expected to be integral.
+//at line 171 of function fshortestpath called by :
+//[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
diff --git a/tests/general_tests/fshortestpath/fshortestpath_startnodes_dim.sce b/tests/general_tests/fshortestpath/fshortestpath_startnodes_dim.sce
new file mode 100644
index 0000000..349388a
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_startnodes_dim.sce
@@ -0,0 +1,15 @@
+//Check the dimensions of the 'start_nodes' vector(expected - 1xn matrix)
+
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3;
+ 0, 0, 0, 1, 1, 2, 2, 3, 3];
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4];
+weights = [20, 30, 10, 40, 30, 10, 20, 5, 20];
+st=[0,4];
+
+//Error
+//fshortestpath : Wrong Input Size. The input argument #1 is expected to be a matrix of dimensions of the form 1xn (2x9 obtained instead)
+//at line 123 of function fshortestpath called by :
+//[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
diff --git a/tests/general_tests/fshortestpath/fshortestpath_startnodes_integral.sce b/tests/general_tests/fshortestpath/fshortestpath_startnodes_integral.sce
new file mode 100644
index 0000000..bdacd93
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_startnodes_integral.sce
@@ -0,0 +1,15 @@
+//Check if all the start nodes' values are integral(however, 'tis not mandatory to store them in a matrix integer type)
+
+start_nodes=[ 0.8 0.3 1.5 1 2 4 5 4];
+end_nodes= [ 1 5 2 5 3 3 4 2];
+weights=[10 8 5 2 7 10 10 8];
+st=[0,3];
+
+//Error
+//fshortestpath : The values in the 'start_nodes' vector(input argument #1) are expected to be integral.
+//at line 156 of function fshortestpath called by :
+//[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
diff --git a/tests/general_tests/fshortestpath/fshortestpath_targetChk.sce b/tests/general_tests/fshortestpath/fshortestpath_targetChk.sce
new file mode 100644
index 0000000..c95c9e8
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_targetChk.sce
@@ -0,0 +1,14 @@
+//Check for the validity of the specified target node in the given graph
+
+start_nodes=[ 0 0 1 1 2 4 5 4];
+end_nodes= [ 1 5 2 5 3 3 4 2];
+weights=[10 8 5 2 7 10 10 8];
+
+st=[1,7]
+
+//Error
+//fshortestpath : Invalid target node(7)- The specified target node does not exist in the given graph
+//at line 195 of function fshortestpath called by :
+//[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
diff --git a/tests/general_tests/fshortestpath/fshortestpath_weights_dim.sce b/tests/general_tests/fshortestpath/fshortestpath_weights_dim.sce
new file mode 100644
index 0000000..c31db7a
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_weights_dim.sce
@@ -0,0 +1,18 @@
+//Check the dimensions of the 'weights' vector(expected- 1xn matrix)
+
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3];
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4];
+
+weights = [20, 30, 10, 40, 30, 10, 20, 5, 20;
+ 1, 1, 1, 1, 1, 1, 1, 1, 1;
+ 7, 5, 3, 2, 7, 2, 1, 3, 5];
+st=[0,4];
+
+//Error
+//fshortestpath : Wrong Input Size. The input argument #3 is expected to be a matrix of dimensions of the form 1xn (3x9 obtained instead)
+//at line 133 of function fshortestpath called by :
+//[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
diff --git a/tests/general_tests/fshortestpath/fshortestpath_weights_integral.sce b/tests/general_tests/fshortestpath/fshortestpath_weights_integral.sce
new file mode 100644
index 0000000..0318d21
--- /dev/null
+++ b/tests/general_tests/fshortestpath/fshortestpath_weights_integral.sce
@@ -0,0 +1,15 @@
+//Check if all the end nodes' values are integral(however, 'tis not mandatory to store them in a matrix integer type)
+
+start_nodes=[ 0 0 1 1.0 2.0 4 5 4]; //x.0 is considered integral, so 'start_nodes' doesn't throw any error
+end_nodes= [ 1 5 2 5 3 3 4 2];
+weights=[10.6 8.9 5 2 7.5 10 10 8];
+st=[0,3];
+
+
+//Error
+//fshortestpath : The values in the 'weights' vector(input argument #3) are expected to be integral.
+//at line 166 of function fshortestpath called by :
+//[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
+
+
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st)
diff --git a/tests/general_tests/jssp/jssp_duration_valid.sce b/tests/general_tests/jssp/jssp_duration_valid.sce
new file mode 100644
index 0000000..224a105
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_duration_valid.sce
@@ -0,0 +1,27 @@
+//Check if all the duration values in the 'tasks' matrix are valid (Expected- nonnegative, integral values)
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = 0;
+
+tasks=[ 1 1 -1;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//jssp : One or more 'duration' values in the 'tasks' matrix (argument #4) are invalid. Duration values cannot be negative.
+//at line 324 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_endbefore_valid.sce b/tests/general_tests/jssp/jssp_endbefore_valid.sce
new file mode 100644
index 0000000..2edabba
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_endbefore_valid.sce
@@ -0,0 +1,28 @@
+//Check if the index values in the 'end-before' column (column 5) in 'tasks' matrix (only for mode '1'), are valid
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = 1;
+
+tasks=[ 1 1 3 -1 -1;
+ 1 2 2 -1 1;
+ 1 3 2 -1 -1;
+ 2 1 2 -1 21;
+ 2 3 1 -1 -1;
+ 2 2 4 -1 -1;
+ 3 2 4 --1 -1;
+ 3 3 3 -1 -1;
+ ];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//jssp : One or more job-index values in the 'end-before' column (column 5) in the 'tasks' matrix (argument #4) are invalid. Expected - either '-1' or a value from '1' to '3'.
+//at line 348 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_firsttask_mode1.sce b/tests/general_tests/jssp/jssp_firsttask_mode1.sce
new file mode 100644
index 0000000..f12bf95
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_firsttask_mode1.sce
@@ -0,0 +1,25 @@
+//For mode '1', checking if there's one task eligible to be the very first task in the schedule
+
+machines = 2;
+jobs = 5;
+jssp_mode = 1;
+
+tasks = [1 1 13 1 -1;
+ 1 2 3 1 -1;
+ 2 1 2 1 -1;
+ 2 2 5 1 -1;
+ 3 1 1 1 -1;
+ 3 2 3 1 -1;
+ 4 1 4 1 -1;
+ 4 2 6 1 -1;
+ 5 1 5 1 -1;
+ 5 2 7 1 -1];
+
+time_limit = [];
+
+//Error
+//jssp : At least one task in every job must be free from a 'start-after' constraint ( = -1), to serve as a potential first task for that job. No such tasks found in job #1.
+//at line 371 of function jssp called by :
+//[makespan, schedule, status] = jssp (machines, jobs, jssp_mode, tasks, time_limit);
+
+[makespan, schedule, status] = jssp (machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_inputargs.sce b/tests/general_tests/jssp/jssp_inputargs.sce
new file mode 100644
index 0000000..2c71567
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_inputargs.sce
@@ -0,0 +1,26 @@
+//Check if the number of input arguments is correct/permissible
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+bleh = [1];
+
+//Error
+// !--error 10000
+//jssp : Unexpected number of input arguments. '4' or '5' expected. Refer to help/FOT Documentation for more details.
+//at line 112 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, [], bleh);
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, [], bleh);
diff --git a/tests/general_tests/jssp/jssp_jmode_dims.sce b/tests/general_tests/jssp/jssp_jmode_dims.sce
new file mode 100644
index 0000000..9e18b47
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_jmode_dims.sce
@@ -0,0 +1,26 @@
+//Check if the dimensions of 'jmode' are correct (Expected - Singular , 0/1 value)
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = [0 1];
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+
+//Error
+// !--error 10000
+//jssp : Wrong dimensions for input argument #3 ('jmode'). Single integral value [1x1] expected.
+//at line 186 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, []);
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, []);
diff --git a/tests/general_tests/jssp/jssp_jmode_int.sce b/tests/general_tests/jssp/jssp_jmode_int.sce
new file mode 100644
index 0000000..4dcae1f
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_jmode_int.sce
@@ -0,0 +1,27 @@
+//Check if the value of 'machines' is integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = 0.1;
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//jssp : Input argument #3('jmode') can only take the value '0' or '1' (details in help/FOT documentation).
+//at line 193 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_jmode_type.sce b/tests/general_tests/jssp/jssp_jmode_type.sce
new file mode 100644
index 0000000..1644269
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_jmode_type.sce
@@ -0,0 +1,28 @@
+//Check if 'jmode' is of the correct type
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = "0";
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//jssp: Expected type ["constant"] for input argument jmode at input #3, but got "string" instead.
+//at line 56 of function Checktype called by :
+//at line 145 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_jmode_valid.sce b/tests/general_tests/jssp/jssp_jmode_valid.sce
new file mode 100644
index 0000000..f290fbe
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_jmode_valid.sce
@@ -0,0 +1,27 @@
+//Check if the 'jmode' value is valid (Expected - only integral '0' or '1')
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = 2;
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//jssp : Input argument #3('jmode') can only take the value '0' or '1' (details in help/FOT documentation).
+//at line 193 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_jobindices_valid.sce b/tests/general_tests/jssp/jssp_jobindices_valid.sce
new file mode 100644
index 0000000..ef0166b
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_jobindices_valid.sce
@@ -0,0 +1,27 @@
+//Checking if all the job-indices in the 'tasks' matrix (column 1) are valid
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 4 2 4;
+ 3 3 3;
+ ];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//jssp : One or more job-index values in the 'tasks' matrix (argument #4) are invalid. Job indices can only take values from '1' to '3'.
+//at line 307 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_jobs_dims.sce b/tests/general_tests/jssp/jssp_jobs_dims.sce
new file mode 100644
index 0000000..5895ac7
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_jobs_dims.sce
@@ -0,0 +1,26 @@
+//Check if the dimensions of 'jobs' is correct( Expected- Singular, integral value)
+
+machines = 3;
+jobs = [];
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+
+
+//Error
+// !--error 10000
+//jssp : Wrong dimensions for input argument #2 ('jobs'). Single integral value [1x1] expected.
+//at line 175 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, []);
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, []);
diff --git a/tests/general_tests/jssp/jssp_jobs_int.sce b/tests/general_tests/jssp/jssp_jobs_int.sce
new file mode 100644
index 0000000..f90c4b8
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_jobs_int.sce
@@ -0,0 +1,27 @@
+//Check if the value of 'jobs' is integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+machines = 3;
+jobs = 3.00001;
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//jssp : Number of jobs ( 'jobs' ; argument #2) is expected to be an integral value.
+//at line 252 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_jobs_type.sce b/tests/general_tests/jssp/jssp_jobs_type.sce
new file mode 100644
index 0000000..edb3074
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_jobs_type.sce
@@ -0,0 +1,30 @@
+//Checking if 'jobs' is of the correct type
+
+machines = 3;
+jobs = "3";
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//jssp: Expected type ["constant"] for input argument jobs at input #2, but got "string" instead.
+//at line 56 of function Checktype called by :
+//at line 144 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+
+
diff --git a/tests/general_tests/jssp/jssp_lasttask_mode1.sce b/tests/general_tests/jssp/jssp_lasttask_mode1.sce
new file mode 100644
index 0000000..25f7eb8
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_lasttask_mode1.sce
@@ -0,0 +1,27 @@
+//For mode '1', checking if there's one task eligible to be the very last task in the schedule
+
+machines = 2;
+jobs = 5;
+jssp_mode = 1;
+
+tasks = [1 1 13 -1 1;
+ 1 2 3 -1 1;
+ 2 1 2 -1 1;
+ 2 2 5 -1 1;
+ 3 1 1 -1 1;
+ 3 2 3 -1 1;
+ 4 1 4 -1 1;
+ 4 2 6 -1 1;
+ 5 1 5 -1 1;
+ 5 2 7 -1 1];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//jssp : At least one task in every job must be free from an 'end-before' constraint ( = -1), to serve as a potential last task for that job. No such tasks found in job #1.
+//at line 364 of function jssp called by :
+//[makespan, schedule, status] = jssp (machines, jobs, jssp_mode, tasks, time_limit);
+//
+
+[makespan, schedule, status] = jssp (machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_machineindices_valid.sce b/tests/general_tests/jssp/jssp_machineindices_valid.sce
new file mode 100644
index 0000000..d34ca6d
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_machineindices_valid.sce
@@ -0,0 +1,28 @@
+//Checking if all the machine-indices in the 'tasks' matrix (column 1) are valid
+
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3;
+ 1 4 2;
+ 1 3 2;
+ 2 6 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//jssp : One or more machine-index values in the 'tasks' matrix (argument #4) are invalid. Machine indices can only take values from '1' to '3'.
+//at line 315 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_machines_dims.sce b/tests/general_tests/jssp/jssp_machines_dims.sce
new file mode 100644
index 0000000..621a9d2
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_machines_dims.sce
@@ -0,0 +1,27 @@
+//Check if the dimensions of 'machines' is correct(Expected- Single, integral value)
+
+machines = [3 1];
+jobs = 3;
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+//Error
+// !--error 10000
+//jssp : Wrong dimensions for input argument #1 ('machines'). Single integral value [1x1] expected.
+//at line 162 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, []);
+//
+
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, []);
diff --git a/tests/general_tests/jssp/jssp_machines_int.sce b/tests/general_tests/jssp/jssp_machines_int.sce
new file mode 100644
index 0000000..44c7df6
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_machines_int.sce
@@ -0,0 +1,29 @@
+//Check if the value of 'machines' is integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+
+machines = 3.1;
+jobs = 3;
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//jssp : Number of machines ( 'machines' ; argument #1) is expected to be an integral value.
+//at line 244 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+//
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_machines_type.sce b/tests/general_tests/jssp/jssp_machines_type.sce
new file mode 100644
index 0000000..af3724f
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_machines_type.sce
@@ -0,0 +1,28 @@
+//Check if 'machines' is of the correct type
+
+machines = list(3);
+jobs = 3;
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//jssp: Expected type ["constant"] for input argument machines at input #1, but got "list" instead.
+//at line 56 of function Checktype called by :
+//at line 143 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_outputargs.sce b/tests/general_tests/jssp/jssp_outputargs.sce
new file mode 100644
index 0000000..158fd00
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_outputargs.sce
@@ -0,0 +1,24 @@
+//Check if the number of output arguments is correct/permissible
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+
+
+//Error
+//!--error 59
+//Wrong number of output arguments.
+
+[makespan, schedule, status, redundancy] = jssp(machines, jobs, jssp_mode, tasks, []);
diff --git a/tests/general_tests/jssp/jssp_startafter_valid.sce b/tests/general_tests/jssp/jssp_startafter_valid.sce
new file mode 100644
index 0000000..da93a37
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_startafter_valid.sce
@@ -0,0 +1,27 @@
+//Check if the index values in the 'start-after' column (column 4) in 'tasks' matrix (only for mode '1'), are valid
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = 1;
+
+tasks=[ 1 1 3 -1 -1;
+ 1 2 2 -1 1;
+ 1 3 2 -1 -1;
+ 2 1 2 -1 -1;
+ 2 3 1 -1 -1;
+ 2 2 4 -1 -1;
+ 3 2 4 -100 -1;
+ 3 3 3 -1 -1;
+ ];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//jssp : One or more job-index values in the 'start-after' column ( column 4) in the 'tasks' matrix (argument #4) are invalid. Expected - either '-1' or a value from '1' to '3'.
+//at line 340 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_tasks_dims.sce b/tests/general_tests/jssp/jssp_tasks_dims.sce
new file mode 100644
index 0000000..1812f52
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_tasks_dims.sce
@@ -0,0 +1,26 @@
+//Check if the dimensions of the 'tasks' matrix are correct ( Expected - a 3-column matrix for mode '0' and a 5-column matrix for mode '1')
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3 1;
+ 1 2 2 1;
+ 1 3 2 1;
+ 2 1 2 1;
+ 2 3 1 1;
+ 2 2 4 1;
+ 3 2 4 1;
+ 3 3 3 1;
+ ];
+
+//Error
+// !--error 10000
+//jssp : Wrong dimensions for input argument #4( 'tasks'). [8x3] expected.
+//at line 209 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, []);
+
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, []);
diff --git a/tests/general_tests/jssp/jssp_tasks_int.sce b/tests/general_tests/jssp/jssp_tasks_int.sce
new file mode 100644
index 0000000..a2f4e09
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_tasks_int.sce
@@ -0,0 +1,27 @@
+//Check if all the values of the adjacency matrix - 'adj_matrix' are integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3;
+ 1 2.01 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//jssp : All the values in the 'tasks' matrix (argument #4) are expected to be integral.
+//at line 263 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_tasks_type.sce b/tests/general_tests/jssp/jssp_tasks_type.sce
new file mode 100644
index 0000000..125b654
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_tasks_type.sce
@@ -0,0 +1,28 @@
+//Check if 'tasks' is of the correct type
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = 0;
+
+tasks=list([ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ]);
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//jssp: Expected type ["constant"] for input argument tasks at input #4, but got "list" instead.
+//at line 56 of function Checktype called by :
+//at line 146 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_timelimit_dims.sce b/tests/general_tests/jssp/jssp_timelimit_dims.sce
new file mode 100644
index 0000000..8d81e72
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_timelimit_dims.sce
@@ -0,0 +1,26 @@
+//Check if the dimension of 'time_limit' , if provided, are correct (Expected - Singular, integral, positive value)
+machines = 3;
+jobs = 3;
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+time_limit = [1 3];
+
+//Error
+// !--error 10000
+//jssp : Wrong dimensions for input argument #5('time_limit'). Single integral value [1x1] or an empty matrix expected.
+//at line 229 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_timelimit_int.sce b/tests/general_tests/jssp/jssp_timelimit_int.sce
new file mode 100644
index 0000000..dd2b07d
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_timelimit_int.sce
@@ -0,0 +1,28 @@
+//Check if the value of 'time_limit', if provided, is integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+time_limit = 100.90;
+
+
+//Error
+// !--error 10000
+//jssp : Time Limit ( 'time_limit' ; argument #5 ) is expected to be an integral value.
+//at line 271 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+//
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_timelimit_type.sce b/tests/general_tests/jssp/jssp_timelimit_type.sce
new file mode 100644
index 0000000..a38a090
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_timelimit_type.sce
@@ -0,0 +1,30 @@
+//Check if 'time_limit' is of the correct type
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+time_limit = "1000";
+
+
+//Error
+// !--error 10000
+//jssp: Expected type ["constant"] for input argument time_limit at input #5, but got "string" instead.
+//at line 56 of function Checktype called by :
+//at line 147 of function jssp called by :
+//[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
+//
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/jssp/jssp_timelimit_valid.sce b/tests/general_tests/jssp/jssp_timelimit_valid.sce
new file mode 100644
index 0000000..5902f5b
--- /dev/null
+++ b/tests/general_tests/jssp/jssp_timelimit_valid.sce
@@ -0,0 +1,29 @@
+//Check if the value of 'time_limit' is valid ( Expected- Positive integral value)
+
+
+
+machines = 2;
+jobs = 5;
+jssp_mode = 0;
+
+tasks = [1 1 13;
+ 1 2 3;
+ 2 1 2;
+ 2 2 5;
+ 3 1 1;
+ 3 2 3;
+ 4 1 4;
+ 4 2 6;
+ 5 1 5;
+ 5 2 7];
+
+time_limit = 0;
+
+
+//Error
+// !--error 10000
+//jssp : Invalid value for argument #5 ('time_limit'). A positive, integral value expected.
+//at line 298 of function jssp called by :
+//[makespan, schedule, status] = jssp (machines, jobs, jssp_mode, tasks, time_limit);
+
+[makespan, schedule, status] = jssp (machines, jobs, jssp_mode, tasks, time_limit);
diff --git a/tests/general_tests/linsum/linsum_t1.sce b/tests/general_tests/linsum/linsum_t1.sce
new file mode 100644
index 0000000..29b3cd5
--- /dev/null
+++ b/tests/general_tests/linsum/linsum_t1.sce
@@ -0,0 +1,6 @@
+// Number of Left Nodes should be > 0. Check input #1
+
+kNumLeftNodes = -1;
+kNumRightNodes = 4;
+kCost = [82, 83, 69, 92; 77, 37, 49, 92; 11, 69, 5, 86; 8, 9, 98, 23];
+[cost, assignment, status] = linsum(kNumLeftNodes, kNumRightNodes, kCost);
diff --git a/tests/general_tests/linsum/linsum_t2.sce b/tests/general_tests/linsum/linsum_t2.sce
new file mode 100644
index 0000000..0383168
--- /dev/null
+++ b/tests/general_tests/linsum/linsum_t2.sce
@@ -0,0 +1,6 @@
+// Number of Right Nodes should be > 0. Check input #1
+
+kNumLeftNodes = 4;
+kNumRightNodes = -1;
+kCost = [82, 83, 69, 92; 77, 37, 49, 92; 11, 69, 5, 86; 8, 9, 98, 23];
+[cost, assignment, status] = linsum(kNumLeftNodes, kNumRightNodes, kCost);
diff --git a/tests/general_tests/linsum/linsum_t3.sce b/tests/general_tests/linsum/linsum_t3.sce
new file mode 100644
index 0000000..04e8f0e
--- /dev/null
+++ b/tests/general_tests/linsum/linsum_t3.sce
@@ -0,0 +1,6 @@
+// Number of Left Nodes should be EQUAL to Number of Right Nodes
+
+kNumLeftNodes = 4;
+kNumRightNodes = 5;
+kCost = [82, 83, 69, 92, 0; 77, 37, 49, 92, 0; 11, 69, 5, 86, 0; 8, 9, 98, 23, 0];
+[cost, assignment, status] = linsum(kNumLeftNodes, kNumRightNodes, kCost);
diff --git a/tests/general_tests/linsum/linsum_t4.sce b/tests/general_tests/linsum/linsum_t4.sce
new file mode 100644
index 0000000..fedf49b
--- /dev/null
+++ b/tests/general_tests/linsum/linsum_t4.sce
@@ -0,0 +1,6 @@
+// Expected type ["constant"] for input argument kNumSources at input #1, but got "string" instead.
+
+kNumLeftNodes = '4';
+kNumRightNodes = 5;
+kCost = [82, 83, 69, 92, 0; 77, 37, 49, 92, 0; 11, 69, 5, 86, 0; 8, 9, 98, 23, 0];
+[cost, assignment, status] = linsum(kNumLeftNodes, kNumRightNodes, kCost);
diff --git a/tests/general_tests/linsum/linsum_t5.sce b/tests/general_tests/linsum/linsum_t5.sce
new file mode 100644
index 0000000..08ae1df
--- /dev/null
+++ b/tests/general_tests/linsum/linsum_t5.sce
@@ -0,0 +1,6 @@
+// Expected type ["constant"] for input argument kNumRightNodes at input #2, but got "string" instead.
+
+kNumLeftNodes = 4;
+kNumRightNodes = '5';
+kCost = [82, 83, 69, 92, 0; 77, 37, 49, 92, 0; 11, 69, 5, 86, 0; 8, 9, 98, 23, 0];
+[cost, assignment, status] = linsum(kNumLeftNodes, kNumRightNodes, kCost);
diff --git a/tests/general_tests/linsum/linsum_t6.sce b/tests/general_tests/linsum/linsum_t6.sce
new file mode 100644
index 0000000..8bd7d79
--- /dev/null
+++ b/tests/general_tests/linsum/linsum_t6.sce
@@ -0,0 +1,6 @@
+// Expected type ["constant"] for input argument kCost at input #3, but got "string" instead.
+
+kNumLeftNodes = 4;
+kNumRightNodes = 5;
+kCost = ['82', '83', '69', '92', '0'; '77', '37', '49', '92', '0'; '11', '69', '5', '86', '0'; '8', '9', '98', '23', '0'];
+[cost, assignment, status] = linsum(kNumLeftNodes, kNumRightNodes, kCost);
diff --git a/tests/general_tests/linsum/linsum_t7.sce b/tests/general_tests/linsum/linsum_t7.sce
new file mode 100644
index 0000000..ceea9db
--- /dev/null
+++ b/tests/general_tests/linsum/linsum_t7.sce
@@ -0,0 +1,6 @@
+// Unexpected number of input arguments : 2 provided while the number of expected input arguments should be in the set [3]
+
+kNumLeftNodes = 4;
+kNumRightNodes = 4;
+kCost = [82, 83, 69, 92; 77, 37, 49, 92; 11, 69, 5, 86; 8, 9, 98, 23];
+[cost, assignment, status] = linsum(kNumLeftNodes, kNumRightNodes); // <---
diff --git a/tests/general_tests/linsum/linsum_t8.sce b/tests/general_tests/linsum/linsum_t8.sce
new file mode 100644
index 0000000..8951a18
--- /dev/null
+++ b/tests/general_tests/linsum/linsum_t8.sce
@@ -0,0 +1,6 @@
+// Expected size [4 4] for input argument kCost at input #3, but got [4 3] instead
+
+kNumLeftNodes = 4;
+kNumRightNodes = 4;
+kCost = [82, 83, 69; 77, 37, 49; 11, 69, 5; 8, 9, 98];
+[cost, assignment, status] = linsum(kNumLeftNodes, kNumRightNodes, kCost);
diff --git a/tests/general_tests/linsum/linsum_t9.sce b/tests/general_tests/linsum/linsum_t9.sce
new file mode 100644
index 0000000..2dd8e98
--- /dev/null
+++ b/tests/general_tests/linsum/linsum_t9.sce
@@ -0,0 +1,6 @@
+// Unexpected number of output arguments : 1 provided while the expected number of output arguments should be in the set [2 3].
+
+kNumLeftNodes = 4;
+kNumRightNodes = 4;
+kCost = [82, 83, 69, 100; 77, 37, 49, 100; 11, 69, 5, 100; 8, 9, 98, 100];
+linsum(kNumLeftNodes, kNumRightNodes, kCost); // <---
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t1.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t1.sce
new file mode 100644
index 0000000..69d26e5
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t1.sce
@@ -0,0 +1,9 @@
+// Number of Sources should be > 0. Check input #1
+
+kNumSources = -1;
+kNumTargets = 4;
+kCost = [4, 6, 8, 13; 13, 11, 10, 8; 14, 4, 10, 13; 9, 11, 13, 8];
+kCapacity = [200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200];
+kSupply = [50, 70, 30, 50];
+kDemand = [25, 35, 105, 20];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t10.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t10.sce
new file mode 100644
index 0000000..07b70ee
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t10.sce
@@ -0,0 +1,9 @@
+// Expected type ["constant"] for input argument kSupply at input #5, but got "string" instead.
+
+kNumSources = 4;
+kNumTargets = 5;
+kCost = [4, 6, 8, 13, 0; 13, 11, 10, 8, 0; 14, 4, 10, 13, 0; 9, 11, 13, 8, 0];
+kCapacity = [200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200];
+kSupply = ['50', '70', '30', '50'];
+kDemand = [25, 35, 105, 20, 15];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t11.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t11.sce
new file mode 100644
index 0000000..c44f685
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t11.sce
@@ -0,0 +1,9 @@
+// Expected type ["constant"] for input argument kDemand at input #6, but got "string" instead.
+
+kNumSources = 4;
+kNumTargets = 5;
+kCost = [4, 6, 8, 13, 0; 13, 11, 10, 8, 0; 14, 4, 10, 13, 0; 9, 11, 13, 8, 0];
+kCapacity = [200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200];
+kSupply = [50, 70, 30, 50];
+kDemand = ['25', '35', '105', '20', '15'];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t12.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t12.sce
new file mode 100644
index 0000000..65cbbc4
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t12.sce
@@ -0,0 +1,9 @@
+// Unexpected number of output arguments : 1 provided while the expected number of output arguments should be in the set [2 3].
+
+kNumSources = 4;
+kNumTargets = 5;
+kCost = [4, 6, 8, 13, 0; 13, 11, 10, 8, 0; 14, 4, 10, 13, 0; 9, 11, 13, 8, 0];
+kCapacity = [200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200];
+kSupply = [50, 70, 30, 50];
+kDemand = [25, 35, 105, 20, 15];
+min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand); // <---
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t13.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t13.sce
new file mode 100644
index 0000000..5ab2fc3
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t13.sce
@@ -0,0 +1,9 @@
+// Expected size [4 5] for input argument kCost at input #3, but got [4 4] instead.
+
+kNumSources = 4;
+kNumTargets = 5;
+kCost = [4, 6, 8, 13; 13, 11, 10, 8; 14, 4, 10, 13; 9, 11, 13, 8]; // <---
+kCapacity = [200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200];
+kSupply = [50, 70, 30, 50];
+kDemand = [25, 35, 105, 20, 15];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t14.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t14.sce
new file mode 100644
index 0000000..2356b01
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t14.sce
@@ -0,0 +1,9 @@
+// Expected size [4 5] for input argument kCapacity at input #4, but got [4 4] instead.
+
+kNumSources = 4;
+kNumTargets = 5;
+kCost = [4, 6, 8, 13, 0; 13, 11, 10, 8, 0; 14, 4, 10, 13, 0; 9, 11, 13, 8, 0];
+kCapacity = [200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200]; // <---
+kSupply = [50, 70, 30, 50];
+kDemand = [25, 35, 105, 20, 15];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t15.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t15.sce
new file mode 100644
index 0000000..eab0015
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t15.sce
@@ -0,0 +1,9 @@
+// Expected size [1 4] for input argument kSupply at input #5, but got [1 3] instead.
+
+kNumSources = 4;
+kNumTargets = 5;
+kCost = [4, 6, 8, 13, 0; 13, 11, 10, 8, 0; 14, 4, 10, 13, 0; 9, 11, 13, 8, 0];
+kCapacity = [200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200];
+kSupply = [50, 70, 30];
+kDemand = [25, 35, 105, 20, 15];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t16.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t16.sce
new file mode 100644
index 0000000..64d2a60
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t16.sce
@@ -0,0 +1,9 @@
+// Expected size [1 5] for input argument kDemand at input #6, but got [1 4] instead.
+
+kNumSources = 4;
+kNumTargets = 5;
+kCost = [4, 6, 8, 13, 0; 13, 11, 10, 8, 0; 14, 4, 10, 13, 0; 9, 11, 13, 8, 0];
+kCapacity = [200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200];
+kSupply = [50, 70, 30, 50];
+kDemand = [25, 35, 105, 20];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t17.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t17.sce
new file mode 100644
index 0000000..cb8da0f
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t17.sce
@@ -0,0 +1,9 @@
+// Unexpected number of input arguments : 4 provided while the number of expected input arguments should be in the set [6].
+
+kNumSources = 4;
+kNumTargets = 5;
+kCost = [4, 6, 8, 13, 0; 13, 11, 10, 8, 0; 14, 4, 10, 13, 0; 9, 11, 13, 8, 0];
+kCapacity = [200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200];
+kSupply = [50, 70, 30, 50];
+kDemand = [25, 35, 105, 20, 15];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity);
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t2.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t2.sce
new file mode 100644
index 0000000..a6cd6e7
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t2.sce
@@ -0,0 +1,9 @@
+// Number of Targets should be > 0. Check input #2
+
+kNumSources = 4;
+kNumTargets = -1;
+kCost = [4, 6, 8, 13; 13, 11, 10, 8; 14, 4, 10, 13; 9, 11, 13, 8];
+kCapacity = [200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200];
+kSupply = [50, 70, 30, 50];
+kDemand = [25, 35, 105, 20];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t3.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t3.sce
new file mode 100644
index 0000000..67607f1
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t3.sce
@@ -0,0 +1,9 @@
+// Capacity should be >= 0. Check input #4
+
+kNumSources = 4;
+kNumTargets = 4;
+kCost = [4, 6, 8, 13; 13, 11, 10, 8; 14, 4, 10, 13; 9, 11, 13, 8];
+kCapacity = [-1, 200, 200, 200; 200, -1, 200, 200; 200, 200, 200, -1; 200, 200, 200, -1];
+kSupply = [50, 70, 30, 50];
+kDemand = [25, 35, 105, 20];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t4.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t4.sce
new file mode 100644
index 0000000..85ee391
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t4.sce
@@ -0,0 +1,9 @@
+// Supply should be >= 0. Check input #5
+
+kNumSources = 4;
+kNumTargets = 4;
+kCost = [4, 6, 8, 13; 13, 11, 10, 8; 14, 4, 10, 13; 9, 11, 13, 8];
+kCapacity = [200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200];
+kSupply = [50, -1, 30, 50];
+kDemand = [25, 35, 105, 20];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t5.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t5.sce
new file mode 100644
index 0000000..ff630b6
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t5.sce
@@ -0,0 +1,9 @@
+// Demand should be >= 0. Check input #6
+
+kNumSources = 4;
+kNumTargets = 4;
+kCost = [4, 6, 8, 13; 13, 11, 10, 8; 14, 4, 10, 13; 9, 11, 13, 8];
+kCapacity = [200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200];
+kSupply = [50, 70, 30, 50];
+kDemand = [25, -1, 105, 20];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t6.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t6.sce
new file mode 100644
index 0000000..38c9aa0
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t6.sce
@@ -0,0 +1,9 @@
+// Expected type ["constant"] for input argument kNumSources at input #1, but got "string" instead.
+
+kNumSources = '4';
+kNumTargets = 5;
+kCost = [4, 6, 8, 13, 0; 13, 11, 10, 8, 0; 14, 4, 10, 13, 0; 9, 11, 13, 8, 0];
+kCapacity = [200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200];
+kSupply = [50, 70, 30, 50];
+kDemand = [25, 35, 105, 20, 15];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t7.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t7.sce
new file mode 100644
index 0000000..73f8ed4
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t7.sce
@@ -0,0 +1,9 @@
+// Expected type ["constant"] for input argument kNumTargets at input #2, but got "string" instead.
+
+kNumSources = 4;
+kNumTargets = '5';
+kCost = [4, 6, 8, 13, 0; 13, 11, 10, 8, 0; 14, 4, 10, 13, 0; 9, 11, 13, 8, 0];
+kCapacity = [200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200];
+kSupply = [50, 70, 30, 50];
+kDemand = [25, 35, 105, 20, 15];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t8.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t8.sce
new file mode 100644
index 0000000..65d461c
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t8.sce
@@ -0,0 +1,9 @@
+// Expected type ["constant"] for input argument kCost at input #3, but got "string" instead.
+
+kNumSources = 4;
+kNumTargets = 5;
+kCost = ['4', '6', '8', '13', '0'; '13', '11', '10', '8', '0'; '14', '4', '10', '13', '0'; '9', '11', '13', '8', '0'];
+kCapacity = [200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200];
+kSupply = [50, 70, 30, 50];
+kDemand = [25, 35, 105, 20, 15];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
diff --git a/tests/general_tests/min_cost_flow/min_cost_flow_t9.sce b/tests/general_tests/min_cost_flow/min_cost_flow_t9.sce
new file mode 100644
index 0000000..c56e208
--- /dev/null
+++ b/tests/general_tests/min_cost_flow/min_cost_flow_t9.sce
@@ -0,0 +1,9 @@
+// Expected type ["constant"] for input argument kCapacity at input #4, but got "string" instead.
+
+kNumSources = 4;
+kNumTargets = 5;
+kCost = [4, 6, 8, 13, 0; 13, 11, 10, 8, 0; 14, 4, 10, 13, 0; 9, 11, 13, 8, 0];
+kCapacity = ['200', '200', '200', '200', '200'; '200', '200', '200', '200', '200'; '200', '200', '200', '200', '200'; '200', '200', '200', '200', '200'];
+kSupply = [50, 70, 30, 50];
+kDemand = [25, 35, 105, 20, 15];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t1.sce b/tests/general_tests/qcqpglob/qcqpglob_t1.sce
new file mode 100644
index 0000000..d4446f4
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t1.sce
@@ -0,0 +1,17 @@
+// Number of Decision Variables should be > 0. Check input #1
+
+n = 0; // <--
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t10.sce b/tests/general_tests/qcqpglob/qcqpglob_t10.sce
new file mode 100644
index 0000000..48b527d
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t10.sce
@@ -0,0 +1,17 @@
+// Expected size [1 1] for input argument lb_con at input #8, but got [0 0] instead.
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = []; // <--
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t11.sce b/tests/general_tests/qcqpglob/qcqpglob_t11.sce
new file mode 100644
index 0000000..cafe594
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t11.sce
@@ -0,0 +1,17 @@
+// Expected size [1 1] for input argument ub_con at input #9, but got [0 0] instead.
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = []; // <--
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t12.sce b/tests/general_tests/qcqpglob/qcqpglob_t12.sce
new file mode 100644
index 0000000..b1e5044
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t12.sce
@@ -0,0 +1,17 @@
+// 'maxcputime' should be > 0. Check input #12
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 0; // <--
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t13.sce b/tests/general_tests/qcqpglob/qcqpglob_t13.sce
new file mode 100644
index 0000000..5d349f4
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t13.sce
@@ -0,0 +1,17 @@
+// Expected size [1 2] for input argument lb_var at input #10, but got [1 1] instead.
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10]; // <--
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t14.sce b/tests/general_tests/qcqpglob/qcqpglob_t14.sce
new file mode 100644
index 0000000..3651114
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t14.sce
@@ -0,0 +1,17 @@
+// Expected size [1 2] for input argument ub_var at input #11, but got [1 1] instead.
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6]; // <--
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t15.sce b/tests/general_tests/qcqpglob/qcqpglob_t15.sce
new file mode 100644
index 0000000..5bcd2f1
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t15.sce
@@ -0,0 +1,17 @@
+// Unexpected number of output arguments : 1 provided while the expected number of output arguments should be in the set [2 3].
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime); // <--
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t16.sce b/tests/general_tests/qcqpglob/qcqpglob_t16.sce
new file mode 100644
index 0000000..2bf1036
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t16.sce
@@ -0,0 +1,17 @@
+// Unexpected number of input arguments : 9 provided while the number of expected input arguments should be in the set [11 12].
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con); // <--
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t2.sce b/tests/general_tests/qcqpglob/qcqpglob_t2.sce
new file mode 100644
index 0000000..d91f7ed
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t2.sce
@@ -0,0 +1,17 @@
+// Number of Constraints should be >= 0. Check input #2
+
+n = 2;
+m = -1; // <--
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t3.sce b/tests/general_tests/qcqpglob/qcqpglob_t3.sce
new file mode 100644
index 0000000..8dbc019
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t3.sce
@@ -0,0 +1,17 @@
+// Expected size [2 2] for input argument h_obj at input #3, but got [1 4] instead.
+
+n = 2;
+m = 1;
+h_obj = [-2, -1, -2, 4]; // <--
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t4.sce b/tests/general_tests/qcqpglob/qcqpglob_t4.sce
new file mode 100644
index 0000000..bfdd5e3
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t4.sce
@@ -0,0 +1,17 @@
+// Expected size [1 2] for input argument f_obj at input #4, but got [1 1] instead.
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4]; // <--
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t5.sce b/tests/general_tests/qcqpglob/qcqpglob_t5.sce
new file mode 100644
index 0000000..c98eee8
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t5.sce
@@ -0,0 +1,17 @@
+// Expected size [1 1] for input argument c_obj at input #5, but got [0 0] instead.
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = []; // <--
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t6.sce b/tests/general_tests/qcqpglob/qcqpglob_t6.sce
new file mode 100644
index 0000000..4603a0b
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t6.sce
@@ -0,0 +1,17 @@
+// Expected type ["list"] for input argument h_con at input #6, but got "constant" instead.
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = []; // <--
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t7.sce b/tests/general_tests/qcqpglob/qcqpglob_t7.sce
new file mode 100644
index 0000000..69df594
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t7.sce
@@ -0,0 +1,17 @@
+// Expected size [2 2] for input argument h_con(1) at input #6, but got [1 4] instead.
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0, 0, 2]; // <--
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t8.sce b/tests/general_tests/qcqpglob/qcqpglob_t8.sce
new file mode 100644
index 0000000..eb94de7
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t8.sce
@@ -0,0 +1,17 @@
+// Expected type ["list"] for input argument f_con at input #7, but got "constant" instead.
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = []; // <--
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
diff --git a/tests/general_tests/qcqpglob/qcqpglob_t9.sce b/tests/general_tests/qcqpglob/qcqpglob_t9.sce
new file mode 100644
index 0000000..646689d
--- /dev/null
+++ b/tests/general_tests/qcqpglob/qcqpglob_t9.sce
@@ -0,0 +1,17 @@
+// Expected size [1 2] for input argument f_con(1) at input #7, but got [1 1] instead.
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1]; // <--
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
diff --git a/tests/general_tests/tsp/tsp_adj_diag.sce b/tests/general_tests/tsp/tsp_adj_diag.sce
new file mode 100644
index 0000000..b595ec4
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_adj_diag.sce
@@ -0,0 +1,20 @@
+//Check if all the diagonal elements of the given adjacency matrix are '0'
+adj = [0 10 15 20;
+ 10 1 35 25;
+ 15 35 0 30;
+ 20 25 30 0;];
+
+start_node=1;
+
+labels=['A' 'B' 'C' 'D'];
+
+
+//Error
+//tsp : All leading diagonal elements of the adjacency matrix need to be 0
+//at line 138 of function tsp called by :
+//[mincost,path,status]=tsp(adj,start_node,labels);
+
+
+
+[mincost,path,status]=tsp(adj,start_node,labels);
+
diff --git a/tests/general_tests/tsp/tsp_adj_dims.sce b/tests/general_tests/tsp/tsp_adj_dims.sce
new file mode 100644
index 0000000..596ab11
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_adj_dims.sce
@@ -0,0 +1,20 @@
+//Check if the dimensions of the adjacency matrix are corrent( [n x n] expected ; n-> number of nodes in the graph)
+
+adj = [0 10 15 20;
+ 10 0 35 25;
+ 15 35 0 30;
+ 20 25 30 0;
+ 13 23 10 10];
+
+start_node=1;
+
+labels=['A' 'B' 'C' 'D'];
+
+//Error
+//tsp : The dimensions of the given adjacency matrix are erroneous [5 x 4]. Number of rows and columns has to be equal(square matrix) ( = no. of nodes in the graph).
+//at line 130 of function tsp called by :
+//[mincost,path,status]=tsp(adj,start_node,labels);
+
+
+
+[mincost,path,status]=tsp(adj,start_node,labels);
diff --git a/tests/general_tests/tsp/tsp_adj_integral.sce b/tests/general_tests/tsp/tsp_adj_integral.sce
new file mode 100644
index 0000000..1b0dd3a
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_adj_integral.sce
@@ -0,0 +1,22 @@
+//Check if all the values of the adjacency matrix are integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+adj = [0 10.3 15 20;
+ 10 0 35 25;
+ 15 35 0 30;
+ 20 25 30 0];
+
+start_node=1;
+
+labels=['A' 'B' 'C' 'D'];
+
+
+//Error
+//tsp : All values in the adjacency matrix ( input argument #1) are expected to be integral
+//at line 155 of function tsp called by :
+//[mincost,path,status]=tsp(adj,start_node,labels);
+
+
+[mincost,path,status]=tsp(adj,start_node,labels);
+
+
+
diff --git a/tests/general_tests/tsp/tsp_adj_type.sce b/tests/general_tests/tsp/tsp_adj_type.sce
new file mode 100644
index 0000000..5c5bcb4
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_adj_type.sce
@@ -0,0 +1,20 @@
+// Check if the type of the adj_matrix is correct ("constant" ie. scilab numeric matrix)
+
+adj = ['0' '10' '15' '20';
+ '10' '0' '35' '25';
+ '15' '35' '0' '30';
+ '20' '25' '30' '0'];
+
+start_node=1;
+
+labels=['A' 'B' 'C' 'D'];
+
+
+//Error
+//tsp: Expected type ["constant"] for input argument adj_matrix at input #1, but got "string" instead.
+//at line 56 of function Checktype called by :
+//at line 112 of function tsp called by :
+//[mincost,path,status]=tsp(adj,start_node,labels);
+
+
+[mincost,path,status]=tsp(adj,start_node,labels);
diff --git a/tests/general_tests/tsp/tsp_input1.sce b/tests/general_tests/tsp/tsp_input1.sce
new file mode 100644
index 0000000..d3637a2
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_input1.sce
@@ -0,0 +1,17 @@
+//Check for the admissible number of input arguments(2-3)
+
+adj = [0 10 15 20;
+ 10 0 35 25;
+ 15 35 0 30;
+ 20 25 30 0];
+
+
+//Error
+//tsp : Number of input arguments is expected to be 2 or 3. Found 1. Refer to help/FOT documentation for more details.
+//at line 89 of function tsp called by :
+//[mincost,path,status]=tsp(adj);
+
+
+
+[mincost,path,status]=tsp(adj);
+
diff --git a/tests/general_tests/tsp/tsp_input2.sce b/tests/general_tests/tsp/tsp_input2.sce
new file mode 100644
index 0000000..03bb258
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_input2.sce
@@ -0,0 +1,19 @@
+//Check for the admissible number of input arguments(2-3)
+
+adj = [0 10 15 20;
+ 10 0 35 25;
+ 15 35 0 30;
+ 20 25 30 0];
+
+start_node=1;
+
+labels=['A' 'B' 'C' 'D'];
+
+//Error
+//tsp : Number of input arguments is expected to be 2 or 3. Found 4. Refer to help/FOT documentation for more details.
+//at line 89 of function tsp called by :
+//[mincost,path,status]=tsp(adj,start_node,labels,1);
+
+
+
+[mincost,path,status]=tsp(adj,start_node,labels,1);
diff --git a/tests/general_tests/tsp/tsp_labels_dims1.sce b/tests/general_tests/tsp/tsp_labels_dims1.sce
new file mode 100644
index 0000000..b1b84d7
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_labels_dims1.sce
@@ -0,0 +1,22 @@
+//Check if the dimensions of the 'labels' vector are correct ( [1xn] expected ; n->no. of nodes in the given graph)
+
+adj = [0 10 15 20;
+ 10 0 35 25;
+ 15 35 0 30;
+ 20 25 30 0];
+
+start_node=1;
+
+labels=['A' 'B' 'C' 'D' 'E'];
+
+
+//Error
+//tsp : The number of elements 'labels' vector (input argument #3) must be equal to the number of nodes in the graph.(found 5)
+//at line 187 of function tsp called by :
+//[mincost,path,status]=tsp(adj,start_node,labels);
+
+
+
+
+
+[mincost,path,status]=tsp(adj,start_node,labels);
diff --git a/tests/general_tests/tsp/tsp_labels_dims2.sce b/tests/general_tests/tsp/tsp_labels_dims2.sce
new file mode 100644
index 0000000..6b0ab8c
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_labels_dims2.sce
@@ -0,0 +1,21 @@
+//Check if the dimensions of the 'labels' vector are correct ( [1xn] expected ; n->no. of nodes in the given graph)
+
+adj = [0 10 15 20;
+ 10 0 35 25;
+ 15 35 0 30;
+ 20 25 30 0];
+
+start_node=1;
+
+labels=['A' 'B' 'C' 'D';
+ 'E' 'F' 'G' 'H' ];
+
+
+
+//Error
+//tsp : The 'labels' matrix (input argument #3) must have only one row, ie., it must be vector
+//at line 187 of function tsp called by :
+//[mincost,path,status]=tsp(adj,start_node,labels);
+
+
+[mincost,path,status]=tsp(adj,start_node,labels);
diff --git a/tests/general_tests/tsp/tsp_labels_dims3.sce b/tests/general_tests/tsp/tsp_labels_dims3.sce
new file mode 100644
index 0000000..7a7833b
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_labels_dims3.sce
@@ -0,0 +1,21 @@
+//Check if the dimensions of the 'labels' vector are correct ( [1xn] expected ; n->no. of nodes in the given graph)
+
+adj = [0 10 15 20;
+ 10 0 35 25;
+ 15 35 0 30;
+ 20 25 30 0];
+
+start_node=5;
+
+labels=['A' 'B' 'C' 'D' 'X';
+ 'E' 'F' 'G' 'H' 'Y'];
+
+
+//Error
+//tsp : Invalid 'start node' index (5). It is expected to be between '1' and '4'(no. of nodes in the given graph).
+//at line 169 of function tsp called by :
+//[mincost,path,status]=tsp(adj,start_node,labels);
+
+
+
+[mincost,path,status]=tsp(adj,start_node,labels);
diff --git a/tests/general_tests/tsp/tsp_labels_type.sce b/tests/general_tests/tsp/tsp_labels_type.sce
new file mode 100644
index 0000000..497a96f
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_labels_type.sce
@@ -0,0 +1,20 @@
+//Check if the type of the 'labels' vector is correct ( "string" i.e. scilab string matrix)
+
+adj = [0 10 15 20;
+ 10 0 35 25;
+ 15 35 0 30;
+ 20 25 30 0];
+
+start_node=1;
+
+labels=[1 2 3 4];
+
+
+//Error
+//tsp: Expected type ["string"] for input argument labels at input #3, but got "constant" instead.
+//at line 56 of function Checktype called by :
+//at line 116 of function tsp called by :
+//[mincost,path,status]=tsp(adj,start_node,labels);
+
+
+[mincost,path,status]=tsp(adj,start_node,labels);
diff --git a/tests/general_tests/tsp/tsp_labels_unique.sce b/tests/general_tests/tsp/tsp_labels_unique.sce
new file mode 100644
index 0000000..9783c70
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_labels_unique.sce
@@ -0,0 +1,19 @@
+//Check if all the values in the 'labels' vector are unique ( 2 nodes of the graph cannot have the same label)
+
+adj = [0 10 15 20;
+ 10 0 35 25;
+ 15 35 0 30;
+ 20 25 30 0];
+
+start_node=1;
+
+labels=['A' 'B' 'C' 'B'];
+
+//Error
+//tsp : The entries in the 'label' matrix should be unique ( no 2 nodes can have the same label)
+//at line 195 of function tsp called by :
+//[mincost,path,status]=tsp(adj,start_node,labels);
+
+
+
+[mincost,path,status]=tsp(adj,start_node,labels);
diff --git a/tests/general_tests/tsp/tsp_output1.sce b/tests/general_tests/tsp/tsp_output1.sce
new file mode 100644
index 0000000..5849aef
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_output1.sce
@@ -0,0 +1,19 @@
+//Check for the admissible number of output parameters( 2 or 3)
+
+adj = [0 10 15 20;
+ 10 0 35 25;
+ 15 35 0 30;
+ 20 25 30 0];
+
+start_node=1;
+
+labels=['A' 'B' 'C' 'D'];
+
+
+//Error
+//tsp : Number of output arguments is expected to be to 2 or 3. Found 1. Refer to the help/FOT documentation for more details.
+//at line 96 of function tsp called by :
+//[mincost]=tsp(adj,start_node,labels);
+
+
+[mincost]=tsp(adj,start_node,labels);
diff --git a/tests/general_tests/tsp/tsp_output2.sce b/tests/general_tests/tsp/tsp_output2.sce
new file mode 100644
index 0000000..f37a58a
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_output2.sce
@@ -0,0 +1,18 @@
+//Check for the admissible number of output parameters( 2 or 3)
+
+adj = [0 10 15 20;
+ 10 0 35 25;
+ 15 35 0 30;
+ 20 25 30 0];
+
+start_node=1;
+
+labels=['A' 'B' 'C' 'D'];
+
+//Error
+//Wrong number of output arguments.
+
+
+
+
+[mincost,path,status,xx]=tsp(adj,start_node,labels,1);
diff --git a/tests/general_tests/tsp/tsp_startnode_integral.sce b/tests/general_tests/tsp/tsp_startnode_integral.sce
new file mode 100644
index 0000000..e009b19
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_startnode_integral.sce
@@ -0,0 +1,21 @@
+//Check if the value of the start node index isintegral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+adj = [0 10 15 20;
+ 10 0 35 25;
+ 15 35 0 30;
+ 20 25 30 0];
+
+start_node=1.9;
+
+labels=['A' 'B' 'C' 'D'];
+
+
+//Error
+//tsp : The start_node index ( input argument #2) is expected to be integral
+//at line 160 of function tsp called by :
+//[mincost,path,status]=tsp(adj,start_node,labels);
+
+
+[mincost,path,status]=tsp(adj,start_node,labels);
+
+
diff --git a/tests/general_tests/tsp/tsp_startnode_type.sce b/tests/general_tests/tsp/tsp_startnode_type.sce
new file mode 100644
index 0000000..7e0b647
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_startnode_type.sce
@@ -0,0 +1,21 @@
+//Check if the type of the 'start_node' is correct("constant" ie. scilab numeric matrix)
+
+adj = [0 10 15 20;
+ 10 0 35 25;
+ 15 35 0 30;
+ 20 25 30 0];
+
+start_node='1';
+
+labels=['A' 'B' 'C' 'D'];
+
+//Error
+//tsp: Expected type ["constant"] for input argument start_node at input #2, but got "string" instead.
+//at line 56 of function Checktype called by :
+//at line 113 of function tsp called by :
+//[mincost,path,status]=tsp(adj,start_node,labels);
+
+
+
+
+[mincost,path,status]=tsp(adj,start_node,labels);
diff --git a/tests/general_tests/tsp/tsp_startnode_valid.sce b/tests/general_tests/tsp/tsp_startnode_valid.sce
new file mode 100644
index 0000000..218c4a1
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_startnode_valid.sce
@@ -0,0 +1,20 @@
+//Check if the value of the start node index is valid ( can only be from 1 to 'n' ; n-> no. of nodes in the graph)
+
+adj = [0 10 15 20;
+ 10 0 35 25;
+ 15 35 0 30;
+ 20 25 30 0];
+
+start_node=5;
+
+labels=['A' 'B' 'C' 'D'];
+
+
+//Error
+//tsp : Invalid 'start node' index (5). It is expected to be between '1' and '4'(no. of nodes in the given graph).
+//at line 169 of function tsp called by :
+//[mincost,path,status]=tsp(adj,start_node,labels);
+
+
+
+[mincost,path,status]=tsp(adj,start_node,labels);
diff --git a/tests/general_tests/tsp/tsp_startnodes_dims.sce b/tests/general_tests/tsp/tsp_startnodes_dims.sce
new file mode 100644
index 0000000..d2c0791
--- /dev/null
+++ b/tests/general_tests/tsp/tsp_startnodes_dims.sce
@@ -0,0 +1,19 @@
+//Check if the dimensions of the 'start_node' argument are correct(singular numeric value expected)
+
+adj = [0 10 15 20;
+ 10 0 35 25;
+ 15 35 0 30;
+ 20 25 30 0];
+
+start_node=[1 2];
+
+labels=['A' 'B' 'C' 'D'];
+
+//Error
+//tsp : Invalid start_node index value. Singlular value indicating the index of the node from where the journey is to begin expected
+//at line 145 of function tsp called by :
+//[mincost,path,status]=tsp(adj,start_node,labels);
+
+
+
+[mincost,path,status]=tsp(adj,start_node,labels);
diff --git a/tests/general_tests/vrp/vrp_adj_dim.sce b/tests/general_tests/vrp/vrp_adj_dim.sce
new file mode 100644
index 0000000..b0bfbda
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_adj_dim.sce
@@ -0,0 +1,59 @@
+//Check if the dimensions of the adjacency matrix are correct
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+
+
+
+//Error
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+// !--error 10000
+//vrp : The dimensions of the given adjacency matrix 'adj_matrix' (argument #1) are erroneous [33 32]. Number of rows and columns are to be equal (square matrix) (=no. of nodes of the graph).
+//at line 320 of function vrp called by :
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+
diff --git a/tests/general_tests/vrp/vrp_adj_int.sce b/tests/general_tests/vrp/vrp_adj_int.sce
new file mode 100644
index 0000000..ce48185
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_adj_int.sce
@@ -0,0 +1,60 @@
+//Check if all the values of the adjacency matrix - 'adj_matrix' are integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+adj_matrix = [0, 2451.2, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+//!--error 10000
+//vrp : All values in argument #1 ('adj_matrix') are expected to be integral.
+//at line 559 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_adj_type.sce b/tests/general_tests/vrp/vrp_adj_type.sce
new file mode 100644
index 0000000..4a0587a
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_adj_type.sce
@@ -0,0 +1,60 @@
+//Check if the Adjacency Matrix 'adj_matrix' is of the correct type
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+
+//vrp: Expected type ["constant"] for input argument adj_matrix at input #1, but got "string" instead.
+//at line 56 of function Checktype called by :
+//at line 287 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_adjdiagonal_zero.sce b/tests/general_tests/vrp/vrp_adjdiagonal_zero.sce
new file mode 100644
index 0000000..95dea33
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_adjdiagonal_zero.sce
@@ -0,0 +1,60 @@
+//Check if all the elements in the leading diagonal of the given adjacency matrix 'adj_matrix are zeroes.
+
+adj_matrix = [1111111111, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//tsp : All leading diagonal elements of the adjacency matrix need to be 0
+//at line 656 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_demand_lt_vehiclecapacity.sce b/tests/general_tests/vrp/vrp_demand_lt_vehiclecapacity.sce
new file mode 100644
index 0000000..21d7f08
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_demand_lt_vehiclecapacity.sce
@@ -0,0 +1,74 @@
+//Check if the demand value of no node is greater than the total capacity of a single vehicle in the fleet( The problem would be inherently ifeasible otherwise)
+
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 67956345346 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 0;
+fuel_capacity = [];
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+
+//Error
+//vrp : The demand values for one or more nodes exceed the maximum capacity for the vehicles in question, rendering them unserviceable.
+//at line 742 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_demands_dim.sce b/tests/general_tests/vrp/vrp_demands_dim.sce
new file mode 100644
index 0000000..a9c051d
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_demands_dim.sce
@@ -0,0 +1,56 @@
+//Check if the dimensions of the 'demands' matrix are correct (Expected- Empty matrix or [1xn]; n->No. of nodes)
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+
+//Error
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+// !--error 10000
+//vrp : Wrong dimensions for the input argument #5 ('demands'). Expected to be either an empty matrix or one with dimensions [1x32].
+//at line 366 of function vrp called by :
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+
+
diff --git a/tests/general_tests/vrp/vrp_demands_int.sce b/tests/general_tests/vrp/vrp_demands_int.sce
new file mode 100644
index 0000000..16a7a58
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_demands_int.sce
@@ -0,0 +1,61 @@
+//Check if the value in the argument 'demands' are integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21.50, 6, 19, 7, 12, 16, 6, 16, 8, 14.90, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : All values in argument #5 ('demands') are expected to be integral.
+//at line 578 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+//
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_demands_nonnegative.sce b/tests/general_tests/vrp/vrp_demands_nonnegative.sce
new file mode 100644
index 0000000..3f8c7ba
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_demands_nonnegative.sce
@@ -0,0 +1,72 @@
+//Check if all the demand value in the 'demands' vector(in case of a capacitated VRP), are non-negative.
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 -10 18 19 1 24 8 -10 4 8 -24 24 2 20 -15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 0;
+fuel_capacity = [];
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : One or more values in the 'demands' vector are negative.
+//at line 735 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_demands_type.sce b/tests/general_tests/vrp/vrp_demands_type.sce
new file mode 100644
index 0000000..3ded33c
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_demands_type.sce
@@ -0,0 +1,61 @@
+//Check if the argument 'demands' is of the correct type
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = ['0', '19', '21', '6', '19', '7', '12', '16', '6', '16', '8', '14', '21' ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//vrp: Expected type ["constant"] for input argument demands at input #5, but got "string" instead.
+//at line 56 of function Checktype called by :
+//at line 298 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_depotdemand_zero.sce b/tests/general_tests/vrp/vrp_depotdemand_zero.sce
new file mode 100644
index 0000000..62ef623
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_depotdemand_zero.sce
@@ -0,0 +1,72 @@
+//Check if the demand(s) of the depot node(s) is(are) zero(Depot nodes cannot logically have any demands).
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [50 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 0;
+fuel_capacity = [];
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : The demand for the depot node has to be zero.
+//at line 747 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_fuelcapacity_dim.sce b/tests/general_tests/vrp/vrp_fuelcapacity_dim.sce
new file mode 100644
index 0000000..cdfcbf5
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_fuelcapacity_dim.sce
@@ -0,0 +1,61 @@
+//Check if the dimensions of 'fuel_capacity' are correct (Expected - Single integral value expected; cannot be empty matrix is refuel_flag =1)
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+speeds = [];
+refuel_flag = 1;
+fuel_capacity = [100; 200];
+
+
+//Error
+// !--error 10000
+//vrp : Wrong dimensions for the input argument #12 ('fuel_capacity'). Expected a singular integral value.
+//at line 467 of function vrp called by :
+//, time_windows, speeds, [], refuel_flag, fuel_capacity,[])
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds, [], refuel_flag, fuel_capacity,[]);
+
+
diff --git a/tests/general_tests/vrp/vrp_fuelcapacity_int.sce b/tests/general_tests/vrp/vrp_fuelcapacity_int.sce
new file mode 100644
index 0000000..a20d229
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_fuelcapacity_int.sce
@@ -0,0 +1,59 @@
+//Check if the value of the argument 'fuel_capacity' in integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 1;
+
+fuel_capacity = 100.4;
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : The fuel capacity value for the vehicles (argument #12) is expected to be integral.
+//at line 616 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_fuelcapacity_positive.sce b/tests/general_tests/vrp/vrp_fuelcapacity_positive.sce
new file mode 100644
index 0000000..c9c9dce
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_fuelcapacity_positive.sce
@@ -0,0 +1,75 @@
+//Check if the 'fuel_capacity' value is positive, if fuel constraints are to be considered.
+
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 1;
+fuel_capacity = -343;
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//vrp : Fuel Capacity value is expected to be positive.
+//at line 911 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+//
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_fuelcapacity_specified.sce b/tests/general_tests/vrp/vrp_fuelcapacity_specified.sce
new file mode 100644
index 0000000..b19da70
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_fuelcapacity_specified.sce
@@ -0,0 +1,72 @@
+//Check if the fuel capacity value for the vehicle('fuel_capacity') is positive, if refuelling constraints are included(ie. refuel_flag = 1)
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 1;
+fuel_capacity = 0;
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : Fuel Capacity value is expected to be positive.
+//at line 906 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_fuelcapacity_type.sce b/tests/general_tests/vrp/vrp_fuelcapacity_type.sce
new file mode 100644
index 0000000..ec03877
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_fuelcapacity_type.sce
@@ -0,0 +1,60 @@
+//Check if the argument 'fuel_capacity' is of the correct type
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = "500";
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp: Expected type ["constant"] for input argument fuel_capacity at input #12, but got "string" instead.
+//at line 56 of function Checktype called by :
+//at line 305 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_grouppenalty_dim.sci b/tests/general_tests/vrp/vrp_grouppenalty_dim.sci
new file mode 100644
index 0000000..835e31e
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_grouppenalty_dim.sci
@@ -0,0 +1,64 @@
+//Check if the dimensions of the 'group_penalty' are correct (Expected - Single integral value or empty matrix)
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+speeds = [];
+penalty =[];
+refuel_flag = 0;
+
+groups = [1 2 3 4];
+
+group_penalty = [10 20];
+
+//Error
+//!--error 10000
+//vrp : Wrong dimensions for the input argument #16 ('group_penalty'). Expected a singular integral value or an empty matrix.
+//at line 528 of function vrp called by :
+// speeds,[],refuel_flag,[],[],penalty,groups,group_penalty)
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,[],refuel_flag,[],[],penalty,groups,group_penalty);
+
+
diff --git a/tests/general_tests/vrp/vrp_grouppenalty_int.sce b/tests/general_tests/vrp/vrp_grouppenalty_int.sce
new file mode 100644
index 0000000..89a7853
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_grouppenalty_int.sce
@@ -0,0 +1,61 @@
+//Check if the value of the argument 'group_penalty' in integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = 50.555;
+
+time_limit = [];
+
+
+//Error
+//vrp : The group-penalty value (argument #16) is exected to be integral.
+//at line 636 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_grouppenalty_nonnegative_or_minus1.sce b/tests/general_tests/vrp/vrp_grouppenalty_nonnegative_or_minus1.sce
new file mode 100644
index 0000000..a93dc37
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_grouppenalty_nonnegative_or_minus1.sce
@@ -0,0 +1,73 @@
+//Check if the group penalty value, if provided, non-negative or -1
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 0;
+fuel_capacity = [];
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [1 2 3 4];
+
+group_penalty = -465;
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : Forbidden value for 'group_penalty' (argument #16). Expected- -1, 0, or any positive value.
+//at line 1019 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_grouppenalty_type.sce b/tests/general_tests/vrp/vrp_grouppenalty_type.sce
new file mode 100644
index 0000000..c2df485
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_grouppenalty_type.sce
@@ -0,0 +1,60 @@
+//Check if the argument 'group_penalty' is of the correct type
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = '20';
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp: Expected type ["constant"] for input argument group_penalty at input #16, but got "string" instead.
+//at line 56 of function Checktype called by :
+//at line 309 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_groups_int.sce b/tests/general_tests/vrp/vrp_groups_int.sce
new file mode 100644
index 0000000..8b8e008
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_groups_int.sce
@@ -0,0 +1,60 @@
+//Check if the value in the argument 'groups' are integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [1.2 3 4 5];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : All values in argument #15 ('groups') are expected to be integral.
+//at line 631 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_groups_norepeat.sce b/tests/general_tests/vrp/vrp_groups_norepeat.sce
new file mode 100644
index 0000000..fc28f28
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_groups_norepeat.sce
@@ -0,0 +1,60 @@
+//Check if no node in the 'groups' matrix is repeated.
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [ 1 2 1];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : One or more node index values in the 'groups' matrix (argument #15) are repeated. No index can occur twice in a group. Also, no node can be a part of 2 groups.
+//at line 1025 of function vrp called by :
+//refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_groups_type.sce b/tests/general_tests/vrp/vrp_groups_type.sce
new file mode 100644
index 0000000..e9ee21a
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_groups_type.sce
@@ -0,0 +1,60 @@
+//Check if the argument 'groups' is of the correct type
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = ['3', '5' ,'6'; '1','2','0'];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp: Expected type ["constant"] for input argument groups at input #15, but got "string" instead.
+//at line 56 of function Checktype called by :
+//at line 308 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+//
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_groupsindices_valid.sce b/tests/general_tests/vrp/vrp_groupsindices_valid.sce
new file mode 100644
index 0000000..7497b47
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_groupsindices_valid.sce
@@ -0,0 +1,76 @@
+//Check if all the node indices in the 'groups' matrix, if provided, are valid.
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 0;
+fuel_capacity = [];
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [1 2 3 54 6];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//vrp : One or more node index values in argument #15 ( 'groups') is invalid. Valid indices for this model - '1' to '32'.
+//at line 969 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+//
+//
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_labels_dim.sce b/tests/general_tests/vrp/vrp_labels_dim.sce
new file mode 100644
index 0000000..22193b4
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_labels_dim.sce
@@ -0,0 +1,58 @@
+//Checking is the dimensions of the 'labels' matrix, IF PROVIDED, are indeed correct ( Expected - [1xn], if provided, otherwise empty matrix; n-> No. of nodes in the graph)
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = ['A'];
+
+max_vehicle_capacity = 100;
+
+
+//Error
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+// !--error 10000
+//vrp : Wrong dimensions for the input argument #4 ( 'labels'). Expected to be an empty matrix or one with dimensions [1x32].
+//at line 379 of function vrp called by :
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+
+
diff --git a/tests/general_tests/vrp/vrp_labels_type.sce b/tests/general_tests/vrp/vrp_labels_type.sce
new file mode 100644
index 0000000..68a408d
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_labels_type.sce
@@ -0,0 +1,62 @@
+//Check if the argument 'labels' is of the correct type
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = [1 2 3 4 5 67 8 9 10 11 12 13];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//vrp: Expected type ["string"] for input argument labels at input #4, but got "constant" instead.
+//at line 56 of function Checktype called by :
+//at line 297 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_maxvehiclecapacity_dim.sce b/tests/general_tests/vrp/vrp_maxvehiclecapacity_dim.sce
new file mode 100644
index 0000000..d57f079
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_maxvehiclecapacity_dim.sce
@@ -0,0 +1,56 @@
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = [ 100 10];
+
+//Error
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+// !--error 10000
+//vrp : Wrong dimensions for the input argument #6 ( 'max_vehicle_capacity'). Expected to be either an empty matrix or a singular integral value[1x1].
+//at line 394 of function vrp called by :
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+
+
diff --git a/tests/general_tests/vrp/vrp_maxvehiclecapacity_int.sce b/tests/general_tests/vrp/vrp_maxvehiclecapacity_int.sce
new file mode 100644
index 0000000..0fdcb02
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_maxvehiclecapacity_int.sce
@@ -0,0 +1,60 @@
+//Check if the value of the argument 'max_vehicle_capacity' is integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60.5;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//vrp : Max Vehicle Capacity value (argument #6) is expected to be integral.
+//at line 584 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_maxvehiclecapacity_positive.sce b/tests/general_tests/vrp/vrp_maxvehiclecapacity_positive.sce
new file mode 100644
index 0000000..653ac63
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_maxvehiclecapacity_positive.sce
@@ -0,0 +1,73 @@
+//Check if the value of 'max_vehicle_capacity'(in case of capacitated VRP), is (>0)
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = -1;
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 0;
+fuel_capacity = [];
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : The maximum-vehicle-capacity value needs to be positive.
+//at line 715 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_maxvehiclecapacity_type.sce b/tests/general_tests/vrp/vrp_maxvehiclecapacity_type.sce
new file mode 100644
index 0000000..f9142c2
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_maxvehiclecapacity_type.sce
@@ -0,0 +1,61 @@
+//Check if the argument 'max_vehicle_capacity' is of the correct type
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = "A";
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp: Expected type ["constant"] for input argument max_vehicle_capacity at input #6, but got "string" instead.
+//at line 56 of function Checktype called by :
+//at line 299 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+//
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_penalty_dim.sce b/tests/general_tests/vrp/vrp_penalty_dim.sce
new file mode 100644
index 0000000..20c2811
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_penalty_dim.sce
@@ -0,0 +1,60 @@
+//Check if the dimensions of the 'penalty' matrix are correct(Expected - Empty or a 2-column matrix)
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+speeds = [];
+refuel_flag = 0;
+penalty = [1 2 3; 4 5 6];
+
+//Error
+// !--error 10000
+//vrp : Wrong dimensions for the input argument #14 ('penalty'). Expected an [Ax2] matrix (A->number of skippable nodes) or an empty matrix.
+//at line 506 of function vrp called by :
+//emand, time_windows, speeds,[], refuel_flag,[],[],penalty)
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,[], refuel_flag,[],[],penalty);
+
+
diff --git a/tests/general_tests/vrp/vrp_penalty_int.sce b/tests/general_tests/vrp/vrp_penalty_int.sce
new file mode 100644
index 0000000..3a90196
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_penalty_int.sce
@@ -0,0 +1,62 @@
+//Check if the values of the argument 'penalty' are integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [1 5.5;
+ 2 10.5;
+ 3 4.0];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : All values in argument #14 ('penalty') are expected to be integral.
+//at line 626 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_penalty_nodepot.sce b/tests/general_tests/vrp/vrp_penalty_nodepot.sce
new file mode 100644
index 0000000..b1e25cb
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_penalty_nodepot.sce
@@ -0,0 +1,59 @@
+//Check if no 'depot' nodes or 'start/end' nodes are listed as optional(penalty) nodes.
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [1 100];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : The depot cannot be provided as an optional node.
+//at line 980 of function vrp called by :
+//refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_penalty_nonnegative.sce b/tests/general_tests/vrp/vrp_penalty_nonnegative.sce
new file mode 100644
index 0000000..1929472
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_penalty_nonnegative.sce
@@ -0,0 +1,60 @@
+//Check if all the penalty values ( 2nd column in the 'penalty' matrix) are non-negative
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [10 5; 9 -1];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : Cost penalty values in the 'penalty' matrix (argument #14) cannot be negative.
+//at line 972 of function vrp called by :
+//refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_penalty_type.sce b/tests/general_tests/vrp/vrp_penalty_type.sce
new file mode 100644
index 0000000..fdcb123
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_penalty_type.sce
@@ -0,0 +1,59 @@
+//Check if the argument 'penalty' is of the correct type
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [list(4,100)];
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp: Expected type ["constant"] for input argument penalty at input #14, but got "list" instead.
+//at line 56 of function Checktype called by :
+//at line 307 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_penaltyindices_valid.sce b/tests/general_tests/vrp/vrp_penaltyindices_valid.sce
new file mode 100644
index 0000000..45b6cd5
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_penaltyindices_valid.sce
@@ -0,0 +1,74 @@
+//Check if the node indices in the 'penalty' matrix(first column), if provided, are valid node indices.
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 0;
+fuel_capacity = [];
+refuel_nodes = [];
+
+penalty = [2 100; 33 500];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : One or more node indices provided in the 'penalty' matrix ( argument #14) are invalid. Valid indices for the current model- '1' to '32'.
+//at line 934 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+//
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_refuelflag_dim.sce b/tests/general_tests/vrp/vrp_refuelflag_dim.sce
new file mode 100644
index 0000000..de323ef
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_refuelflag_dim.sce
@@ -0,0 +1,61 @@
+//Check if the dimensions of 'refuel_flag' are correct(Expected - Single 0/1 value or empty matrix expectex)
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+speeds = [];
+refuel_flag = [1 2];
+
+//Error
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,[],refuel_flag,[],[]);
+// !--error 10000
+//vrp : Wrong dimensions for the input argument #11 ('refuel_flag'). Expected either a singular 0/1 value or an empty matrix.
+//at line 456 of function vrp called by :
+//ime_per_demand, time_windows, speeds,[],refuel_flag,[],[])
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,[],refuel_flag,[],[]);
+
+
diff --git a/tests/general_tests/vrp/vrp_refuelflag_int.sce b/tests/general_tests/vrp/vrp_refuelflag_int.sce
new file mode 100644
index 0000000..cfb6a04
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_refuelflag_int.sce
@@ -0,0 +1,59 @@
+//Check if the value of the argument 'refuel_flag' is integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 1.1;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : The Refuel Flag value (argument #11) is expected to be integral.
+//at line 611 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_refuelflag_type.sce b/tests/general_tests/vrp/vrp_refuelflag_type.sce
new file mode 100644
index 0000000..cf453fe
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_refuelflag_type.sce
@@ -0,0 +1,61 @@
+//Check if the argument 'refuel_flag' is of the correct type
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = %F;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+//!--error 10000
+//vrp: Expected type ["constant"] for input argument refuel_flag at input #11, but got "boolean" instead.
+//at line 56 of function Checktype called by :
+//at line 304 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_refuelflag_valid.sce b/tests/general_tests/vrp/vrp_refuelflag_valid.sce
new file mode 100644
index 0000000..d73d215
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_refuelflag_valid.sce
@@ -0,0 +1,60 @@
+//Checking if the value of the refuel_flag, if specified), is valid ( only '0' or '1' allowed)
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 500;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//vrp : The refuel flag can only take the value '0' or '1'. Check the FOT documentation for details.
+//at line 890 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_refuelnodes_dim.sce b/tests/general_tests/vrp/vrp_refuelnodes_dim.sce
new file mode 100644
index 0000000..976c427
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_refuelnodes_dim.sce
@@ -0,0 +1,63 @@
+//Check if the dimensions of the vector - 'refuel_nodes' are correct (Expected - An empty matrix/vector or a row-vector)
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+speeds = [];
+refuel_flag = 1;
+fuel_capacity = 100;
+
+refuel_nodes = [1 ;2; 4];
+
+
+//Error
+// !--error 10000
+//vrp : Wrong dimensions for the input argument #13 ('refuel_nodes'). Expected a vector or an empty matrix.
+//at line 480 of function vrp called by :
+//dows, speeds, [], refuel_flag, fuel_capacity,refuel_nodes)
+//
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds, [], refuel_flag, fuel_capacity,refuel_nodes);
diff --git a/tests/general_tests/vrp/vrp_refuelnodes_int.sce b/tests/general_tests/vrp/vrp_refuelnodes_int.sce
new file mode 100644
index 0000000..88dc07d
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_refuelnodes_int.sce
@@ -0,0 +1,58 @@
+//Check if the value(s) in the argument 'refuel_nodes' is(are) integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 1;
+
+fuel_capacity = 100;
+
+refuel_nodes = [1.1, 2, 3 ,4];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : All values in argument #13 ('refuel_nodes') are expected to be integral.
+//at line 621 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_refuelnodes_type.sce b/tests/general_tests/vrp/vrp_refuelnodes_type.sce
new file mode 100644
index 0000000..ab427e6
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_refuelnodes_type.sce
@@ -0,0 +1,60 @@
+//Check if the argument 'refuel_nodes' is of the correct type
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = list(1 , 2);
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//vrp: Expected type ["constant"] for input argument refuel_nodes at input #13, but got "list" instead.
+//at line 56 of function Checktype called by :
+//at line 306 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_refuelnodes_valid.sce b/tests/general_tests/vrp/vrp_refuelnodes_valid.sce
new file mode 100644
index 0000000..914335c
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_refuelnodes_valid.sce
@@ -0,0 +1,60 @@
+//Check if the values are refuel_nodes ( if fuel constraints are considered), are valid node indices.
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 1;
+
+fuel_capacity = 200;
+
+refuel_nodes = [1 14];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+//vrp : One or more fuel node index values are invalid. Valid indices for the current model - '1' to '13'.
+//at line 921 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+//
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_servicetime_dim.sce b/tests/general_tests/vrp/vrp_servicetime_dim.sce
new file mode 100644
index 0000000..f1c133b
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_servicetime_dim.sce
@@ -0,0 +1,58 @@
+//Checking if the dimensions of 'service_time_per_demand' are correct (Expected - Empty matrix or integral value)
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+
+service_time_per_demand= [1 2];
+
+//Error
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand);
+// !--error 10000
+//vrp : Wrong dimensions for the input argument #7 ('service_time_per_demand'). Expected to be either an empty matrix or a singular integral value[1x1].
+//at line 408 of function vrp called by :
+//s, demands, max_vehicle_capacity, service_time_per_demand)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand);
+
+
diff --git a/tests/general_tests/vrp/vrp_servicetime_gtzero.sce b/tests/general_tests/vrp/vrp_servicetime_gtzero.sce
new file mode 100644
index 0000000..7f78865
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_servicetime_gtzero.sce
@@ -0,0 +1,74 @@
+//Check if the value of the argument 'service_time_per_demand', if provided, is greater than zero.
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = -123;
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 0;
+fuel_capacity = [];
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : The value for argument #7 ('service_time_per_demand') cannot be negative.
+//at line 789 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_servicetime_int.sce b/tests/general_tests/vrp/vrp_servicetime_int.sce
new file mode 100644
index 0000000..a5eefd2
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_servicetime_int.sce
@@ -0,0 +1,62 @@
+//Check if the value of the argument 'service_time_per_demand' is integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=1.45654;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//vrp : The value for servive-time-per-demand (argument #7) is expected to be integral.
+//at line 589 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+//
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_servicetime_type.sce b/tests/general_tests/vrp/vrp_servicetime_type.sce
new file mode 100644
index 0000000..2904fdc
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_servicetime_type.sce
@@ -0,0 +1,61 @@
+//Check if the argument 'service_time_per_demand' is of the correct type
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand= poly(0,"s");
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//vrp: Expected type ["constant"] for input argument service_time_per_demand at input #7, but got "polynomial" instead.
+//at line 56 of function Checktype called by :
+//at line 300 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_speeds_dim.sce b/tests/general_tests/vrp/vrp_speeds_dim.sce
new file mode 100644
index 0000000..5724fb4
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_speeds_dim.sce
@@ -0,0 +1,97 @@
+//Checking if the dimensions of the 'speed' matrix are correct (Expected - Empty matrix, a single integral value or an [nxn] matrix)
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+
+service_time_per_demand = [];
+time_windows =[];
+
+speeds =[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ;
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ]; // 33x32 matrix
+
+
+
+
+//Error
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds);
+// !--error 10000
+//vrp : Wrong dimensions for the input argument #9 ( 'speeds'). Expected to be either [1x1], [32x32] or an empty matrix.
+//at line 433 of function vrp called by :
+//e_capacity, service_time_per_demand, time_windows, speeds)
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds);
+
+
diff --git a/tests/general_tests/vrp/vrp_speeds_int.sce b/tests/general_tests/vrp/vrp_speeds_int.sce
new file mode 100644
index 0000000..10c1086
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_speeds_int.sce
@@ -0,0 +1,61 @@
+//Check if the values in the argument 'speeds' are integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = 100.666667;
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : The value(s) for argument #9 ('speeds') is (are) expected to be integral.
+//at line 600 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+//
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_speeds_positive.sce b/tests/general_tests/vrp/vrp_speeds_positive.sce
new file mode 100644
index 0000000..007bf0f
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_speeds_positive.sce
@@ -0,0 +1,73 @@
+//Checking if the value(s) in the 'speeds' matrix is (are) positive.
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = 0;
+refuel_flag = 0;
+fuel_capacity = [];
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : The avg.speeds value thus provided must be POSITIVE.
+//at line 842 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+//
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_speeds_type.sce b/tests/general_tests/vrp/vrp_speeds_type.sce
new file mode 100644
index 0000000..f374951
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_speeds_type.sce
@@ -0,0 +1,62 @@
+//Check if the argument 'speeds' is of the correct type
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = list(10,"VIE");
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp: Expected type ["constant"] for input argument speeds at input #9, but got "list" instead.
+//at line 56 of function Checktype called by :
+//at line 302 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+//
+//
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_start_dim.sce b/tests/general_tests/vrp/vrp_start_dim.sce
new file mode 100644
index 0000000..4823af8
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_start_dim.sce
@@ -0,0 +1,58 @@
+//Check if the dimensions of 'start' matrix are valid ( Expected - Empty Matrix, [1x1] or [vxv]; where v= no. of variables/routes
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = [1 2 4];
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+
+
+//Error
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+// !--error 10000
+//vrp : Wrong dimensions for input argument #3 ('start'). Expected to be either [1x1], (empty matrix) or [vx2] ( v->number of vehicles). Refer to help/FOT Documentation for more details.
+//at line 353 of function vrp called by :
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+
+
diff --git a/tests/general_tests/vrp/vrp_start_int.sce b/tests/general_tests/vrp/vrp_start_int.sce
new file mode 100644
index 0000000..161b103
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_start_int.sce
@@ -0,0 +1,59 @@
+//Check if the value(s) of the argument 'start' (if note an empty matrix), is(are) integral ( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1.3;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+//vrp : The value(s) for argument #3 ( 'start') is (are) expected to be integral.
+//at line 572 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_start_type.sce b/tests/general_tests/vrp/vrp_start_type.sce
new file mode 100644
index 0000000..0730be0
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_start_type.sce
@@ -0,0 +1,62 @@
+//Check if the argument 'start' is of the correct types
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = "1";
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+//-->[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+// !--error 10000
+//vrp: Expected type ["constant"] for input argument start at input #3, but got "string" instead.
+//at line 56 of function Checktype called by :
+//at line 293 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_startnode_valid.sce b/tests/general_tests/vrp/vrp_startnode_valid.sce
new file mode 100644
index 0000000..b7f9e9e
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_startnode_valid.sce
@@ -0,0 +1,73 @@
+//Check if the value of the start-node is a valid node index for the problem.
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 33;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 0;
+fuel_capacity = [];
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : The given 'start' value is not a valid node index. Indices can only go from '1' to '32' for the given problem
+//at line 677 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_timelimit_dim.sce b/tests/general_tests/vrp/vrp_timelimit_dim.sce
new file mode 100644
index 0000000..3afebe9
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_timelimit_dim.sce
@@ -0,0 +1,71 @@
+//Check if the dimensions of 'time_limit' are correct( Expected- Single integral value or empty matrix)
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 0;
+fuel_capacity = [];
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [1000 2000];
+
+//Error
+// !--error 10000
+//vrp : Wrong dimensions for the input argument #17 ('time_limit'). Expected a singular, integral, positive value.
+//at line 539 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag,fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_timelimit_int.sce b/tests/general_tests/vrp/vrp_timelimit_int.sce
new file mode 100644
index 0000000..3ab22bc
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_timelimit_int.sce
@@ -0,0 +1,61 @@
+//Check if the value of the argument 'time_limit' is integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = 1200.70;
+
+//Error
+// !--error 10000
+//vrp : The time limit values (argument #17) is expected to be integral.
+//at line 641 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+//
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_timelimit_positive.sce b/tests/general_tests/vrp/vrp_timelimit_positive.sce
new file mode 100644
index 0000000..9ddb78f
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_timelimit_positive.sce
@@ -0,0 +1,74 @@
+// Check if the value of the 'time_limit', if given, is positive
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 0;
+fuel_capacity = [];
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = 0;
+
+//Error
+// !--error 10000
+//vrp : Positive value expected for the 'time_limit' (argument #17).
+//at line 1031 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+//
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_timelimit_type.sce b/tests/general_tests/vrp/vrp_timelimit_type.sce
new file mode 100644
index 0000000..3dfc776
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_timelimit_type.sce
@@ -0,0 +1,60 @@
+//Check if the argument 'time_limit' is of the correct type
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = %T;
+
+//Error
+// !--error 10000
+//vrp: Expected type ["constant"] for input argument time_limit at input #17, but got "boolean" instead.
+//at line 56 of function Checktype called by :
+//at line 310 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_timewindows_dim.sce b/tests/general_tests/vrp/vrp_timewindows_dim.sce
new file mode 100644
index 0000000..3b19bd2
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_timewindows_dim.sce
@@ -0,0 +1,65 @@
+//Checking if the dimensions of the 'time_windows' matrix are correct (Expected - Empty matrix or [nx2]; n->no. of nodes)
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+
+
+service_time_per_demand = [];
+
+time_windows = [ 1 2 3;
+ 5 2 5];
+
+
+
+//Error
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows);
+// !--error 10000
+//vrp : Wrong dimensions for the input argument #8 ('time_windows'). Expected to be either an empty matrix or one with dimensions [32x2].
+//at line 420 of function vrp called by :
+//x_vehicle_capacity, service_time_per_demand, time_windows)
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows);
+
+
diff --git a/tests/general_tests/vrp/vrp_timewindows_ends_gt_starts.sce b/tests/general_tests/vrp/vrp_timewindows_ends_gt_starts.sce
new file mode 100644
index 0000000..e9aee17
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_timewindows_ends_gt_starts.sce
@@ -0,0 +1,69 @@
+//Check if all the end-time(unless '-1' indicating "no upper bound") are greater than or equal to the corresponding start times.
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [0 100;
+0 100;
+0 100;
+0 100;
+0 100;
+100 99;
+0 100;
+0 100;
+0 100;
+0 100;
+0 100;
+0 100;
+0 100];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//vrp : Invalid time-window values : The end-time for service window for one or more nodes in less than the corresponding start-time.
+//at line 819 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
diff --git a/tests/general_tests/vrp/vrp_timewindows_int.sce b/tests/general_tests/vrp/vrp_timewindows_int.sce
new file mode 100644
index 0000000..685aeb9
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_timewindows_int.sce
@@ -0,0 +1,72 @@
+//Check if the values of the argument 'time_windows' are integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [0.5 2.5
+ 0.5 2.5
+ 0.5 2.5
+ 0.5 2.5
+ 0.5 2.5
+ 0.5 2.5
+ 0.5 2.5
+ 0.5 2.5
+ 0.5 2.5
+ 0.5 2.5
+ 0.5 2.5
+ 0.5 2.5
+ 0.5 2.5];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//vrp : All values in argument #8 ('time_windows') are expected to be integral.
+//at line 594 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+//
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_timewindows_nonnegative_or_minus1.sce b/tests/general_tests/vrp/vrp_timewindows_nonnegative_or_minus1.sce
new file mode 100644
index 0000000..1ea8070
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_timewindows_nonnegative_or_minus1.sce
@@ -0,0 +1,73 @@
+//Check if all the values in 'time_windows' matrix are non-negative( except '1' for end-times indicating no upper bounds)
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [0 100;
+0 100;
+0 100;
+0 100;
+0 100;
+-1 100;
+0 100;
+0 100;
+0 100;
+0 100;
+0 100;
+0 100;
+0 100];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//vrp : Values in 'time_windows' matrix cannot be negative (except '-1' for end times indicating no upper bound for the corresponding node).
+//at line 811 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
+
diff --git a/tests/general_tests/vrp/vrp_timewindows_type.sce b/tests/general_tests/vrp/vrp_timewindows_type.sce
new file mode 100644
index 0000000..7ecde73
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_timewindows_type.sce
@@ -0,0 +1,72 @@
+//Check if the argument 'time_windows' is of the correct type
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = ['0' '0'
+'0' '0'
+'0' '0'
+'0' '0'
+'0' '0'
+'0' '0'
+'0' '0'
+'0' '0'
+'0' '0'
+'0' '0'
+'0' '0'
+'0' '0'
+'0' '0'];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp: Expected type ["constant"] for input argument time_windows at input #8, but got "string" instead.
+//at line 56 of function Checktype called by :
+//at line 301 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_totaldemands_lt_totalcapacity.sce b/tests/general_tests/vrp/vrp_totaldemands_lt_totalcapacity.sce
new file mode 100644
index 0000000..0bde93f
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_totaldemands_lt_totalcapacity.sce
@@ -0,0 +1,75 @@
+//Checking if the total demands accross all the nodes is less than the total capacity the vehicle fleet( the problem would be inherently infeasible otherwise, allowing us to circumvent invoking the solver, at all)
+
+
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 99 8 99 99 16 3 22 99 99 99 94 98 92 94 98 94 94 92 90 95 92 94 99];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 0;
+fuel_capacity = [];
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+//vrp : The total demand exceeds the total capacity of the vehicles in the fleet. The scenario is inherently unserviceable.
+//at line 749 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+//
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_uniquelabels.sce b/tests/general_tests/vrp/vrp_uniquelabels.sce
new file mode 100644
index 0000000..6b71b7e
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_uniquelabels.sce
@@ -0,0 +1,59 @@
+//Check if the the strings in 'labels' are unique (2 nodes cannot have the same label)
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "New York", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : The entries in the 'label' matrix need to be unique (no 2 nodes can have the same labels).
+//at line 685 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_vehiclecapacity_if_capacitated.sce b/tests/general_tests/vrp/vrp_vehiclecapacity_if_capacitated.sce
new file mode 100644
index 0000000..e7dd74b
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_vehiclecapacity_if_capacitated.sce
@@ -0,0 +1,75 @@
+//Checking if the maximum_vehicle_capacity is specified if it's a Capacitated Vehicle Routing Problem(demands are given)
+
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = [];
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 0;
+fuel_capacity = [];
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : For a capacitate VRP, the max_vehicle_capacity cannot be exclude(cannot be an empty matrix).
+//at line 703 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_vehicles_dim.sce b/tests/general_tests/vrp/vrp_vehicles_dim.sce
new file mode 100644
index 0000000..4e7e43c
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_vehicles_dim.sce
@@ -0,0 +1,58 @@
+//Check if the dimensions of the 'vehicles' argument are correct ( single integral value [1x1] expected)
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = [5 2];
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+
+
+
+//Error
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+// !--error 10000
+//vrp : Wrong dimensions [1x2] for input argument #2 ( 'vehicles'). Single integral value expected (ie. [1x1]).
+//at line 336 of function vrp called by :
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity);
+
+
diff --git a/tests/general_tests/vrp/vrp_vehicles_int.sce b/tests/general_tests/vrp/vrp_vehicles_int.sce
new file mode 100644
index 0000000..cfab932
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_vehicles_int.sce
@@ -0,0 +1,60 @@
+//Check if value of the argument 'vehicles' is integral ( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3.5;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+// !--error 10000
+//vrp : Number of vehicles ( argument #2) is expected to be an integral value.
+//at line 566 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_vehicles_positive.sce b/tests/general_tests/vrp/vrp_vehicles_positive.sce
new file mode 100644
index 0000000..1e1230b
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_vehicles_positive.sce
@@ -0,0 +1,74 @@
+//Check if the value of the argument 'vehicles' is positive
+
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 0;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+waiting_times =[];
+speeds = [];
+refuel_flag = 0;
+fuel_capacity = [];
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+
+//Error
+
+// !--error 10000
+//vrp : The number of vehicles in the fleet must be a positive value.
+//at line 667 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
diff --git a/tests/general_tests/vrp/vrp_vehicles_type.sce b/tests/general_tests/vrp/vrp_vehicles_type.sce
new file mode 100644
index 0000000..be9d2a9
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_vehicles_type.sce
@@ -0,0 +1,61 @@
+//Check if 'vehicles' is of the correct type
+
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = %T;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp: Expected type ["constant"] for input argument vehicles at input #2, but got "boolean" instead.
+//at line 56 of function Checktype called by :
+//at line 292 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_waitingtimes_dim.sce b/tests/general_tests/vrp/vrp_waitingtimes_dim.sce
new file mode 100644
index 0000000..63676ad
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_waitingtimes_dim.sce
@@ -0,0 +1,64 @@
+//Check if the dimensions of 'waiting_times' matrix are correct (Expected -> empty matrix or [1xn]; n->No. of nodes)
+
+adj_matrix = [0 46 103 101 138 66 70 39 120 107 85 143 40 53 38 92 31 83 107 84 49 78 111 107 35 94 23 32 120 68 19 87 ;
+ 46 0 85 83 120 112 52 17 102 89 131 125 10 31 50 116 15 47 89 44 95 32 93 89 53 140 27 64 102 102 27 41 ;
+ 103 85 0 4 39 105 33 68 55 72 124 50 95 54 65 109 84 44 58 45 88 57 82 12 68 133 80 71 37 95 90 48 ;
+ 101 83 4 0 37 101 31 66 51 68 120 46 93 52 63 105 82 48 54 49 86 55 78 8 66 129 78 69 33 91 88 52 ;
+ 138 120 39 37 0 98 68 103 18 33 85 11 130 89 100 70 119 83 31 84 123 92 43 31 103 94 115 106 18 70 125 87 ;
+ 66 112 105 101 98 0 88 105 80 67 33 103 106 119 62 52 97 149 67 150 25 144 71 93 59 28 85 48 80 28 85 153 ;
+ 70 52 33 31 68 88 0 35 50 55 107 73 62 31 32 92 51 61 41 62 71 56 65 37 35 116 47 40 50 78 57 65 ;
+ 39 17 68 66 103 105 35 0 85 72 124 108 27 14 43 109 16 44 72 45 88 39 82 72 46 133 20 57 85 95 22 48 ;
+ 120 102 55 51 18 80 50 85 0 17 69 23 112 71 82 54 101 99 13 100 105 94 27 43 85 78 97 88 18 52 107 103 ;
+ 107 89 72 68 33 67 55 72 17 0 52 36 99 86 69 37 88 116 14 117 92 111 10 60 72 61 84 75 35 39 94 120 ;
+ 85 131 124 120 85 33 107 124 69 52 0 74 125 138 81 19 116 168 66 169 58 163 42 112 78 21 104 67 87 29 104 172 ;
+ 143 125 50 46 11 103 73 108 23 36 74 0 135 94 105 59 124 94 36 95 128 97 32 38 108 91 120 111 23 75 130 98 ;
+ 40 10 95 93 130 106 62 27 112 99 125 135 0 41 44 110 11 57 99 54 89 38 103 99 47 134 21 58 112 96 21 47 ;
+ 53 31 54 52 89 119 31 14 71 86 138 94 41 0 57 123 30 30 72 31 102 25 96 58 60 147 34 71 71 109 36 34 ;
+ 38 50 65 63 100 62 32 43 82 69 81 105 44 57 0 66 35 87 69 88 45 82 73 69 3 90 23 14 82 52 25 91 ;
+ 92 116 109 105 70 52 92 109 54 37 19 59 110 123 66 0 101 153 51 154 77 148 27 97 63 40 89 60 72 24 89 157 ;
+ 31 15 84 82 119 97 51 16 101 88 116 124 11 30 35 101 0 52 88 53 80 47 92 88 38 125 12 49 101 87 12 56 ;
+ 83 47 44 48 83 149 61 44 99 116 168 94 57 30 87 153 52 0 102 3 132 19 126 56 90 177 64 101 81 139 64 10 ;
+ 107 89 58 54 31 67 41 72 13 14 66 36 99 72 69 51 88 102 0 103 92 97 24 46 72 75 84 75 21 39 94 106 ;
+ 84 44 45 49 84 150 62 45 100 117 169 95 54 31 88 154 53 3 103 0 133 16 127 57 91 178 65 102 82 140 65 7 ;
+ 49 95 88 86 123 25 71 88 105 92 58 128 89 102 45 77 80 132 92 133 0 127 96 92 42 45 68 31 105 53 68 136 ;
+ 78 32 57 55 92 144 56 39 94 111 163 97 38 25 82 148 47 19 97 16 127 0 121 61 85 172 59 96 76 134 59 9 ;
+ 111 93 82 78 43 71 65 82 27 10 42 32 103 96 73 27 92 126 24 127 96 121 0 70 76 59 88 79 45 43 98 130 ;
+ 107 89 12 8 31 93 37 72 43 60 112 38 99 58 69 97 88 56 46 57 92 61 70 0 72 121 84 75 25 83 94 60 ;
+ 35 53 68 66 103 59 35 46 85 72 78 108 47 60 3 63 38 90 72 91 42 85 76 72 0 87 26 11 85 49 26 94 ;
+ 94 140 133 129 94 28 116 133 78 61 21 91 134 147 90 40 125 177 75 178 45 172 59 121 87 0 113 76 96 38 113 181 ;
+ 23 27 80 78 115 85 47 20 97 84 104 120 21 34 23 89 12 64 84 65 68 59 88 84 26 113 0 37 97 75 10 68 ;
+ 32 64 71 69 106 48 40 57 88 75 67 111 58 71 14 60 49 101 75 102 31 96 79 75 11 76 37 0 88 38 37 105 ;
+ 120 102 37 33 18 80 50 85 18 35 87 23 112 71 82 72 101 81 21 82 105 76 45 25 85 96 97 88 0 58 107 85 ;
+ 68 102 95 91 70 28 78 95 52 39 29 75 96 109 52 24 87 139 39 140 53 134 43 83 49 38 75 38 58 0 75 143 ;
+ 19 27 90 88 125 85 57 22 107 94 104 130 21 36 25 89 12 64 94 65 68 59 98 94 26 113 10 37 107 75 0 68 ;
+ 87 41 48 52 87 153 65 48 103 120 172 98 47 34 91 157 56 10 106 7 136 9 130 60 94 181 68 105 85 143 68 0 ];
+
+vehicles = 5;
+start = 1;
+
+
+demands = [0 19 21 6 19 7 12 16 6 16 8 14 21 16 3 22 18 19 1 24 8 12 4 8 24 24 2 20 15 2 14 9];
+
+labels = [];
+
+max_vehicle_capacity = 100;
+service_time_per_demand = [];
+time_windows =[];
+
+speeds = [];
+
+waiting_times = [1 2 3 4 6 7 6 7];
+
+
+
+//Error
+//[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows,speeds, );
+// !--error 10000
+//vrp : Wrong dimensions for the input argument #10 ('waiting_times'). Expected to be either an empty matrix or one with dimensions [1x32].
+//at line 444 of function vrp called by :
+//_capacity, service_time_per_demand, time_windows,speeds, )
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows,speeds,waiting_times );
+
+
diff --git a/tests/general_tests/vrp/vrp_waitingtimes_int.sce b/tests/general_tests/vrp/vrp_waitingtimes_int.sce
new file mode 100644
index 0000000..470aa73
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_waitingtimes_int.sce
@@ -0,0 +1,60 @@
+//Check if the values in the argument 'waiting_times' are integral( x.0 is considered INTEGRAL; any other fractional part throws an error)
+
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [0,20,20,60.0,20.7,20.5,20.1,20,20,20,20,20,20];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : Wrong dimensions for the input argument #10 ('waiting_times'). Expected to be either an empty matrix or one with dimensions [1x13].
+//at line 449 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_waitingtimes_nonnegative.sce b/tests/general_tests/vrp/vrp_waitingtimes_nonnegative.sce
new file mode 100644
index 0000000..0621b6a
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_waitingtimes_nonnegative.sce
@@ -0,0 +1,59 @@
+//Check if all the values in the argument 'waiting_times' non-negative.
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = [5,5,5,5,5,5,5,5,5,5,5,5,-8];
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+// !--error 10000
+//vrp : Waiting time values cannot be negative.
+//at line 880 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/general_tests/vrp/vrp_waitingtimes_type.sce b/tests/general_tests/vrp/vrp_waitingtimes_type.sce
new file mode 100644
index 0000000..5bb578f
--- /dev/null
+++ b/tests/general_tests/vrp/vrp_waitingtimes_type.sce
@@ -0,0 +1,59 @@
+//Check if the argument 'waiting_times' is of the correct type
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374, 2408, 213, 2571, 875, 1420, 2145, 1972;
+ 2451, 0, 1745, 1524, 831, 1240, 959, 2596, 403, 1589, 1374, 357, 579;
+ 713, 1745, 0, 355, 920, 803, 1737, 851, 1858, 262, 940, 1453, 1260;
+ 1018, 1524, 355, 0, 700, 862, 1395, 1123, 1584, 466, 1056, 1280, 987;
+ 1631, 831, 920, 700, 0, 663, 1021, 1769, 949, 796, 879, 586, 371;
+ 1374, 1240, 803, 862, 663, 0, 1681, 1551, 1765, 547, 225, 887, 999;
+ 2408, 959, 1737, 1395, 1021, 1681, 0, 2493, 678, 1724, 1891, 1114, 701;
+ 213, 2596, 851, 1123, 1769, 1551, 2493, 0, 2699, 1038, 1605, 2300, 2099;
+ 2571, 403, 1858, 1584, 949, 1765, 678, 2699, 0, 1744, 1645, 653, 600;
+ 875, 1589, 262, 466, 796, 547, 1724, 1038, 1744, 0, 679, 1272, 1162;
+ 1420, 1374, 940, 1056, 879, 225, 1891, 1605, 1645, 679, 0, 1017, 1200;
+ 2145, 357, 1453, 1280, 586, 887, 1114, 2300, 653, 1272, 1017, 0, 504;
+ 1972, 579, 1260, 987, 371, 999, 701, 2099, 600, 1162, 1200, 504, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas", "Seattle", "Boston", "San Francisco", "St. Louis", "Houston", "Phoenix", "Salt Lake City"];
+
+start = 1;
+
+vehicles = 3;
+
+demands = [0, 19, 21, 6, 19, 7, 12, 16, 6, 16, 8, 14, 21 ];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+time_windows = [];
+
+speeds = [];
+
+waiting_times = list( 10,10,10,10,10,10,10,10,10,10,10,10,10);
+
+refuel_flag = 0;
+
+fuel_capacity = [];
+
+refuel_nodes = [];
+
+penalty = [];
+
+groups = [];
+
+group_penalty = [];
+
+time_limit = [];
+
+//Error
+//vrp: Expected type ["constant"] for input argument waiting_times at input #10, but got "list" instead.
+//at line 56 of function Checktype called by :
+//at line 303 of function vrp called by :
+// refuel_nodes, penalty, groups, group_penalty, time_limit)
+
+
+[total_distance, routes ] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand, time_windows, speeds,waiting_times,refuel_flag, fuel_capacity, refuel_nodes, penalty, groups, group_penalty, time_limit);
+
+
+
diff --git a/tests/unit_tests/fmaxflow.dia.ref b/tests/unit_tests/fmaxflow.dia.ref
new file mode 100644
index 0000000..ccbb80a
--- /dev/null
+++ b/tests/unit_tests/fmaxflow.dia.ref
@@ -0,0 +1,78 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Samuel Wilson
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+//endfunction
+//A simple max-flow problem(has optimal solution). Ref : https://developers.google.com/optimization/flow/maxflow
+//Defining the graph(3 vectors)
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3];
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4];
+capacities = [20, 30, 10, 40, 30, 10, 20, 5, 20];
+//Specifying the source and target nodes for the max-flow solution
+st=[0, 4];
+//calling the scilab routine
+[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st);
+Max flow = 60
+Arc Flow Capacity
+0->1 20 20
+0->2 30 30
+0->3 10 10
+1->2 0 40
+1->4 20 30
+2->3 10 10
+2->4 20 20
+3->2 0 5
+3->4 20 20
+
+An optimal solution was found
+assert_checkequal(maxflow,int32(60));
+assert_checkequal(arcflows,int32([20 30 10 0 20 10 20 0 20]));
+assert_checkequal(status,int32(0));
+printf("\nTest Successful!\n");
+
+Test Successful!
diff --git a/tests/unit_tests/fmaxflow.tst b/tests/unit_tests/fmaxflow.tst
new file mode 100644
index 0000000..ffcd00c
--- /dev/null
+++ b/tests/unit_tests/fmaxflow.tst
@@ -0,0 +1,73 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Samuel Wilson
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+
+
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+//endfunction
+
+//A simple max-flow problem(has optimal solution). Ref : https://developers.google.com/optimization/flow/maxflow
+
+//Defining the graph(3 vectors)
+start_nodes = [0, 0, 0, 1, 1, 2, 2, 3, 3];
+end_nodes = [1, 2, 3, 2, 4, 3, 4, 2, 4];
+capacities = [20, 30, 10, 40, 30, 10, 20, 5, 20];
+
+//Specifying the source and target nodes for the max-flow solution
+st=[0, 4];
+
+
+//calling the scilab routine
+[maxflow,arcflows,status]=fmaxflow(start_nodes,end_nodes,capacities,st);
+
+assert_checkequal(maxflow,int32(60));
+assert_checkequal(arcflows,int32([20 30 10 0 20 10 20 0 20]));
+assert_checkequal(status,int32(0));
+printf("\nTest Successful!\n");
+
diff --git a/tests/unit_tests/fshortestpath.dia.ref b/tests/unit_tests/fshortestpath.dia.ref
new file mode 100644
index 0000000..853ccf5
--- /dev/null
+++ b/tests/unit_tests/fshortestpath.dia.ref
@@ -0,0 +1,69 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Samuel Wilson
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+//endfunction
+//A simple shortest-path example. Refer to the documentation for more details on the same example.
+start_nodes=[ 0 0 1 1 2 4 5 4];
+end_nodes= [ 1 5 2 5 3 3 4 2];
+weights=[10 8 5 2 7 10 10 8];
+st=[0,3];
+//Calling the routine
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st);
+
+Shortest path from start-node:0 to end-node:3 is :
+0 -> 1 -> 2 -> 3
+Minumum cost (using the said path) :- 22.000000
+
+ Shortest/Lowest Cost Path found.
+assert_checkequal(mincost,[22]);
+assert_checkequal(shortestpath,int32([0 1 2 3]));
+assert_checkequal(flag,int32(1));
+printf("\nTest Successful!\n");
+
+Test Successful!
diff --git a/tests/unit_tests/fshortestpath.tst b/tests/unit_tests/fshortestpath.tst
new file mode 100644
index 0000000..520ce05
--- /dev/null
+++ b/tests/unit_tests/fshortestpath.tst
@@ -0,0 +1,68 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Samuel Wilson
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+
+
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+//endfunction
+
+//A simple shortest-path example. Refer to the documentation for more details on the same example.
+
+start_nodes=[ 0 0 1 1 2 4 5 4];
+end_nodes= [ 1 5 2 5 3 3 4 2];
+weights=[10 8 5 2 7 10 10 8];
+st=[0,3];
+
+//Calling the routine
+[mincost,shortestpath,flag]=fshortestpath(start_nodes,end_nodes,weights,st);
+
+assert_checkequal(mincost,[22]);
+assert_checkequal(shortestpath,int32([0 1 2 3]));
+assert_checkequal(flag,int32(1));
+printf("\nTest Successful!\n");
diff --git a/tests/unit_tests/jssp.dia.ref b/tests/unit_tests/jssp.dia.ref
new file mode 100644
index 0000000..a7fb2dc
--- /dev/null
+++ b/tests/unit_tests/jssp.dia.ref
@@ -0,0 +1,78 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Samuel Wilson
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+//endfunction
+//A simple Job-Shop Scheduling problem(has optimal solution)
+machines = 3;
+jobs = 3;
+jssp_mode = 0;
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, []);
+Optimal Solution Found!
+Optimal Makespan : 11
+Optimal Schedule(machine-wise) :-
+machine_0: Job- 1, Task- 1[0, 3] Job- 2, Task- 1[3, 5]
+machine_1: Job- 3, Task- 1[0, 4] Job- 1, Task- 2[4, 6] Job- 2, Task- 3[6, 10]
+machine_2: Job- 2, Task- 2[5, 6] Job- 1, Task- 3[6, 8] Job- 3, Task- 2[8, 11]
+
+assert_checkequal(makespan,int32(11));
+assert_checkequal(schedule,int32([1 1 3 0 3;1 2 2 4 6;1 3 2 6 8;2 1 2 3 5;2 3 1 5 6;2 2 4 6 10;3 2 4 0 4;3 3 3 8 11]));
+assert_checkequal(status,int32(0));
+printf("\nTest Successful!\n");
+
+Test Successful!
diff --git a/tests/unit_tests/jssp.tst b/tests/unit_tests/jssp.tst
new file mode 100644
index 0000000..8781cab
--- /dev/null
+++ b/tests/unit_tests/jssp.tst
@@ -0,0 +1,81 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Samuel Wilson
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+
+
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+//endfunction
+
+//A simple Job-Shop Scheduling problem(has optimal solution)
+
+machines = 3;
+jobs = 3;
+
+jssp_mode = 0;
+
+tasks=[ 1 1 3;
+ 1 2 2;
+ 1 3 2;
+ 2 1 2;
+ 2 3 1;
+ 2 2 4;
+ 3 2 4;
+ 3 3 3;
+ ];
+
+
+[makespan, schedule, status] = jssp(machines, jobs, jssp_mode, tasks, []);
+
+
+
+assert_checkequal(makespan,int32(11));
+assert_checkequal(schedule,int32([1 1 3 0 3;1 2 2 4 6;1 3 2 6 8;2 1 2 3 5;2 3 1 5 6;2 2 4 6 10;3 2 4 0 4;3 3 3 8 11]));
+assert_checkequal(status,int32(0));
+printf("\nTest Successful!\n");
+
diff --git a/tests/unit_tests/linsum.dia.ref b/tests/unit_tests/linsum.dia.ref
new file mode 100644
index 0000000..9f29f1b
--- /dev/null
+++ b/tests/unit_tests/linsum.dia.ref
@@ -0,0 +1,65 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Souvik Das
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+//endfunction
+//A simple linear sum test problem
+// Ref : http://www.hungarianalgorithm.com/examplehungarianalgorithm.php
+kNumLeftNodes = 4;
+kNumRightNodes = 4;
+kCost = [82, 83, 69, 92; 77, 37, 49, 92; 11, 69, 5, 86; 8, 9, 98, 23];
+//Calling the routine
+[cost, assignment, status] = linsum(kNumLeftNodes, kNumRightNodes, kCost);
+
+Optimal Solution Found.
+assert_checkequal(cost,[140]);
+assert_checkequal(assignment,[%F %F %T %F;%F %T %F %F;%T %F %F %F;%F %F %F %T]);
+assert_checkequal(status,[1]);
+printf("\nTest Successful!\n");
+
+Test Successful!
diff --git a/tests/unit_tests/linsum.tst b/tests/unit_tests/linsum.tst
new file mode 100644
index 0000000..a33e0ad
--- /dev/null
+++ b/tests/unit_tests/linsum.tst
@@ -0,0 +1,69 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Souvik Das
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+
+
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+//endfunction
+
+
+//A simple linear sum test problem
+// Ref : http://www.hungarianalgorithm.com/examplehungarianalgorithm.php
+
+kNumLeftNodes = 4;
+kNumRightNodes = 4;
+kCost = [82, 83, 69, 92; 77, 37, 49, 92; 11, 69, 5, 86; 8, 9, 98, 23];
+
+//Calling the routine
+[cost, assignment, status] = linsum(kNumLeftNodes, kNumRightNodes, kCost);
+
+assert_checkequal(cost,[140]);
+assert_checkequal(assignment,[%F %F %T %F;%F %T %F %F;%T %F %F %F;%F %F %F %T]);
+assert_checkequal(status,[1]);
+printf("\nTest Successful!\n");
\ No newline at end of file
diff --git a/tests/unit_tests/min_cost_flow.dia.ref b/tests/unit_tests/min_cost_flow.dia.ref
new file mode 100644
index 0000000..a0844cb
--- /dev/null
+++ b/tests/unit_tests/min_cost_flow.dia.ref
@@ -0,0 +1,78 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Souvik Das
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+//endfunction
+//A simple min-cost-flow example
+// Before balancing (Infeasible):
+// kNumSources = 4;
+// kNumTargets = 4;
+// kCost = [4, 6, 8, 13; 13, 11, 10, 8; 14, 4, 10, 13; 9, 11, 13, 8];
+// kCapacity = [200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200];
+// kSupply = [50, 70, 30, 50];
+// kDemand = [25, 35, 105, 20];
+// [cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
+// After balancing (Optimal):
+kNumSources = 4;
+kNumTargets = 5;
+kCost = [4, 6, 8, 13, 0; 13, 11, 10, 8, 0; 14, 4, 10, 13, 0; 9, 11, 13, 8, 0];
+kCapacity = [200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200];
+kSupply = [50, 70, 30, 50];
+kDemand = [25, 35, 105, 20, 15];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
+
+Optimal Solution Found.
+assert_checkequal(cost,[1465]); //We can check for equality rather than 'close' as cost is supposed to be integral(as specified by the typedef in Google OR tools)
+assert_checkequal(flow,[25 0 25 0 0;
+ 0 0 70 0 0;
+ 0 30 0 0 0;
+ 0 5 10 20 15]);
+assert_checkequal(status,[1]);
+printf("\nTest Successful!\n");
+
+Test Successful!
diff --git a/tests/unit_tests/min_cost_flow.tst b/tests/unit_tests/min_cost_flow.tst
new file mode 100644
index 0000000..6556f81
--- /dev/null
+++ b/tests/unit_tests/min_cost_flow.tst
@@ -0,0 +1,85 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Souvik Das
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+
+
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+//endfunction
+
+
+//A simple min-cost-flow example
+
+// Before balancing (Infeasible):
+// kNumSources = 4;
+// kNumTargets = 4;
+// kCost = [4, 6, 8, 13; 13, 11, 10, 8; 14, 4, 10, 13; 9, 11, 13, 8];
+// kCapacity = [200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200; 200, 200, 200, 200];
+// kSupply = [50, 70, 30, 50];
+// kDemand = [25, 35, 105, 20];
+// [cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
+
+// After balancing (Optimal):
+
+
+kNumSources = 4;
+kNumTargets = 5;
+kCost = [4, 6, 8, 13, 0; 13, 11, 10, 8, 0; 14, 4, 10, 13, 0; 9, 11, 13, 8, 0];
+kCapacity = [200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200; 200, 200, 200, 200, 200];
+kSupply = [50, 70, 30, 50];
+kDemand = [25, 35, 105, 20, 15];
+[cost, flow, status] = min_cost_flow(kNumSources, kNumTargets, kCost, kCapacity, kSupply, kDemand);
+
+
+assert_checkequal(cost,[1465]); //We can check for equality rather than 'close' as cost is supposed to be integral(as specified by the typedef in Google OR tools)
+assert_checkequal(flow,[25 0 25 0 0;
+ 0 0 70 0 0;
+ 0 30 0 0 0;
+ 0 5 10 20 15]);
+assert_checkequal(status,[1]);
+printf("\nTest Successful!\n");
diff --git a/tests/unit_tests/qcqpglob.dia.ref b/tests/unit_tests/qcqpglob.dia.ref
new file mode 100644
index 0000000..f24ac56
--- /dev/null
+++ b/tests/unit_tests/qcqpglob.dia.ref
@@ -0,0 +1,80 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Souvik Das
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+//endfunction
+// Sample Only
+// Min. Z = 100 - x^2 + 2 * y^2 - 3 * x * y + 4 * x - 5 * y
+// Subject to:
+// 60 >= x^2 + y^2 - x - y >= -100
+// -10 <= x <= 6
+// -10 <= y <= 6
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
+
+Optimal Solution Found.
+assert_close(kSoln, 9, 0.1);
+assert_close(kSolnVector, [-7, -1], 0.15);
+assert_checkequal(status,[3]);
+printf("\nTest Successful!\n");
+
+Test Successful!
diff --git a/tests/unit_tests/qcqpglob.tst b/tests/unit_tests/qcqpglob.tst
new file mode 100644
index 0000000..d695ee9
--- /dev/null
+++ b/tests/unit_tests/qcqpglob.tst
@@ -0,0 +1,83 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Souvik Das
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+
+
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+//endfunction
+
+
+// Sample Only
+// Min. Z = 100 - x^2 + 2 * y^2 - 3 * x * y + 4 * x - 5 * y
+// Subject to:
+// 60 >= x^2 + y^2 - x - y >= -100
+// -10 <= x <= 6
+// -10 <= y <= 6
+
+n = 2;
+m = 1;
+h_obj = [-2, -1; -2, 4];
+f_obj = [4, -5];
+c_obj = 100;
+h_con = list();
+h_con(1) = [2, 0; 0, 2];
+f_con = list();
+f_con(1) = [-1, -1];
+lb_con = [-100];
+ub_con = [60];
+maxcputime = 600;
+lb_var = [-10, -10];
+ub_var = [6, 6];
+[kSoln, kSolnVector, status] = qcqpglob(n, m, h_obj, f_obj, c_obj, h_con, f_con, lb_con, ub_con, lb_var, ub_var, maxcputime);
+
+
+assert_close(kSoln, 9, 0.1);
+assert_close(kSolnVector, [-7, -1], 0.15);
+assert_checkequal(status,[3]);
+printf("\nTest Successful!\n");
diff --git a/tests/unit_tests/tsp.dia.ref b/tests/unit_tests/tsp.dia.ref
new file mode 100644
index 0000000..b44751c
--- /dev/null
+++ b/tests/unit_tests/tsp.dia.ref
@@ -0,0 +1,70 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Samuel Wilson
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+//endfunction
+//A simple Travelling Saleman Problem Example(optimal solution exists). Refer to the documentation of the function for more details on the same example
+//defining the adjacency matrix
+adj=[0 10 15 20;
+10 0 35 25;
+15 35 0 30;
+20 25 30 0];
+//specifying the start node
+start_node=1;
+labels=['A' 'B' 'C' 'D'];
+//calling the routine
+[mincost,path,status]=tsp(adj,start_node,labels);
+
+ 'ROUTING_SUCCESS' ; An optimal solution was found
+Minimum cost -> 80
+
+Optimal Path :-
+ A (1) -> B (2) -> D (4) -> C (3) ->A (1)assert_checkequal(mincost,int32[80]);
+
+
+exec('SCI/etc/scilab.quit',-1);quit;
diff --git a/tests/unit_tests/tsp.tst b/tests/unit_tests/tsp.tst
new file mode 100644
index 0000000..cc924be
--- /dev/null
+++ b/tests/unit_tests/tsp.tst
@@ -0,0 +1,78 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Samuel Wilson
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+
+
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+//endfunction
+
+
+//A simple Travelling Saleman Problem Example(optimal solution exists). Refer to the documentation of the function for more details on the same example
+
+//defining the adjacency matrix
+adj=[0 10 15 20;
+10 0 35 25;
+15 35 0 30;
+20 25 30 0];
+
+//specifying the start node
+start_node=1;
+
+labels=['A' 'B' 'C' 'D'];
+
+//calling the routine
+[mincost,path,status]=tsp(adj,start_node,labels);
+
+
+assert_checkequal(mincost,int32[80]);
+assert_checkequal(path,int32[1 2 4 3 1]);
+assert_checkequal(status,int32[1]);
+printf("\n Test Successful!\n");
+
+
diff --git a/tests/unit_tests/vrp.dia.ref b/tests/unit_tests/vrp.dia.ref
new file mode 100644
index 0000000..a7e2758
--- /dev/null
+++ b/tests/unit_tests/vrp.dia.ref
@@ -0,0 +1,78 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Samuel Wilson
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then bugmes();quit;end
+//endfunction
+
+//A simple Vehicle-Routing Problem(with optimal solution)
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374,
+ 2451, 0, 1745, 1524, 831, 1240;
+ 713, 1745, 0, 355, 920, 803;
+ 1018, 1524, 355, 0, 700, 862;
+ 1631, 831, 920, 700, 0, 663;
+ 1374, 1240, 803, 862, 663, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas"];
+
+start = 1;
+
+vehicles = 2;
+
+demands = [0, 19, 21, 6, 19, 7];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+
+
+[total_distance, routes,distances, total_time, times, status] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand);
+
+
+exec('SCI/etc/scilab.quit',-1);quit;
diff --git a/tests/unit_tests/vrp.tst b/tests/unit_tests/vrp.tst
new file mode 100644
index 0000000..1d065aa
--- /dev/null
+++ b/tests/unit_tests/vrp.tst
@@ -0,0 +1,90 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// Author: Samuel Wilson
+// Organization: FOSSEE, IIT Bombay
+// Email: harpreet.mertia@gmail.com
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+// <-- JVM NOT MANDATORY -->
+// <-- ENGLISH IMPOSED -->
+// <-- NO CHECK REF -->
+// <-- NO CHECK ERROR OUTPUT -->
+
+//
+// assert_close --
+// Returns 1 if the two real matrices computed and expected are close,
+// i.e. if the relative distance between computed and expected is lesser than epsilon.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+function flag = assert_close ( computed, expected, epsilon )
+ if expected==0.0 then
+ shift = norm(computed-expected);
+ else
+ shift = norm(computed-expected)/norm(expected);
+ end
+// if shift < epsilon then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+ flag = assert_checktrue ( shift < epsilon );
+endfunction
+//
+// assert_equal --
+// Returns 1 if the two real matrices computed and expected are equal.
+// Arguments
+// computed, expected : the two matrices to compare
+// epsilon : a small number
+//
+//function flag = assert_equal ( computed , expected )
+// if computed==expected then
+// flag = 1;
+// else
+// flag = 0;
+// end
+// if flag <> 1 then pause,end
+//endfunction
+
+
+//A simple Vehicle-Routing Problem(with optimal solution)
+
+adj_matrix = [0, 2451, 713, 1018, 1631, 1374,
+ 2451, 0, 1745, 1524, 831, 1240;
+ 713, 1745, 0, 355, 920, 803;
+ 1018, 1524, 355, 0, 700, 862;
+ 1631, 831, 920, 700, 0, 663;
+ 1374, 1240, 803, 862, 663, 0];
+
+labels = ["New York", "Los Angeles", "Chicago", "Minneapolis", "Denver", "Dallas"];
+
+start = 1;
+
+vehicles = 2;
+
+demands = [0, 19, 21, 6, 19, 7];
+
+service_time_per_demand=3;
+
+max_vehicle_capacity = 60;
+
+
+
+[total_distance, routes,distances, total_time, times, status] = vrp( adj_matrix, vehicles, start, labels, demands, max_vehicle_capacity, service_time_per_demand);
+
+
+assert_checkequal(total_distance, int32(6589));
+assert_checkequal(routes,int32([1 3 1 0 0 0; 1 6 2 5 4 1));
+assert_checkequal(distances, int32([1426 5163]));
+assert_checkequal(total_time, int32([216]));
+assert_checkequal(times, int32([63 153]));
+assert_checkequal(status, int32([1]));
+printf("\nTest Successful!\n");
+
diff --git a/thirdparty/.gitignore b/thirdparty/.gitignore
new file mode 100644
index 0000000..f9be8df
--- /dev/null
+++ b/thirdparty/.gitignore
@@ -0,0 +1 @@
+!*
diff --git a/thirdparty/linux/include/boost/assert.hpp b/thirdparty/linux/include/boost/assert.hpp
new file mode 100644
index 0000000..9650d7a
--- /dev/null
+++ b/thirdparty/linux/include/boost/assert.hpp
@@ -0,0 +1,85 @@
+//
+// boost/assert.hpp - BOOST_ASSERT(expr)
+// BOOST_ASSERT_MSG(expr, msg)
+// BOOST_VERIFY(expr)
+// BOOST_VERIFY_MSG(expr, msg)
+// BOOST_ASSERT_IS_VOID
+//
+// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
+// Copyright (c) 2007, 2014 Peter Dimov
+// Copyright (c) Beman Dawes 2011
+// Copyright (c) 2015 Ion Gaztanaga
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+// Note: There are no include guards. This is intentional.
+//
+// See http://www.boost.org/libs/assert/assert.html for documentation.
+//
+
+//
+// Stop inspect complaining about use of 'assert':
+//
+// boostinspect:naassert_macro
+//
+
+//
+// BOOST_ASSERT, BOOST_ASSERT_MSG, BOOST_ASSERT_IS_VOID
+//
+
+#undef BOOST_ASSERT
+#undef BOOST_ASSERT_MSG
+#undef BOOST_ASSERT_IS_VOID
+
+#if defined(BOOST_DISABLE_ASSERTS) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && defined(NDEBUG) )
+
+# define BOOST_ASSERT(expr) ((void)0)
+# define BOOST_ASSERT_MSG(expr, msg) ((void)0)
+# define BOOST_ASSERT_IS_VOID
+
+#elif defined(BOOST_ENABLE_ASSERT_HANDLER) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && !defined(NDEBUG) )
+
+#include // for BOOST_LIKELY
+#include
+
+namespace boost
+{
+ void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined
+ void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line); // user defined
+} // namespace boost
+
+#define BOOST_ASSERT(expr) (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
+#define BOOST_ASSERT_MSG(expr, msg) (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
+
+#else
+
+# include // .h to support old libraries w/o - effect is the same
+
+# define BOOST_ASSERT(expr) assert(expr)
+# define BOOST_ASSERT_MSG(expr, msg) assert((expr)&&(msg))
+#if defined(NDEBUG)
+# define BOOST_ASSERT_IS_VOID
+#endif
+
+#endif
+
+//
+// BOOST_VERIFY, BOOST_VERIFY_MSG
+//
+
+#undef BOOST_VERIFY
+#undef BOOST_VERIFY_MSG
+
+#if defined(BOOST_DISABLE_ASSERTS) || ( !defined(BOOST_ENABLE_ASSERT_HANDLER) && defined(NDEBUG) )
+
+# define BOOST_VERIFY(expr) ((void)(expr))
+# define BOOST_VERIFY_MSG(expr, msg) ((void)(expr))
+
+#else
+
+# define BOOST_VERIFY(expr) BOOST_ASSERT(expr)
+# define BOOST_VERIFY_MSG(expr, msg) BOOST_ASSERT_MSG(expr,msg)
+
+#endif
diff --git a/thirdparty/linux/include/boost/checked_delete.hpp b/thirdparty/linux/include/boost/checked_delete.hpp
new file mode 100644
index 0000000..fb71c78
--- /dev/null
+++ b/thirdparty/linux/include/boost/checked_delete.hpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2014 Glen Fernandes
+ *
+ * Distributed under the Boost Software License, Version 1.0. (See
+ * accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
+ */
+
+#ifndef BOOST_CHECKED_DELETE_HPP
+#define BOOST_CHECKED_DELETE_HPP
+
+// The header file at this path is deprecated;
+// use boost/core/checked_delete.hpp instead.
+
+#include
+
+#endif
diff --git a/thirdparty/linux/include/boost/config.hpp b/thirdparty/linux/include/boost/config.hpp
new file mode 100644
index 0000000..d49bb27
--- /dev/null
+++ b/thirdparty/linux/include/boost/config.hpp
@@ -0,0 +1,67 @@
+// Boost config.hpp configuration header file ------------------------------//
+
+// (C) Copyright John Maddock 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org/libs/config for most recent version.
+
+// Boost config.hpp policy and rationale documentation has been moved to
+// http://www.boost.org/libs/config
+//
+// CAUTION: This file is intended to be completely stable -
+// DO NOT MODIFY THIS FILE!
+//
+
+#ifndef BOOST_CONFIG_HPP
+#define BOOST_CONFIG_HPP
+
+// if we don't have a user config, then use the default location:
+#if !defined(BOOST_USER_CONFIG) && !defined(BOOST_NO_USER_CONFIG)
+# define BOOST_USER_CONFIG
+#if 0
+// For dependency trackers:
+# include
+#endif
+#endif
+// include it first:
+#ifdef BOOST_USER_CONFIG
+# include BOOST_USER_CONFIG
+#endif
+
+// if we don't have a compiler config set, try and find one:
+#if !defined(BOOST_COMPILER_CONFIG) && !defined(BOOST_NO_COMPILER_CONFIG) && !defined(BOOST_NO_CONFIG)
+# include
+#endif
+// if we have a compiler config, include it now:
+#ifdef BOOST_COMPILER_CONFIG
+# include BOOST_COMPILER_CONFIG
+#endif
+
+// if we don't have a std library config set, try and find one:
+#if !defined(BOOST_STDLIB_CONFIG) && !defined(BOOST_NO_STDLIB_CONFIG) && !defined(BOOST_NO_CONFIG) && defined(__cplusplus)
+# include
+#endif
+// if we have a std library config, include it now:
+#ifdef BOOST_STDLIB_CONFIG
+# include BOOST_STDLIB_CONFIG
+#endif
+
+// if we don't have a platform config set, try and find one:
+#if !defined(BOOST_PLATFORM_CONFIG) && !defined(BOOST_NO_PLATFORM_CONFIG) && !defined(BOOST_NO_CONFIG)
+# include
+#endif
+// if we have a platform config, include it now:
+#ifdef BOOST_PLATFORM_CONFIG
+# include BOOST_PLATFORM_CONFIG
+#endif
+
+// get config suffix code:
+#include
+
+#ifdef BOOST_HAS_PRAGMA_ONCE
+#pragma once
+#endif
+
+#endif // BOOST_CONFIG_HPP
diff --git a/thirdparty/linux/include/boost/config/abi/borland_prefix.hpp b/thirdparty/linux/include/boost/config/abi/borland_prefix.hpp
new file mode 100644
index 0000000..3a0e5ae
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/abi/borland_prefix.hpp
@@ -0,0 +1,27 @@
+// (C) Copyright John Maddock 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// for C++ Builder the following options effect the ABI:
+//
+// -b (on or off - effect emum sizes)
+// -Vx (on or off - empty members)
+// -Ve (on or off - empty base classes)
+// -aX (alignment - 5 options).
+// -pX (Calling convention - 4 options)
+// -VmX (member pointer size and layout - 5 options)
+// -VC (on or off, changes name mangling)
+// -Vl (on or off, changes struct layout).
+
+// In addition the following warnings are sufficiently annoying (and
+// unfixable) to have them turned off by default:
+//
+// 8027 - functions containing [for|while] loops are not expanded inline
+// 8026 - functions taking class by value arguments are not expanded inline
+
+#pragma nopushoptwarn
+# pragma option push -a8 -Vx- -Ve- -b- -pc -Vmv -VC- -Vl- -w-8027 -w-8026
+
+
+
diff --git a/thirdparty/linux/include/boost/config/abi/borland_suffix.hpp b/thirdparty/linux/include/boost/config/abi/borland_suffix.hpp
new file mode 100644
index 0000000..940535f
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/abi/borland_suffix.hpp
@@ -0,0 +1,12 @@
+// (C) Copyright John Maddock 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+# pragma option pop
+#pragma nopushoptwarn
+
+
+
+
+
diff --git a/thirdparty/linux/include/boost/config/abi/msvc_prefix.hpp b/thirdparty/linux/include/boost/config/abi/msvc_prefix.hpp
new file mode 100644
index 0000000..97f06cd
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/abi/msvc_prefix.hpp
@@ -0,0 +1,22 @@
+// (C) Copyright John Maddock 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+//
+// Boost binaries are built with the compiler's default ABI settings,
+// if the user changes their default alignment in the VS IDE then their
+// code will no longer be binary compatible with the bjam built binaries
+// unless this header is included to force Boost code into a consistent ABI.
+//
+// Note that inclusion of this header is only necessary for libraries with
+// separate source, header only libraries DO NOT need this as long as all
+// translation units are built with the same options.
+//
+#if defined(_M_X64)
+# pragma pack(push,16)
+#else
+# pragma pack(push,8)
+#endif
+
+
diff --git a/thirdparty/linux/include/boost/config/abi/msvc_suffix.hpp b/thirdparty/linux/include/boost/config/abi/msvc_suffix.hpp
new file mode 100644
index 0000000..a64d783
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/abi/msvc_suffix.hpp
@@ -0,0 +1,8 @@
+// (C) Copyright John Maddock 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#pragma pack(pop)
+
+
diff --git a/thirdparty/linux/include/boost/config/abi_prefix.hpp b/thirdparty/linux/include/boost/config/abi_prefix.hpp
new file mode 100644
index 0000000..3b13474
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/abi_prefix.hpp
@@ -0,0 +1,25 @@
+// abi_prefix header -------------------------------------------------------//
+
+// (c) Copyright John Maddock 2003
+
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+
+#ifndef BOOST_CONFIG_ABI_PREFIX_HPP
+# define BOOST_CONFIG_ABI_PREFIX_HPP
+#else
+# error double inclusion of header boost/config/abi_prefix.hpp is an error
+#endif
+
+#include
+
+// this must occur after all other includes and before any code appears:
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+#if defined( __BORLANDC__ )
+#pragma nopushoptwarn
+#endif
+
diff --git a/thirdparty/linux/include/boost/config/abi_suffix.hpp b/thirdparty/linux/include/boost/config/abi_suffix.hpp
new file mode 100644
index 0000000..9391616
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/abi_suffix.hpp
@@ -0,0 +1,27 @@
+// abi_sufffix header -------------------------------------------------------//
+
+// (c) Copyright John Maddock 2003
+
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+
+// This header should be #included AFTER code that was preceded by a #include
+// .
+
+#ifndef BOOST_CONFIG_ABI_PREFIX_HPP
+# error Header boost/config/abi_suffix.hpp must only be used after boost/config/abi_prefix.hpp
+#else
+# undef BOOST_CONFIG_ABI_PREFIX_HPP
+#endif
+
+// the suffix header occurs after all of our code:
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#if defined( __BORLANDC__ )
+#pragma nopushoptwarn
+#endif
+
+
diff --git a/thirdparty/linux/include/boost/config/auto_link.hpp b/thirdparty/linux/include/boost/config/auto_link.hpp
new file mode 100644
index 0000000..56a16b0
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/auto_link.hpp
@@ -0,0 +1,439 @@
+// (C) Copyright John Maddock 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE auto_link.hpp
+ * VERSION see
+ * DESCRIPTION: Automatic library inclusion for Borland/Microsoft compilers.
+ */
+
+/*************************************************************************
+
+USAGE:
+~~~~~~
+
+Before including this header you must define one or more of define the following macros:
+
+BOOST_LIB_NAME: Required: A string containing the basename of the library,
+ for example boost_regex.
+BOOST_LIB_TOOLSET: Optional: the base name of the toolset.
+BOOST_DYN_LINK: Optional: when set link to dll rather than static library.
+BOOST_LIB_DIAGNOSTIC: Optional: when set the header will print out the name
+ of the library selected (useful for debugging).
+BOOST_AUTO_LINK_NOMANGLE: Specifies that we should link to BOOST_LIB_NAME.lib,
+ rather than a mangled-name version.
+BOOST_AUTO_LINK_TAGGED: Specifies that we link to libraries built with the --layout=tagged option.
+ This is essentially the same as the default name-mangled version, but without
+ the compiler name and version, or the Boost version. Just the build options.
+
+These macros will be undef'ed at the end of the header, further this header
+has no include guards - so be sure to include it only once from your library!
+
+Algorithm:
+~~~~~~~~~~
+
+Libraries for Borland and Microsoft compilers are automatically
+selected here, the name of the lib is selected according to the following
+formula:
+
+BOOST_LIB_PREFIX
+ + BOOST_LIB_NAME
+ + "_"
+ + BOOST_LIB_TOOLSET
+ + BOOST_LIB_THREAD_OPT
+ + BOOST_LIB_RT_OPT
+ "-"
+ + BOOST_LIB_VERSION
+
+These are defined as:
+
+BOOST_LIB_PREFIX: "lib" for static libraries otherwise "".
+
+BOOST_LIB_NAME: The base name of the lib ( for example boost_regex).
+
+BOOST_LIB_TOOLSET: The compiler toolset name (vc6, vc7, bcb5 etc).
+
+BOOST_LIB_THREAD_OPT: "-mt" for multithread builds, otherwise nothing.
+
+BOOST_LIB_RT_OPT: A suffix that indicates the runtime library used,
+ contains one or more of the following letters after
+ a hyphen:
+
+ s static runtime (dynamic if not present).
+ g debug/diagnostic runtime (release if not present).
+ y Python debug/diagnostic runtime (release if not present).
+ d debug build (release if not present).
+ p STLport build.
+ n STLport build without its IOStreams.
+
+BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
+
+
+***************************************************************************/
+
+#ifdef __cplusplus
+# ifndef BOOST_CONFIG_HPP
+# include
+# endif
+#elif defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__EDG_VERSION__)
+//
+// C language compatability (no, honestly)
+//
+# define BOOST_MSVC _MSC_VER
+# define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
+# define BOOST_DO_STRINGIZE(X) #X
+#endif
+//
+// Only include what follows for known and supported compilers:
+//
+#if defined(BOOST_MSVC) \
+ || defined(__BORLANDC__) \
+ || (defined(__MWERKS__) && defined(_WIN32) && (__MWERKS__ >= 0x3000)) \
+ || (defined(__ICL) && defined(_MSC_EXTENSIONS) && (_MSC_VER >= 1200))
+
+#ifndef BOOST_VERSION_HPP
+# include
+#endif
+
+#ifndef BOOST_LIB_NAME
+# error "Macro BOOST_LIB_NAME not set (internal error)"
+#endif
+
+//
+// error check:
+//
+#if defined(__MSVC_RUNTIME_CHECKS) && !defined(_DEBUG)
+# pragma message("Using the /RTC option without specifying a debug runtime will lead to linker errors")
+# pragma message("Hint: go to the code generation options and switch to one of the debugging runtimes")
+# error "Incompatible build options"
+#endif
+//
+// select toolset if not defined already:
+//
+#ifndef BOOST_LIB_TOOLSET
+# if defined(BOOST_MSVC) && (BOOST_MSVC < 1200)
+ // Note: no compilers before 1200 are supported
+# elif defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+
+# ifdef UNDER_CE
+ // eVC4:
+# define BOOST_LIB_TOOLSET "evc4"
+# else
+ // vc6:
+# define BOOST_LIB_TOOLSET "vc6"
+# endif
+
+# elif defined(BOOST_MSVC) && (BOOST_MSVC < 1310)
+
+ // vc7:
+# define BOOST_LIB_TOOLSET "vc7"
+
+# elif defined(BOOST_MSVC) && (BOOST_MSVC < 1400)
+
+ // vc71:
+# define BOOST_LIB_TOOLSET "vc71"
+
+# elif defined(BOOST_MSVC) && (BOOST_MSVC < 1500)
+
+ // vc80:
+# define BOOST_LIB_TOOLSET "vc80"
+
+# elif defined(BOOST_MSVC) && (BOOST_MSVC < 1600)
+
+ // vc90:
+# define BOOST_LIB_TOOLSET "vc90"
+
+# elif defined(BOOST_MSVC) && (BOOST_MSVC < 1700)
+
+ // vc10:
+# define BOOST_LIB_TOOLSET "vc100"
+
+# elif defined(BOOST_MSVC) && (BOOST_MSVC < 1800)
+
+ // vc11:
+# define BOOST_LIB_TOOLSET "vc110"
+
+# elif defined(BOOST_MSVC) && (BOOST_MSVC < 1900)
+
+ // vc12:
+# define BOOST_LIB_TOOLSET "vc120"
+
+# elif defined(BOOST_MSVC)
+
+ // vc14:
+# define BOOST_LIB_TOOLSET "vc140"
+
+# elif defined(__BORLANDC__)
+
+ // CBuilder 6:
+# define BOOST_LIB_TOOLSET "bcb"
+
+# elif defined(__ICL)
+
+ // Intel C++, no version number:
+# define BOOST_LIB_TOOLSET "iw"
+
+# elif defined(__MWERKS__) && (__MWERKS__ <= 0x31FF )
+
+ // Metrowerks CodeWarrior 8.x
+# define BOOST_LIB_TOOLSET "cw8"
+
+# elif defined(__MWERKS__) && (__MWERKS__ <= 0x32FF )
+
+ // Metrowerks CodeWarrior 9.x
+# define BOOST_LIB_TOOLSET "cw9"
+
+# endif
+#endif // BOOST_LIB_TOOLSET
+
+//
+// select thread opt:
+//
+#if defined(_MT) || defined(__MT__)
+# define BOOST_LIB_THREAD_OPT "-mt"
+#else
+# define BOOST_LIB_THREAD_OPT
+#endif
+
+#if defined(_MSC_VER) || defined(__MWERKS__)
+
+# ifdef _DLL
+
+# if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS))
+
+# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
+ && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
+# define BOOST_LIB_RT_OPT "-gydp"
+# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
+# define BOOST_LIB_RT_OPT "-gdp"
+# elif defined(_DEBUG)\
+ && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
+# define BOOST_LIB_RT_OPT "-gydp"
+# pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1")
+# error "Build options aren't compatible with pre-built libraries"
+# elif defined(_DEBUG)
+# define BOOST_LIB_RT_OPT "-gdp"
+# pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1")
+# error "Build options aren't compatible with pre-built libraries"
+# else
+# define BOOST_LIB_RT_OPT "-p"
+# endif
+
+# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+
+# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
+ && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
+# define BOOST_LIB_RT_OPT "-gydpn"
+# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
+# define BOOST_LIB_RT_OPT "-gdpn"
+# elif defined(_DEBUG)\
+ && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
+# define BOOST_LIB_RT_OPT "-gydpn"
+# pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1")
+# error "Build options aren't compatible with pre-built libraries"
+# elif defined(_DEBUG)
+# define BOOST_LIB_RT_OPT "-gdpn"
+# pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1")
+# error "Build options aren't compatible with pre-built libraries"
+# else
+# define BOOST_LIB_RT_OPT "-pn"
+# endif
+
+# else
+
+# if defined(_DEBUG) && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
+# define BOOST_LIB_RT_OPT "-gyd"
+# elif defined(_DEBUG)
+# define BOOST_LIB_RT_OPT "-gd"
+# else
+# define BOOST_LIB_RT_OPT
+# endif
+
+# endif
+
+# else
+
+# if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS))
+
+# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
+ && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
+# define BOOST_LIB_RT_OPT "-sgydp"
+# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
+# define BOOST_LIB_RT_OPT "-sgdp"
+# elif defined(_DEBUG)\
+ && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
+# define BOOST_LIB_RT_OPT "-sgydp"
+# pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1")
+# error "Build options aren't compatible with pre-built libraries"
+# elif defined(_DEBUG)
+# define BOOST_LIB_RT_OPT "-sgdp"
+# pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1")
+# error "Build options aren't compatible with pre-built libraries"
+# else
+# define BOOST_LIB_RT_OPT "-sp"
+# endif
+
+# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+
+# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
+ && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
+# define BOOST_LIB_RT_OPT "-sgydpn"
+# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
+# define BOOST_LIB_RT_OPT "-sgdpn"
+# elif defined(_DEBUG)\
+ && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
+# define BOOST_LIB_RT_OPT "-sgydpn"
+# pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1")
+# error "Build options aren't compatible with pre-built libraries"
+# elif defined(_DEBUG)
+# define BOOST_LIB_RT_OPT "-sgdpn"
+# pragma message("warning: STLport debug versions are built with /D_STLP_DEBUG=1")
+# error "Build options aren't compatible with pre-built libraries"
+# else
+# define BOOST_LIB_RT_OPT "-spn"
+# endif
+
+# else
+
+# if defined(_DEBUG)\
+ && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
+# define BOOST_LIB_RT_OPT "-sgyd"
+# elif defined(_DEBUG)
+# define BOOST_LIB_RT_OPT "-sgd"
+# else
+# define BOOST_LIB_RT_OPT "-s"
+# endif
+
+# endif
+
+# endif
+
+#elif defined(__BORLANDC__)
+
+//
+// figure out whether we want the debug builds or not:
+//
+#if __BORLANDC__ > 0x561
+#pragma defineonoption BOOST_BORLAND_DEBUG -v
+#endif
+//
+// sanity check:
+//
+#if defined(__STL_DEBUG) || defined(_STLP_DEBUG)
+#error "Pre-built versions of the Boost libraries are not provided in STLport-debug form"
+#endif
+
+# ifdef _RTLDLL
+
+# if defined(BOOST_BORLAND_DEBUG)\
+ && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
+# define BOOST_LIB_RT_OPT "-yd"
+# elif defined(BOOST_BORLAND_DEBUG)
+# define BOOST_LIB_RT_OPT "-d"
+# elif defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
+# define BOOST_LIB_RT_OPT -y
+# else
+# define BOOST_LIB_RT_OPT
+# endif
+
+# else
+
+# if defined(BOOST_BORLAND_DEBUG)\
+ && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
+# define BOOST_LIB_RT_OPT "-syd"
+# elif defined(BOOST_BORLAND_DEBUG)
+# define BOOST_LIB_RT_OPT "-sd"
+# elif defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
+# define BOOST_LIB_RT_OPT "-sy"
+# else
+# define BOOST_LIB_RT_OPT "-s"
+# endif
+
+# endif
+
+#endif
+
+//
+// select linkage opt:
+//
+#if (defined(_DLL) || defined(_RTLDLL)) && defined(BOOST_DYN_LINK)
+# define BOOST_LIB_PREFIX
+#elif defined(BOOST_DYN_LINK)
+# error "Mixing a dll boost library with a static runtime is a really bad idea..."
+#else
+# define BOOST_LIB_PREFIX "lib"
+#endif
+
+//
+// now include the lib:
+//
+#if defined(BOOST_LIB_NAME) \
+ && defined(BOOST_LIB_PREFIX) \
+ && defined(BOOST_LIB_TOOLSET) \
+ && defined(BOOST_LIB_THREAD_OPT) \
+ && defined(BOOST_LIB_RT_OPT) \
+ && defined(BOOST_LIB_VERSION)
+
+#ifdef BOOST_AUTO_LINK_TAGGED
+# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib")
+# ifdef BOOST_LIB_DIAGNOSTIC
+# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib")
+# endif
+#elif defined(BOOST_AUTO_LINK_NOMANGLE)
+# pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
+# ifdef BOOST_LIB_DIAGNOSTIC
+# pragma message ("Linking to lib file: " BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
+# endif
+#elif defined(BOOST_LIB_BUILDID)
+# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION "-" BOOST_STRINGIZE(BOOST_LIB_BUILDID) ".lib")
+# ifdef BOOST_LIB_DIAGNOSTIC
+# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION "-" BOOST_STRINGIZE(BOOST_LIB_BUILDID) ".lib")
+# endif
+#else
+# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
+# ifdef BOOST_LIB_DIAGNOSTIC
+# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
+# endif
+#endif
+
+#else
+# error "some required macros where not defined (internal logic error)."
+#endif
+
+
+#endif // _MSC_VER || __BORLANDC__
+
+//
+// finally undef any macros we may have set:
+//
+#ifdef BOOST_LIB_PREFIX
+# undef BOOST_LIB_PREFIX
+#endif
+#if defined(BOOST_LIB_NAME)
+# undef BOOST_LIB_NAME
+#endif
+// Don't undef this one: it can be set by the user and should be the
+// same for all libraries:
+//#if defined(BOOST_LIB_TOOLSET)
+//# undef BOOST_LIB_TOOLSET
+//#endif
+#if defined(BOOST_LIB_THREAD_OPT)
+# undef BOOST_LIB_THREAD_OPT
+#endif
+#if defined(BOOST_LIB_RT_OPT)
+# undef BOOST_LIB_RT_OPT
+#endif
+#if defined(BOOST_LIB_LINK_OPT)
+# undef BOOST_LIB_LINK_OPT
+#endif
+#if defined(BOOST_LIB_DEBUG_OPT)
+# undef BOOST_LIB_DEBUG_OPT
+#endif
+#if defined(BOOST_DYN_LINK)
+# undef BOOST_DYN_LINK
+#endif
+
+
diff --git a/thirdparty/linux/include/boost/config/compiler/borland.hpp b/thirdparty/linux/include/boost/config/compiler/borland.hpp
new file mode 100644
index 0000000..ccd930e
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/borland.hpp
@@ -0,0 +1,319 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright David Abrahams 2002 - 2003.
+// (C) Copyright Aleksey Gurtovoy 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Borland C++ compiler setup:
+
+//
+// versions check:
+// we don't support Borland prior to version 5.4:
+#if __BORLANDC__ < 0x540
+# error "Compiler not supported or configured - please reconfigure"
+#endif
+
+// last known compiler version:
+#if (__BORLANDC__ > 0x613)
+//# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown compiler version - please run the configure tests and report the results"
+//# else
+//# pragma message( "Unknown compiler version - please run the configure tests and report the results")
+//# endif
+#elif (__BORLANDC__ == 0x600)
+# error "CBuilderX preview compiler is no longer supported"
+#endif
+
+//
+// Support macros to help with standard library detection
+#if (__BORLANDC__ < 0x560) || defined(_USE_OLD_RW_STL)
+# define BOOST_BCB_WITH_ROGUE_WAVE
+#elif __BORLANDC__ < 0x570
+# define BOOST_BCB_WITH_STLPORT
+#else
+# define BOOST_BCB_WITH_DINKUMWARE
+#endif
+
+//
+// Version 5.0 and below:
+# if __BORLANDC__ <= 0x0550
+// Borland C++Builder 4 and 5:
+# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+# if __BORLANDC__ == 0x0550
+// Borland C++Builder 5, command-line compiler 5.5:
+# define BOOST_NO_OPERATORS_IN_NAMESPACE
+# endif
+// Variadic macros do not exist for C++ Builder versions 5 and below
+#define BOOST_NO_CXX11_VARIADIC_MACROS
+# endif
+
+// Version 5.51 and below:
+#if (__BORLANDC__ <= 0x551)
+# define BOOST_NO_CV_SPECIALIZATIONS
+# define BOOST_NO_CV_VOID_SPECIALIZATIONS
+# define BOOST_NO_DEDUCED_TYPENAME
+// workaround for missing WCHAR_MAX/WCHAR_MIN:
+#ifdef __cplusplus
+#include
+#include
+#else
+#include
+#include
+#endif // __cplusplus
+#ifndef WCHAR_MAX
+# define WCHAR_MAX 0xffff
+#endif
+#ifndef WCHAR_MIN
+# define WCHAR_MIN 0
+#endif
+#endif
+
+// Borland C++ Builder 6 and below:
+#if (__BORLANDC__ <= 0x564)
+
+# if defined(NDEBUG) && defined(__cplusplus)
+ // fix broken so that Boost.test works:
+# include
+# undef strcmp
+# endif
+ // fix broken errno declaration:
+# include
+# ifndef errno
+# define errno errno
+# endif
+
+#endif
+
+//
+// new bug in 5.61:
+#if (__BORLANDC__ >= 0x561) && (__BORLANDC__ <= 0x580)
+ // this seems to be needed by the command line compiler, but not the IDE:
+# define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
+#endif
+
+// Borland C++ Builder 2006 Update 2 and below:
+#if (__BORLANDC__ <= 0x582)
+# define BOOST_NO_SFINAE
+# define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
+# define BOOST_NO_TEMPLATE_TEMPLATES
+
+# define BOOST_NO_PRIVATE_IN_AGGREGATE
+
+# ifdef _WIN32
+# define BOOST_NO_SWPRINTF
+# elif defined(linux) || defined(__linux__) || defined(__linux)
+ // we should really be able to do without this
+ // but the wcs* functions aren't imported into std::
+# define BOOST_NO_STDC_NAMESPACE
+ // _CPPUNWIND doesn't get automatically set for some reason:
+# pragma defineonoption BOOST_CPPUNWIND -x
+# endif
+#endif
+
+#if (__BORLANDC__ <= 0x613) // Beman has asked Alisdair for more info
+ // we shouldn't really need this - but too many things choke
+ // without it, this needs more investigation:
+# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+# define BOOST_NO_IS_ABSTRACT
+# define BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS
+# define BOOST_NO_USING_TEMPLATE
+# define BOOST_SP_NO_SP_CONVERTIBLE
+
+// Temporary workaround
+#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+#endif
+
+// Borland C++ Builder 2008 and below:
+# define BOOST_NO_INTEGRAL_INT64_T
+# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
+# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
+# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
+# define BOOST_NO_NESTED_FRIENDSHIP
+# define BOOST_NO_TYPENAME_WITH_CTOR
+#if (__BORLANDC__ < 0x600)
+# define BOOST_ILLEGAL_CV_REFERENCES
+#endif
+
+//
+// Positive Feature detection
+//
+// Borland C++ Builder 2008 and below:
+#if (__BORLANDC__ >= 0x599)
+# pragma defineonoption BOOST_CODEGEAR_0X_SUPPORT -Ax
+#endif
+//
+// C++0x Macros:
+//
+#if !defined( BOOST_CODEGEAR_0X_SUPPORT ) || (__BORLANDC__ < 0x610)
+# define BOOST_NO_CXX11_CHAR16_T
+# define BOOST_NO_CXX11_CHAR32_T
+# define BOOST_NO_CXX11_DECLTYPE
+# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+# define BOOST_NO_CXX11_EXTERN_TEMPLATE
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
+# define BOOST_NO_CXX11_SCOPED_ENUMS
+# define BOOST_NO_CXX11_STATIC_ASSERT
+#else
+# define BOOST_HAS_ALIGNOF
+# define BOOST_HAS_CHAR16_T
+# define BOOST_HAS_CHAR32_T
+# define BOOST_HAS_DECLTYPE
+# define BOOST_HAS_EXPLICIT_CONVERSION_OPS
+# define BOOST_HAS_REF_QUALIFIER
+# define BOOST_HAS_RVALUE_REFS
+# define BOOST_HAS_STATIC_ASSERT
+#endif
+
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_SCOPED_ENUMS
+#define BOOST_NO_SFINAE_EXPR
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS // UTF-8 still not supported
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#define BOOST_NO_CXX11_ALIGNAS
+#define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+#define BOOST_NO_CXX11_INLINE_NAMESPACES
+#define BOOST_NO_CXX11_REF_QUALIFIERS
+#define BOOST_NO_CXX11_FINAL
+#define BOOST_NO_CXX11_THREAD_LOCAL
+
+// C++ 14:
+#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
+# define BOOST_NO_CXX14_AGGREGATE_NSDMI
+#endif
+#if !defined(__cpp_binary_literals) || (__cpp_binary_literals < 201304)
+# define BOOST_NO_CXX14_BINARY_LITERALS
+#endif
+#if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
+# define BOOST_NO_CXX14_CONSTEXPR
+#endif
+#if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304)
+# define BOOST_NO_CXX14_DECLTYPE_AUTO
+#endif
+#if (__cplusplus < 201304) // There's no SD6 check for this....
+# define BOOST_NO_CXX14_DIGIT_SEPARATORS
+#endif
+#if !defined(__cpp_generic_lambdas) || (__cpp_generic_lambdas < 201304)
+# define BOOST_NO_CXX14_GENERIC_LAMBDAS
+#endif
+#if !defined(__cpp_init_captures) || (__cpp_init_captures < 201304)
+# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
+#endif
+#if !defined(__cpp_return_type_deduction) || (__cpp_return_type_deduction < 201304)
+# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
+#endif
+#if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+#endif
+
+#if __BORLANDC__ >= 0x590
+# define BOOST_HAS_TR1_HASH
+
+# define BOOST_HAS_MACRO_USE_FACET
+#endif
+
+//
+// Post 0x561 we have long long and stdint.h:
+#if __BORLANDC__ >= 0x561
+# ifndef __NO_LONG_LONG
+# define BOOST_HAS_LONG_LONG
+# else
+# define BOOST_NO_LONG_LONG
+# endif
+ // On non-Win32 platforms let the platform config figure this out:
+# ifdef _WIN32
+# define BOOST_HAS_STDINT_H
+# endif
+#endif
+
+// Borland C++Builder 6 defaults to using STLPort. If _USE_OLD_RW_STL is
+// defined, then we have 0x560 or greater with the Rogue Wave implementation
+// which presumably has the std::DBL_MAX bug.
+#if defined( BOOST_BCB_WITH_ROGUE_WAVE )
+// is partly broken, some macros define symbols that are really in
+// namespace std, so you end up having to use illegal constructs like
+// std::DBL_MAX, as a fix we'll just include float.h and have done with:
+#include
+#endif
+//
+// __int64:
+//
+#if (__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)
+# define BOOST_HAS_MS_INT64
+#endif
+//
+// check for exception handling support:
+//
+#if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND) && !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
+# define BOOST_NO_EXCEPTIONS
+#endif
+//
+// all versions have a :
+//
+#ifndef __STRICT_ANSI__
+# define BOOST_HAS_DIRENT_H
+#endif
+//
+// all versions support __declspec:
+//
+#if defined(__STRICT_ANSI__)
+// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
+# define BOOST_SYMBOL_EXPORT
+#endif
+//
+// ABI fixing headers:
+//
+#if __BORLANDC__ != 0x600 // not implemented for version 6 compiler yet
+#ifndef BOOST_ABI_PREFIX
+# define BOOST_ABI_PREFIX "boost/config/abi/borland_prefix.hpp"
+#endif
+#ifndef BOOST_ABI_SUFFIX
+# define BOOST_ABI_SUFFIX "boost/config/abi/borland_suffix.hpp"
+#endif
+#endif
+//
+// Disable Win32 support in ANSI mode:
+//
+#if __BORLANDC__ < 0x600
+# pragma defineonoption BOOST_DISABLE_WIN32 -A
+#elif defined(__STRICT_ANSI__)
+# define BOOST_DISABLE_WIN32
+#endif
+//
+// MSVC compatibility mode does some nasty things:
+// TODO: look up if this doesn't apply to the whole 12xx range
+//
+#if defined(_MSC_VER) && (_MSC_VER <= 1200)
+# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+# define BOOST_NO_VOID_RETURNS
+#endif
+
+// Borland did not implement value-initialization completely, as I reported
+// in 2007, Borland Report 51854, "Value-initialization: POD struct should be
+// zero-initialized", http://qc.embarcadero.com/wc/qcmain.aspx?d=51854
+// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
+// (Niels Dekker, LKEB, April 2010)
+#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
+
+#define BOOST_COMPILER "Borland C++ version " BOOST_STRINGIZE(__BORLANDC__)
diff --git a/thirdparty/linux/include/boost/config/compiler/clang.hpp b/thirdparty/linux/include/boost/config/compiler/clang.hpp
new file mode 100644
index 0000000..150e3c0
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/clang.hpp
@@ -0,0 +1,304 @@
+// (C) Copyright Douglas Gregor 2010
+//
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Clang compiler setup.
+
+#define BOOST_HAS_PRAGMA_ONCE
+
+// Detecting `-fms-extension` compiler flag assuming that _MSC_VER defined when that flag is used.
+#if defined (_MSC_VER) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4))
+# define BOOST_HAS_PRAGMA_DETECT_MISMATCH
+#endif
+
+// When compiling with clang before __has_extension was defined,
+// even if one writes 'defined(__has_extension) && __has_extension(xxx)',
+// clang reports a compiler error. So the only workaround found is:
+
+#ifndef __has_extension
+#define __has_extension __has_feature
+#endif
+
+#ifndef __has_attribute
+#define __has_attribute(x) 0
+#endif
+
+#if !__has_feature(cxx_exceptions) && !defined(BOOST_NO_EXCEPTIONS)
+# define BOOST_NO_EXCEPTIONS
+#endif
+
+#if !__has_feature(cxx_rtti) && !defined(BOOST_NO_RTTI)
+# define BOOST_NO_RTTI
+#endif
+
+#if !__has_feature(cxx_rtti) && !defined(BOOST_NO_TYPEID)
+# define BOOST_NO_TYPEID
+#endif
+
+#if !__has_feature(cxx_thread_local)
+# define BOOST_NO_CXX11_THREAD_LOCAL
+#endif
+
+#ifdef __is_identifier
+#if !__is_identifier(__int64) && !defined(__GNUC__)
+# define BOOST_HAS_MS_INT64
+#endif
+#endif
+
+#if __has_include()
+# define BOOST_HAS_STDINT_H
+#endif
+
+
+#define BOOST_HAS_NRVO
+
+// Branch prediction hints
+#if defined(__has_builtin)
+#if __has_builtin(__builtin_expect)
+#define BOOST_LIKELY(x) __builtin_expect(x, 1)
+#define BOOST_UNLIKELY(x) __builtin_expect(x, 0)
+#endif
+#endif
+
+// Clang supports "long long" in all compilation modes.
+#define BOOST_HAS_LONG_LONG
+
+//
+// We disable this if the compiler is really nvcc with C++03 as it
+// doesn't actually support __int128 as of CUDA_VERSION=7500
+// even though it defines __SIZEOF_INT128__.
+// See https://svn.boost.org/trac/boost/ticket/10418
+// https://svn.boost.org/trac/boost/ticket/11852
+// Only re-enable this for nvcc if you're absolutely sure
+// of the circumstances under which it's supported.
+// Similarly __SIZEOF_INT128__ is defined when targetting msvc
+// compatibility even though the required support functions are absent.
+//
+#if defined(__CUDACC__)
+# if defined(BOOST_GCC_CXX11)
+# define BOOST_NVCC_CXX11
+# else
+# define BOOST_NVCC_CXX03
+# endif
+#endif
+
+#if defined(__SIZEOF_INT128__) && !defined(BOOST_NVCC_CXX03) && !defined(_MSC_VER)
+# define BOOST_HAS_INT128
+#endif
+
+
+//
+// Dynamic shared object (DSO) and dynamic-link library (DLL) support
+//
+#if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
+# define BOOST_SYMBOL_EXPORT __attribute__((__visibility__("default")))
+# define BOOST_SYMBOL_IMPORT
+# define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default")))
+#endif
+
+//
+// The BOOST_FALLTHROUGH macro can be used to annotate implicit fall-through
+// between switch labels.
+//
+#if __cplusplus >= 201103L && defined(__has_warning)
+# if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
+# define BOOST_FALLTHROUGH [[clang::fallthrough]]
+# endif
+#endif
+
+#if !__has_feature(cxx_auto_type)
+# define BOOST_NO_CXX11_AUTO_DECLARATIONS
+# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#endif
+
+//
+// Currently clang on Windows using VC++ RTL does not support C++11's char16_t or char32_t
+//
+#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || !(defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
+# define BOOST_NO_CXX11_CHAR16_T
+# define BOOST_NO_CXX11_CHAR32_T
+#endif
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1800) && !defined(__GNUC__)
+#define BOOST_HAS_EXPM1
+#define BOOST_HAS_LOG1P
+#endif
+
+#if !__has_feature(cxx_constexpr)
+# define BOOST_NO_CXX11_CONSTEXPR
+#endif
+
+#if !__has_feature(cxx_decltype)
+# define BOOST_NO_CXX11_DECLTYPE
+#endif
+
+#if !__has_feature(cxx_decltype_incomplete_return_types)
+# define BOOST_NO_CXX11_DECLTYPE_N3276
+#endif
+
+#if !__has_feature(cxx_defaulted_functions)
+# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#endif
+
+#if !__has_feature(cxx_deleted_functions)
+# define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#endif
+
+#if !__has_feature(cxx_explicit_conversions)
+# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#endif
+
+#if !__has_feature(cxx_default_function_template_args)
+# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#endif
+
+#if !__has_feature(cxx_generalized_initializers)
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#endif
+
+#if !__has_feature(cxx_lambdas)
+# define BOOST_NO_CXX11_LAMBDAS
+#endif
+
+#if !__has_feature(cxx_local_type_template_args)
+# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#endif
+
+#if !__has_feature(cxx_noexcept)
+# define BOOST_NO_CXX11_NOEXCEPT
+#endif
+
+#if !__has_feature(cxx_nullptr)
+# define BOOST_NO_CXX11_NULLPTR
+#endif
+
+#if !__has_feature(cxx_range_for)
+# define BOOST_NO_CXX11_RANGE_BASED_FOR
+#endif
+
+#if !__has_feature(cxx_raw_string_literals)
+# define BOOST_NO_CXX11_RAW_LITERALS
+#endif
+
+#if !__has_feature(cxx_reference_qualified_functions)
+# define BOOST_NO_CXX11_REF_QUALIFIERS
+#endif
+
+#if !__has_feature(cxx_generalized_initializers)
+# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#endif
+
+#if !__has_feature(cxx_rvalue_references)
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
+#endif
+
+#if !__has_feature(cxx_strong_enums)
+# define BOOST_NO_CXX11_SCOPED_ENUMS
+#endif
+
+#if !__has_feature(cxx_static_assert)
+# define BOOST_NO_CXX11_STATIC_ASSERT
+#endif
+
+#if !__has_feature(cxx_alias_templates)
+# define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#endif
+
+#if !__has_feature(cxx_unicode_literals)
+# define BOOST_NO_CXX11_UNICODE_LITERALS
+#endif
+
+#if !__has_feature(cxx_variadic_templates)
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#endif
+
+#if !__has_feature(cxx_user_literals)
+# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#endif
+
+#if !__has_feature(cxx_alignas)
+# define BOOST_NO_CXX11_ALIGNAS
+#endif
+
+#if !__has_feature(cxx_trailing_return)
+# define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+#endif
+
+#if !__has_feature(cxx_inline_namespaces)
+# define BOOST_NO_CXX11_INLINE_NAMESPACES
+#endif
+
+#if !__has_feature(cxx_override_control)
+# define BOOST_NO_CXX11_FINAL
+#endif
+
+#if !(__has_feature(__cxx_binary_literals__) || __has_extension(__cxx_binary_literals__))
+# define BOOST_NO_CXX14_BINARY_LITERALS
+#endif
+
+#if !__has_feature(__cxx_decltype_auto__)
+# define BOOST_NO_CXX14_DECLTYPE_AUTO
+#endif
+
+#if !__has_feature(__cxx_aggregate_nsdmi__)
+# define BOOST_NO_CXX14_AGGREGATE_NSDMI
+#endif
+
+#if !__has_feature(__cxx_init_captures__)
+# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
+#endif
+
+#if !__has_feature(__cxx_generic_lambdas__)
+# define BOOST_NO_CXX14_GENERIC_LAMBDAS
+#endif
+
+// clang < 3.5 has a defect with dependent type, like following.
+//
+// template
+// constexpr typename enable_if >::type foo(T &)
+// { } // error: no return statement in constexpr function
+//
+// This issue also affects C++11 mode, but C++11 constexpr requires return stmt.
+// Therefore we don't care such case.
+//
+// Note that we can't check Clang version directly as the numbering system changes depending who's
+// creating the Clang release (see https://github.com/boostorg/config/pull/39#issuecomment-59927873)
+// so instead verify that we have a feature that was introduced at the same time as working C++14
+// constexpr (generic lambda's in this case):
+//
+#if !__has_feature(__cxx_generic_lambdas__) || !__has_feature(__cxx_relaxed_constexpr__)
+# define BOOST_NO_CXX14_CONSTEXPR
+#endif
+
+#if !__has_feature(__cxx_return_type_deduction__)
+# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
+#endif
+
+#if !__has_feature(__cxx_variable_templates__)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+#endif
+
+#if __cplusplus < 201400
+// All versions with __cplusplus above this value seem to support this:
+# define BOOST_NO_CXX14_DIGIT_SEPARATORS
+#endif
+//
+// __builtin_unreachable:
+#if defined(__has_builtin) && __has_builtin(__builtin_unreachable)
+#define BOOST_UNREACHABLE_RETURN(x) __builtin_unreachable();
+#endif
+
+// Clang has supported the 'unused' attribute since the first release.
+#define BOOST_ATTRIBUTE_UNUSED __attribute__((__unused__))
+
+#ifndef BOOST_COMPILER
+# define BOOST_COMPILER "Clang version " __clang_version__
+#endif
+
+// Macro used to identify the Clang compiler.
+#define BOOST_CLANG 1
+
diff --git a/thirdparty/linux/include/boost/config/compiler/codegear.hpp b/thirdparty/linux/include/boost/config/compiler/codegear.hpp
new file mode 100644
index 0000000..e2f6061
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/codegear.hpp
@@ -0,0 +1,221 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright David Abrahams 2002 - 2003.
+// (C) Copyright Aleksey Gurtovoy 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// CodeGear C++ compiler setup:
+
+#if !defined( BOOST_WITH_CODEGEAR_WARNINGS )
+// these warnings occur frequently in optimized template code
+# pragma warn -8004 // var assigned value, but never used
+# pragma warn -8008 // condition always true/false
+# pragma warn -8066 // dead code can never execute
+# pragma warn -8104 // static members with ctors not threadsafe
+# pragma warn -8105 // reference member in class without ctors
+#endif
+//
+// versions check:
+// last known and checked version is 0x621
+#if (__CODEGEARC__ > 0x621)
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown compiler version - please run the configure tests and report the results"
+# else
+# pragma message( "Unknown compiler version - please run the configure tests and report the results")
+# endif
+#endif
+
+// CodeGear C++ Builder 2009
+#if (__CODEGEARC__ <= 0x613)
+# define BOOST_NO_INTEGRAL_INT64_T
+# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
+# define BOOST_NO_PRIVATE_IN_AGGREGATE
+# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
+ // we shouldn't really need this - but too many things choke
+ // without it, this needs more investigation:
+# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+# define BOOST_SP_NO_SP_CONVERTIBLE
+#endif
+
+// CodeGear C++ Builder 2010
+#if (__CODEGEARC__ <= 0x621)
+# define BOOST_NO_TYPENAME_WITH_CTOR // Cannot use typename keyword when making temporaries of a dependant type
+# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
+# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+# define BOOST_NO_NESTED_FRIENDSHIP // TC1 gives nested classes access rights as any other member
+# define BOOST_NO_USING_TEMPLATE
+# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+// Temporary hack, until specific MPL preprocessed headers are generated
+# define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+
+// CodeGear has not yet completely implemented value-initialization, for
+// example for array types, as I reported in 2010: Embarcadero Report 83751,
+// "Value-initialization: arrays should have each element value-initialized",
+// http://qc.embarcadero.com/wc/qcmain.aspx?d=83751
+// Last checked version: Embarcadero C++ 6.21
+// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
+// (Niels Dekker, LKEB, April 2010)
+# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
+
+# if defined(NDEBUG) && defined(__cplusplus)
+ // fix broken so that Boost.test works:
+# include
+# undef strcmp
+# endif
+ // fix broken errno declaration:
+# include
+# ifndef errno
+# define errno errno
+# endif
+
+#endif
+
+// Reportedly, #pragma once is supported since C++ Builder 2010
+#if (__CODEGEARC__ >= 0x620)
+# define BOOST_HAS_PRAGMA_ONCE
+#endif
+
+//
+// C++0x macros:
+//
+#if (__CODEGEARC__ <= 0x620)
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#else
+#define BOOST_HAS_STATIC_ASSERT
+#endif
+#define BOOST_HAS_CHAR16_T
+#define BOOST_HAS_CHAR32_T
+#define BOOST_HAS_LONG_LONG
+// #define BOOST_HAS_ALIGNOF
+#define BOOST_HAS_DECLTYPE
+#define BOOST_HAS_EXPLICIT_CONVERSION_OPS
+// #define BOOST_HAS_RVALUE_REFS
+#define BOOST_HAS_SCOPED_ENUM
+// #define BOOST_HAS_STATIC_ASSERT
+#define BOOST_HAS_STD_TYPE_TRAITS
+
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_SFINAE_EXPR
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#define BOOST_NO_CXX11_ALIGNAS
+#define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+#define BOOST_NO_CXX11_INLINE_NAMESPACES
+#define BOOST_NO_CXX11_REF_QUALIFIERS
+#define BOOST_NO_CXX11_FINAL
+#define BOOST_NO_CXX11_THREAD_LOCAL
+
+// C++ 14:
+#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
+# define BOOST_NO_CXX14_AGGREGATE_NSDMI
+#endif
+#if !defined(__cpp_binary_literals) || (__cpp_binary_literals < 201304)
+# define BOOST_NO_CXX14_BINARY_LITERALS
+#endif
+#if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
+# define BOOST_NO_CXX14_CONSTEXPR
+#endif
+#if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304)
+# define BOOST_NO_CXX14_DECLTYPE_AUTO
+#endif
+#if (__cplusplus < 201304) // There's no SD6 check for this....
+# define BOOST_NO_CXX14_DIGIT_SEPARATORS
+#endif
+#if !defined(__cpp_generic_lambdas) || (__cpp_generic_lambdas < 201304)
+# define BOOST_NO_CXX14_GENERIC_LAMBDAS
+#endif
+#if !defined(__cpp_init_captures) || (__cpp_init_captures < 201304)
+# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
+#endif
+#if !defined(__cpp_return_type_deduction) || (__cpp_return_type_deduction < 201304)
+# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
+#endif
+#if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+#endif
+
+//
+// TR1 macros:
+//
+#define BOOST_HAS_TR1_HASH
+#define BOOST_HAS_TR1_TYPE_TRAITS
+#define BOOST_HAS_TR1_UNORDERED_MAP
+#define BOOST_HAS_TR1_UNORDERED_SET
+
+#define BOOST_HAS_MACRO_USE_FACET
+
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+
+// On non-Win32 platforms let the platform config figure this out:
+#ifdef _WIN32
+# define BOOST_HAS_STDINT_H
+#endif
+
+//
+// __int64:
+//
+#if !defined(__STRICT_ANSI__)
+# define BOOST_HAS_MS_INT64
+#endif
+//
+// check for exception handling support:
+//
+#if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND) && !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
+# define BOOST_NO_EXCEPTIONS
+#endif
+//
+// all versions have a :
+//
+#if !defined(__STRICT_ANSI__)
+# define BOOST_HAS_DIRENT_H
+#endif
+//
+// all versions support __declspec:
+//
+#if defined(__STRICT_ANSI__)
+// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
+# define BOOST_SYMBOL_EXPORT
+#endif
+//
+// ABI fixing headers:
+//
+#ifndef BOOST_ABI_PREFIX
+# define BOOST_ABI_PREFIX "boost/config/abi/borland_prefix.hpp"
+#endif
+#ifndef BOOST_ABI_SUFFIX
+# define BOOST_ABI_SUFFIX "boost/config/abi/borland_suffix.hpp"
+#endif
+//
+// Disable Win32 support in ANSI mode:
+//
+# pragma defineonoption BOOST_DISABLE_WIN32 -A
+//
+// MSVC compatibility mode does some nasty things:
+// TODO: look up if this doesn't apply to the whole 12xx range
+//
+#if defined(_MSC_VER) && (_MSC_VER <= 1200)
+# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+# define BOOST_NO_VOID_RETURNS
+#endif
+
+#define BOOST_COMPILER "CodeGear C++ version " BOOST_STRINGIZE(__CODEGEARC__)
+
diff --git a/thirdparty/linux/include/boost/config/compiler/comeau.hpp b/thirdparty/linux/include/boost/config/compiler/comeau.hpp
new file mode 100644
index 0000000..0984160
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/comeau.hpp
@@ -0,0 +1,59 @@
+// (C) Copyright John Maddock 2001.
+// (C) Copyright Douglas Gregor 2001.
+// (C) Copyright Peter Dimov 2001.
+// (C) Copyright Aleksey Gurtovoy 2003.
+// (C) Copyright Beman Dawes 2003.
+// (C) Copyright Jens Maurer 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Comeau C++ compiler setup:
+
+#include
+
+#if (__COMO_VERSION__ <= 4245)
+
+# if defined(_MSC_VER) && _MSC_VER <= 1300
+# if _MSC_VER > 100
+ // only set this in non-strict mode:
+# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+# endif
+# endif
+
+// Void returns don't work when emulating VC 6 (Peter Dimov)
+// TODO: look up if this doesn't apply to the whole 12xx range
+# if defined(_MSC_VER) && (_MSC_VER < 1300)
+# define BOOST_NO_VOID_RETURNS
+# endif
+
+#endif // version 4245
+
+//
+// enable __int64 support in VC emulation mode
+//
+# if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# define BOOST_HAS_MS_INT64
+# endif
+
+#define BOOST_COMPILER "Comeau compiler version " BOOST_STRINGIZE(__COMO_VERSION__)
+
+//
+// versions check:
+// we don't know Comeau prior to version 4245:
+#if __COMO_VERSION__ < 4245
+# error "Compiler not configured - please reconfigure"
+#endif
+//
+// last known and checked version is 4245:
+#if (__COMO_VERSION__ > 4245)
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown compiler version - please run the configure tests and report the results"
+# endif
+#endif
+
+
+
+
diff --git a/thirdparty/linux/include/boost/config/compiler/common_edg.hpp b/thirdparty/linux/include/boost/config/compiler/common_edg.hpp
new file mode 100644
index 0000000..c09faeb
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/common_edg.hpp
@@ -0,0 +1,144 @@
+// (C) Copyright John Maddock 2001 - 2002.
+// (C) Copyright Jens Maurer 2001.
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Aleksey Gurtovoy 2002.
+// (C) Copyright Markus Schoepflin 2005.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+//
+// Options common to all edg based compilers.
+//
+// This is included from within the individual compiler mini-configs.
+
+#ifndef __EDG_VERSION__
+# error This file requires that __EDG_VERSION__ be defined.
+#endif
+
+#if (__EDG_VERSION__ <= 238)
+# define BOOST_NO_INTEGRAL_INT64_T
+# define BOOST_NO_SFINAE
+#endif
+
+#if (__EDG_VERSION__ <= 240)
+# define BOOST_NO_VOID_RETURNS
+#endif
+
+#if (__EDG_VERSION__ <= 241) && !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
+# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+#endif
+
+#if (__EDG_VERSION__ <= 244) && !defined(BOOST_NO_TEMPLATE_TEMPLATES)
+# define BOOST_NO_TEMPLATE_TEMPLATES
+#endif
+
+#if (__EDG_VERSION__ < 300) && !defined(BOOST_NO_IS_ABSTRACT)
+# define BOOST_NO_IS_ABSTRACT
+#endif
+
+#if (__EDG_VERSION__ <= 303) && !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
+# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
+#endif
+
+// See also kai.hpp which checks a Kai-specific symbol for EH
+# if !defined(__KCC) && !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
+# define BOOST_NO_EXCEPTIONS
+# endif
+
+# if !defined(__NO_LONG_LONG)
+# define BOOST_HAS_LONG_LONG
+# else
+# define BOOST_NO_LONG_LONG
+# endif
+
+// Not sure what version was the first to support #pragma once, but
+// different EDG-based compilers (e.g. Intel) supported it for ages.
+// Add a proper version check if it causes problems.
+#define BOOST_HAS_PRAGMA_ONCE
+
+//
+// C++0x features
+//
+// See above for BOOST_NO_LONG_LONG
+//
+#if (__EDG_VERSION__ < 310)
+# define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#endif
+#if (__EDG_VERSION__ <= 310)
+// No support for initializer lists
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#endif
+#if (__EDG_VERSION__ < 400)
+# define BOOST_NO_CXX11_VARIADIC_MACROS
+#endif
+
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_SCOPED_ENUMS
+#define BOOST_NO_SFINAE_EXPR
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#define BOOST_NO_CXX11_ALIGNAS
+#define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+#define BOOST_NO_CXX11_INLINE_NAMESPACES
+#define BOOST_NO_CXX11_REF_QUALIFIERS
+#define BOOST_NO_CXX11_FINAL
+#define BOOST_NO_CXX11_THREAD_LOCAL
+
+// C++ 14:
+#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
+# define BOOST_NO_CXX14_AGGREGATE_NSDMI
+#endif
+#if !defined(__cpp_binary_literals) || (__cpp_binary_literals < 201304)
+# define BOOST_NO_CXX14_BINARY_LITERALS
+#endif
+#if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
+# define BOOST_NO_CXX14_CONSTEXPR
+#endif
+#if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304)
+# define BOOST_NO_CXX14_DECLTYPE_AUTO
+#endif
+#if (__cplusplus < 201304) // There's no SD6 check for this....
+# define BOOST_NO_CXX14_DIGIT_SEPARATORS
+#endif
+#if !defined(__cpp_generic_lambdas) || (__cpp_generic_lambdas < 201304)
+# define BOOST_NO_CXX14_GENERIC_LAMBDAS
+#endif
+#if !defined(__cpp_init_captures) || (__cpp_init_captures < 201304)
+# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
+#endif
+#if !defined(__cpp_return_type_deduction) || (__cpp_return_type_deduction < 201304)
+# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
+#endif
+#if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+#endif
+
+#ifdef c_plusplus
+// EDG has "long long" in non-strict mode
+// However, some libraries have insufficient "long long" support
+// #define BOOST_HAS_LONG_LONG
+#endif
diff --git a/thirdparty/linux/include/boost/config/compiler/compaq_cxx.hpp b/thirdparty/linux/include/boost/config/compiler/compaq_cxx.hpp
new file mode 100644
index 0000000..4d6b8ab
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/compaq_cxx.hpp
@@ -0,0 +1,19 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Tru64 C++ compiler setup (now HP):
+
+#define BOOST_COMPILER "HP Tru64 C++ " BOOST_STRINGIZE(__DECCXX_VER)
+
+#include
+
+//
+// versions check:
+// Nothing to do here?
+
+
+
diff --git a/thirdparty/linux/include/boost/config/compiler/cray.hpp b/thirdparty/linux/include/boost/config/compiler/cray.hpp
new file mode 100644
index 0000000..837f815
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/cray.hpp
@@ -0,0 +1,93 @@
+// (C) Copyright John Maddock 2011.
+// (C) Copyright Cray, Inc. 2013
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Greenhills C compiler setup:
+
+#define BOOST_COMPILER "Cray C version " BOOST_STRINGIZE(_RELEASE)
+
+#if _RELEASE < 8
+# error "Boost is not configured for Cray compilers prior to version 8, please try the configure script."
+#endif
+
+//
+// Check this is a recent EDG based compiler, otherwise we don't support it here:
+//
+#ifndef __EDG_VERSION__
+# error "Unsupported Cray compiler, please try running the configure script."
+#endif
+
+#include
+
+
+//
+//
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_HAS_NRVO
+#define BOOST_NO_CXX11_VARIADIC_MACROS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+#define BOOST_HAS_NRVO
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_SFINAE_EXPR
+#define BOOST_NO_CXX11_SCOPED_ENUMS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_REF_QUALIFIERS
+#define BOOST_NO_CXX11_FINAL
+#define BOOST_NO_CXX11_THREAD_LOCAL
+
+
+//#define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
+#define BOOST_MATH_DISABLE_STD_FPCLASSIFY
+//#define BOOST_HAS_FPCLASSIFY
+
+#define BOOST_SP_USE_PTHREADS
+#define BOOST_AC_USE_PTHREADS
+
+/* everything that follows is working around what are thought to be
+ * compiler shortcomings. Revist all of these regularly.
+ */
+
+//#define BOOST_USE_ENUM_STATIC_ASSERT
+//#define BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS //(this may be implied by the previous #define
+
+// These constants should be provided by the
+// compiler, at least when -hgnu is asserted on the command line.
+
+#ifndef __ATOMIC_RELAXED
+#define __ATOMIC_RELAXED 0
+#define __ATOMIC_CONSUME 1
+#define __ATOMIC_ACQUIRE 2
+#define __ATOMIC_RELEASE 3
+#define __ATOMIC_ACQ_REL 4
+#define __ATOMIC_SEQ_CST 5
+#endif
+
+
+
diff --git a/thirdparty/linux/include/boost/config/compiler/digitalmars.hpp b/thirdparty/linux/include/boost/config/compiler/digitalmars.hpp
new file mode 100644
index 0000000..c344aae
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/digitalmars.hpp
@@ -0,0 +1,125 @@
+// Copyright (C) Christof Meerwald 2003
+// Copyright (C) Dan Watkins 2003
+//
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// Digital Mars C++ compiler setup:
+#define BOOST_COMPILER __DMC_VERSION_STRING__
+
+#define BOOST_HAS_LONG_LONG
+#define BOOST_HAS_PRAGMA_ONCE
+
+#if !defined(BOOST_STRICT_CONFIG)
+#define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+#define BOOST_NO_OPERATORS_IN_NAMESPACE
+#define BOOST_NO_UNREACHABLE_RETURN_DETECTION
+#define BOOST_NO_SFINAE
+#define BOOST_NO_USING_TEMPLATE
+#define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
+#endif
+
+//
+// has macros:
+#define BOOST_HAS_DIRENT_H
+#define BOOST_HAS_STDINT_H
+#define BOOST_HAS_WINTHREADS
+
+#if (__DMC__ >= 0x847)
+#define BOOST_HAS_EXPM1
+#define BOOST_HAS_LOG1P
+#endif
+
+//
+// Is this really the best way to detect whether the std lib is in namespace std?
+//
+#ifdef __cplusplus
+#include
+#endif
+#if !defined(__STL_IMPORT_VENDOR_CSTD) && !defined(_STLP_IMPORT_VENDOR_CSTD)
+# define BOOST_NO_STDC_NAMESPACE
+#endif
+
+
+// check for exception handling support:
+#if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS)
+# define BOOST_NO_EXCEPTIONS
+#endif
+
+//
+// C++0x features
+//
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_SCOPED_ENUMS
+#define BOOST_NO_SFINAE_EXPR
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#define BOOST_NO_CXX11_ALIGNAS
+#define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+#define BOOST_NO_CXX11_INLINE_NAMESPACES
+#define BOOST_NO_CXX11_REF_QUALIFIERS
+#define BOOST_NO_CXX11_FINAL
+#define BOOST_NO_CXX11_THREAD_LOCAL
+
+// C++ 14:
+#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
+# define BOOST_NO_CXX14_AGGREGATE_NSDMI
+#endif
+#if !defined(__cpp_binary_literals) || (__cpp_binary_literals < 201304)
+# define BOOST_NO_CXX14_BINARY_LITERALS
+#endif
+#if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
+# define BOOST_NO_CXX14_CONSTEXPR
+#endif
+#if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304)
+# define BOOST_NO_CXX14_DECLTYPE_AUTO
+#endif
+#if (__cplusplus < 201304) // There's no SD6 check for this....
+# define BOOST_NO_CXX14_DIGIT_SEPARATORS
+#endif
+#if !defined(__cpp_generic_lambdas) || (__cpp_generic_lambdas < 201304)
+# define BOOST_NO_CXX14_GENERIC_LAMBDAS
+#endif
+#if !defined(__cpp_init_captures) || (__cpp_init_captures < 201304)
+# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
+#endif
+#if !defined(__cpp_return_type_deduction) || (__cpp_return_type_deduction < 201304)
+# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
+#endif
+#if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+#endif
+
+#if (__DMC__ <= 0x840)
+#error "Compiler not supported or configured - please reconfigure"
+#endif
+//
+// last known and checked version is ...:
+#if (__DMC__ > 0x848)
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown compiler version - please run the configure tests and report the results"
+# endif
+#endif
diff --git a/thirdparty/linux/include/boost/config/compiler/gcc.hpp b/thirdparty/linux/include/boost/config/compiler/gcc.hpp
new file mode 100644
index 0000000..e319d04
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/gcc.hpp
@@ -0,0 +1,328 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Darin Adler 2001 - 2002.
+// (C) Copyright Jens Maurer 2001 - 2002.
+// (C) Copyright Beman Dawes 2001 - 2003.
+// (C) Copyright Douglas Gregor 2002.
+// (C) Copyright David Abrahams 2002 - 2003.
+// (C) Copyright Synge Todo 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// GNU C++ compiler setup.
+
+//
+// Define BOOST_GCC so we know this is "real" GCC and not some pretender:
+//
+#define BOOST_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
+#if !defined(__CUDACC__)
+#define BOOST_GCC BOOST_GCC_VERSION
+#endif
+
+#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
+# define BOOST_GCC_CXX11
+#endif
+
+#if __GNUC__ == 3
+# if defined (__PATHSCALE__)
+# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+# define BOOST_NO_IS_ABSTRACT
+# endif
+
+# if __GNUC_MINOR__ < 4
+# define BOOST_NO_IS_ABSTRACT
+# endif
+# define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#endif
+#if __GNUC__ < 4
+//
+// All problems to gcc-3.x and earlier here:
+//
+#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+# ifdef __OPEN64__
+# define BOOST_NO_IS_ABSTRACT
+# endif
+#endif
+
+// GCC prior to 3.4 had #pragma once too but it didn't work well with filesystem links
+#if BOOST_GCC_VERSION >= 30400
+#define BOOST_HAS_PRAGMA_ONCE
+#endif
+
+#if BOOST_GCC_VERSION < 40400
+// Previous versions of GCC did not completely implement value-initialization:
+// GCC Bug 30111, "Value-initialization of POD base class doesn't initialize
+// members", reported by Jonathan Wakely in 2006,
+// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30111 (fixed for GCC 4.4)
+// GCC Bug 33916, "Default constructor fails to initialize array members",
+// reported by Michael Elizabeth Chastain in 2007,
+// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33916 (fixed for GCC 4.2.4)
+// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
+#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
+#endif
+
+#if !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
+# define BOOST_NO_EXCEPTIONS
+#endif
+
+
+//
+// Threading support: Turn this on unconditionally here (except for
+// those platforms where we can know for sure). It will get turned off again
+// later if no threading API is detected.
+//
+#if !defined(__MINGW32__) && !defined(linux) && !defined(__linux) && !defined(__linux__)
+# define BOOST_HAS_THREADS
+#endif
+
+//
+// gcc has "long long"
+// Except on Darwin with standard compliance enabled (-pedantic)
+// Apple gcc helpfully defines this macro we can query
+//
+#if !defined(__DARWIN_NO_LONG_LONG)
+# define BOOST_HAS_LONG_LONG
+#endif
+
+//
+// gcc implements the named return value optimization since version 3.1
+//
+#define BOOST_HAS_NRVO
+
+// Branch prediction hints
+#define BOOST_LIKELY(x) __builtin_expect(x, 1)
+#define BOOST_UNLIKELY(x) __builtin_expect(x, 0)
+
+//
+// Dynamic shared object (DSO) and dynamic-link library (DLL) support
+//
+#if __GNUC__ >= 4
+# if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(__CYGWIN__)
+ // All Win32 development environments, including 64-bit Windows and MinGW, define
+ // _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment,
+ // so does not define _WIN32 or its variants.
+# define BOOST_HAS_DECLSPEC
+# define BOOST_SYMBOL_EXPORT __attribute__((__dllexport__))
+# define BOOST_SYMBOL_IMPORT __attribute__((__dllimport__))
+# else
+# define BOOST_SYMBOL_EXPORT __attribute__((__visibility__("default")))
+# define BOOST_SYMBOL_IMPORT
+# endif
+# define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default")))
+#else
+// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
+# define BOOST_SYMBOL_EXPORT
+#endif
+
+//
+// RTTI and typeinfo detection is possible post gcc-4.3:
+//
+#if BOOST_GCC_VERSION > 40300
+# ifndef __GXX_RTTI
+# ifndef BOOST_NO_TYPEID
+# define BOOST_NO_TYPEID
+# endif
+# ifndef BOOST_NO_RTTI
+# define BOOST_NO_RTTI
+# endif
+# endif
+#endif
+
+//
+// Recent GCC versions have __int128 when in 64-bit mode.
+//
+// We disable this if the compiler is really nvcc with C++03 as it
+// doesn't actually support __int128 as of CUDA_VERSION=7500
+// even though it defines __SIZEOF_INT128__.
+// See https://svn.boost.org/trac/boost/ticket/8048
+// https://svn.boost.org/trac/boost/ticket/11852
+// Only re-enable this for nvcc if you're absolutely sure
+// of the circumstances under which it's supported:
+//
+#if defined(__CUDACC__)
+# if defined(BOOST_GCC_CXX11)
+# define BOOST_NVCC_CXX11
+# else
+# define BOOST_NVCC_CXX03
+# endif
+#endif
+
+#if defined(__SIZEOF_INT128__) && !defined(BOOST_NVCC_CXX03)
+# define BOOST_HAS_INT128
+#endif
+//
+// Recent GCC versions have a __float128 native type, we need to
+// include a std lib header to detect this - not ideal, but we'll
+// be including later anyway when we select the std lib.
+//
+// Nevertheless, as of CUDA 7.5, using __float128 with the host
+// compiler in pre-C++11 mode is still not supported.
+// See https://svn.boost.org/trac/boost/ticket/11852
+//
+#ifdef __cplusplus
+#include
+#else
+#include
+#endif
+#if defined(_GLIBCXX_USE_FLOAT128) && !defined(__STRICT_ANSI__) && !defined(BOOST_NVCC_CXX03)
+# define BOOST_HAS_FLOAT128
+#endif
+
+// C++0x features in 4.3.n and later
+//
+#if (BOOST_GCC_VERSION >= 40300) && defined(BOOST_GCC_CXX11)
+// C++0x features are only enabled when -std=c++0x or -std=gnu++0x are
+// passed on the command line, which in turn defines
+// __GXX_EXPERIMENTAL_CXX0X__.
+# define BOOST_HAS_DECLTYPE
+# define BOOST_HAS_RVALUE_REFS
+# define BOOST_HAS_STATIC_ASSERT
+# define BOOST_HAS_VARIADIC_TMPL
+#else
+# define BOOST_NO_CXX11_DECLTYPE
+# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
+# define BOOST_NO_CXX11_STATIC_ASSERT
+#endif
+
+// C++0x features in 4.4.n and later
+//
+#if (BOOST_GCC_VERSION < 40400) || !defined(BOOST_GCC_CXX11)
+# define BOOST_NO_CXX11_AUTO_DECLARATIONS
+# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+# define BOOST_NO_CXX11_CHAR16_T
+# define BOOST_NO_CXX11_CHAR32_T
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+# define BOOST_NO_CXX11_DELETED_FUNCTIONS
+# define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+# define BOOST_NO_CXX11_INLINE_NAMESPACES
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#endif
+
+#if BOOST_GCC_VERSION < 40500
+# define BOOST_NO_SFINAE_EXPR
+#endif
+
+// GCC 4.5 forbids declaration of defaulted functions in private or protected sections
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 5) || !defined(BOOST_GCC_CXX11)
+# define BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS
+#endif
+
+// C++0x features in 4.5.0 and later
+//
+#if (BOOST_GCC_VERSION < 40500) || !defined(BOOST_GCC_CXX11)
+# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+# define BOOST_NO_CXX11_LAMBDAS
+# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+# define BOOST_NO_CXX11_RAW_LITERALS
+# define BOOST_NO_CXX11_UNICODE_LITERALS
+#endif
+
+// C++0x features in 4.5.1 and later
+//
+#if (BOOST_GCC_VERSION < 40501) || !defined(BOOST_GCC_CXX11)
+// scoped enums have a serious bug in 4.4.0, so define BOOST_NO_CXX11_SCOPED_ENUMS before 4.5.1
+// See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064
+# define BOOST_NO_CXX11_SCOPED_ENUMS
+#endif
+
+// C++0x features in 4.6.n and later
+//
+#if (BOOST_GCC_VERSION < 40600) || !defined(BOOST_GCC_CXX11)
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#endif
+
+// C++0x features in 4.7.n and later
+//
+#if (BOOST_GCC_VERSION < 40700) || !defined(BOOST_GCC_CXX11)
+# define BOOST_NO_CXX11_FINAL
+# define BOOST_NO_CXX11_TEMPLATE_ALIASES
+# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+# define BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS
+#endif
+
+// C++0x features in 4.8.n and later
+//
+#if (BOOST_GCC_VERSION < 40800) || !defined(BOOST_GCC_CXX11)
+# define BOOST_NO_CXX11_ALIGNAS
+# define BOOST_NO_CXX11_THREAD_LOCAL
+#endif
+
+// C++0x features in 4.8.1 and later
+//
+#if (BOOST_GCC_VERSION < 40801) || !defined(BOOST_GCC_CXX11)
+# define BOOST_NO_CXX11_DECLTYPE_N3276
+# define BOOST_NO_CXX11_REF_QUALIFIERS
+# define BOOST_NO_CXX14_BINARY_LITERALS
+#endif
+
+// C++14 features in 4.9.0 and later
+//
+#if (BOOST_GCC_VERSION < 40900) || (__cplusplus < 201300)
+# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
+# define BOOST_NO_CXX14_GENERIC_LAMBDAS
+# define BOOST_NO_CXX14_DIGIT_SEPARATORS
+# define BOOST_NO_CXX14_DECLTYPE_AUTO
+# if !((BOOST_GCC_VERSION >= 40801) && (BOOST_GCC_VERSION < 40900) && defined(BOOST_GCC_CXX11))
+# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
+# endif
+#endif
+
+
+// C++ 14:
+#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
+# define BOOST_NO_CXX14_AGGREGATE_NSDMI
+#endif
+#if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
+# define BOOST_NO_CXX14_CONSTEXPR
+#endif
+#if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+#endif
+
+//
+// Unused attribute:
+#if __GNUC__ >= 4
+# define BOOST_ATTRIBUTE_UNUSED __attribute__((__unused__))
+#endif
+//
+// __builtin_unreachable:
+#if BOOST_GCC_VERSION >= 40800
+#define BOOST_UNREACHABLE_RETURN(x) __builtin_unreachable();
+#endif
+
+#ifndef BOOST_COMPILER
+# define BOOST_COMPILER "GNU C++ version " __VERSION__
+#endif
+
+// ConceptGCC compiler:
+// http://www.generic-programming.org/software/ConceptGCC/
+#ifdef __GXX_CONCEPTS__
+# define BOOST_HAS_CONCEPTS
+# define BOOST_COMPILER "ConceptGCC version " __VERSION__
+#endif
+
+// versions check:
+// we don't know gcc prior to version 3.30:
+#if (BOOST_GCC_VERSION< 30300)
+# error "Compiler not configured - please reconfigure"
+#endif
+//
+// last known and checked version is 4.9:
+#if (BOOST_GCC_VERSION > 40900)
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown compiler version - please run the configure tests and report the results"
+# else
+// we don't emit warnings here anymore since there are no defect macros defined for
+// gcc post 3.4, so any failures are gcc regressions...
+//# warning "Unknown compiler version - please run the configure tests and report the results"
+# endif
+#endif
+
diff --git a/thirdparty/linux/include/boost/config/compiler/gcc_xml.hpp b/thirdparty/linux/include/boost/config/compiler/gcc_xml.hpp
new file mode 100644
index 0000000..b56c786
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/gcc_xml.hpp
@@ -0,0 +1,96 @@
+// (C) Copyright John Maddock 2006.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// GCC-XML C++ compiler setup:
+
+# if !defined(__GCCXML_GNUC__) || ((__GCCXML_GNUC__ <= 3) && (__GCCXML_GNUC_MINOR__ <= 3))
+# define BOOST_NO_IS_ABSTRACT
+# endif
+
+//
+// Threading support: Turn this on unconditionally here (except for
+// those platforms where we can know for sure). It will get turned off again
+// later if no threading API is detected.
+//
+#if !defined(__MINGW32__) && !defined(_MSC_VER) && !defined(linux) && !defined(__linux) && !defined(__linux__)
+# define BOOST_HAS_THREADS
+#endif
+
+//
+// gcc has "long long"
+//
+#define BOOST_HAS_LONG_LONG
+
+// C++0x features:
+//
+# define BOOST_NO_CXX11_CONSTEXPR
+# define BOOST_NO_CXX11_NULLPTR
+# define BOOST_NO_CXX11_TEMPLATE_ALIASES
+# define BOOST_NO_CXX11_DECLTYPE
+# define BOOST_NO_CXX11_DECLTYPE_N3276
+# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
+# define BOOST_NO_CXX11_STATIC_ASSERT
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+# define BOOST_NO_CXX11_VARIADIC_MACROS
+# define BOOST_NO_CXX11_AUTO_DECLARATIONS
+# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+# define BOOST_NO_CXX11_CHAR16_T
+# define BOOST_NO_CXX11_CHAR32_T
+# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+# define BOOST_NO_CXX11_DELETED_FUNCTIONS
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_SCOPED_ENUMS
+# define BOOST_NO_SFINAE_EXPR
+# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+# define BOOST_NO_CXX11_LAMBDAS
+# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+# define BOOST_NO_CXX11_RANGE_BASED_FOR
+# define BOOST_NO_CXX11_RAW_LITERALS
+# define BOOST_NO_CXX11_UNICODE_LITERALS
+# define BOOST_NO_CXX11_NOEXCEPT
+# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+# define BOOST_NO_CXX11_ALIGNAS
+# define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+# define BOOST_NO_CXX11_INLINE_NAMESPACES
+# define BOOST_NO_CXX11_REF_QUALIFIERS
+# define BOOST_NO_CXX11_FINAL
+# define BOOST_NO_CXX11_THREAD_LOCAL
+
+// C++ 14:
+#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
+# define BOOST_NO_CXX14_AGGREGATE_NSDMI
+#endif
+#if !defined(__cpp_binary_literals) || (__cpp_binary_literals < 201304)
+# define BOOST_NO_CXX14_BINARY_LITERALS
+#endif
+#if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
+# define BOOST_NO_CXX14_CONSTEXPR
+#endif
+#if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304)
+# define BOOST_NO_CXX14_DECLTYPE_AUTO
+#endif
+#if (__cplusplus < 201304) // There's no SD6 check for this....
+# define BOOST_NO_CXX14_DIGIT_SEPARATORS
+#endif
+#if !defined(__cpp_generic_lambdas) || (__cpp_generic_lambdas < 201304)
+# define BOOST_NO_CXX14_GENERIC_LAMBDAS
+#endif
+#if !defined(__cpp_init_captures) || (__cpp_init_captures < 201304)
+# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
+#endif
+#if !defined(__cpp_return_type_deduction) || (__cpp_return_type_deduction < 201304)
+# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
+#endif
+#if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+#endif
+
+#define BOOST_COMPILER "GCC-XML C++ version " __GCCXML__
+
+
diff --git a/thirdparty/linux/include/boost/config/compiler/greenhills.hpp b/thirdparty/linux/include/boost/config/compiler/greenhills.hpp
new file mode 100644
index 0000000..a76a07c
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/greenhills.hpp
@@ -0,0 +1,28 @@
+// (C) Copyright John Maddock 2001.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Greenhills C++ compiler setup:
+
+#define BOOST_COMPILER "Greenhills C++ version " BOOST_STRINGIZE(__ghs)
+
+#include
+
+//
+// versions check:
+// we don't support Greenhills prior to version 0:
+#if __ghs < 0
+# error "Compiler not supported or configured - please reconfigure"
+#endif
+//
+// last known and checked version is 0:
+#if (__ghs > 0)
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown compiler version - please run the configure tests and report the results"
+# endif
+#endif
+
+
diff --git a/thirdparty/linux/include/boost/config/compiler/hp_acc.hpp b/thirdparty/linux/include/boost/config/compiler/hp_acc.hpp
new file mode 100644
index 0000000..a773b8c
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/hp_acc.hpp
@@ -0,0 +1,146 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2001 - 2003.
+// (C) Copyright Aleksey Gurtovoy 2002.
+// (C) Copyright David Abrahams 2002 - 2003.
+// (C) Copyright Toon Knapen 2003.
+// (C) Copyright Boris Gubenko 2006 - 2007.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// HP aCC C++ compiler setup:
+
+#if defined(__EDG__)
+#include
+#endif
+
+#if (__HP_aCC <= 33100)
+# define BOOST_NO_INTEGRAL_INT64_T
+# define BOOST_NO_OPERATORS_IN_NAMESPACE
+# if !defined(_NAMESPACE_STD)
+# define BOOST_NO_STD_LOCALE
+# define BOOST_NO_STRINGSTREAM
+# endif
+#endif
+
+#if (__HP_aCC <= 33300)
+// member templates are sufficiently broken that we disable them for now
+# define BOOST_NO_MEMBER_TEMPLATES
+# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
+# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
+#endif
+
+#if (__HP_aCC <= 38000)
+# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+#endif
+
+#if (__HP_aCC > 50000) && (__HP_aCC < 60000)
+# define BOOST_NO_UNREACHABLE_RETURN_DETECTION
+# define BOOST_NO_TEMPLATE_TEMPLATES
+# define BOOST_NO_SWPRINTF
+# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
+# define BOOST_NO_IS_ABSTRACT
+# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+#endif
+
+// optional features rather than defects:
+#if (__HP_aCC >= 33900)
+# define BOOST_HAS_LONG_LONG
+# define BOOST_HAS_PARTIAL_STD_ALLOCATOR
+#endif
+
+#if (__HP_aCC >= 50000 ) && (__HP_aCC <= 53800 ) || (__HP_aCC < 31300 )
+# define BOOST_NO_MEMBER_TEMPLATE_KEYWORD
+#endif
+
+// This macro should not be defined when compiling in strict ansi
+// mode, but, currently, we don't have the ability to determine
+// what standard mode we are compiling with. Some future version
+// of aCC6 compiler will provide predefined macros reflecting the
+// compilation options, including the standard mode.
+#if (__HP_aCC >= 60000) || ((__HP_aCC > 38000) && defined(__hpxstd98))
+# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+#endif
+
+#define BOOST_COMPILER "HP aCC version " BOOST_STRINGIZE(__HP_aCC)
+
+//
+// versions check:
+// we don't support HP aCC prior to version 33000:
+#if __HP_aCC < 33000
+# error "Compiler not supported or configured - please reconfigure"
+#endif
+
+//
+// Extended checks for supporting aCC on PA-RISC
+#if __HP_aCC > 30000 && __HP_aCC < 50000
+# if __HP_aCC < 38000
+ // versions prior to version A.03.80 not supported
+# error "Compiler version not supported - version A.03.80 or higher is required"
+# elif !defined(__hpxstd98)
+ // must compile using the option +hpxstd98 with version A.03.80 and above
+# error "Compiler option '+hpxstd98' is required for proper support"
+# endif //PA-RISC
+#endif
+
+//
+// C++0x features
+//
+// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
+//
+#if !defined(__EDG__)
+
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_SCOPED_ENUMS
+#define BOOST_NO_SFINAE_EXPR
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#define BOOST_NO_CXX11_ALIGNAS
+#define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+#define BOOST_NO_CXX11_INLINE_NAMESPACES
+#define BOOST_NO_CXX11_REF_QUALIFIERS
+#define BOOST_NO_CXX11_THREAD_LOCAL
+
+/*
+ See https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1443331 and
+ https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1443436
+*/
+
+#if (__HP_aCC < 62500) || !defined(HP_CXX0x_SOURCE)
+ #define BOOST_NO_CXX11_VARIADIC_MACROS
+#endif
+
+#endif
+
+//
+// last known and checked version for HP-UX/ia64 is 61300
+// last known and checked version for PA-RISC is 38000
+#if ((__HP_aCC > 61300) || ((__HP_aCC > 38000) && defined(__hpxstd98)))
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown compiler version - please run the configure tests and report the results"
+# endif
+#endif
diff --git a/thirdparty/linux/include/boost/config/compiler/intel.hpp b/thirdparty/linux/include/boost/config/compiler/intel.hpp
new file mode 100644
index 0000000..1885ea2
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/intel.hpp
@@ -0,0 +1,552 @@
+// (C) Copyright John Maddock 2001-8.
+// (C) Copyright Peter Dimov 2001.
+// (C) Copyright Jens Maurer 2001.
+// (C) Copyright David Abrahams 2002 - 2003.
+// (C) Copyright Aleksey Gurtovoy 2002 - 2003.
+// (C) Copyright Guillaume Melquiond 2002 - 2003.
+// (C) Copyright Beman Dawes 2003.
+// (C) Copyright Martin Wille 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Intel compiler setup:
+
+#if defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500) && (defined(_MSC_VER) || defined(__GNUC__))
+
+#ifdef _MSC_VER
+
+#include
+
+#undef BOOST_MSVC
+#undef BOOST_MSVC_FULL_VER
+
+#if (__INTEL_COMPILER >= 1500) && (_MSC_VER >= 1900)
+//
+// These appear to be supported, even though VC++ may not support them:
+//
+#define BOOST_HAS_EXPM1
+#define BOOST_HAS_LOG1P
+#undef BOOST_NO_CXX14_BINARY_LITERALS
+// This one may be a little risky to enable??
+#undef BOOST_NO_SFINAE_EXPR
+
+#endif
+
+#if (__INTEL_COMPILER <= 1600) && !defined(BOOST_NO_CXX14_VARIABLE_TEMPLATES)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+#endif
+
+#else
+
+#include
+
+#undef BOOST_GCC_VERSION
+#undef BOOST_GCC_CXX11
+
+#endif
+
+#undef BOOST_COMPILER
+
+#if defined(__INTEL_COMPILER)
+#if __INTEL_COMPILER == 9999
+# define BOOST_INTEL_CXX_VERSION 1200 // Intel bug in 12.1.
+#else
+# define BOOST_INTEL_CXX_VERSION __INTEL_COMPILER
+#endif
+#elif defined(__ICL)
+# define BOOST_INTEL_CXX_VERSION __ICL
+#elif defined(__ICC)
+# define BOOST_INTEL_CXX_VERSION __ICC
+#elif defined(__ECC)
+# define BOOST_INTEL_CXX_VERSION __ECC
+#endif
+
+// Flags determined by comparing output of 'icpc -dM -E' with and without '-std=c++0x'
+#if (!(defined(_WIN32) || defined(_WIN64)) && defined(__STDC_HOSTED__) && (__STDC_HOSTED__ && (BOOST_INTEL_CXX_VERSION <= 1200))) || defined(__GXX_EXPERIMENTAL_CPP0X__) || defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_INTEL_STDCXX0X
+#endif
+#if defined(_MSC_VER) && (_MSC_VER >= 1600)
+# define BOOST_INTEL_STDCXX0X
+#endif
+
+#ifdef __GNUC__
+# define BOOST_INTEL_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
+#endif
+
+#if !defined(BOOST_COMPILER)
+# if defined(BOOST_INTEL_STDCXX0X)
+# define BOOST_COMPILER "Intel C++ C++0x mode version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION)
+# else
+# define BOOST_COMPILER "Intel C++ version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION)
+# endif
+#endif
+
+#define BOOST_INTEL BOOST_INTEL_CXX_VERSION
+
+#if defined(_WIN32) || defined(_WIN64)
+# define BOOST_INTEL_WIN BOOST_INTEL
+#else
+# define BOOST_INTEL_LINUX BOOST_INTEL
+#endif
+
+#else
+
+#include
+
+#if defined(__INTEL_COMPILER)
+#if __INTEL_COMPILER == 9999
+# define BOOST_INTEL_CXX_VERSION 1200 // Intel bug in 12.1.
+#else
+# define BOOST_INTEL_CXX_VERSION __INTEL_COMPILER
+#endif
+#elif defined(__ICL)
+# define BOOST_INTEL_CXX_VERSION __ICL
+#elif defined(__ICC)
+# define BOOST_INTEL_CXX_VERSION __ICC
+#elif defined(__ECC)
+# define BOOST_INTEL_CXX_VERSION __ECC
+#endif
+
+// Flags determined by comparing output of 'icpc -dM -E' with and without '-std=c++0x'
+#if (!(defined(_WIN32) || defined(_WIN64)) && defined(__STDC_HOSTED__) && (__STDC_HOSTED__ && (BOOST_INTEL_CXX_VERSION <= 1200))) || defined(__GXX_EXPERIMENTAL_CPP0X__) || defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_INTEL_STDCXX0X
+#endif
+#if defined(_MSC_VER) && (_MSC_VER >= 1600)
+# define BOOST_INTEL_STDCXX0X
+#endif
+
+#ifdef __GNUC__
+# define BOOST_INTEL_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
+#endif
+
+#if !defined(BOOST_COMPILER)
+# if defined(BOOST_INTEL_STDCXX0X)
+# define BOOST_COMPILER "Intel C++ C++0x mode version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION)
+# else
+# define BOOST_COMPILER "Intel C++ version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION)
+# endif
+#endif
+
+#define BOOST_INTEL BOOST_INTEL_CXX_VERSION
+
+#if defined(_WIN32) || defined(_WIN64)
+# define BOOST_INTEL_WIN BOOST_INTEL
+#else
+# define BOOST_INTEL_LINUX BOOST_INTEL
+#endif
+
+#if (BOOST_INTEL_CXX_VERSION <= 600)
+
+# if defined(_MSC_VER) && (_MSC_VER <= 1300) // added check for <= VC 7 (Peter Dimov)
+
+// Boost libraries assume strong standard conformance unless otherwise
+// indicated by a config macro. As configured by Intel, the EDG front-end
+// requires certain compiler options be set to achieve that strong conformance.
+// Particularly /Qoption,c,--arg_dep_lookup (reported by Kirk Klobe & Thomas Witt)
+// and /Zc:wchar_t,forScope. See boost-root/tools/build/intel-win32-tools.jam for
+// details as they apply to particular versions of the compiler. When the
+// compiler does not predefine a macro indicating if an option has been set,
+// this config file simply assumes the option has been set.
+// Thus BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP will not be defined, even if
+// the compiler option is not enabled.
+
+# define BOOST_NO_SWPRINTF
+# endif
+
+// Void returns, 64 bit integrals don't work when emulating VC 6 (Peter Dimov)
+
+# if defined(_MSC_VER) && (_MSC_VER <= 1200)
+# define BOOST_NO_VOID_RETURNS
+# define BOOST_NO_INTEGRAL_INT64_T
+# endif
+
+#endif
+
+#if (BOOST_INTEL_CXX_VERSION <= 710) && defined(_WIN32)
+# define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
+#endif
+
+// See http://aspn.activestate.com/ASPN/Mail/Message/boost/1614864
+#if BOOST_INTEL_CXX_VERSION < 600
+# define BOOST_NO_INTRINSIC_WCHAR_T
+#else
+// We should test the macro _WCHAR_T_DEFINED to check if the compiler
+// supports wchar_t natively. *BUT* there is a problem here: the standard
+// headers define this macro if they typedef wchar_t. Anyway, we're lucky
+// because they define it without a value, while Intel C++ defines it
+// to 1. So we can check its value to see if the macro was defined natively
+// or not.
+// Under UNIX, the situation is exactly the same, but the macro _WCHAR_T
+// is used instead.
+# if ((_WCHAR_T_DEFINED + 0) == 0) && ((_WCHAR_T + 0) == 0)
+# define BOOST_NO_INTRINSIC_WCHAR_T
+# endif
+#endif
+
+#if defined(__GNUC__) && !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
+//
+// Figure out when Intel is emulating this gcc bug
+// (All Intel versions prior to 9.0.26, and versions
+// later than that if they are set up to emulate gcc 3.2
+// or earlier):
+//
+# if ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)) || (BOOST_INTEL < 900) || (__INTEL_COMPILER_BUILD_DATE < 20050912)
+# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
+# endif
+#endif
+#if (defined(__GNUC__) && (__GNUC__ < 4)) || (defined(_WIN32) && (BOOST_INTEL_CXX_VERSION <= 1200)) || (BOOST_INTEL_CXX_VERSION <= 1200)
+// GCC or VC emulation:
+#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+#endif
+//
+// Verify that we have actually got BOOST_NO_INTRINSIC_WCHAR_T
+// set correctly, if we don't do this now, we will get errors later
+// in type_traits code among other things, getting this correct
+// for the Intel compiler is actually remarkably fragile and tricky:
+//
+#ifdef __cplusplus
+#if defined(BOOST_NO_INTRINSIC_WCHAR_T)
+#include
+template< typename T > struct assert_no_intrinsic_wchar_t;
+template<> struct assert_no_intrinsic_wchar_t { typedef void type; };
+// if you see an error here then you need to unset BOOST_NO_INTRINSIC_WCHAR_T
+// where it is defined above:
+typedef assert_no_intrinsic_wchar_t::type assert_no_intrinsic_wchar_t_;
+#else
+template< typename T > struct assert_intrinsic_wchar_t;
+template<> struct assert_intrinsic_wchar_t {};
+// if you see an error here then define BOOST_NO_INTRINSIC_WCHAR_T on the command line:
+template<> struct assert_intrinsic_wchar_t {};
+#endif
+#endif
+
+#if defined(_MSC_VER) && (_MSC_VER+0 >= 1000)
+# if _MSC_VER >= 1200
+# define BOOST_HAS_MS_INT64
+# endif
+# define BOOST_NO_SWPRINTF
+# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+#elif defined(_WIN32)
+# define BOOST_DISABLE_WIN32
+#endif
+
+// I checked version 6.0 build 020312Z, it implements the NRVO.
+// Correct this as you find out which version of the compiler
+// implemented the NRVO first. (Daniel Frey)
+#if (BOOST_INTEL_CXX_VERSION >= 600)
+# define BOOST_HAS_NRVO
+#endif
+
+// Branch prediction hints
+// I'm not sure 8.0 was the first version to support these builtins,
+// update the condition if the version is not accurate. (Andrey Semashev)
+#if defined(__GNUC__) && BOOST_INTEL_CXX_VERSION >= 800
+#define BOOST_LIKELY(x) __builtin_expect(x, 1)
+#define BOOST_UNLIKELY(x) __builtin_expect(x, 0)
+#endif
+
+// RTTI
+// __RTTI is the EDG macro
+// __INTEL_RTTI__ is the Intel macro
+// __GXX_RTTI is the g++ macro
+// _CPPRTTI is the MSVC++ macro
+#if !defined(__RTTI) && !defined(__INTEL_RTTI__) && !defined(__GXX_RTTI) && !defined(_CPPRTTI)
+
+#if !defined(BOOST_NO_RTTI)
+# define BOOST_NO_RTTI
+#endif
+
+// in MS mode, static typeid works even when RTTI is off
+#if !defined(_MSC_VER) && !defined(BOOST_NO_TYPEID)
+# define BOOST_NO_TYPEID
+#endif
+
+#endif
+
+//
+// versions check:
+// we don't support Intel prior to version 6.0:
+#if BOOST_INTEL_CXX_VERSION < 600
+# error "Compiler not supported or configured - please reconfigure"
+#endif
+
+// Intel on MacOS requires
+#if defined(__APPLE__) && defined(__INTEL_COMPILER)
+# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+#endif
+
+// Intel on Altix Itanium
+#if defined(__itanium__) && defined(__INTEL_COMPILER)
+# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+#endif
+
+//
+// An attempt to value-initialize a pointer-to-member may trigger an
+// internal error on Intel <= 11.1 (last checked version), as was
+// reported by John Maddock, Intel support issue 589832, May 2010.
+// Moreover, according to test results from Huang-Vista-x86_32_intel,
+// intel-vc9-win-11.1 may leave a non-POD array uninitialized, in some
+// cases when it should be value-initialized.
+// (Niels Dekker, LKEB, May 2010)
+// Apparently Intel 12.1 (compiler version number 9999 !!) has the same issue (compiler regression).
+#if defined(__INTEL_COMPILER)
+# if (__INTEL_COMPILER <= 1110) || (__INTEL_COMPILER == 9999) || (defined(_WIN32) && (__INTEL_COMPILER < 1600))
+# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
+# endif
+#endif
+
+//
+// Dynamic shared object (DSO) and dynamic-link library (DLL) support
+//
+#if defined(__GNUC__) && (__GNUC__ >= 4)
+# define BOOST_SYMBOL_EXPORT __attribute__((visibility("default")))
+# define BOOST_SYMBOL_IMPORT
+# define BOOST_SYMBOL_VISIBLE __attribute__((visibility("default")))
+#endif
+//
+// C++0x features
+// For each feature we need to check both the Intel compiler version,
+// and the version of MSVC or GCC that we are emulating.
+// See http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler/
+// for a list of which features were implemented in which Intel releases.
+//
+#if defined(BOOST_INTEL_STDCXX0X)
+// BOOST_NO_CXX11_CONSTEXPR:
+#if (BOOST_INTEL_CXX_VERSION >= 1500) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40600)) && !defined(_MSC_VER)
+// Available in earlier Intel versions, but fail our tests:
+# undef BOOST_NO_CXX11_CONSTEXPR
+#endif
+// BOOST_NO_CXX11_NULLPTR:
+#if (BOOST_INTEL_CXX_VERSION >= 1210) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40600)) && (!defined(_MSC_VER) || (_MSC_VER >= 1600))
+# undef BOOST_NO_CXX11_NULLPTR
+#endif
+// BOOST_NO_CXX11_TEMPLATE_ALIASES
+#if (BOOST_INTEL_CXX_VERSION >= 1210) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40700)) && (!defined(_MSC_VER) || (_MSC_FULL_VER >= 180020827))
+# undef BOOST_NO_CXX11_TEMPLATE_ALIASES
+#endif
+
+// BOOST_NO_CXX11_DECLTYPE
+#if (BOOST_INTEL_CXX_VERSION >= 1200) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40300)) && (!defined(_MSC_VER) || (_MSC_VER >= 1600))
+# undef BOOST_NO_CXX11_DECLTYPE
+#endif
+
+// BOOST_NO_CXX11_DECLTYPE_N3276
+#if (BOOST_INTEL_CXX_VERSION >= 1500) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40800)) && (!defined(_MSC_VER) || (_MSC_FULL_VER >= 180020827))
+# undef BOOST_NO_CXX11_DECLTYPE_N3276
+#endif
+
+// BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#if (BOOST_INTEL_CXX_VERSION >= 1200) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40300)) && (!defined(_MSC_VER) || (_MSC_FULL_VER >= 180020827))
+# undef BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#endif
+
+// BOOST_NO_CXX11_RVALUE_REFERENCES
+#if (BOOST_INTEL_CXX_VERSION >= 1300) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40300)) && (!defined(_MSC_VER) || (_MSC_VER >= 1600))
+// This is available from earlier Intel versions, but breaks Filesystem and other libraries:
+# undef BOOST_NO_CXX11_RVALUE_REFERENCES
+#endif
+
+// BOOST_NO_CXX11_STATIC_ASSERT
+#if (BOOST_INTEL_CXX_VERSION >= 1110) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40300)) && (!defined(_MSC_VER) || (_MSC_VER >= 1600))
+# undef BOOST_NO_CXX11_STATIC_ASSERT
+#endif
+
+// BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#if (BOOST_INTEL_CXX_VERSION >= 1200) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40400)) && (!defined(_MSC_VER) || (_MSC_FULL_VER >= 180020827))
+# undef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#endif
+
+// BOOST_NO_CXX11_VARIADIC_MACROS
+#if (BOOST_INTEL_CXX_VERSION >= 1200) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40200)) && (!defined(_MSC_VER) || (_MSC_VER >= 1400))
+# undef BOOST_NO_CXX11_VARIADIC_MACROS
+#endif
+
+// BOOST_NO_CXX11_AUTO_DECLARATIONS
+#if (BOOST_INTEL_CXX_VERSION >= 1200) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40400)) && (!defined(_MSC_VER) || (_MSC_VER >= 1600))
+# undef BOOST_NO_CXX11_AUTO_DECLARATIONS
+#endif
+
+// BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#if (BOOST_INTEL_CXX_VERSION >= 1200) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40400)) && (!defined(_MSC_VER) || (_MSC_VER >= 1600))
+# undef BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#endif
+
+// BOOST_NO_CXX11_CHAR16_T
+#if (BOOST_INTEL_CXX_VERSION >= 1400) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40400)) && (!defined(_MSC_VER) || (_MSC_VER >= 9999))
+# undef BOOST_NO_CXX11_CHAR16_T
+#endif
+
+// BOOST_NO_CXX11_CHAR32_T
+#if (BOOST_INTEL_CXX_VERSION >= 1400) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40400)) && (!defined(_MSC_VER) || (_MSC_VER >= 9999))
+# undef BOOST_NO_CXX11_CHAR32_T
+#endif
+
+// BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#if (BOOST_INTEL_CXX_VERSION >= 1200) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40400)) && (!defined(_MSC_VER) || (_MSC_FULL_VER >= 180020827))
+# undef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#endif
+
+// BOOST_NO_CXX11_DELETED_FUNCTIONS
+#if (BOOST_INTEL_CXX_VERSION >= 1200) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40400)) && (!defined(_MSC_VER) || (_MSC_FULL_VER >= 180020827))
+# undef BOOST_NO_CXX11_DELETED_FUNCTIONS
+#endif
+
+// BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#if (BOOST_INTEL_CXX_VERSION >= 1400) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40400)) && (!defined(_MSC_VER) || (_MSC_VER >= 1700))
+# undef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#endif
+
+// BOOST_NO_CXX11_SCOPED_ENUMS
+#if (BOOST_INTEL_CXX_VERSION >= 1400) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40501)) && (!defined(_MSC_VER) || (_MSC_VER >= 1700))
+// This is available but broken in earlier Intel releases.
+# undef BOOST_NO_CXX11_SCOPED_ENUMS
+#endif
+
+// BOOST_NO_SFINAE_EXPR
+#if (BOOST_INTEL_CXX_VERSION >= 1200) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40500)) && (!defined(_MSC_VER) || (_MSC_VER >= 9999))
+# undef BOOST_NO_SFINAE_EXPR
+#endif
+
+// BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#if (BOOST_INTEL_CXX_VERSION >= 1500) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40500)) && (!defined(_MSC_VER) || (_MSC_FULL_VER >= 180020827))
+// This is available in earlier Intel releases, but breaks Multiprecision:
+# undef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#endif
+
+// BOOST_NO_CXX11_LAMBDAS
+#if (BOOST_INTEL_CXX_VERSION >= 1200) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40500)) && (!defined(_MSC_VER) || (_MSC_VER >= 1600))
+# undef BOOST_NO_CXX11_LAMBDAS
+#endif
+
+// BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#if (BOOST_INTEL_CXX_VERSION >= 1200) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40500))
+# undef BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#endif
+
+// BOOST_NO_CXX11_RANGE_BASED_FOR
+#if (BOOST_INTEL_CXX_VERSION >= 1400) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40600)) && (!defined(_MSC_VER) || (_MSC_VER >= 1700))
+# undef BOOST_NO_CXX11_RANGE_BASED_FOR
+#endif
+
+// BOOST_NO_CXX11_RAW_LITERALS
+#if (BOOST_INTEL_CXX_VERSION >= 1400) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40500)) && (!defined(_MSC_VER) || (_MSC_FULL_VER >= 180020827))
+# undef BOOST_NO_CXX11_RAW_LITERALS
+#endif
+
+// BOOST_NO_CXX11_UNICODE_LITERALS
+#if (BOOST_INTEL_CXX_VERSION >= 1400) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40500)) && (!defined(_MSC_VER) || (_MSC_VER >= 9999))
+# undef BOOST_NO_CXX11_UNICODE_LITERALS
+#endif
+
+// BOOST_NO_CXX11_NOEXCEPT
+#if (BOOST_INTEL_CXX_VERSION >= 1500) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40600)) && (!defined(_MSC_VER) || (_MSC_VER >= 9999))
+// Available in earlier Intel release, but generates errors when used with
+// conditional exception specifications, for example in multiprecision:
+# undef BOOST_NO_CXX11_NOEXCEPT
+#endif
+
+// BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#if (BOOST_INTEL_CXX_VERSION >= 1400) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40600)) && (!defined(_MSC_VER) || (_MSC_VER >= 9999))
+# undef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#endif
+
+// BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#if (BOOST_INTEL_CXX_VERSION >= 1500) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40700)) && (!defined(_MSC_VER) || (_MSC_FULL_VER >= 190021730))
+# undef BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#endif
+
+// BOOST_NO_CXX11_ALIGNAS
+#if (BOOST_INTEL_CXX_VERSION >= 1500) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40800)) && (!defined(_MSC_VER) || (_MSC_FULL_VER >= 190021730))
+# undef BOOST_NO_CXX11_ALIGNAS
+#endif
+
+// BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+#if (BOOST_INTEL_CXX_VERSION >= 1200) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40400)) && (!defined(_MSC_VER) || (_MSC_FULL_VER >= 180020827))
+# undef BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+#endif
+
+// BOOST_NO_CXX11_INLINE_NAMESPACES
+#if (BOOST_INTEL_CXX_VERSION >= 1400) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40400)) && (!defined(_MSC_VER) || (_MSC_FULL_VER >= 190021730))
+# undef BOOST_NO_CXX11_INLINE_NAMESPACES
+#endif
+
+// BOOST_NO_CXX11_REF_QUALIFIERS
+#if (BOOST_INTEL_CXX_VERSION >= 1400) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40800)) && (!defined(_MSC_VER) || (_MSC_FULL_VER >= 190021730))
+# undef BOOST_NO_CXX11_REF_QUALIFIERS
+#endif
+
+// BOOST_NO_CXX11_FINAL
+#if (BOOST_INTEL_CXX_VERSION >= 1400) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40700)) && (!defined(_MSC_VER) || (_MSC_VER >= 1700))
+# undef BOOST_NO_CXX11_FINAL
+#endif
+
+#endif
+
+//
+// Broken in all versions up to 15:
+#define BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS
+
+#if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION <= 1310)
+# define BOOST_NO_CXX11_HDR_FUTURE
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#endif
+
+#if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION == 1400)
+// A regression in Intel's compiler means that seems to be broken in this release as well as :
+# define BOOST_NO_CXX11_HDR_FUTURE
+# define BOOST_NO_CXX11_HDR_TUPLE
+#endif
+
+// Broken in all versions up to 17:
+#if !defined(BOOST_NO_CXX14_CONSTEXPR)
+#define BOOST_NO_CXX14_CONSTEXPR
+#endif
+
+#if (BOOST_INTEL_CXX_VERSION < 1200)
+//
+// fenv.h appears not to work with Intel prior to 12.0:
+//
+# define BOOST_NO_FENV_H
+#endif
+
+// Intel 13.10 fails to access defaulted functions of a base class declared in private or protected sections,
+// producing the following errors:
+// error #453: protected function "..." (declared at ...") is not accessible through a "..." pointer or object
+#if (BOOST_INTEL_CXX_VERSION <= 1310)
+# define BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS
+#endif
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1600)
+# define BOOST_HAS_STDINT_H
+#endif
+
+#if defined(__CUDACC__)
+# if defined(BOOST_GCC_CXX11)
+# define BOOST_NVCC_CXX11
+# else
+# define BOOST_NVCC_CXX03
+# endif
+#endif
+
+#if defined(__LP64__) && defined(__GNUC__) && (BOOST_INTEL_CXX_VERSION >= 1310) && !defined(BOOST_NVCC_CXX03)
+# define BOOST_HAS_INT128
+#endif
+
+#endif
+//
+// last known and checked version:
+#if (BOOST_INTEL_CXX_VERSION > 1500)
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown compiler version - please run the configure tests and report the results"
+# elif defined(_MSC_VER)
+//
+// We don't emit this warning any more, since we have so few
+// defect macros set anyway (just the one).
+//
+//# pragma message("Unknown compiler version - please run the configure tests and report the results")
+# endif
+#endif
+
diff --git a/thirdparty/linux/include/boost/config/compiler/kai.hpp b/thirdparty/linux/include/boost/config/compiler/kai.hpp
new file mode 100644
index 0000000..960d501
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/kai.hpp
@@ -0,0 +1,33 @@
+// (C) Copyright John Maddock 2001.
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Aleksey Gurtovoy 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Kai C++ compiler setup:
+
+#include
+
+# if (__KCC_VERSION <= 4001) || !defined(BOOST_STRICT_CONFIG)
+ // at least on Sun, the contents of is not in namespace std
+# define BOOST_NO_STDC_NAMESPACE
+# endif
+
+// see also common_edg.hpp which needs a special check for __KCC
+# if !defined(_EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
+# define BOOST_NO_EXCEPTIONS
+# endif
+
+//
+// last known and checked version is 4001:
+#if (__KCC_VERSION > 4001)
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown compiler version - please run the configure tests and report the results"
+# endif
+#endif
+
+
+
diff --git a/thirdparty/linux/include/boost/config/compiler/metrowerks.hpp b/thirdparty/linux/include/boost/config/compiler/metrowerks.hpp
new file mode 100644
index 0000000..3c5e228
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/metrowerks.hpp
@@ -0,0 +1,180 @@
+// (C) Copyright John Maddock 2001.
+// (C) Copyright Darin Adler 2001.
+// (C) Copyright Peter Dimov 2001.
+// (C) Copyright David Abrahams 2001 - 2002.
+// (C) Copyright Beman Dawes 2001 - 2003.
+// (C) Copyright Stefan Slapeta 2004.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Metrowerks C++ compiler setup:
+
+// locale support is disabled when linking with the dynamic runtime
+# ifdef _MSL_NO_LOCALE
+# define BOOST_NO_STD_LOCALE
+# endif
+
+# if __MWERKS__ <= 0x2301 // 5.3
+# define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+# define BOOST_NO_POINTER_TO_MEMBER_CONST
+# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
+# define BOOST_NO_MEMBER_TEMPLATE_KEYWORD
+# endif
+
+# if __MWERKS__ <= 0x2401 // 6.2
+//# define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+# endif
+
+# if(__MWERKS__ <= 0x2407) // 7.x
+# define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
+# define BOOST_NO_UNREACHABLE_RETURN_DETECTION
+# endif
+
+# if(__MWERKS__ <= 0x3003) // 8.x
+# define BOOST_NO_SFINAE
+# endif
+
+// the "|| !defined(BOOST_STRICT_CONFIG)" part should apply to the last
+// tested version *only*:
+# if(__MWERKS__ <= 0x3207) || !defined(BOOST_STRICT_CONFIG) // 9.6
+# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+# define BOOST_NO_IS_ABSTRACT
+# endif
+
+#if !__option(wchar_type)
+# define BOOST_NO_INTRINSIC_WCHAR_T
+#endif
+
+#if !__option(exceptions) && !defined(BOOST_NO_EXCEPTIONS)
+# define BOOST_NO_EXCEPTIONS
+#endif
+
+#if (__INTEL__ && _WIN32) || (__POWERPC__ && macintosh)
+# if __MWERKS__ == 0x3000
+# define BOOST_COMPILER_VERSION 8.0
+# elif __MWERKS__ == 0x3001
+# define BOOST_COMPILER_VERSION 8.1
+# elif __MWERKS__ == 0x3002
+# define BOOST_COMPILER_VERSION 8.2
+# elif __MWERKS__ == 0x3003
+# define BOOST_COMPILER_VERSION 8.3
+# elif __MWERKS__ == 0x3200
+# define BOOST_COMPILER_VERSION 9.0
+# elif __MWERKS__ == 0x3201
+# define BOOST_COMPILER_VERSION 9.1
+# elif __MWERKS__ == 0x3202
+# define BOOST_COMPILER_VERSION 9.2
+# elif __MWERKS__ == 0x3204
+# define BOOST_COMPILER_VERSION 9.3
+# elif __MWERKS__ == 0x3205
+# define BOOST_COMPILER_VERSION 9.4
+# elif __MWERKS__ == 0x3206
+# define BOOST_COMPILER_VERSION 9.5
+# elif __MWERKS__ == 0x3207
+# define BOOST_COMPILER_VERSION 9.6
+# else
+# define BOOST_COMPILER_VERSION __MWERKS__
+# endif
+#else
+# define BOOST_COMPILER_VERSION __MWERKS__
+#endif
+
+//
+// C++0x features
+//
+// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
+//
+#if __MWERKS__ > 0x3206 && __option(rvalue_refs)
+# define BOOST_HAS_RVALUE_REFS
+#else
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
+#endif
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_SCOPED_ENUMS
+#define BOOST_NO_SFINAE_EXPR
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_VARIADIC_MACROS
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#define BOOST_NO_CXX11_ALIGNAS
+#define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+#define BOOST_NO_CXX11_INLINE_NAMESPACES
+#define BOOST_NO_CXX11_REF_QUALIFIERS
+#define BOOST_NO_CXX11_FINAL
+#define BOOST_NO_CXX11_THREAD_LOCAL
+
+// C++ 14:
+#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
+# define BOOST_NO_CXX14_AGGREGATE_NSDMI
+#endif
+#if !defined(__cpp_binary_literals) || (__cpp_binary_literals < 201304)
+# define BOOST_NO_CXX14_BINARY_LITERALS
+#endif
+#if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
+# define BOOST_NO_CXX14_CONSTEXPR
+#endif
+#if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304)
+# define BOOST_NO_CXX14_DECLTYPE_AUTO
+#endif
+#if (__cplusplus < 201304) // There's no SD6 check for this....
+# define BOOST_NO_CXX14_DIGIT_SEPARATORS
+#endif
+#if !defined(__cpp_generic_lambdas) || (__cpp_generic_lambdas < 201304)
+# define BOOST_NO_CXX14_GENERIC_LAMBDAS
+#endif
+#if !defined(__cpp_init_captures) || (__cpp_init_captures < 201304)
+# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
+#endif
+#if !defined(__cpp_return_type_deduction) || (__cpp_return_type_deduction < 201304)
+# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
+#endif
+#if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+#endif
+
+#define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
+
+//
+// versions check:
+// we don't support Metrowerks prior to version 5.3:
+#if __MWERKS__ < 0x2301
+# error "Compiler not supported or configured - please reconfigure"
+#endif
+//
+// last known and checked version:
+#if (__MWERKS__ > 0x3205)
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown compiler version - please run the configure tests and report the results"
+# endif
+#endif
+
+
+
+
+
+
+
diff --git a/thirdparty/linux/include/boost/config/compiler/mpw.hpp b/thirdparty/linux/include/boost/config/compiler/mpw.hpp
new file mode 100644
index 0000000..084f9e1
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/mpw.hpp
@@ -0,0 +1,122 @@
+// (C) Copyright John Maddock 2001 - 2002.
+// (C) Copyright Aleksey Gurtovoy 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// MPW C++ compilers setup:
+
+# if defined(__SC__)
+# define BOOST_COMPILER "MPW SCpp version " BOOST_STRINGIZE(__SC__)
+# elif defined(__MRC__)
+# define BOOST_COMPILER "MPW MrCpp version " BOOST_STRINGIZE(__MRC__)
+# else
+# error "Using MPW compiler configuration by mistake. Please update."
+# endif
+
+//
+// MPW 8.90:
+//
+#if (MPW_CPLUS <= 0x890) || !defined(BOOST_STRICT_CONFIG)
+# define BOOST_NO_CV_SPECIALIZATIONS
+# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
+# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
+# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+# define BOOST_NO_INTRINSIC_WCHAR_T
+# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+# define BOOST_NO_USING_TEMPLATE
+
+# define BOOST_NO_CWCHAR
+# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+
+# define BOOST_NO_STD_ALLOCATOR /* actually a bug with const reference overloading */
+
+#endif
+
+//
+// C++0x features
+//
+// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
+//
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_SCOPED_ENUMS
+#define BOOST_NO_SFINAE_EXPR
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_VARIADIC_MACROS
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#define BOOST_NO_CXX11_ALIGNAS
+#define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+#define BOOST_NO_CXX11_INLINE_NAMESPACES
+#define BOOST_NO_CXX11_REF_QUALIFIERS
+#define BOOST_NO_CXX11_FINAL
+#define BOOST_NO_CXX11_THREAD_LOCAL
+
+// C++ 14:
+#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
+# define BOOST_NO_CXX14_AGGREGATE_NSDMI
+#endif
+#if !defined(__cpp_binary_literals) || (__cpp_binary_literals < 201304)
+# define BOOST_NO_CXX14_BINARY_LITERALS
+#endif
+#if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
+# define BOOST_NO_CXX14_CONSTEXPR
+#endif
+#if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304)
+# define BOOST_NO_CXX14_DECLTYPE_AUTO
+#endif
+#if (__cplusplus < 201304) // There's no SD6 check for this....
+# define BOOST_NO_CXX14_DIGIT_SEPARATORS
+#endif
+#if !defined(__cpp_generic_lambdas) || (__cpp_generic_lambdas < 201304)
+# define BOOST_NO_CXX14_GENERIC_LAMBDAS
+#endif
+#if !defined(__cpp_init_captures) || (__cpp_init_captures < 201304)
+# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
+#endif
+#if !defined(__cpp_return_type_deduction) || (__cpp_return_type_deduction < 201304)
+# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
+#endif
+#if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+#endif
+
+//
+// versions check:
+// we don't support MPW prior to version 8.9:
+#if MPW_CPLUS < 0x890
+# error "Compiler not supported or configured - please reconfigure"
+#endif
+//
+// last known and checked version is 0x890:
+#if (MPW_CPLUS > 0x890)
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown compiler version - please run the configure tests and report the results"
+# endif
+#endif
+
+
diff --git a/thirdparty/linux/include/boost/config/compiler/nvcc.hpp b/thirdparty/linux/include/boost/config/compiler/nvcc.hpp
new file mode 100644
index 0000000..b31d4f4
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/nvcc.hpp
@@ -0,0 +1,32 @@
+// (C) Copyright Eric Jourdanneau, Joel Falcou 2010
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// NVIDIA CUDA C++ compiler setup
+
+#ifndef BOOST_COMPILER
+# define BOOST_COMPILER "NVIDIA CUDA C++ Compiler"
+#endif
+
+// NVIDIA Specific support
+// BOOST_GPU_ENABLED : Flag a function or a method as being enabled on the host and device
+#define BOOST_GPU_ENABLED __host__ __device__
+
+// A bug in version 7.0 of CUDA prevents use of variadic templates in some occasions
+// https://svn.boost.org/trac/boost/ticket/11897
+// This is fixed in 7.5. As the following version macro was introduced in 7.5 an existance
+// check is enough to detect versions < 7.5
+#if !defined(__CUDACC_VER__) || (__CUDACC_VER__ < 70500)
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#endif
+// The same bug is back again in 8.0:
+#if (__CUDACC_VER__ > 80000) && (__CUDACC_VER__ < 80100)
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#endif
+// Most recent CUDA (8.0) has no constexpr support in msvc mode:
+#if defined(_MSC_VER)
+# define BOOST_NO_CXX11_CONSTEXPR
+#endif
diff --git a/thirdparty/linux/include/boost/config/compiler/pathscale.hpp b/thirdparty/linux/include/boost/config/compiler/pathscale.hpp
new file mode 100644
index 0000000..a5e65af
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/pathscale.hpp
@@ -0,0 +1,115 @@
+// (C) Copyright Bryce Lelbach 2011
+
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// PathScale EKOPath C++ Compiler
+
+#ifndef BOOST_COMPILER
+# define BOOST_COMPILER "PathScale EKOPath C++ Compiler version " __PATHSCALE__
+#endif
+
+#if __PATHCC__ >= 4
+# define BOOST_MSVC6_MEMBER_TEMPLATES
+# define BOOST_HAS_UNISTD_H
+# define BOOST_HAS_STDINT_H
+# define BOOST_HAS_SIGACTION
+# define BOOST_HAS_SCHED_YIELD
+# define BOOST_HAS_THREADS
+# define BOOST_HAS_PTHREADS
+# define BOOST_HAS_PTHREAD_YIELD
+# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+# define BOOST_HAS_PARTIAL_STD_ALLOCATOR
+# define BOOST_HAS_NRVO
+# define BOOST_HAS_NL_TYPES_H
+# define BOOST_HAS_NANOSLEEP
+# define BOOST_HAS_LONG_LONG
+# define BOOST_HAS_LOG1P
+# define BOOST_HAS_GETTIMEOFDAY
+# define BOOST_HAS_EXPM1
+# define BOOST_HAS_DIRENT_H
+# define BOOST_HAS_CLOCK_GETTIME
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+# define BOOST_NO_CXX11_UNICODE_LITERALS
+# define BOOST_NO_CXX11_TEMPLATE_ALIASES
+# define BOOST_NO_CXX11_STATIC_ASSERT
+# define BOOST_NO_SFINAE_EXPR
+# define BOOST_NO_CXX11_SCOPED_ENUMS
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
+# define BOOST_NO_CXX11_RANGE_BASED_FOR
+# define BOOST_NO_CXX11_RAW_LITERALS
+# define BOOST_NO_CXX11_NULLPTR
+# define BOOST_NO_CXX11_NUMERIC_LIMITS
+# define BOOST_NO_CXX11_NOEXCEPT
+# define BOOST_NO_CXX11_LAMBDAS
+# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+# define BOOST_NO_MS_INT64_NUMERIC_LIMITS
+# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+# define BOOST_NO_CXX11_DELETED_FUNCTIONS
+# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+# define BOOST_NO_CXX11_DECLTYPE
+# define BOOST_NO_CXX11_DECLTYPE_N3276
+# define BOOST_NO_CXX11_CONSTEXPR
+# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
+# define BOOST_NO_CXX11_CHAR32_T
+# define BOOST_NO_CXX11_CHAR16_T
+# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+# define BOOST_NO_CXX11_AUTO_DECLARATIONS
+# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+# define BOOST_NO_CXX11_HDR_UNORDERED_SET
+# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
+# define BOOST_NO_CXX11_HDR_TYPEINDEX
+# define BOOST_NO_CXX11_HDR_TUPLE
+# define BOOST_NO_CXX11_HDR_THREAD
+# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
+# define BOOST_NO_CXX11_HDR_REGEX
+# define BOOST_NO_CXX11_HDR_RATIO
+# define BOOST_NO_CXX11_HDR_RANDOM
+# define BOOST_NO_CXX11_HDR_MUTEX
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_HDR_FUTURE
+# define BOOST_NO_CXX11_HDR_FORWARD_LIST
+# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
+# define BOOST_NO_CXX11_HDR_CODECVT
+# define BOOST_NO_CXX11_HDR_CHRONO
+# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+# define BOOST_NO_CXX11_ALIGNAS
+# define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+# define BOOST_NO_CXX11_INLINE_NAMESPACES
+# define BOOST_NO_CXX11_REF_QUALIFIERS
+# define BOOST_NO_CXX11_FINAL
+# define BOOST_NO_CXX11_THREAD_LOCAL
+
+// C++ 14:
+#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
+# define BOOST_NO_CXX14_AGGREGATE_NSDMI
+#endif
+#if !defined(__cpp_binary_literals) || (__cpp_binary_literals < 201304)
+# define BOOST_NO_CXX14_BINARY_LITERALS
+#endif
+#if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
+# define BOOST_NO_CXX14_CONSTEXPR
+#endif
+#if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304)
+# define BOOST_NO_CXX14_DECLTYPE_AUTO
+#endif
+#if (__cplusplus < 201304) // There's no SD6 check for this....
+# define BOOST_NO_CXX14_DIGIT_SEPARATORS
+#endif
+#if !defined(__cpp_generic_lambdas) || (__cpp_generic_lambdas < 201304)
+# define BOOST_NO_CXX14_GENERIC_LAMBDAS
+#endif
+#if !defined(__cpp_init_captures) || (__cpp_init_captures < 201304)
+# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
+#endif
+#if !defined(__cpp_return_type_deduction) || (__cpp_return_type_deduction < 201304)
+# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
+#endif
+#if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+#endif
+#endif
diff --git a/thirdparty/linux/include/boost/config/compiler/pgi.hpp b/thirdparty/linux/include/boost/config/compiler/pgi.hpp
new file mode 100644
index 0000000..fa2d5e4
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/pgi.hpp
@@ -0,0 +1,156 @@
+// (C) Copyright Noel Belcourt 2007.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// PGI C++ compiler setup:
+
+#define BOOST_COMPILER_VERSION __PGIC__##__PGIC_MINOR__
+#define BOOST_COMPILER "PGI compiler version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
+
+//
+// Threading support:
+// Turn this on unconditionally here, it will get turned off again later
+// if no threading API is detected.
+//
+
+#if __PGIC__ >= 11
+
+// options requested by configure --enable-test
+#define BOOST_HAS_PTHREADS
+#define BOOST_HAS_THREADS
+#define BOOST_HAS_PTHREAD_YIELD
+#define BOOST_HAS_NRVO
+#define BOOST_HAS_LONG_LONG
+
+// options --enable-test wants undefined
+#undef BOOST_NO_STDC_NAMESPACE
+#undef BOOST_NO_EXCEPTION_STD_NAMESPACE
+#undef BOOST_DEDUCED_TYPENAME
+
+#define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
+#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+
+#elif __PGIC__ >= 10
+
+// options requested by configure --enable-test
+#define BOOST_HAS_THREADS
+#define BOOST_HAS_NRVO
+#define BOOST_HAS_LONG_LONG
+#if defined(linux) || defined(__linux) || defined(__linux__)
+# define BOOST_HAS_STDINT_H
+#endif
+
+// options --enable-test wants undefined
+#undef BOOST_NO_STDC_NAMESPACE
+#undef BOOST_NO_EXCEPTION_STD_NAMESPACE
+#undef BOOST_DEDUCED_TYPENAME
+
+#elif __PGIC__ >= 7
+
+#define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
+#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+#define BOOST_NO_SWPRINTF
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+
+#else
+
+# error "Pgi compiler not configured - please reconfigure"
+
+#endif
+//
+// C++0x features
+//
+// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
+//
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_NUMERIC_LIMITS
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_SCOPED_ENUMS
+#define BOOST_NO_SFINAE_EXPR
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_SWPRINTF
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_VARIADIC_MACROS
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+
+#define BOOST_NO_CXX11_HDR_UNORDERED_SET
+#define BOOST_NO_CXX11_HDR_UNORDERED_MAP
+#define BOOST_NO_CXX11_HDR_TYPEINDEX
+#define BOOST_NO_CXX11_HDR_TYPE_TRAITS
+#define BOOST_NO_CXX11_HDR_TUPLE
+#define BOOST_NO_CXX11_HDR_THREAD
+#define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
+#define BOOST_NO_CXX11_HDR_REGEX
+#define BOOST_NO_CXX11_HDR_RATIO
+#define BOOST_NO_CXX11_HDR_RANDOM
+#define BOOST_NO_CXX11_HDR_MUTEX
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_HDR_FUTURE
+#define BOOST_NO_CXX11_HDR_FORWARD_LIST
+#define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
+#define BOOST_NO_CXX11_HDR_CODECVT
+#define BOOST_NO_CXX11_HDR_CHRONO
+#define BOOST_NO_CXX11_HDR_ARRAY
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#define BOOST_NO_CXX11_ALIGNAS
+#define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+#define BOOST_NO_CXX11_INLINE_NAMESPACES
+#define BOOST_NO_CXX11_REF_QUALIFIERS
+#define BOOST_NO_CXX11_FINAL
+#define BOOST_NO_CXX11_THREAD_LOCAL
+
+// C++ 14:
+#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
+# define BOOST_NO_CXX14_AGGREGATE_NSDMI
+#endif
+#if !defined(__cpp_binary_literals) || (__cpp_binary_literals < 201304)
+# define BOOST_NO_CXX14_BINARY_LITERALS
+#endif
+#if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
+# define BOOST_NO_CXX14_CONSTEXPR
+#endif
+#if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304)
+# define BOOST_NO_CXX14_DECLTYPE_AUTO
+#endif
+#if (__cplusplus < 201304) // There's no SD6 check for this....
+# define BOOST_NO_CXX14_DIGIT_SEPARATORS
+#endif
+#if !defined(__cpp_generic_lambdas) || (__cpp_generic_lambdas < 201304)
+# define BOOST_NO_CXX14_GENERIC_LAMBDAS
+#endif
+#if !defined(__cpp_init_captures) || (__cpp_init_captures < 201304)
+# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
+#endif
+#if !defined(__cpp_return_type_deduction) || (__cpp_return_type_deduction < 201304)
+# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
+#endif
+#if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+#endif
+//
+// version check:
+// probably nothing to do here?
+
diff --git a/thirdparty/linux/include/boost/config/compiler/sgi_mipspro.hpp b/thirdparty/linux/include/boost/config/compiler/sgi_mipspro.hpp
new file mode 100644
index 0000000..54433c9
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/sgi_mipspro.hpp
@@ -0,0 +1,29 @@
+// (C) Copyright John Maddock 2001 - 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// SGI C++ compiler setup:
+
+#define BOOST_COMPILER "SGI Irix compiler version " BOOST_STRINGIZE(_COMPILER_VERSION)
+
+#include
+
+//
+// Threading support:
+// Turn this on unconditionally here, it will get turned off again later
+// if no threading API is detected.
+//
+#define BOOST_HAS_THREADS
+#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+
+#undef BOOST_NO_SWPRINTF
+#undef BOOST_DEDUCED_TYPENAME
+
+//
+// version check:
+// probably nothing to do here?
+
+
diff --git a/thirdparty/linux/include/boost/config/compiler/sunpro_cc.hpp b/thirdparty/linux/include/boost/config/compiler/sunpro_cc.hpp
new file mode 100644
index 0000000..ac259fc
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/sunpro_cc.hpp
@@ -0,0 +1,198 @@
+// (C) Copyright John Maddock 2001.
+// (C) Copyright Jens Maurer 2001 - 2003.
+// (C) Copyright Peter Dimov 2002.
+// (C) Copyright Aleksey Gurtovoy 2002 - 2003.
+// (C) Copyright David Abrahams 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Sun C++ compiler setup:
+
+# if __SUNPRO_CC <= 0x500
+# define BOOST_NO_MEMBER_TEMPLATES
+# define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+# endif
+
+# if (__SUNPRO_CC <= 0x520)
+ //
+ // Sunpro 5.2 and earler:
+ //
+ // although sunpro 5.2 supports the syntax for
+ // inline initialization it often gets the value
+ // wrong, especially where the value is computed
+ // from other constants (J Maddock 6th May 2001)
+# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+
+ // Although sunpro 5.2 supports the syntax for
+ // partial specialization, it often seems to
+ // bind to the wrong specialization. Better
+ // to disable it until suppport becomes more stable
+ // (J Maddock 6th May 2001).
+# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+# endif
+
+# if (__SUNPRO_CC <= 0x530)
+ // Requesting debug info (-g) with Boost.Python results
+ // in an internal compiler error for "static const"
+ // initialized in-class.
+ // >> Assertion: (../links/dbg_cstabs.cc, line 611)
+ // while processing ../test.cpp at line 0.
+ // (Jens Maurer according to Gottfried Ganssauge 04 Mar 2002)
+# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+
+ // SunPro 5.3 has better support for partial specialization,
+ // but breaks when compiling std::less >
+ // (Jens Maurer 4 Nov 2001).
+
+ // std::less specialization fixed as reported by George
+ // Heintzelman; partial specialization re-enabled
+ // (Peter Dimov 17 Jan 2002)
+
+//# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ // integral constant expressions with 64 bit numbers fail
+# define BOOST_NO_INTEGRAL_INT64_T
+# endif
+
+# if (__SUNPRO_CC < 0x570)
+# define BOOST_NO_TEMPLATE_TEMPLATES
+ // see http://lists.boost.org/MailArchives/boost/msg47184.php
+ // and http://lists.boost.org/MailArchives/boost/msg47220.php
+# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+# define BOOST_NO_SFINAE
+# define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS
+# endif
+# if (__SUNPRO_CC <= 0x580)
+# define BOOST_NO_IS_ABSTRACT
+# endif
+
+# if (__SUNPRO_CC <= 0x5100)
+ // Sun 5.10 may not correctly value-initialize objects of
+ // some user defined types, as was reported in April 2010
+ // (CR 6947016), and confirmed by Steve Clamage.
+ // (Niels Dekker, LKEB, May 2010).
+# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
+# endif
+
+//
+// Dynamic shared object (DSO) and dynamic-link library (DLL) support
+//
+#if __SUNPRO_CC > 0x500
+# define BOOST_SYMBOL_EXPORT __global
+# define BOOST_SYMBOL_IMPORT __global
+# define BOOST_SYMBOL_VISIBLE __global
+#endif
+
+#if (__SUNPRO_CC < 0x5130)
+// C++03 features in 12.4:
+#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+#define BOOST_NO_SFINAE_EXPR
+#define BOOST_NO_ADL_BARRIER
+#define BOOST_NO_CXX11_VARIADIC_MACROS
+#endif
+
+#if (__SUNPRO_CC < 0x5130) || (__cplusplus < 201100)
+// C++11 only featuires in 12.4:
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_SCOPED_ENUMS
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_ALIGNAS
+#define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+#define BOOST_NO_CXX11_INLINE_NAMESPACES
+#define BOOST_NO_CXX11_FINAL
+#endif
+
+#if (__SUNPRO_CC < 0x5140) || (__cplusplus < 201103)
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#define BOOST_NO_CXX11_REF_QUALIFIERS
+#define BOOST_NO_CXX11_THREAD_LOCAL
+#endif
+
+#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
+//
+// C++0x features
+//
+# define BOOST_HAS_LONG_LONG
+
+
+// C++ 14:
+#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
+# define BOOST_NO_CXX14_AGGREGATE_NSDMI
+#endif
+#if !defined(__cpp_binary_literals) || (__cpp_binary_literals < 201304)
+# define BOOST_NO_CXX14_BINARY_LITERALS
+#endif
+#if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
+# define BOOST_NO_CXX14_CONSTEXPR
+#endif
+#if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304) || (__cplusplus < 201402L)
+# define BOOST_NO_CXX14_DECLTYPE_AUTO
+#endif
+#if (__cplusplus < 201304) // There's no SD6 check for this....
+# define BOOST_NO_CXX14_DIGIT_SEPARATORS
+#endif
+#if !defined(__cpp_generic_lambdas) || (__cpp_generic_lambdas < 201304)
+# define BOOST_NO_CXX14_GENERIC_LAMBDAS
+#endif
+#if !defined(__cpp_init_captures) || (__cpp_init_captures < 201304)
+# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
+#endif
+#if !defined(__cpp_return_type_deduction) || (__cpp_return_type_deduction < 201304)
+# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
+#endif
+#if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+#endif
+
+// Turn on threading support for Solaris 12.
+// Ticket #11972
+#if (__SUNPRO_CC >= 0x5140) && defined(__SunOS_5_12) && !defined(BOOST_HAS_THREADS)
+# define BOOST_HAS_THREADS
+#endif
+
+//
+// Version
+//
+
+#define BOOST_COMPILER "Sun compiler version " BOOST_STRINGIZE(__SUNPRO_CC)
+
+//
+// versions check:
+// we don't support sunpro prior to version 4:
+#if __SUNPRO_CC < 0x400
+#error "Compiler not supported or configured - please reconfigure"
+#endif
+//
+// last known and checked version is 0x590:
+#if (__SUNPRO_CC > 0x590)
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown compiler version - please run the configure tests and report the results"
+# endif
+#endif
diff --git a/thirdparty/linux/include/boost/config/compiler/vacpp.hpp b/thirdparty/linux/include/boost/config/compiler/vacpp.hpp
new file mode 100644
index 0000000..3fbed9f
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/vacpp.hpp
@@ -0,0 +1,163 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Toon Knapen 2001 - 2003.
+// (C) Copyright Lie-Quan Lee 2001.
+// (C) Copyright Markus Schoepflin 2002 - 2003.
+// (C) Copyright Beman Dawes 2002 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Visual Age (IBM) C++ compiler setup:
+
+#if __IBMCPP__ <= 501
+# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+# define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
+#endif
+
+#if (__IBMCPP__ <= 502)
+// Actually the compiler supports inclass member initialization but it
+// requires a definition for the class member and it doesn't recognize
+// it as an integral constant expression when used as a template argument.
+# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+# define BOOST_NO_INTEGRAL_INT64_T
+# define BOOST_NO_MEMBER_TEMPLATE_KEYWORD
+#endif
+
+#if (__IBMCPP__ <= 600) || !defined(BOOST_STRICT_CONFIG)
+# define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
+#endif
+
+#if (__IBMCPP__ <= 1110)
+// XL C++ V11.1 and earlier versions may not always value-initialize
+// a temporary object T(), when T is a non-POD aggregate class type.
+// Michael Wong (IBM Canada Ltd) has confirmed this issue and gave it
+// high priority. -- Niels Dekker (LKEB), May 2010.
+# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
+#endif
+
+//
+// On AIX thread support seems to be indicated by _THREAD_SAFE:
+//
+#ifdef _THREAD_SAFE
+# define BOOST_HAS_THREADS
+#endif
+
+#define BOOST_COMPILER "IBM Visual Age version " BOOST_STRINGIZE(__IBMCPP__)
+
+//
+// versions check:
+// we don't support Visual age prior to version 5:
+#if __IBMCPP__ < 500
+#error "Compiler not supported or configured - please reconfigure"
+#endif
+//
+// last known and checked version is 1210:
+#if (__IBMCPP__ > 1210)
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown compiler version - please run the configure tests and report the results"
+# endif
+#endif
+
+// Some versions of the compiler have issues with default arguments on partial specializations
+#if __IBMCPP__ <= 1010
+#define BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
+#endif
+
+//
+// C++0x features
+//
+// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
+//
+#if ! __IBMCPP_AUTO_TYPEDEDUCTION
+# define BOOST_NO_CXX11_AUTO_DECLARATIONS
+# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#endif
+#if ! __IBMCPP_UTF_LITERAL__
+# define BOOST_NO_CXX11_CHAR16_T
+# define BOOST_NO_CXX11_CHAR32_T
+#endif
+#if ! __IBMCPP_CONSTEXPR
+# define BOOST_NO_CXX11_CONSTEXPR
+#endif
+#if ! __IBMCPP_DECLTYPE
+# define BOOST_NO_CXX11_DECLTYPE
+#else
+# define BOOST_HAS_DECLTYPE
+#endif
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#if ! __IBMCPP_EXPLICIT_CONVERSION_OPERATORS
+# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#endif
+#if ! __IBMCPP_EXTERN_TEMPLATE
+# define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#endif
+#if ! __IBMCPP_VARIADIC_TEMPLATES
+// not enabled separately at this time
+# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#endif
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#if ! __IBMCPP_RVALUE_REFERENCES
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
+#endif
+#if ! __IBMCPP_SCOPED_ENUM
+# define BOOST_NO_CXX11_SCOPED_ENUMS
+#endif
+#define BOOST_NO_SFINAE_EXPR
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#if ! __IBMCPP_STATIC_ASSERT
+# define BOOST_NO_CXX11_STATIC_ASSERT
+#endif
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#if ! __IBMCPP_VARIADIC_TEMPLATES
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#endif
+#if ! __C99_MACRO_WITH_VA_ARGS
+# define BOOST_NO_CXX11_VARIADIC_MACROS
+#endif
+#define BOOST_NO_CXX11_ALIGNAS
+#define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+#define BOOST_NO_CXX11_INLINE_NAMESPACES
+#define BOOST_NO_CXX11_REF_QUALIFIERS
+#define BOOST_NO_CXX11_FINAL
+#define BOOST_NO_CXX11_THREAD_LOCAL
+
+// C++ 14:
+#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
+# define BOOST_NO_CXX14_AGGREGATE_NSDMI
+#endif
+#if !defined(__cpp_binary_literals) || (__cpp_binary_literals < 201304)
+# define BOOST_NO_CXX14_BINARY_LITERALS
+#endif
+#if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
+# define BOOST_NO_CXX14_CONSTEXPR
+#endif
+#if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304)
+# define BOOST_NO_CXX14_DECLTYPE_AUTO
+#endif
+#if (__cplusplus < 201304) // There's no SD6 check for this....
+# define BOOST_NO_CXX14_DIGIT_SEPARATORS
+#endif
+#if !defined(__cpp_generic_lambdas) || (__cpp_generic_lambdas < 201304)
+# define BOOST_NO_CXX14_GENERIC_LAMBDAS
+#endif
+#if !defined(__cpp_init_captures) || (__cpp_init_captures < 201304)
+# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
+#endif
+#if !defined(__cpp_return_type_deduction) || (__cpp_return_type_deduction < 201304)
+# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
+#endif
+#if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+#endif
diff --git a/thirdparty/linux/include/boost/config/compiler/visualc.hpp b/thirdparty/linux/include/boost/config/compiler/visualc.hpp
new file mode 100644
index 0000000..cdbc9b6
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/visualc.hpp
@@ -0,0 +1,303 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Darin Adler 2001 - 2002.
+// (C) Copyright Peter Dimov 2001.
+// (C) Copyright Aleksey Gurtovoy 2002.
+// (C) Copyright David Abrahams 2002 - 2003.
+// (C) Copyright Beman Dawes 2002 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+//
+// Microsoft Visual C++ compiler setup:
+//
+// We need to be careful with the checks in this file, as contrary
+// to popular belief there are versions with _MSC_VER with the final
+// digit non-zero (mainly the MIPS cross compiler).
+//
+// So we either test _MSC_VER >= XXXX or else _MSC_VER < XXXX.
+// No other comparisons (==, >, or <=) are safe.
+//
+
+#define BOOST_MSVC _MSC_VER
+
+//
+// Helper macro BOOST_MSVC_FULL_VER for use in Boost code:
+//
+#if _MSC_FULL_VER > 100000000
+# define BOOST_MSVC_FULL_VER _MSC_FULL_VER
+#else
+# define BOOST_MSVC_FULL_VER (_MSC_FULL_VER * 10)
+#endif
+
+// Attempt to suppress VC6 warnings about the length of decorated names (obsolete):
+#pragma warning( disable : 4503 ) // warning: decorated name length exceeded
+
+#define BOOST_HAS_PRAGMA_ONCE
+
+//
+// versions check:
+// we don't support Visual C++ prior to version 7.1:
+#if _MSC_VER < 1310
+# error "Compiler not supported or configured - please reconfigure"
+#endif
+
+#if _MSC_FULL_VER < 180020827
+# define BOOST_NO_FENV_H
+#endif
+
+#if _MSC_VER < 1400
+// although a conforming signature for swprint exists in VC7.1
+// it appears not to actually work:
+# define BOOST_NO_SWPRINTF
+// Our extern template tests also fail for this compiler:
+# define BOOST_NO_CXX11_EXTERN_TEMPLATE
+// Variadic macros do not exist for VC7.1 and lower
+# define BOOST_NO_CXX11_VARIADIC_MACROS
+# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#endif
+
+#if _MSC_VER < 1500 // 140X == VC++ 8.0
+# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+#endif
+
+#if _MSC_VER < 1600 // 150X == VC++ 9.0
+ // A bug in VC9:
+# define BOOST_NO_ADL_BARRIER
+#endif
+
+
+#ifndef _NATIVE_WCHAR_T_DEFINED
+# define BOOST_NO_INTRINSIC_WCHAR_T
+#endif
+
+//
+// check for exception handling support:
+#if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS)
+# define BOOST_NO_EXCEPTIONS
+#endif
+
+//
+// __int64 support:
+//
+#define BOOST_HAS_MS_INT64
+#if defined(_MSC_EXTENSIONS) || (_MSC_VER >= 1400)
+# define BOOST_HAS_LONG_LONG
+#else
+# define BOOST_NO_LONG_LONG
+#endif
+#if (_MSC_VER >= 1400) && !defined(_DEBUG)
+# define BOOST_HAS_NRVO
+#endif
+#if _MSC_VER >= 1600 // 160X == VC++ 10.0
+# define BOOST_HAS_PRAGMA_DETECT_MISMATCH
+#endif
+//
+// disable Win32 API's if compiler extensions are
+// turned off:
+//
+#if !defined(_MSC_EXTENSIONS) && !defined(BOOST_DISABLE_WIN32)
+# define BOOST_DISABLE_WIN32
+#endif
+#if !defined(_CPPRTTI) && !defined(BOOST_NO_RTTI)
+# define BOOST_NO_RTTI
+#endif
+
+//
+// TR1 features:
+//
+#if _MSC_VER >= 1700
+// # define BOOST_HAS_TR1_HASH // don't know if this is true yet.
+// # define BOOST_HAS_TR1_TYPE_TRAITS // don't know if this is true yet.
+# define BOOST_HAS_TR1_UNORDERED_MAP
+# define BOOST_HAS_TR1_UNORDERED_SET
+#endif
+
+//
+// C++0x features
+//
+// See above for BOOST_NO_LONG_LONG
+
+// C++ features supported by VC++ 10 (aka 2010)
+//
+#if _MSC_VER < 1600
+# define BOOST_NO_CXX11_AUTO_DECLARATIONS
+# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+# define BOOST_NO_CXX11_LAMBDAS
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
+# define BOOST_NO_CXX11_STATIC_ASSERT
+# define BOOST_NO_CXX11_NULLPTR
+# define BOOST_NO_CXX11_DECLTYPE
+#endif // _MSC_VER < 1600
+
+#if _MSC_VER >= 1600
+# define BOOST_HAS_STDINT_H
+#endif
+
+// C++11 features supported by VC++ 11 (aka 2012)
+//
+#if _MSC_VER < 1700
+# define BOOST_NO_CXX11_FINAL
+# define BOOST_NO_CXX11_RANGE_BASED_FOR
+# define BOOST_NO_CXX11_SCOPED_ENUMS
+#endif // _MSC_VER < 1700
+
+// C++11 features supported by VC++ 12 (aka 2013).
+//
+#if _MSC_FULL_VER < 180020827
+# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+# define BOOST_NO_CXX11_DELETED_FUNCTIONS
+# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+# define BOOST_NO_CXX11_RAW_LITERALS
+# define BOOST_NO_CXX11_TEMPLATE_ALIASES
+# define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+# define BOOST_NO_CXX11_DECLTYPE_N3276
+#endif
+
+#if _MSC_FULL_VER >= 180020827
+#define BOOST_HAS_EXPM1
+#define BOOST_HAS_LOG1P
+#endif
+
+// C++11 features supported by VC++ 14 (aka 2015)
+//
+#if (_MSC_FULL_VER < 190023026)
+# define BOOST_NO_CXX11_NOEXCEPT
+# define BOOST_NO_CXX11_REF_QUALIFIERS
+# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+# define BOOST_NO_CXX11_ALIGNAS
+# define BOOST_NO_CXX11_INLINE_NAMESPACES
+# define BOOST_NO_CXX11_CHAR16_T
+# define BOOST_NO_CXX11_CHAR32_T
+# define BOOST_NO_CXX11_UNICODE_LITERALS
+# define BOOST_NO_CXX14_DECLTYPE_AUTO
+# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
+# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
+# define BOOST_NO_CXX14_BINARY_LITERALS
+# define BOOST_NO_CXX14_GENERIC_LAMBDAS
+# define BOOST_NO_CXX14_DIGIT_SEPARATORS
+# define BOOST_NO_CXX11_THREAD_LOCAL
+#endif
+// C++11 features supported by VC++ 14 update 3 (aka 2015)
+//
+#if (_MSC_FULL_VER < 190024210)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+# define BOOST_NO_SFINAE_EXPR
+# define BOOST_NO_CXX11_CONSTEXPR
+#endif
+
+// C++14 features supported by VC++ 15 Preview 5
+//
+#if (_MSC_VER < 1910)
+# define BOOST_NO_CXX14_AGGREGATE_NSDMI
+# define BOOST_NO_CXX14_CONSTEXPR
+#endif
+
+// MSVC including version 14 has not yet completely
+// implemented value-initialization, as is reported:
+// "VC++ does not value-initialize members of derived classes without
+// user-declared constructor", reported in 2009 by Sylvester Hesp:
+// https://connect.microsoft.com/VisualStudio/feedback/details/484295
+// "Presence of copy constructor breaks member class initialization",
+// reported in 2009 by Alex Vakulenko:
+// https://connect.microsoft.com/VisualStudio/feedback/details/499606
+// "Value-initialization in new-expression", reported in 2005 by
+// Pavel Kuznetsov (MetaCommunications Engineering):
+// https://connect.microsoft.com/VisualStudio/feedback/details/100744
+// Reported again by John Maddock in 2015 for VC14:
+// https://connect.microsoft.com/VisualStudio/feedback/details/1582233/c-subobjects-still-not-value-initialized-correctly
+// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
+// (Niels Dekker, LKEB, May 2010)
+#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
+//
+// C++ 11:
+//
+#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+
+//
+// prefix and suffix headers:
+//
+#ifndef BOOST_ABI_PREFIX
+# define BOOST_ABI_PREFIX "boost/config/abi/msvc_prefix.hpp"
+#endif
+#ifndef BOOST_ABI_SUFFIX
+# define BOOST_ABI_SUFFIX "boost/config/abi/msvc_suffix.hpp"
+#endif
+
+#ifndef BOOST_COMPILER
+// TODO:
+// these things are mostly bogus. 1200 means version 12.0 of the compiler. The
+// artificial versions assigned to them only refer to the versions of some IDE
+// these compilers have been shipped with, and even that is not all of it. Some
+// were shipped with freely downloadable SDKs, others as crosscompilers in eVC.
+// IOW, you can't use these 'versions' in any sensible way. Sorry.
+# if defined(UNDER_CE)
+# if _MSC_VER < 1400
+ // Note: I'm not aware of any CE compiler with version 13xx
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown EVC++ compiler version - please run the configure tests and report the results"
+# else
+# pragma message("Unknown EVC++ compiler version - please run the configure tests and report the results")
+# endif
+# elif _MSC_VER < 1500
+# define BOOST_COMPILER_VERSION evc8
+# elif _MSC_VER < 1600
+# define BOOST_COMPILER_VERSION evc9
+# elif _MSC_VER < 1700
+# define BOOST_COMPILER_VERSION evc10
+# elif _MSC_VER < 1800
+# define BOOST_COMPILER_VERSION evc11
+# elif _MSC_VER < 1900
+# define BOOST_COMPILER_VERSION evc12
+# elif _MSC_VER < 2000
+# define BOOST_COMPILER_VERSION evc14
+# else
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown EVC++ compiler version - please run the configure tests and report the results"
+# else
+# pragma message("Unknown EVC++ compiler version - please run the configure tests and report the results")
+# endif
+# endif
+# else
+# if _MSC_VER < 1310
+ // Note: Versions up to 7.0 aren't supported.
+# define BOOST_COMPILER_VERSION 5.0
+# elif _MSC_VER < 1300
+# define BOOST_COMPILER_VERSION 6.0
+# elif _MSC_VER < 1310
+# define BOOST_COMPILER_VERSION 7.0
+# elif _MSC_VER < 1400
+# define BOOST_COMPILER_VERSION 7.1
+# elif _MSC_VER < 1500
+# define BOOST_COMPILER_VERSION 8.0
+# elif _MSC_VER < 1600
+# define BOOST_COMPILER_VERSION 9.0
+# elif _MSC_VER < 1700
+# define BOOST_COMPILER_VERSION 10.0
+# elif _MSC_VER < 1800
+# define BOOST_COMPILER_VERSION 11.0
+# elif _MSC_VER < 1900
+# define BOOST_COMPILER_VERSION 12.0
+# elif _MSC_VER < 2000
+# define BOOST_COMPILER_VERSION 14.0
+# else
+# define BOOST_COMPILER_VERSION _MSC_VER
+# endif
+# endif
+
+# define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
+#endif
+
+//
+// last known and checked version is 19.10.24629 (VC++ 2017 RC):
+#if (_MSC_VER > 1910)
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown compiler version - please run the configure tests and report the results"
+# else
+# pragma message("Unknown compiler version - please run the configure tests and report the results")
+# endif
+#endif
diff --git a/thirdparty/linux/include/boost/config/compiler/xlcpp.hpp b/thirdparty/linux/include/boost/config/compiler/xlcpp.hpp
new file mode 100644
index 0000000..2aaafc3
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/compiler/xlcpp.hpp
@@ -0,0 +1,262 @@
+// (C) Copyright Douglas Gregor 2010
+//
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// compiler setup for IBM XL C/C++ for Linux (Little Endian) based on clang.
+
+#define BOOST_HAS_PRAGMA_ONCE
+
+// Detecting `-fms-extension` compiler flag assuming that _MSC_VER defined when that flag is used.
+#if defined (_MSC_VER) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4))
+# define BOOST_HAS_PRAGMA_DETECT_MISMATCH
+#endif
+
+// When compiling with clang before __has_extension was defined,
+// even if one writes 'defined(__has_extension) && __has_extension(xxx)',
+// clang reports a compiler error. So the only workaround found is:
+
+#ifndef __has_extension
+#define __has_extension __has_feature
+#endif
+
+#if !__has_feature(cxx_exceptions) && !defined(BOOST_NO_EXCEPTIONS)
+# define BOOST_NO_EXCEPTIONS
+#endif
+
+#if !__has_feature(cxx_rtti) && !defined(BOOST_NO_RTTI)
+# define BOOST_NO_RTTI
+#endif
+
+#if !__has_feature(cxx_rtti) && !defined(BOOST_NO_TYPEID)
+# define BOOST_NO_TYPEID
+#endif
+
+#if defined(__int64) && !defined(__GNUC__)
+# define BOOST_HAS_MS_INT64
+#endif
+
+#define BOOST_HAS_NRVO
+
+// Branch prediction hints
+#if defined(__has_builtin)
+#if __has_builtin(__builtin_expect)
+#define BOOST_LIKELY(x) __builtin_expect(x, 1)
+#define BOOST_UNLIKELY(x) __builtin_expect(x, 0)
+#endif
+#endif
+
+// Clang supports "long long" in all compilation modes.
+#define BOOST_HAS_LONG_LONG
+
+//
+// Dynamic shared object (DSO) and dynamic-link library (DLL) support
+//
+#if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
+# define BOOST_SYMBOL_EXPORT __attribute__((__visibility__("default")))
+# define BOOST_SYMBOL_IMPORT
+# define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default")))
+#endif
+
+//
+// The BOOST_FALLTHROUGH macro can be used to annotate implicit fall-through
+// between switch labels.
+//
+#if __cplusplus >= 201103L && defined(__has_warning)
+# if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
+# define BOOST_FALLTHROUGH [[clang::fallthrough]]
+# endif
+#endif
+
+#if !__has_feature(cxx_auto_type)
+# define BOOST_NO_CXX11_AUTO_DECLARATIONS
+# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#endif
+
+//
+// Currently clang on Windows using VC++ RTL does not support C++11's char16_t or char32_t
+//
+#if defined(_MSC_VER) || !(defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
+# define BOOST_NO_CXX11_CHAR16_T
+# define BOOST_NO_CXX11_CHAR32_T
+#endif
+
+#if !__has_feature(cxx_constexpr)
+# define BOOST_NO_CXX11_CONSTEXPR
+#endif
+
+#if !__has_feature(cxx_decltype)
+# define BOOST_NO_CXX11_DECLTYPE
+#endif
+
+#if !__has_feature(cxx_decltype_incomplete_return_types)
+# define BOOST_NO_CXX11_DECLTYPE_N3276
+#endif
+
+#if !__has_feature(cxx_defaulted_functions)
+# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#endif
+
+#if !__has_feature(cxx_deleted_functions)
+# define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#endif
+
+#if !__has_feature(cxx_explicit_conversions)
+# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#endif
+
+#if !__has_feature(cxx_default_function_template_args)
+# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#endif
+
+#if !__has_feature(cxx_generalized_initializers)
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#endif
+
+#if !__has_feature(cxx_lambdas)
+# define BOOST_NO_CXX11_LAMBDAS
+#endif
+
+#if !__has_feature(cxx_local_type_template_args)
+# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#endif
+
+#if !__has_feature(cxx_noexcept)
+# define BOOST_NO_CXX11_NOEXCEPT
+#endif
+
+#if !__has_feature(cxx_nullptr)
+# define BOOST_NO_CXX11_NULLPTR
+#endif
+
+#if !__has_feature(cxx_range_for)
+# define BOOST_NO_CXX11_RANGE_BASED_FOR
+#endif
+
+#if !__has_feature(cxx_raw_string_literals)
+# define BOOST_NO_CXX11_RAW_LITERALS
+#endif
+
+#if !__has_feature(cxx_reference_qualified_functions)
+# define BOOST_NO_CXX11_REF_QUALIFIERS
+#endif
+
+#if !__has_feature(cxx_generalized_initializers)
+# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#endif
+
+#if !__has_feature(cxx_rvalue_references)
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
+#endif
+
+#if !__has_feature(cxx_strong_enums)
+# define BOOST_NO_CXX11_SCOPED_ENUMS
+#endif
+
+#if !__has_feature(cxx_static_assert)
+# define BOOST_NO_CXX11_STATIC_ASSERT
+#endif
+
+#if !__has_feature(cxx_alias_templates)
+# define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#endif
+
+#if !__has_feature(cxx_unicode_literals)
+# define BOOST_NO_CXX11_UNICODE_LITERALS
+#endif
+
+#if !__has_feature(cxx_variadic_templates)
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#endif
+
+#if !__has_feature(cxx_user_literals)
+# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#endif
+
+#if !__has_feature(cxx_alignas)
+# define BOOST_NO_CXX11_ALIGNAS
+#endif
+
+#if !__has_feature(cxx_trailing_return)
+# define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
+#endif
+
+#if !__has_feature(cxx_inline_namespaces)
+# define BOOST_NO_CXX11_INLINE_NAMESPACES
+#endif
+
+#if !__has_feature(cxx_override_control)
+# define BOOST_NO_CXX11_FINAL
+#endif
+
+#if !(__has_feature(__cxx_binary_literals__) || __has_extension(__cxx_binary_literals__))
+# define BOOST_NO_CXX14_BINARY_LITERALS
+#endif
+
+#if !__has_feature(__cxx_decltype_auto__)
+# define BOOST_NO_CXX14_DECLTYPE_AUTO
+#endif
+
+#if !__has_feature(__cxx_aggregate_nsdmi__)
+# define BOOST_NO_CXX14_AGGREGATE_NSDMI
+#endif
+
+#if !__has_feature(__cxx_init_captures__)
+# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
+#endif
+
+#if !__has_feature(__cxx_generic_lambdas__)
+# define BOOST_NO_CXX14_GENERIC_LAMBDAS
+#endif
+
+// clang < 3.5 has a defect with dependent type, like following.
+//
+// template
+// constexpr typename enable_if >::type foo(T &)
+// { } // error: no return statement in constexpr function
+//
+// This issue also affects C++11 mode, but C++11 constexpr requires return stmt.
+// Therefore we don't care such case.
+//
+// Note that we can't check Clang version directly as the numbering system changes depending who's
+// creating the Clang release (see https://github.com/boostorg/config/pull/39#issuecomment-59927873)
+// so instead verify that we have a feature that was introduced at the same time as working C++14
+// constexpr (generic lambda's in this case):
+//
+#if !__has_feature(__cxx_generic_lambdas__) || !__has_feature(__cxx_relaxed_constexpr__)
+# define BOOST_NO_CXX14_CONSTEXPR
+#endif
+
+#if !__has_feature(__cxx_return_type_deduction__)
+# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
+#endif
+
+#if !__has_feature(__cxx_variable_templates__)
+# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
+#endif
+
+#if !__has_feature(cxx_thread_local)
+# define BOOST_NO_CXX11_THREAD_LOCAL
+#endif
+
+#if __cplusplus < 201400
+// All versions with __cplusplus above this value seem to support this:
+# define BOOST_NO_CXX14_DIGIT_SEPARATORS
+#endif
+
+
+// Unused attribute:
+#if defined(__GNUC__) && (__GNUC__ >= 4)
+# define BOOST_ATTRIBUTE_UNUSED __attribute__((unused))
+#endif
+
+#ifndef BOOST_COMPILER
+# define BOOST_COMPILER "Clang version " __clang_version__
+#endif
+
+// Macro used to identify the Clang compiler.
+#define BOOST_CLANG 1
+
diff --git a/thirdparty/linux/include/boost/config/no_tr1/cmath.hpp b/thirdparty/linux/include/boost/config/no_tr1/cmath.hpp
new file mode 100644
index 0000000..d8268d8
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/no_tr1/cmath.hpp
@@ -0,0 +1,28 @@
+// (C) Copyright John Maddock 2008.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// The aim of this header is just to include but to do
+// so in a way that does not result in recursive inclusion of
+// the Boost TR1 components if boost/tr1/tr1/cmath is in the
+// include search path. We have to do this to avoid circular
+// dependencies:
+//
+
+#ifndef BOOST_CONFIG_CMATH
+# define BOOST_CONFIG_CMATH
+
+# ifndef BOOST_TR1_NO_RECURSION
+# define BOOST_TR1_NO_RECURSION
+# define BOOST_CONFIG_NO_CMATH_RECURSION
+# endif
+
+# include
+
+# ifdef BOOST_CONFIG_NO_CMATH_RECURSION
+# undef BOOST_TR1_NO_RECURSION
+# undef BOOST_CONFIG_NO_CMATH_RECURSION
+# endif
+
+#endif
diff --git a/thirdparty/linux/include/boost/config/no_tr1/complex.hpp b/thirdparty/linux/include/boost/config/no_tr1/complex.hpp
new file mode 100644
index 0000000..ca20092
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/no_tr1/complex.hpp
@@ -0,0 +1,28 @@
+// (C) Copyright John Maddock 2005.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// The aim of this header is just to include but to do
+// so in a way that does not result in recursive inclusion of
+// the Boost TR1 components if boost/tr1/tr1/complex is in the
+// include search path. We have to do this to avoid circular
+// dependencies:
+//
+
+#ifndef BOOST_CONFIG_COMPLEX
+# define BOOST_CONFIG_COMPLEX
+
+# ifndef BOOST_TR1_NO_RECURSION
+# define BOOST_TR1_NO_RECURSION
+# define BOOST_CONFIG_NO_COMPLEX_RECURSION
+# endif
+
+# include
+
+# ifdef BOOST_CONFIG_NO_COMPLEX_RECURSION
+# undef BOOST_TR1_NO_RECURSION
+# undef BOOST_CONFIG_NO_COMPLEX_RECURSION
+# endif
+
+#endif
diff --git a/thirdparty/linux/include/boost/config/no_tr1/functional.hpp b/thirdparty/linux/include/boost/config/no_tr1/functional.hpp
new file mode 100644
index 0000000..e395efc
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/no_tr1/functional.hpp
@@ -0,0 +1,28 @@
+// (C) Copyright John Maddock 2005.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// The aim of this header is just to include but to do
+// so in a way that does not result in recursive inclusion of
+// the Boost TR1 components if boost/tr1/tr1/functional is in the
+// include search path. We have to do this to avoid circular
+// dependencies:
+//
+
+#ifndef BOOST_CONFIG_FUNCTIONAL
+# define BOOST_CONFIG_FUNCTIONAL
+
+# ifndef BOOST_TR1_NO_RECURSION
+# define BOOST_TR1_NO_RECURSION
+# define BOOST_CONFIG_NO_FUNCTIONAL_RECURSION
+# endif
+
+# include
+
+# ifdef BOOST_CONFIG_NO_FUNCTIONAL_RECURSION
+# undef BOOST_TR1_NO_RECURSION
+# undef BOOST_CONFIG_NO_FUNCTIONAL_RECURSION
+# endif
+
+#endif
diff --git a/thirdparty/linux/include/boost/config/no_tr1/memory.hpp b/thirdparty/linux/include/boost/config/no_tr1/memory.hpp
new file mode 100644
index 0000000..2b5d208
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/no_tr1/memory.hpp
@@ -0,0 +1,28 @@
+// (C) Copyright John Maddock 2005.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// The aim of this header is just to include but to do
+// so in a way that does not result in recursive inclusion of
+// the Boost TR1 components if boost/tr1/tr1/memory is in the
+// include search path. We have to do this to avoid circular
+// dependencies:
+//
+
+#ifndef BOOST_CONFIG_MEMORY
+# define BOOST_CONFIG_MEMORY
+
+# ifndef BOOST_TR1_NO_RECURSION
+# define BOOST_TR1_NO_RECURSION
+# define BOOST_CONFIG_NO_MEMORY_RECURSION
+# endif
+
+# include
+
+# ifdef BOOST_CONFIG_NO_MEMORY_RECURSION
+# undef BOOST_TR1_NO_RECURSION
+# undef BOOST_CONFIG_NO_MEMORY_RECURSION
+# endif
+
+#endif
diff --git a/thirdparty/linux/include/boost/config/no_tr1/utility.hpp b/thirdparty/linux/include/boost/config/no_tr1/utility.hpp
new file mode 100644
index 0000000..dea8f11
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/no_tr1/utility.hpp
@@ -0,0 +1,28 @@
+// (C) Copyright John Maddock 2005.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// The aim of this header is just to include but to do
+// so in a way that does not result in recursive inclusion of
+// the Boost TR1 components if boost/tr1/tr1/utility is in the
+// include search path. We have to do this to avoid circular
+// dependencies:
+//
+
+#ifndef BOOST_CONFIG_UTILITY
+# define BOOST_CONFIG_UTILITY
+
+# ifndef BOOST_TR1_NO_RECURSION
+# define BOOST_TR1_NO_RECURSION
+# define BOOST_CONFIG_NO_UTILITY_RECURSION
+# endif
+
+# include
+
+# ifdef BOOST_CONFIG_NO_UTILITY_RECURSION
+# undef BOOST_TR1_NO_RECURSION
+# undef BOOST_CONFIG_NO_UTILITY_RECURSION
+# endif
+
+#endif
diff --git a/thirdparty/linux/include/boost/config/platform/aix.hpp b/thirdparty/linux/include/boost/config/platform/aix.hpp
new file mode 100644
index 0000000..894ef42
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/aix.hpp
@@ -0,0 +1,33 @@
+// (C) Copyright John Maddock 2001 - 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// IBM/Aix specific config options:
+
+#define BOOST_PLATFORM "IBM Aix"
+
+#define BOOST_HAS_UNISTD_H
+#define BOOST_HAS_NL_TYPES_H
+#define BOOST_HAS_NANOSLEEP
+#define BOOST_HAS_CLOCK_GETTIME
+
+// This needs support in "boost/cstdint.hpp" exactly like FreeBSD.
+// This platform has header named which includes all
+// the things needed.
+#define BOOST_HAS_STDINT_H
+
+// Threading API's:
+#define BOOST_HAS_PTHREADS
+#define BOOST_HAS_PTHREAD_DELAY_NP
+#define BOOST_HAS_SCHED_YIELD
+//#define BOOST_HAS_PTHREAD_YIELD
+
+// boilerplate code:
+#include
+
+
+
+
diff --git a/thirdparty/linux/include/boost/config/platform/amigaos.hpp b/thirdparty/linux/include/boost/config/platform/amigaos.hpp
new file mode 100644
index 0000000..34bcf41
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/amigaos.hpp
@@ -0,0 +1,15 @@
+// (C) Copyright John Maddock 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+#define BOOST_PLATFORM "AmigaOS"
+
+#define BOOST_DISABLE_THREADS
+#define BOOST_NO_CWCHAR
+#define BOOST_NO_STD_WSTRING
+#define BOOST_NO_INTRINSIC_WCHAR_T
+
+
diff --git a/thirdparty/linux/include/boost/config/platform/beos.hpp b/thirdparty/linux/include/boost/config/platform/beos.hpp
new file mode 100644
index 0000000..48c3d8d
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/beos.hpp
@@ -0,0 +1,26 @@
+// (C) Copyright John Maddock 2001.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// BeOS specific config options:
+
+#define BOOST_PLATFORM "BeOS"
+
+#define BOOST_NO_CWCHAR
+#define BOOST_NO_CWCTYPE
+#define BOOST_HAS_UNISTD_H
+
+#define BOOST_HAS_BETHREADS
+
+#ifndef BOOST_DISABLE_THREADS
+# define BOOST_HAS_THREADS
+#endif
+
+// boilerplate code:
+#include
+
+
+
diff --git a/thirdparty/linux/include/boost/config/platform/bsd.hpp b/thirdparty/linux/include/boost/config/platform/bsd.hpp
new file mode 100644
index 0000000..a014297
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/bsd.hpp
@@ -0,0 +1,86 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Darin Adler 2001.
+// (C) Copyright Douglas Gregor 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// generic BSD config options:
+
+#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
+#error "This platform is not BSD"
+#endif
+
+#ifdef __FreeBSD__
+#define BOOST_PLATFORM "FreeBSD " BOOST_STRINGIZE(__FreeBSD__)
+#elif defined(__NetBSD__)
+#define BOOST_PLATFORM "NetBSD " BOOST_STRINGIZE(__NetBSD__)
+#elif defined(__OpenBSD__)
+#define BOOST_PLATFORM "OpenBSD " BOOST_STRINGIZE(__OpenBSD__)
+#elif defined(__DragonFly__)
+#define BOOST_PLATFORM "DragonFly " BOOST_STRINGIZE(__DragonFly__)
+#endif
+
+//
+// is this the correct version check?
+// FreeBSD has but does not
+// advertise the fact in :
+//
+#if (defined(__FreeBSD__) && (__FreeBSD__ >= 3)) || defined(__DragonFly__)
+# define BOOST_HAS_NL_TYPES_H
+#endif
+
+//
+// FreeBSD 3.x has pthreads support, but defines _POSIX_THREADS in
+// and not in
+//
+#if (defined(__FreeBSD__) && (__FreeBSD__ <= 3))\
+ || defined(__OpenBSD__) || defined(__DragonFly__)
+# define BOOST_HAS_PTHREADS
+#endif
+
+//
+// No wide character support in the BSD header files:
+//
+#if defined(__NetBSD__)
+#define __NetBSD_GCC__ (__GNUC__ * 1000000 \
+ + __GNUC_MINOR__ * 1000 \
+ + __GNUC_PATCHLEVEL__)
+// XXX - the following is required until c++config.h
+// defines _GLIBCXX_HAVE_SWPRINTF and friends
+// or the preprocessor conditionals are removed
+// from the cwchar header.
+#define _GLIBCXX_HAVE_SWPRINTF 1
+#endif
+
+#if !((defined(__FreeBSD__) && (__FreeBSD__ >= 5)) \
+ || (defined(__NetBSD_GCC__) && (__NetBSD_GCC__ >= 2095003)) || defined(__DragonFly__))
+# define BOOST_NO_CWCHAR
+#endif
+//
+// The BSD has macros only, no functions:
+//
+#if !defined(__OpenBSD__) || defined(__DragonFly__)
+# define BOOST_NO_CTYPE_FUNCTIONS
+#endif
+
+//
+// thread API's not auto detected:
+//
+#define BOOST_HAS_SCHED_YIELD
+#define BOOST_HAS_NANOSLEEP
+#define BOOST_HAS_GETTIMEOFDAY
+#define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+#define BOOST_HAS_SIGACTION
+
+// boilerplate code:
+#define BOOST_HAS_UNISTD_H
+#include
+
+
+
+
+
+
diff --git a/thirdparty/linux/include/boost/config/platform/cloudabi.hpp b/thirdparty/linux/include/boost/config/platform/cloudabi.hpp
new file mode 100644
index 0000000..bed7b63
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/cloudabi.hpp
@@ -0,0 +1,18 @@
+// Copyright Nuxi, https://nuxi.nl/ 2015.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#define BOOST_PLATFORM "CloudABI"
+
+#define BOOST_HAS_DIRENT_H
+#define BOOST_HAS_STDINT_H
+#define BOOST_HAS_UNISTD_H
+
+#define BOOST_HAS_CLOCK_GETTIME
+#define BOOST_HAS_EXPM1
+#define BOOST_HAS_GETTIMEOFDAY
+#define BOOST_HAS_LOG1P
+#define BOOST_HAS_NANOSLEEP
+#define BOOST_HAS_PTHREADS
+#define BOOST_HAS_SCHED_YIELD
diff --git a/thirdparty/linux/include/boost/config/platform/cray.hpp b/thirdparty/linux/include/boost/config/platform/cray.hpp
new file mode 100644
index 0000000..5c476e4
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/cray.hpp
@@ -0,0 +1,18 @@
+// (C) Copyright John Maddock 2011.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+
+// See http://www.boost.org for most recent version.
+
+// SGI Irix specific config options:
+
+#define BOOST_PLATFORM "Cray"
+
+// boilerplate code:
+#define BOOST_HAS_UNISTD_H
+#include
+
+
+
diff --git a/thirdparty/linux/include/boost/config/platform/cygwin.hpp b/thirdparty/linux/include/boost/config/platform/cygwin.hpp
new file mode 100644
index 0000000..b7ef572
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/cygwin.hpp
@@ -0,0 +1,58 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// cygwin specific config options:
+
+#define BOOST_PLATFORM "Cygwin"
+#define BOOST_HAS_DIRENT_H
+#define BOOST_HAS_LOG1P
+#define BOOST_HAS_EXPM1
+
+//
+// Threading API:
+// See if we have POSIX threads, if we do use them, otherwise
+// revert to native Win threads.
+#define BOOST_HAS_UNISTD_H
+#include
+#if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(BOOST_HAS_WINTHREADS)
+# define BOOST_HAS_PTHREADS
+# define BOOST_HAS_SCHED_YIELD
+# define BOOST_HAS_GETTIMEOFDAY
+# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+# define BOOST_HAS_SIGACTION
+#else
+# if !defined(BOOST_HAS_WINTHREADS)
+# define BOOST_HAS_WINTHREADS
+# endif
+# define BOOST_HAS_FTIME
+#endif
+
+//
+// find out if we have a stdint.h, there should be a better way to do this:
+//
+#include
+#ifdef _STDINT_H
+#define BOOST_HAS_STDINT_H
+#endif
+
+/// Cygwin has no fenv.h
+#define BOOST_NO_FENV_H
+
+// boilerplate code:
+#include
+
+//
+// Cygwin lies about XSI conformance, there is no nl_types.h:
+//
+#ifdef BOOST_HAS_NL_TYPES_H
+# undef BOOST_HAS_NL_TYPES_H
+#endif
+
+
+
+
+
diff --git a/thirdparty/linux/include/boost/config/platform/haiku.hpp b/thirdparty/linux/include/boost/config/platform/haiku.hpp
new file mode 100644
index 0000000..750866c
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/haiku.hpp
@@ -0,0 +1,31 @@
+// (C) Copyright Jessica Hamilton 2014.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Haiku specific config options:
+
+#define BOOST_PLATFORM "Haiku"
+
+#define BOOST_HAS_UNISTD_H
+#define BOOST_HAS_STDINT_H
+
+#ifndef BOOST_DISABLE_THREADS
+# define BOOST_HAS_THREADS
+#endif
+
+#define BOOST_NO_CXX11_HDR_TYPE_TRAITS
+#define BOOST_NO_CXX11_ATOMIC_SMART_PTR
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_CXX11_VARIADIC_MACROS
+
+//
+// thread API's not auto detected:
+//
+#define BOOST_HAS_SCHED_YIELD
+#define BOOST_HAS_GETTIMEOFDAY
+
+// boilerplate code:
+#include
diff --git a/thirdparty/linux/include/boost/config/platform/hpux.hpp b/thirdparty/linux/include/boost/config/platform/hpux.hpp
new file mode 100644
index 0000000..19ce68e
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/hpux.hpp
@@ -0,0 +1,87 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2001 - 2003.
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Toon Knapen 2003.
+// (C) Copyright Boris Gubenko 2006 - 2007.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// hpux specific config options:
+
+#define BOOST_PLATFORM "HP-UX"
+
+// In principle, HP-UX has a nice under the name
+// However, it has the following problem:
+// Use of UINT32_C(0) results in "0u l" for the preprocessed source
+// (verifyable with gcc 2.95.3)
+#if (defined(__GNUC__) && (__GNUC__ >= 3)) || defined(__HP_aCC)
+# define BOOST_HAS_STDINT_H
+#endif
+
+#if !(defined(__HP_aCC) || !defined(_INCLUDE__STDC_A1_SOURCE))
+# define BOOST_NO_SWPRINTF
+#endif
+#if defined(__HP_aCC) && !defined(_INCLUDE__STDC_A1_SOURCE)
+# define BOOST_NO_CWCTYPE
+#endif
+
+#if defined(__GNUC__)
+# if (__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ < 3))
+ // GNU C on HP-UX does not support threads (checked up to gcc 3.3)
+# define BOOST_DISABLE_THREADS
+# elif !defined(BOOST_DISABLE_THREADS)
+ // threads supported from gcc-3.3 onwards:
+# define BOOST_HAS_THREADS
+# define BOOST_HAS_PTHREADS
+# endif
+#elif defined(__HP_aCC) && !defined(BOOST_DISABLE_THREADS)
+# define BOOST_HAS_PTHREADS
+#endif
+
+// boilerplate code:
+#define BOOST_HAS_UNISTD_H
+#include
+
+// the following are always available:
+#ifndef BOOST_HAS_GETTIMEOFDAY
+# define BOOST_HAS_GETTIMEOFDAY
+#endif
+#ifndef BOOST_HAS_SCHED_YIELD
+# define BOOST_HAS_SCHED_YIELD
+#endif
+#ifndef BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+#endif
+#ifndef BOOST_HAS_NL_TYPES_H
+# define BOOST_HAS_NL_TYPES_H
+#endif
+#ifndef BOOST_HAS_NANOSLEEP
+# define BOOST_HAS_NANOSLEEP
+#endif
+#ifndef BOOST_HAS_GETTIMEOFDAY
+# define BOOST_HAS_GETTIMEOFDAY
+#endif
+#ifndef BOOST_HAS_DIRENT_H
+# define BOOST_HAS_DIRENT_H
+#endif
+#ifndef BOOST_HAS_CLOCK_GETTIME
+# define BOOST_HAS_CLOCK_GETTIME
+#endif
+#ifndef BOOST_HAS_SIGACTION
+# define BOOST_HAS_SIGACTION
+#endif
+#ifndef BOOST_HAS_NRVO
+# ifndef __parisc
+# define BOOST_HAS_NRVO
+# endif
+#endif
+#ifndef BOOST_HAS_LOG1P
+# define BOOST_HAS_LOG1P
+#endif
+#ifndef BOOST_HAS_EXPM1
+# define BOOST_HAS_EXPM1
+#endif
+
diff --git a/thirdparty/linux/include/boost/config/platform/irix.hpp b/thirdparty/linux/include/boost/config/platform/irix.hpp
new file mode 100644
index 0000000..aeae49c
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/irix.hpp
@@ -0,0 +1,31 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+
+// See http://www.boost.org for most recent version.
+
+// SGI Irix specific config options:
+
+#define BOOST_PLATFORM "SGI Irix"
+
+#define BOOST_NO_SWPRINTF
+//
+// these are not auto detected by POSIX feature tests:
+//
+#define BOOST_HAS_GETTIMEOFDAY
+#define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+
+#ifdef __GNUC__
+ // GNU C on IRIX does not support threads (checked up to gcc 3.3)
+# define BOOST_DISABLE_THREADS
+#endif
+
+// boilerplate code:
+#define BOOST_HAS_UNISTD_H
+#include
+
+
+
diff --git a/thirdparty/linux/include/boost/config/platform/linux.hpp b/thirdparty/linux/include/boost/config/platform/linux.hpp
new file mode 100644
index 0000000..8c43c7b
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/linux.hpp
@@ -0,0 +1,105 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2001 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// linux specific config options:
+
+#define BOOST_PLATFORM "linux"
+
+// make sure we have __GLIBC_PREREQ if available at all
+#ifdef __cplusplus
+#include
+#else
+#include
+#endif
+
+//
+// added to glibc 2.1.1
+// We can only test for 2.1 though:
+//
+#if defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1)))
+ // defines int64_t unconditionally, but defines
+ // int64_t only if __GNUC__. Thus, assume a fully usable
+ // only when using GCC.
+# if defined __GNUC__
+# define BOOST_HAS_STDINT_H
+# endif
+#endif
+
+#if defined(__LIBCOMO__)
+ //
+ // como on linux doesn't have std:: c functions:
+ // NOTE: versions of libcomo prior to beta28 have octal version numbering,
+ // e.g. version 25 is 21 (dec)
+ //
+# if __LIBCOMO_VERSION__ <= 20
+# define BOOST_NO_STDC_NAMESPACE
+# endif
+
+# if __LIBCOMO_VERSION__ <= 21
+# define BOOST_NO_SWPRINTF
+# endif
+
+#endif
+
+//
+// If glibc is past version 2 then we definitely have
+// gettimeofday, earlier versions may or may not have it:
+//
+#if defined(__GLIBC__) && (__GLIBC__ >= 2)
+# define BOOST_HAS_GETTIMEOFDAY
+#endif
+
+#ifdef __USE_POSIX199309
+# define BOOST_HAS_NANOSLEEP
+#endif
+
+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+// __GLIBC_PREREQ is available since 2.1.2
+
+ // swprintf is available since glibc 2.2.0
+# if !__GLIBC_PREREQ(2,2) || (!defined(__USE_ISOC99) && !defined(__USE_UNIX98))
+# define BOOST_NO_SWPRINTF
+# endif
+#else
+# define BOOST_NO_SWPRINTF
+#endif
+
+// boilerplate code:
+#define BOOST_HAS_UNISTD_H
+#include
+#if defined(__USE_GNU) && !defined(__ANDROID__) && !defined(ANDROID)
+#define BOOST_HAS_PTHREAD_YIELD
+#endif
+
+#ifndef __GNUC__
+//
+// if the compiler is not gcc we still need to be able to parse
+// the GNU system headers, some of which (mainly )
+// use GNU specific extensions:
+//
+# ifndef __extension__
+# define __extension__
+# endif
+# ifndef __const__
+# define __const__ const
+# endif
+# ifndef __volatile__
+# define __volatile__ volatile
+# endif
+# ifndef __signed__
+# define __signed__ signed
+# endif
+# ifndef __typeof__
+# define __typeof__ typeof
+# endif
+# ifndef __inline__
+# define __inline__ inline
+# endif
+#endif
+
+
diff --git a/thirdparty/linux/include/boost/config/platform/macos.hpp b/thirdparty/linux/include/boost/config/platform/macos.hpp
new file mode 100644
index 0000000..5be4e3b
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/macos.hpp
@@ -0,0 +1,87 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Darin Adler 2001 - 2002.
+// (C) Copyright Bill Kempf 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Mac OS specific config options:
+
+#define BOOST_PLATFORM "Mac OS"
+
+#if __MACH__ && !defined(_MSL_USING_MSL_C)
+
+// Using the Mac OS X system BSD-style C library.
+
+# ifndef BOOST_HAS_UNISTD_H
+# define BOOST_HAS_UNISTD_H
+# endif
+//
+// Begin by including our boilerplate code for POSIX
+// feature detection, this is safe even when using
+// the MSL as Metrowerks supply their own
+// to replace the platform-native BSD one. G++ users
+// should also always be able to do this on MaxOS X.
+//
+# include
+# ifndef BOOST_HAS_STDINT_H
+# define BOOST_HAS_STDINT_H
+# endif
+
+//
+// BSD runtime has pthreads, sigaction, sched_yield and gettimeofday,
+// of these only pthreads are advertised in , so set the
+// other options explicitly:
+//
+# define BOOST_HAS_SCHED_YIELD
+# define BOOST_HAS_GETTIMEOFDAY
+# define BOOST_HAS_SIGACTION
+
+# if (__GNUC__ < 3) && !defined( __APPLE_CC__)
+
+// GCC strange "ignore std" mode works better if you pretend everything
+// is in the std namespace, for the most part.
+
+# define BOOST_NO_STDC_NAMESPACE
+# endif
+
+# if (__GNUC__ >= 4)
+
+// Both gcc and intel require these.
+# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+# define BOOST_HAS_NANOSLEEP
+
+# endif
+
+#else
+
+// Using the MSL C library.
+
+// We will eventually support threads in non-Carbon builds, but we do
+// not support this yet.
+# if ( defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON ) || ( defined(TARGET_CARBON) && TARGET_CARBON )
+
+# if !defined(BOOST_HAS_PTHREADS)
+// MPTasks support is deprecated/removed from Boost:
+//# define BOOST_HAS_MPTASKS
+# elif ( __dest_os == __mac_os_x )
+// We are doing a Carbon/Mach-O/MSL build which has pthreads, but only the
+// gettimeofday and no posix.
+# define BOOST_HAS_GETTIMEOFDAY
+# endif
+
+#ifdef BOOST_HAS_PTHREADS
+# define BOOST_HAS_THREADS
+#endif
+
+// The remote call manager depends on this.
+# define BOOST_BIND_ENABLE_PASCAL
+
+# endif
+
+#endif
+
+
+
diff --git a/thirdparty/linux/include/boost/config/platform/qnxnto.hpp b/thirdparty/linux/include/boost/config/platform/qnxnto.hpp
new file mode 100644
index 0000000..b1377c8
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/qnxnto.hpp
@@ -0,0 +1,31 @@
+// (C) Copyright Jim Douglas 2005.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// QNX specific config options:
+
+#define BOOST_PLATFORM "QNX"
+
+#define BOOST_HAS_UNISTD_H
+#include
+
+// QNX claims XOpen version 5 compatibility, but doesn't have an nl_types.h
+// or log1p and expm1:
+#undef BOOST_HAS_NL_TYPES_H
+#undef BOOST_HAS_LOG1P
+#undef BOOST_HAS_EXPM1
+
+#define BOOST_HAS_PTHREADS
+#define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+
+#define BOOST_HAS_GETTIMEOFDAY
+#define BOOST_HAS_CLOCK_GETTIME
+#define BOOST_HAS_NANOSLEEP
+
+
+
+
+
diff --git a/thirdparty/linux/include/boost/config/platform/solaris.hpp b/thirdparty/linux/include/boost/config/platform/solaris.hpp
new file mode 100644
index 0000000..6e4efc9
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/solaris.hpp
@@ -0,0 +1,31 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// sun specific config options:
+
+#define BOOST_PLATFORM "Sun Solaris"
+
+#define BOOST_HAS_GETTIMEOFDAY
+
+// boilerplate code:
+#define BOOST_HAS_UNISTD_H
+#include
+
+//
+// pthreads don't actually work with gcc unless _PTHREADS is defined:
+//
+#if defined(__GNUC__) && defined(_POSIX_THREADS) && !defined(_PTHREADS)
+# undef BOOST_HAS_PTHREADS
+#endif
+
+#define BOOST_HAS_STDINT_H
+#define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+#define BOOST_HAS_LOG1P
+#define BOOST_HAS_EXPM1
+
+
diff --git a/thirdparty/linux/include/boost/config/platform/symbian.hpp b/thirdparty/linux/include/boost/config/platform/symbian.hpp
new file mode 100644
index 0000000..e02a778
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/symbian.hpp
@@ -0,0 +1,97 @@
+// (C) Copyright Yuriy Krasnoschek 2009.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2001 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// symbian specific config options:
+
+
+#define BOOST_PLATFORM "Symbian"
+#define BOOST_SYMBIAN 1
+
+
+#if defined(__S60_3X__)
+// Open C / C++ plugin was introdused in this SDK, earlier versions don't have CRT / STL
+# define BOOST_S60_3rd_EDITION_FP2_OR_LATER_SDK
+// make sure we have __GLIBC_PREREQ if available at all
+#ifdef __cplusplus
+#include
+#else
+#include
+#endif// boilerplate code:
+# define BOOST_HAS_UNISTD_H
+# include
+// S60 SDK defines _POSIX_VERSION as POSIX.1
+# ifndef BOOST_HAS_STDINT_H
+# define BOOST_HAS_STDINT_H
+# endif
+# ifndef BOOST_HAS_GETTIMEOFDAY
+# define BOOST_HAS_GETTIMEOFDAY
+# endif
+# ifndef BOOST_HAS_DIRENT_H
+# define BOOST_HAS_DIRENT_H
+# endif
+# ifndef BOOST_HAS_SIGACTION
+# define BOOST_HAS_SIGACTION
+# endif
+# ifndef BOOST_HAS_PTHREADS
+# define BOOST_HAS_PTHREADS
+# endif
+# ifndef BOOST_HAS_NANOSLEEP
+# define BOOST_HAS_NANOSLEEP
+# endif
+# ifndef BOOST_HAS_SCHED_YIELD
+# define BOOST_HAS_SCHED_YIELD
+# endif
+# ifndef BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+# endif
+# ifndef BOOST_HAS_LOG1P
+# define BOOST_HAS_LOG1P
+# endif
+# ifndef BOOST_HAS_EXPM1
+# define BOOST_HAS_EXPM1
+# endif
+# ifndef BOOST_POSIX_API
+# define BOOST_POSIX_API
+# endif
+// endianess support
+# include
+// Symbian SDK provides _BYTE_ORDER instead of __BYTE_ORDER
+# ifndef __LITTLE_ENDIAN
+# ifdef _LITTLE_ENDIAN
+# define __LITTLE_ENDIAN _LITTLE_ENDIAN
+# else
+# define __LITTLE_ENDIAN 1234
+# endif
+# endif
+# ifndef __BIG_ENDIAN
+# ifdef _BIG_ENDIAN
+# define __BIG_ENDIAN _BIG_ENDIAN
+# else
+# define __BIG_ENDIAN 4321
+# endif
+# endif
+# ifndef __BYTE_ORDER
+# define __BYTE_ORDER __LITTLE_ENDIAN // Symbian is LE
+# endif
+// Known limitations
+# define BOOST_ASIO_DISABLE_SERIAL_PORT
+# define BOOST_DATE_TIME_NO_LOCALE
+# define BOOST_NO_STD_WSTRING
+# define BOOST_EXCEPTION_DISABLE
+# define BOOST_NO_EXCEPTIONS
+
+#else // TODO: More platform support e.g. UIQ
+# error "Unsuppoted Symbian SDK"
+#endif
+
+#if defined(__WINSCW__) && !defined(BOOST_DISABLE_WIN32)
+# define BOOST_DISABLE_WIN32 // winscw defines WIN32 macro
+#endif
+
+
diff --git a/thirdparty/linux/include/boost/config/platform/vms.hpp b/thirdparty/linux/include/boost/config/platform/vms.hpp
new file mode 100644
index 0000000..f70efcf
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/vms.hpp
@@ -0,0 +1,25 @@
+// (C) Copyright Artyom Beilis 2010.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CONFIG_PLATFORM_VMS_HPP
+#define BOOST_CONFIG_PLATFORM_VMS_HPP
+
+#define BOOST_PLATFORM "OpenVMS"
+
+#undef BOOST_HAS_STDINT_H
+#define BOOST_HAS_UNISTD_H
+#define BOOST_HAS_NL_TYPES_H
+#define BOOST_HAS_GETTIMEOFDAY
+#define BOOST_HAS_DIRENT_H
+#define BOOST_HAS_PTHREADS
+#define BOOST_HAS_NANOSLEEP
+#define BOOST_HAS_CLOCK_GETTIME
+#define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+#define BOOST_HAS_LOG1P
+#define BOOST_HAS_EXPM1
+#define BOOST_HAS_THREADS
+#undef BOOST_HAS_SCHED_YIELD
+
+#endif
diff --git a/thirdparty/linux/include/boost/config/platform/vxworks.hpp b/thirdparty/linux/include/boost/config/platform/vxworks.hpp
new file mode 100644
index 0000000..cdda015
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/vxworks.hpp
@@ -0,0 +1,369 @@
+// (C) Copyright Dustin Spicuzza 2009.
+// Adapted to vxWorks 6.9 by Peter Brockamp 2012.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Since WRS does not yet properly support boost under vxWorks
+// and this file was badly outdated, but I was keen on using it,
+// I patched boost myself to make things work. This has been tested
+// and adapted by me for vxWorks 6.9 *only*, as I'm lacking access
+// to earlier 6.X versions! The only thing I know for sure is that
+// very old versions of vxWorks (namely everything below 6.x) are
+// absolutely unable to use boost. This is mainly due to the completely
+// outdated libraries and ancient compiler (GCC 2.96 or worse). Do
+// not even think of getting this to work, a miserable failure will
+// be guaranteed!
+// Equally, this file has been tested for RTPs (Real Time Processes)
+// only, not for DKMs (Downloadable Kernel Modules). These two types
+// of executables differ largely in the available functionality of
+// the C-library, STL, and so on. A DKM uses a library similar to those
+// of vxWorks 5.X - with all its limitations and incompatibilities
+// with respect to ANSI C++ and STL. So probably there might be problems
+// with the usage of boost from DKMs. WRS or any voluteers are free to
+// prove the opposite!
+
+// ====================================================================
+//
+// Some important information regarding the usage of POSIX semaphores:
+// -------------------------------------------------------------------
+//
+// VxWorks as a real time operating system handles threads somewhat
+// different from what "normal" OSes do, regarding their scheduling!
+// This could lead to a scenario called "priority inversion" when using
+// semaphores, see http://en.wikipedia.org/wiki/Priority_inversion.
+//
+// Now, VxWorks POSIX-semaphores for DKM's default to the usage of
+// priority inverting semaphores, which is fine. On the other hand,
+// for RTP's it defaults to using non priority inverting semaphores,
+// which could easily pose a serious problem for a real time process,
+// i.e. deadlocks! To overcome this two possibilities do exist:
+//
+// a) Patch every piece of boost that uses semaphores to instanciate
+// the proper type of semaphores. This is non-intrusive with respect
+// to the OS and could relatively easy been done by giving all
+// semaphores attributes deviating from the default (for in-depth
+// information see the POSIX functions pthread_mutexattr_init()
+// and pthread_mutexattr_setprotocol()). However this breaks all
+// too easily, as with every new version some boost library could
+// all in a sudden start using semaphores, resurrecting the very
+// same, hard to locate problem over and over again!
+//
+// b) We could change the default properties for POSIX-semaphores
+// that VxWorks uses for RTP's and this is being suggested here,
+// as it will more or less seamlessly integrate with boost. I got
+// the following information from WRS how to do this, compare
+// Wind River TSR# 1209768:
+//
+// Instructions for changing the default properties of POSIX-
+// semaphores for RTP's in VxWorks 6.9:
+// - Edit the file /vxworks-6.9/target/usr/src/posix/pthreadLib.c
+// in the root of your Workbench-installation.
+// - Around line 917 there should be the definition of the default
+// mutex attributes:
+//
+// LOCAL pthread_mutexattr_t defaultMutexAttr =
+// {
+// PTHREAD_INITIALIZED_OBJ, PTHREAD_PRIO_NONE, 0,
+// PTHREAD_MUTEX_DEFAULT
+// };
+//
+// Here, replace PTHREAD_PRIO_NONE by PTHREAD_PRIO_INHERIT.
+// - Around line 1236 there should be a definition for the function
+// pthread_mutexattr_init(). A couple of lines below you should
+// find a block of code like this:
+//
+// pAttr->mutexAttrStatus = PTHREAD_INITIALIZED_OBJ;
+// pAttr->mutexAttrProtocol = PTHREAD_PRIO_NONE;
+// pAttr->mutexAttrPrioceiling = 0;
+// pAttr->mutexAttrType = PTHREAD_MUTEX_DEFAULT;
+//
+// Here again, replace PTHREAD_PRIO_NONE by PTHREAD_PRIO_INHERIT.
+// - Finally, rebuild your VSB. This will create a new VxWorks kernel
+// with the changed properties. That's it! Now, using boost should
+// no longer cause any problems with task deadlocks!
+//
+// And here's another useful piece of information concerning VxWorks'
+// POSIX-functionality in general:
+// VxWorks is not a genuine POSIX-OS in itself, rather it is using a
+// kind of compatibility layer (sort of a wrapper) to emulate the
+// POSIX-functionality by using its own resources and functions.
+// At the time a task (thread) calls it's first POSIX-function during
+// runtime it is being transformed by the OS into a POSIX-thread.
+// This transformation does include a call to malloc() to allocate the
+// memory required for the housekeeping of POSIX-threads. In a high
+// priority RTP this malloc() call may be highly undesirable, as its
+// timing is more or less unpredictable (depending on what your actual
+// heap looks like). You can circumvent this problem by calling the
+// function thread_self() at a well defined point in the code of the
+// task, e.g. shortly after the task spawns up. Thereby you are able
+// to define the time when the task-transformation will take place and
+// you could shift it to an uncritical point where a malloc() call is
+// tolerable. So, if this could pose a problem for your code, remember
+// to call thread_self() from the affected task at an early stage.
+//
+// ====================================================================
+
+// Block out all versions before vxWorks 6.x, as these don't work:
+// Include header with the vxWorks version information and query them
+#include
+#if !defined(_WRS_VXWORKS_MAJOR) || (_WRS_VXWORKS_MAJOR < 6)
+# error "The vxWorks version you're using is so badly outdated,\
+ it doesn't work at all with boost, sorry, no chance!"
+#endif
+
+// Handle versions above 5.X but below 6.9
+#if (_WRS_VXWORKS_MAJOR == 6) && (_WRS_VXWORKS_MINOR < 9)
+// TODO: Starting from what version does vxWorks work with boost?
+// We can't reasonably insert a #warning "" as a user hint here,
+// as this will show up with every file including some boost header,
+// badly bugging the user... So for the time being we just leave it.
+#endif
+
+// vxWorks specific config options:
+// --------------------------------
+#define BOOST_PLATFORM "vxWorks"
+
+// Special behaviour for DKMs:
+#ifdef _WRS_KERNEL
+ // DKMs do not have the -header,
+ // but apparently they do have an intrinsic wchar_t meanwhile!
+# define BOOST_NO_CWCHAR
+
+ // Lots of wide-functions and -headers are unavailable for DKMs as well:
+# define BOOST_NO_CWCTYPE
+# define BOOST_NO_SWPRINTF
+# define BOOST_NO_STD_WSTRING
+# define BOOST_NO_STD_WSTREAMBUF
+#endif
+
+// Generally available headers:
+#define BOOST_HAS_UNISTD_H
+#define BOOST_HAS_STDINT_H
+#define BOOST_HAS_DIRENT_H
+#define BOOST_HAS_SLIST
+
+// vxWorks does not have installed an iconv-library by default,
+// so unfortunately no Unicode support from scratch is available!
+// Thus, instead it is suggested to switch to ICU, as this seems
+// to be the most complete and portable option...
+#define BOOST_LOCALE_WITH_ICU
+
+// Generally available functionality:
+#define BOOST_HAS_THREADS
+#define BOOST_HAS_NANOSLEEP
+#define BOOST_HAS_GETTIMEOFDAY
+#define BOOST_HAS_CLOCK_GETTIME
+#define BOOST_HAS_MACRO_USE_FACET
+
+// Generally unavailable functionality, delivered by boost's test function:
+//#define BOOST_NO_DEDUCED_TYPENAME // Commented this out, boost's test gives an errorneous result!
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_VARIADIC_MACROS
+
+// Generally available threading API's:
+#define BOOST_HAS_PTHREADS
+#define BOOST_HAS_SCHED_YIELD
+#define BOOST_HAS_SIGACTION
+
+// Functionality available for RTPs only:
+#ifdef __RTP__
+# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+# define BOOST_HAS_LOG1P
+# define BOOST_HAS_EXPM1
+#endif
+
+// Functionality available for DKMs only:
+#ifdef _WRS_KERNEL
+ // Luckily, at the moment there seems to be none!
+#endif
+
+// These #defines allow posix_features to work, since vxWorks doesn't
+// #define them itself for DKMs (for RTPs on the contrary it does):
+#ifdef _WRS_KERNEL
+# ifndef _POSIX_TIMERS
+# define _POSIX_TIMERS 1
+# endif
+# ifndef _POSIX_THREADS
+# define _POSIX_THREADS 1
+# endif
+#endif
+
+// vxWorks doesn't work with asio serial ports:
+#define BOOST_ASIO_DISABLE_SERIAL_PORT
+// TODO: The problem here seems to bee that vxWorks uses its own, very specific
+// ways to handle serial ports, incompatible with POSIX or anything...
+// Maybe a specific implementation would be possible, but until the
+// straight need arises... This implementation would presumably consist
+// of some vxWorks specific ioctl-calls, etc. Any voluteers?
+
+// vxWorks-around: #defines CLOCKS_PER_SEC as sysClkRateGet() but
+// miserably fails to #include the required to make
+// sysClkRateGet() available! So we manually include it here.
+#ifdef __RTP__
+# include
+# include
+#endif
+
+// vxWorks-around: In the macros INT32_C(), UINT32_C(), INT64_C() and
+// UINT64_C() are defined errorneously, yielding not a signed/
+// unsigned long/long long type, but a signed/unsigned int/long
+// type. Eventually this leads to compile errors in ratio_fwd.hpp,
+// when trying to define several constants which do not fit into a
+// long type! We correct them here by redefining.
+#include
+
+// Some macro-magic to do the job
+#define VX_JOIN(X, Y) VX_DO_JOIN(X, Y)
+#define VX_DO_JOIN(X, Y) VX_DO_JOIN2(X, Y)
+#define VX_DO_JOIN2(X, Y) X##Y
+
+// Correctly setup the macros
+#undef INT32_C
+#undef UINT32_C
+#undef INT64_C
+#undef UINT64_C
+#define INT32_C(x) VX_JOIN(x, L)
+#define UINT32_C(x) VX_JOIN(x, UL)
+#define INT64_C(x) VX_JOIN(x, LL)
+#define UINT64_C(x) VX_JOIN(x, ULL)
+
+// #include Libraries required for the following function adaption
+#include
+#include
+#include
+
+// Use C-linkage for the following helper functions
+extern "C" {
+
+// vxWorks-around: The required functions getrlimit() and getrlimit() are missing.
+// But we have the similar functions getprlimit() and setprlimit(),
+// which may serve the purpose.
+// Problem: The vxWorks-documentation regarding these functions
+// doesn't deserve its name! It isn't documented what the first two
+// parameters idtype and id mean, so we must fall back to an educated
+// guess - null, argh... :-/
+
+// TODO: getprlimit() and setprlimit() do exist for RTPs only, for whatever reason.
+// Thus for DKMs there would have to be another implementation.
+#ifdef __RTP__
+ inline int getrlimit(int resource, struct rlimit *rlp){
+ return getprlimit(0, 0, resource, rlp);
+ }
+
+ inline int setrlimit(int resource, const struct rlimit *rlp){
+ return setprlimit(0, 0, resource, const_cast(rlp));
+ }
+#endif
+
+// vxWorks has ftruncate() only, so we do simulate truncate():
+inline int truncate(const char *p, off_t l){
+ int fd = open(p, O_WRONLY);
+ if (fd == -1){
+ errno = EACCES;
+ return -1;
+ }
+ if (ftruncate(fd, l) == -1){
+ close(fd);
+ errno = EACCES;
+ return -1;
+ }
+ return close(fd);
+}
+
+// Fake symlink handling by dummy functions:
+inline int symlink(const char*, const char*){
+ // vxWorks has no symlinks -> always return an error!
+ errno = EACCES;
+ return -1;
+}
+
+inline ssize_t readlink(const char*, char*, size_t){
+ // vxWorks has no symlinks -> always return an error!
+ errno = EACCES;
+ return -1;
+}
+
+// vxWorks claims to implement gettimeofday in sys/time.h
+// but nevertheless does not provide it! See
+// https://support.windriver.com/olsPortal/faces/maintenance/techtipDetail_noHeader.jspx?docId=16442&contentId=WR_TECHTIP_006256
+// We implement a surrogate version here via clock_gettime:
+inline int gettimeofday(struct timeval *tv, void * /*tzv*/) {
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ tv->tv_sec = ts.tv_sec;
+ tv->tv_usec = ts.tv_nsec / 1000;
+ return 0;
+}
+
+// vxWorks does provide neither struct tms nor function times()!
+// We implement an empty dummy-function, simply setting the user
+// and system time to the half of thew actual system ticks-value
+// and the child user and system time to 0.
+// Rather ugly but at least it suppresses compiler errors...
+// Unfortunately, this of course *does* have an severe impact on
+// dependant libraries, actually this is chrono only! Here it will
+// not be possible to correctly use user and system times! But
+// as vxWorks is lacking the ability to calculate user and system
+// process times there seems to be no other possible solution.
+struct tms{
+ clock_t tms_utime; // User CPU time
+ clock_t tms_stime; // System CPU time
+ clock_t tms_cutime; // User CPU time of terminated child processes
+ clock_t tms_cstime; // System CPU time of terminated child processes
+};
+
+inline clock_t times(struct tms *t){
+ struct timespec ts;
+ clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
+ clock_t ticks(static_cast(static_cast(ts.tv_sec) * CLOCKS_PER_SEC +
+ static_cast(ts.tv_nsec) * CLOCKS_PER_SEC / 1000000.0));
+ t->tms_utime = ticks/2U;
+ t->tms_stime = ticks/2U;
+ t->tms_cutime = 0; // vxWorks is lacking the concept of a child process!
+ t->tms_cstime = 0; // -> Set the wait times for childs to 0
+ return ticks;
+}
+
+} // extern "C"
+
+// Put the selfmade functions into the std-namespace, just in case
+namespace std {
+# ifdef __RTP__
+ using ::getrlimit;
+ using ::setrlimit;
+# endif
+ using ::truncate;
+ using ::symlink;
+ using ::readlink;
+ using ::times;
+ using ::gettimeofday;
+}
+
+// Some more macro-magic:
+// vxWorks-around: Some functions are not present or broken in vxWorks
+// but may be patched to life via helper macros...
+
+// Include signal.h which might contain a typo to be corrected here
+#include
+
+#define getpagesize() sysconf(_SC_PAGESIZE) // getpagesize is deprecated anyway!
+#ifndef S_ISSOCK
+# define S_ISSOCK(mode) ((mode & S_IFMT) == S_IFSOCK) // Is file a socket?
+#endif
+#define lstat(p, b) stat(p, b) // lstat() == stat(), as vxWorks has no symlinks!
+#ifndef FPE_FLTINV
+# define FPE_FLTINV (FPE_FLTSUB+1) // vxWorks has no FPE_FLTINV, so define one as a dummy
+#endif
+#if !defined(BUS_ADRALN) && defined(BUS_ADRALNR)
+# define BUS_ADRALN BUS_ADRALNR // Correct a supposed typo in vxWorks'
+#endif
+//typedef int locale_t; // locale_t is a POSIX-extension, currently unpresent in vxWorks!
+
+// #include boilerplate code:
+#include
+
+// vxWorks lies about XSI conformance, there is no nl_types.h:
+#undef BOOST_HAS_NL_TYPES_H
diff --git a/thirdparty/linux/include/boost/config/platform/win32.hpp b/thirdparty/linux/include/boost/config/platform/win32.hpp
new file mode 100644
index 0000000..450158f
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/platform/win32.hpp
@@ -0,0 +1,90 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Bill Kempf 2001.
+// (C) Copyright Aleksey Gurtovoy 2003.
+// (C) Copyright Rene Rivera 2005.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Win32 specific config options:
+
+#define BOOST_PLATFORM "Win32"
+
+// Get the information about the MinGW runtime, i.e. __MINGW32_*VERSION.
+#if defined(__MINGW32__)
+# include <_mingw.h>
+#endif
+
+#if defined(__GNUC__) && !defined(BOOST_NO_SWPRINTF)
+# define BOOST_NO_SWPRINTF
+#endif
+
+// Default defines for BOOST_SYMBOL_EXPORT and BOOST_SYMBOL_IMPORT
+// If a compiler doesn't support __declspec(dllexport)/__declspec(dllimport),
+// its boost/config/compiler/ file must define BOOST_SYMBOL_EXPORT and
+// BOOST_SYMBOL_IMPORT
+#ifndef BOOST_SYMBOL_EXPORT
+# define BOOST_HAS_DECLSPEC
+# define BOOST_SYMBOL_EXPORT __declspec(dllexport)
+# define BOOST_SYMBOL_IMPORT __declspec(dllimport)
+#endif
+
+#if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0)))
+# define BOOST_HAS_STDINT_H
+# ifndef __STDC_LIMIT_MACROS
+# define __STDC_LIMIT_MACROS
+# endif
+# define BOOST_HAS_DIRENT_H
+# define BOOST_HAS_UNISTD_H
+#endif
+
+#if defined(__MINGW32__) && (__GNUC__ >= 4)
+// Mingw has these functions but there are persistent problems
+// with calls to these crashing, so disable for now:
+//# define BOOST_HAS_EXPM1
+//# define BOOST_HAS_LOG1P
+# define BOOST_HAS_GETTIMEOFDAY
+#endif
+//
+// Win32 will normally be using native Win32 threads,
+// but there is a pthread library avaliable as an option,
+// we used to disable this when BOOST_DISABLE_WIN32 was
+// defined but no longer - this should allow some
+// files to be compiled in strict mode - while maintaining
+// a consistent setting of BOOST_HAS_THREADS across
+// all translation units (needed for shared_ptr etc).
+//
+
+#ifndef BOOST_HAS_PTHREADS
+# define BOOST_HAS_WINTHREADS
+#endif
+
+//
+// WinCE configuration:
+//
+#if defined(_WIN32_WCE) || defined(UNDER_CE)
+# define BOOST_NO_ANSI_APIS
+// Windows CE does not have a conforming signature for swprintf
+# define BOOST_NO_SWPRINTF
+#else
+# define BOOST_HAS_GETSYSTEMTIMEASFILETIME
+# define BOOST_HAS_THREADEX
+# define BOOST_HAS_GETSYSTEMTIMEASFILETIME
+#endif
+
+//
+// Windows Runtime
+//
+#if defined(WINAPI_FAMILY) && \
+ (WINAPI_FAMILY == WINAPI_FAMILY_APP || WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+# define BOOST_NO_ANSI_APIS
+#endif
+
+#ifndef BOOST_DISABLE_WIN32
+// WEK: Added
+#define BOOST_HAS_FTIME
+#define BOOST_WINDOWS 1
+
+#endif
diff --git a/thirdparty/linux/include/boost/config/posix_features.hpp b/thirdparty/linux/include/boost/config/posix_features.hpp
new file mode 100644
index 0000000..d129547
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/posix_features.hpp
@@ -0,0 +1,95 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+
+// See http://www.boost.org for most recent version.
+
+// All POSIX feature tests go in this file,
+// Note that we test _POSIX_C_SOURCE and _XOPEN_SOURCE as well
+// _POSIX_VERSION and _XOPEN_VERSION: on some systems POSIX API's
+// may be present but none-functional unless _POSIX_C_SOURCE and
+// _XOPEN_SOURCE have been defined to the right value (it's up
+// to the user to do this *before* including any header, although
+// in most cases the compiler will do this for you).
+
+# if defined(BOOST_HAS_UNISTD_H)
+# include
+
+ // XOpen has , but is this the correct version check?
+# if defined(_XOPEN_VERSION) && (_XOPEN_VERSION >= 3)
+# define BOOST_HAS_NL_TYPES_H
+# endif
+
+ // POSIX version 6 requires
+# if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 200100)
+# define BOOST_HAS_STDINT_H
+# endif
+
+ // POSIX version 2 requires
+# if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 199009L)
+# define BOOST_HAS_DIRENT_H
+# endif
+
+ // POSIX version 3 requires to have sigaction:
+# if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 199506L)
+# define BOOST_HAS_SIGACTION
+# endif
+ // POSIX defines _POSIX_THREADS > 0 for pthread support,
+ // however some platforms define _POSIX_THREADS without
+ // a value, hence the (_POSIX_THREADS+0 >= 0) check.
+ // Strictly speaking this may catch platforms with a
+ // non-functioning stub , but such occurrences should
+ // occur very rarely if at all.
+# if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(BOOST_HAS_WINTHREADS) && !defined(BOOST_HAS_MPTASKS)
+# define BOOST_HAS_PTHREADS
+# endif
+
+ // BOOST_HAS_NANOSLEEP:
+ // This is predicated on _POSIX_TIMERS or _XOPEN_REALTIME:
+# if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0)) \
+ || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0))
+# define BOOST_HAS_NANOSLEEP
+# endif
+
+ // BOOST_HAS_CLOCK_GETTIME:
+ // This is predicated on _POSIX_TIMERS (also on _XOPEN_REALTIME
+ // but at least one platform - linux - defines that flag without
+ // defining clock_gettime):
+# if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0))
+# define BOOST_HAS_CLOCK_GETTIME
+# endif
+
+ // BOOST_HAS_SCHED_YIELD:
+ // This is predicated on _POSIX_PRIORITY_SCHEDULING or
+ // on _POSIX_THREAD_PRIORITY_SCHEDULING or on _XOPEN_REALTIME.
+# if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING+0 > 0)\
+ || (defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING+0 > 0))\
+ || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0))
+# define BOOST_HAS_SCHED_YIELD
+# endif
+
+ // BOOST_HAS_GETTIMEOFDAY:
+ // BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE:
+ // These are predicated on _XOPEN_VERSION, and appears to be first released
+ // in issue 4, version 2 (_XOPEN_VERSION > 500).
+ // Likewise for the functions log1p and expm1.
+# if defined(_XOPEN_VERSION) && (_XOPEN_VERSION+0 >= 500)
+# define BOOST_HAS_GETTIMEOFDAY
+# if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE+0 >= 500)
+# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+# endif
+# ifndef BOOST_HAS_LOG1P
+# define BOOST_HAS_LOG1P
+# endif
+# ifndef BOOST_HAS_EXPM1
+# define BOOST_HAS_EXPM1
+# endif
+# endif
+
+# endif
+
+
+
+
diff --git a/thirdparty/linux/include/boost/config/requires_threads.hpp b/thirdparty/linux/include/boost/config/requires_threads.hpp
new file mode 100644
index 0000000..cfaff23
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/requires_threads.hpp
@@ -0,0 +1,92 @@
+// (C) Copyright John Maddock 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+
+#ifndef BOOST_CONFIG_REQUIRES_THREADS_HPP
+#define BOOST_CONFIG_REQUIRES_THREADS_HPP
+
+#ifndef BOOST_CONFIG_HPP
+# include
+#endif
+
+#if defined(BOOST_DISABLE_THREADS)
+
+//
+// special case to handle versions of gcc which don't currently support threads:
+//
+#if defined(__GNUC__) && ((__GNUC__ < 3) || (__GNUC_MINOR__ <= 3) || !defined(BOOST_STRICT_CONFIG))
+//
+// this is checked up to gcc 3.3:
+//
+#if defined(__sgi) || defined(__hpux)
+# error "Multi-threaded programs are not supported by gcc on HPUX or Irix (last checked with gcc 3.3)"
+#endif
+
+#endif
+
+# error "Threading support unavaliable: it has been explicitly disabled with BOOST_DISABLE_THREADS"
+
+#elif !defined(BOOST_HAS_THREADS)
+
+# if defined __COMO__
+// Comeau C++
+# error "Compiler threading support is not turned on. Please set the correct command line options for threading: -D_MT (Windows) or -D_REENTRANT (Unix)"
+
+#elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
+// Intel
+#ifdef _WIN32
+# error "Compiler threading support is not turned on. Please set the correct command line options for threading: either /MT /MTd /MD or /MDd"
+#else
+# error "Compiler threading support is not turned on. Please set the correct command line options for threading: -openmp"
+#endif
+
+# elif defined __GNUC__
+// GNU C++:
+# error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
+
+#elif defined __sgi
+// SGI MIPSpro C++
+# error "Compiler threading support is not turned on. Please set the correct command line options for threading: -D_SGI_MP_SOURCE"
+
+#elif defined __DECCXX
+// Compaq Tru64 Unix cxx
+# error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread"
+
+#elif defined __BORLANDC__
+// Borland
+# error "Compiler threading support is not turned on. Please set the correct command line options for threading: -tWM"
+
+#elif defined __MWERKS__
+// Metrowerks CodeWarrior
+# error "Compiler threading support is not turned on. Please set the correct command line options for threading: either -runtime sm, -runtime smd, -runtime dm, or -runtime dmd"
+
+#elif defined __SUNPRO_CC
+// Sun Workshop Compiler C++
+# error "Compiler threading support is not turned on. Please set the correct command line options for threading: -mt"
+
+#elif defined __HP_aCC
+// HP aCC
+# error "Compiler threading support is not turned on. Please set the correct command line options for threading: -mt"
+
+#elif defined(__IBMCPP__)
+// IBM Visual Age
+# error "Compiler threading support is not turned on. Please compile the code with the xlC_r compiler"
+
+#elif defined _MSC_VER
+// Microsoft Visual C++
+//
+// Must remain the last #elif since some other vendors (Metrowerks, for
+// example) also #define _MSC_VER
+# error "Compiler threading support is not turned on. Please set the correct command line options for threading: either /MT /MTd /MD or /MDd"
+
+#else
+
+# error "Compiler threading support is not turned on. Please consult your compiler's documentation for the appropriate options to use"
+
+#endif // compilers
+
+#endif // BOOST_HAS_THREADS
+
+#endif // BOOST_CONFIG_REQUIRES_THREADS_HPP
diff --git a/thirdparty/linux/include/boost/config/select_compiler_config.hpp b/thirdparty/linux/include/boost/config/select_compiler_config.hpp
new file mode 100644
index 0000000..7a75708
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/select_compiler_config.hpp
@@ -0,0 +1,148 @@
+// Boost compiler configuration selection header file
+
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Martin Wille 2003.
+// (C) Copyright Guillaume Melquiond 2003.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org/ for most recent version.
+
+// locate which compiler we are using and define
+// BOOST_COMPILER_CONFIG as needed:
+
+#if defined __CUDACC__
+// NVIDIA CUDA C++ compiler for GPU
+# include "boost/config/compiler/nvcc.hpp"
+
+#endif
+
+#if defined(__GCCXML__)
+// GCC-XML emulates other compilers, it has to appear first here!
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/gcc_xml.hpp"
+
+#elif defined(_CRAYC)
+// EDG based Cray compiler:
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/cray.hpp"
+
+#elif defined __COMO__
+// Comeau C++
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/comeau.hpp"
+
+#elif defined(__PATHSCALE__) && (__PATHCC__ >= 4)
+// PathScale EKOPath compiler (has to come before clang and gcc)
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/pathscale.hpp"
+
+#elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
+// Intel
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/intel.hpp"
+
+#elif defined __clang__ && !defined(__CUDACC__) && !defined(__ibmxl__)
+// when using clang and cuda at same time, you want to appear as gcc
+// Clang C++ emulates GCC, so it has to appear early.
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/clang.hpp"
+
+#elif defined __DMC__
+// Digital Mars C++
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/digitalmars.hpp"
+
+# elif defined(__GNUC__) && !defined(__ibmxl__)
+// GNU C++:
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/gcc.hpp"
+
+#elif defined __KCC
+// Kai C++
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/kai.hpp"
+
+#elif defined __sgi
+// SGI MIPSpro C++
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/sgi_mipspro.hpp"
+
+#elif defined __DECCXX
+// Compaq Tru64 Unix cxx
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/compaq_cxx.hpp"
+
+#elif defined __ghs
+// Greenhills C++
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/greenhills.hpp"
+
+#elif defined __CODEGEARC__
+// CodeGear - must be checked for before Borland
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/codegear.hpp"
+
+#elif defined __BORLANDC__
+// Borland
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/borland.hpp"
+
+#elif defined __MWERKS__
+// Metrowerks CodeWarrior
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/metrowerks.hpp"
+
+#elif defined __SUNPRO_CC
+// Sun Workshop Compiler C++
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/sunpro_cc.hpp"
+
+#elif defined __HP_aCC
+// HP aCC
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/hp_acc.hpp"
+
+#elif defined(__MRC__) || defined(__SC__)
+// MPW MrCpp or SCpp
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/mpw.hpp"
+
+#elif defined(__ibmxl__)
+// IBM XL C/C++ for Linux (Little Endian)
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/xlcpp.hpp"
+
+#elif defined(__IBMCPP__)
+// IBM Visual Age or IBM XL C/C++ for Linux (Big Endian)
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/vacpp.hpp"
+
+#elif defined(__PGI)
+// Portland Group Inc.
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/pgi.hpp"
+
+#elif defined _MSC_VER
+// Microsoft Visual C++
+//
+// Must remain the last #elif since some other vendors (Metrowerks, for
+// example) also #define _MSC_VER
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/visualc.hpp"
+
+#elif defined (BOOST_ASSERT_CONFIG)
+// this must come last - generate an error if we don't
+// recognise the compiler:
+# error "Unknown compiler - please configure (http://www.boost.org/libs/config/config.htm#configuring) and report the results to the main boost mailing list (http://www.boost.org/more/mailing_lists.htm#main)"
+
+#endif
+
+#if 0
+//
+// This section allows dependency scanners to find all the headers we *might* include:
+//
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#endif
+
diff --git a/thirdparty/linux/include/boost/config/select_platform_config.hpp b/thirdparty/linux/include/boost/config/select_platform_config.hpp
new file mode 100644
index 0000000..62fd818
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/select_platform_config.hpp
@@ -0,0 +1,137 @@
+// Boost compiler configuration selection header file
+
+// (C) Copyright John Maddock 2001 - 2002.
+// (C) Copyright Jens Maurer 2001.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// locate which platform we are on and define BOOST_PLATFORM_CONFIG as needed.
+// Note that we define the headers to include using "header_name" not
+// in order to prevent macro expansion within the header
+// name (for example "linux" is a macro on linux systems).
+
+#if (defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(_CRAYC)
+// linux, also other platforms (Hurd etc) that use GLIBC, should these really have their own config headers though?
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/linux.hpp"
+
+#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
+// BSD:
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/bsd.hpp"
+
+#elif defined(sun) || defined(__sun)
+// solaris:
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/solaris.hpp"
+
+#elif defined(__sgi)
+// SGI Irix:
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/irix.hpp"
+
+#elif defined(__hpux)
+// hp unix:
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/hpux.hpp"
+
+#elif defined(__CYGWIN__)
+// cygwin is not win32:
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/cygwin.hpp"
+
+#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
+// win32:
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/win32.hpp"
+
+#elif defined(__HAIKU__)
+// Haiku
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/haiku.hpp"
+
+#elif defined(__BEOS__)
+// BeOS
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/beos.hpp"
+
+#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
+// MacOS
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/macos.hpp"
+
+#elif defined(__IBMCPP__) || defined(_AIX)
+// IBM
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/aix.hpp"
+
+#elif defined(__amigaos__)
+// AmigaOS
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/amigaos.hpp"
+
+#elif defined(__QNXNTO__)
+// QNX:
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/qnxnto.hpp"
+
+#elif defined(__VXWORKS__)
+// vxWorks:
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/vxworks.hpp"
+
+#elif defined(__SYMBIAN32__)
+// Symbian:
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/symbian.hpp"
+
+#elif defined(_CRAYC)
+// Cray:
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/cray.hpp"
+
+#elif defined(__VMS)
+// VMS:
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/vms.hpp"
+
+#elif defined(__CloudABI__)
+// Nuxi CloudABI:
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/cloudabi.hpp"
+#else
+
+# if defined(unix) \
+ || defined(__unix) \
+ || defined(_XOPEN_SOURCE) \
+ || defined(_POSIX_SOURCE)
+
+ // generic unix platform:
+
+# ifndef BOOST_HAS_UNISTD_H
+# define BOOST_HAS_UNISTD_H
+# endif
+
+# include
+
+# endif
+
+# if defined (BOOST_ASSERT_CONFIG)
+ // this must come last - generate an error if we don't
+ // recognise the platform:
+# error "Unknown platform - please configure and report the results to boost.org"
+# endif
+
+#endif
+
+#if 0
+//
+// This section allows dependency scanners to find all the files we *might* include:
+//
+# include "boost/config/platform/linux.hpp"
+# include "boost/config/platform/bsd.hpp"
+# include "boost/config/platform/solaris.hpp"
+# include "boost/config/platform/irix.hpp"
+# include "boost/config/platform/hpux.hpp"
+# include "boost/config/platform/cygwin.hpp"
+# include "boost/config/platform/win32.hpp"
+# include "boost/config/platform/beos.hpp"
+# include "boost/config/platform/macos.hpp"
+# include "boost/config/platform/aix.hpp"
+# include "boost/config/platform/amigaos.hpp"
+# include "boost/config/platform/qnxnto.hpp"
+# include "boost/config/platform/vxworks.hpp"
+# include "boost/config/platform/symbian.hpp"
+# include "boost/config/platform/cray.hpp"
+# include "boost/config/platform/vms.hpp"
+# include
+
+
+
+#endif
+
diff --git a/thirdparty/linux/include/boost/config/select_stdlib_config.hpp b/thirdparty/linux/include/boost/config/select_stdlib_config.hpp
new file mode 100644
index 0000000..e270a88
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/select_stdlib_config.hpp
@@ -0,0 +1,105 @@
+// Boost compiler configuration selection header file
+
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2001 - 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+
+// See http://www.boost.org for most recent version.
+
+// locate which std lib we are using and define BOOST_STDLIB_CONFIG as needed:
+
+// First include to determine if some version of STLport is in use as the std lib
+// (do not rely on this header being included since users can short-circuit this header
+// if they know whose std lib they are using.)
+#ifdef __cplusplus
+# include
+#else
+# include
+#endif
+
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+// STLPort library; this _must_ come first, otherwise since
+// STLport typically sits on top of some other library, we
+// can end up detecting that first rather than STLport:
+# define BOOST_STDLIB_CONFIG "boost/config/stdlib/stlport.hpp"
+
+#else
+
+// If our std lib was not some version of STLport, and has not otherwise
+// been detected, then include as it is about
+// the smallest of the std lib headers that includes real C++ stuff.
+// Some std libs do not include their C++-related macros in
+// so this additional include makes sure we get those definitions.
+// Note: do not rely on this header being included since users can short-circuit this
+// #include if they know whose std lib they are using.
+#if !defined(__LIBCOMO__) && !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER)\
+ && !defined(_LIBCPP_VERSION) && !defined(__GLIBCPP__) && !defined(__GLIBCXX__)\
+ && !defined(__STL_CONFIG_H) && !defined(__MSL_CPP__) && !defined(__IBMCPP__)\
+ && !defined(MSIPL_COMPILE_H) && !defined(_YVALS) && !defined(_CPPLIB_VER)
+#include
+#endif
+
+#if defined(__LIBCOMO__)
+// Comeau STL:
+#define BOOST_STDLIB_CONFIG "boost/config/stdlib/libcomo.hpp"
+
+#elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
+// Rogue Wave library:
+# define BOOST_STDLIB_CONFIG "boost/config/stdlib/roguewave.hpp"
+
+#elif defined(_LIBCPP_VERSION)
+// libc++
+# define BOOST_STDLIB_CONFIG "boost/config/stdlib/libcpp.hpp"
+
+#elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
+// GNU libstdc++ 3
+# define BOOST_STDLIB_CONFIG "boost/config/stdlib/libstdcpp3.hpp"
+
+#elif defined(__STL_CONFIG_H)
+// generic SGI STL
+# define BOOST_STDLIB_CONFIG "boost/config/stdlib/sgi.hpp"
+
+#elif defined(__MSL_CPP__)
+// MSL standard lib:
+# define BOOST_STDLIB_CONFIG "boost/config/stdlib/msl.hpp"
+
+#elif defined(__IBMCPP__)
+// take the default VACPP std lib
+# define BOOST_STDLIB_CONFIG "boost/config/stdlib/vacpp.hpp"
+
+#elif defined(MSIPL_COMPILE_H)
+// Modena C++ standard library
+# define BOOST_STDLIB_CONFIG "boost/config/stdlib/modena.hpp"
+
+#elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
+// Dinkumware Library (this has to appear after any possible replacement libraries):
+# define BOOST_STDLIB_CONFIG "boost/config/stdlib/dinkumware.hpp"
+
+#elif defined (BOOST_ASSERT_CONFIG)
+// this must come last - generate an error if we don't
+// recognise the library:
+# error "Unknown standard library - please configure and report the results to boost.org"
+
+#endif
+
+#endif
+
+#if 0
+//
+// This section allows dependency scanners to find all the files we *might* include:
+//
+# include "boost/config/stdlib/stlport.hpp"
+# include "boost/config/stdlib/libcomo.hpp"
+# include "boost/config/stdlib/roguewave.hpp"
+# include "boost/config/stdlib/libcpp.hpp"
+# include "boost/config/stdlib/libstdcpp3.hpp"
+# include "boost/config/stdlib/sgi.hpp"
+# include "boost/config/stdlib/msl.hpp"
+# include "boost/config/stdlib/vacpp.hpp"
+# include "boost/config/stdlib/modena.hpp"
+# include "boost/config/stdlib/dinkumware.hpp"
+#endif
+
diff --git a/thirdparty/linux/include/boost/config/stdlib/dinkumware.hpp b/thirdparty/linux/include/boost/config/stdlib/dinkumware.hpp
new file mode 100644
index 0000000..8cf5d4d
--- /dev/null
+++ b/thirdparty/linux/include/boost/config/stdlib/dinkumware.hpp
@@ -0,0 +1,209 @@
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2001.
+// (C) Copyright Peter Dimov 2001.
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Guillaume Melquiond 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Dinkumware standard library config:
+
+#if !defined(_YVALS) && !defined(_CPPLIB_VER)
+#include
+#if !defined(_YVALS) && !defined(_CPPLIB_VER)
+#error This is not the Dinkumware lib!
+#endif
+#endif
+
+
+#if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 306)
+ // full dinkumware 3.06 and above
+ // fully conforming provided the compiler supports it:
+# if !(defined(_GLOBAL_USING) && (_GLOBAL_USING+0 > 0)) && !defined(__BORLANDC__) && !defined(_STD) && !(defined(__ICC) && (__ICC >= 700)) // can be defined in yvals.h
+# define BOOST_NO_STDC_NAMESPACE
+# endif
+# if !(defined(_HAS_MEMBER_TEMPLATES_REBIND) && (_HAS_MEMBER_TEMPLATES_REBIND+0 > 0)) && !(defined(_MSC_VER) && (_MSC_VER > 1300)) && defined(BOOST_MSVC)
+# define BOOST_NO_STD_ALLOCATOR
+# endif
+# define BOOST_HAS_PARTIAL_STD_ALLOCATOR
+# if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+ // if this lib version is set up for vc6 then there is no std::use_facet:
+# define BOOST_NO_STD_USE_FACET
+# define BOOST_HAS_TWO_ARG_USE_FACET
+ // C lib functions aren't in namespace std either:
+# define BOOST_NO_STDC_NAMESPACE
+ // and nor is
+# define BOOST_NO_EXCEPTION_STD_NAMESPACE
+# endif
+// There's no numeric_limits support unless _LONGLONG is defined:
+# if !defined(_LONGLONG) && (_CPPLIB_VER <= 310)
+# define BOOST_NO_MS_INT64_NUMERIC_LIMITS
+# endif
+// 3.06 appears to have (non-sgi versions of) & ,
+// and no at all
+#else
+# define BOOST_MSVC_STD_ITERATOR 1
+# define BOOST_NO_STD_ITERATOR
+# define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
+# define BOOST_NO_STD_ALLOCATOR
+# define BOOST_NO_STDC_NAMESPACE
+# define BOOST_NO_STD_USE_FACET
+# define BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN
+# define BOOST_HAS_MACRO_USE_FACET
+# ifndef _CPPLIB_VER
+ // Updated Dinkum library defines this, and provides
+ // its own min and max definitions, as does MTA version.
+# ifndef __MTA__
+# define BOOST_NO_STD_MIN_MAX
+# endif
+# define BOOST_NO_MS_INT64_NUMERIC_LIMITS
+# endif
+#endif
+
+//
+// std extension namespace is stdext for vc7.1 and later,
+// the same applies to other compilers that sit on top
+// of vc7.1 (Intel and Comeau):
+//
+#if defined(_MSC_VER) && (_MSC_VER >= 1310) && !defined(__BORLANDC__)
+# define BOOST_STD_EXTENSION_NAMESPACE stdext
+#endif
+
+
+#if (defined(_MSC_VER) && (_MSC_VER <= 1300) && !defined(__BORLANDC__)) || !defined(_CPPLIB_VER) || (_CPPLIB_VER < 306)
+ // if we're using a dinkum lib that's
+ // been configured for VC6/7 then there is
+ // no iterator traits (true even for icl)
+# define BOOST_NO_STD_ITERATOR_TRAITS
+#endif
+
+#if defined(__ICL) && (__ICL < 800) && defined(_CPPLIB_VER) && (_CPPLIB_VER <= 310)
+// Intel C++ chokes over any non-trivial use of
+// this may be an overly restrictive define, but regex fails without it:
+# define BOOST_NO_STD_LOCALE
+#endif
+
+// Fix for VC++ 8.0 on up ( I do not have a previous version to test )
+// or clang-cl. If exceptions are off you must manually include the
+// header before including the header. Admittedly
+// trying to use Boost libraries or the standard C++ libraries without
+// exception support is not suggested but currently clang-cl ( v 3.4 )
+// does not support exceptions and must be compiled with exceptions off.
+#if !_HAS_EXCEPTIONS && ((defined(BOOST_MSVC) && BOOST_MSVC >= 1400) || (defined(__clang__) && defined(_MSC_VER)))
+#include