miscellaneous-1.3.1/0000755000000000000000000000000014650254633011315 5ustar00miscellaneous-1.3.1/COPYING0000644000000000000000000010451314650254633012354 0ustar00 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . miscellaneous-1.3.1/DESCRIPTION0000644000000000000000000000067114650254633013027 0ustar00Name: miscellaneous Version: 1.3.1 Date: 2024-07-24 Author: various authors Maintainer: Octave-Forge community Title: Miscellaneous functions Description: Miscellaneous tools that don't fit somewhere else. Categories: Miscellaneous Depends: octave (>= 3.8.0) Autoload: no SystemRequirements: units BuildRequires: termcap-devel [Debian], libncurses5-dev, GNU units License: GPLv3+ Url: http://octave.sf.net miscellaneous-1.3.1/INDEX0000644000000000000000000000065214650254633012112 0ustar00miscellaneous >> Miscellaneous functions miscellaneous ascii cell2cell chebyshevpoly clip colorboard csv2latex gameoflife hermitepoly hilbert_curve hc2ind idxmatrix infoskeleton laguerrepoly legendrepoly match normc normr nze partcnt partint peano_curve physical_constant read_options reduce rolldices sample slurp_file solvesudoku text_waitbar textable truncate units zagzig z_curve zigzag miscellaneous-1.3.1/NEWS0000644000000000000000000001066314650254633012022 0ustar00Summary of important user-visible changes for the miscellaneous package ------------------------------------------------------------------------ =============================================================================== miscellaneous-1.3.1 Release Date: 2024-07-24 Release Manager: John Donoghue =============================================================================== ** pkg update for octave 7.0+ functionality ** gunits: check for gunits if available, redirect errors to nul ** Allow spaces in octave path for configure =============================================================================== miscellaneous-1.3.0 Release Date: 2019-10-27 Release Manager: John Donoghue =============================================================================== ** New functions: idxmatrix: creates a matrix with each element corresponding to its subindex in the matrix. hc2ind: Hilbert curve to linear indices ** The function publish has been removed from the miscellaneous package because it is now released with Octave core since version 4.2. Note that it's API is slightly different. ** The package is no longer dependent on the general package. ** pkg update for octave 5.1+ functionality =============================================================================== miscellaneous-1.2.1 Release Date: 2014-06-05 Release Manager: Carnë Draug =============================================================================== ** The following functions have been deprecated in previous releases of the miscellaneous package and have now been removed: apply map partarray temp_name ** units is now able to perform non-linear unit conversions such as conversion between Fahrenheit and Celsius. ** The function `asci' has been renamed `ascii'. =============================================================================== miscellaneous-1.2.0 Release Date: 2012-10-16 Release Manager: Carnë Draug =============================================================================== ** New functions: truncate: truncates a number to a given precision. textable: create LaTeX tables from matrix ** The following functions have been imported from the combinatorics package which has been removed: partcnt partint ** The function `physical_constant' has been imported from the physicalconstants package. ** The values returned by `physical_constant' have been adjusted to the latest (2010) recommended values by CODATA. ** The function `physical_constant' has a new API and should also perform faster. ** Package is now dependent on the general (>= 1.3.1) =============================================================================== miscellaneous-1.1.0 Release Date: 2012-03-24 Release Manager: Carnë Draug =============================================================================== ** IMPORTANT NOTE: * the function `waitbar' has been renamed `text_waitbar'. Octave core has implemented a Matlab compatible `waitbar' which is imcompatible with the old miscellaneous `waitbar'. If you use the `waitbar' function from the miscellaneous package you have 3 options: 1. replace all `waitbar' calls by `text_waitbar'; 2. fix your `waitbar' calls for the new API as per octave core. Note that `waitbar' is graphical tool only; 3. use an old version of the miscellaneous package or modify the source to keep shadowing the octave core `waitbar'. ** The following functions are new: clip normr text_waitbar normc sample ** The following functions have been moved to the IO package: cell2csv csvconcat xmlread csv2cell csvexplode xmlwrite ** The function `clip' was imported from the audio package. ** The functions `apply' and `map' have been deprecated. `cellfun' and `arrayfun' from octave core should be used instead. ** The function `partarray' has been deprecated. `mat2cell' from octave core should be used instead. ** The function `temp_name' has been deprecated. `tmpnam' from octave core should be used instead. ** Multiple bug fixes and increased input check on many functions. ** Package is no longer automatically loaded. ** improvements to help text. ** The function `csv2latex' has been made silent and had bugs fixed. ** The function `publish' had bugs fixed. ** The function `match' can now accept cell arrays as input. miscellaneous-1.3.1/inst/0000755000000000000000000000000014650254633012272 5ustar00miscellaneous-1.3.1/inst/.svnignore0000644000000000000000000000003014650254633014276 0ustar00PKG_ADD *.octlink *.oct miscellaneous-1.3.1/inst/asci.m0000644000000000000000000000246314650254633013374 0ustar00## Copyright (C) 2008, Thomas Treichl ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function} {[@var{string}] =} asci ([@var{columns}]) ## Print ASCII table. ## ## This function has been renamed @code{ascii} (note double i at the end of ## its name) and will be removed from future versions of the miscellaneous ## package. Please refer to @code{ascii} help text for its documentation. ## ## @end deftypefn function [varargout] = asci (varargin) persistent warned = false; if (! warned) warned = true; warning ("asci() has been deprecated. Use ascii (note double i in the name) instead"); endif [varargout{1:nargout}] = ascii (varargin{:}); endfunction miscellaneous-1.3.1/inst/ascii.m0000644000000000000000000000601414650254633013541 0ustar00## Copyright (C) 2008 Thomas Treichl ## Copyright (C) 2013 Carnë Draug ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function File} {} ascii () ## @deftypefnx {Function File} {} ascii (@var{columns}) ## Print ASCII table. ## ## If this function is called without any input argument and without any output ## argument then prints a nice ASCII-table (excluding special characters with ## hexcode 0x00 to 0x20). The input argument @var{columns} specifies the ## number of columns and defaults to 4. ## ## If it is called with one output argument then return the ASCII table as ## a string without displaying anything. Run @code{demo ascii} for examples. ## ## @seealso{char, isascii, toascii} ## @end deftypefn function table = ascii (vcol = 4) if (nargin > 1) print_usage (); elseif (! isnumeric (vcol) || ! isscalar (vcol) || fix (vcol) != vcol || vcol < 1) error ("ascii: COLUMNS must be a positive integer"); endif ## First char is #32 (0x20) and last char is #128 (0x80) voff = floor ((128 - 32) / vcol); ## Print a first row for the and underline that row vtab = [repmat(" Dec Hex Chr ", [1 vcol]) repmat("-------------", [1 vcol])]; ## Create the lines and columns of the asci table for vpos = 32:(32+voff) vline = ""; for vcnt = 1:vcol vact = (vcnt-1)*voff+vpos; vstr = {num2str(vact), dec2hex(vact), char(vact)}; vline = [vline sprintf(" %3s", vstr{1:length (vstr)}) " "]; endfor vtab = [vtab; vline]; endfor ## Print table to screen or return it to output argument if (nargout == 0) display (vtab); else table = vtab; endif endfunction %!demo %! ## Display pretty table of conversion between ASCII, decimal and hexadecimal %! ascii () %!demo %! ## Display 6 columns table of conversion between ASCII, decimal and hexadecimal %! ascii (6) %!demo %! ## Return a string with a pretty formatted table (but don't display it) %! table = ascii (1) %! display (table (65, :)); %!test %! str = ascii (5); %! assert (str(1,:), " Dec Hex Chr Dec Hex Chr Dec Hex Chr Dec Hex Chr Dec Hex Chr "); %! assert (str(4,:), " 33 21 ! 52 34 4 71 47 G 90 5A Z 109 6D m "); %!test %! str = ascii (1); %! assert (str(1,:), " Dec Hex Chr "); %! assert (str(6,:), " 35 23 # "); %!error ascii (0) %!error ascii (4.5) %!error ascii ("dec") miscellaneous-1.3.1/inst/chebyshevpoly.m0000644000000000000000000000407314650254633015340 0ustar00## Copyright (C) 2007 Muthiah Annamalai ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function File} {@var{coefs}=} chebyshevpoly (@var{kind},@var{order},@var{x}) ## ## Compute the coefficients of the Chebyshev polynomial, given the ## @var{order}. We calculate the Chebyshev polynomial using the recurrence ## relations Tn+1(x) = (2*x*Tn(x) - Tn-1(x)). The @var{kind} can be set to ## compute the first or second kind Chebyshev polynomial. ## ## If the value @var{x} is specified, the polynomial is evaluated at @var{x}, ## otherwise just the coefficients of the polynomial are returned. ## ## This is NOT the generalized Chebyshev polynomial. ## ## @end deftypefn function h=chebyshevpoly(kind,order,val) if nargin < 2, print_usage, endif h_prev=[0 1]; if kind == 1 h_now=[1 0]; elseif (kind == 2) h_now=[2 0]; else error('unknown kind'); endif if order == 0 h=h_prev; else h=h_now; endif for ord=2:order x=[];y=[]; if (length(h_now) < (1+ord)) x=0; endif y=zeros(1,(1+ord)-length(h_prev)); p1=[h_now, x]; p3=[y, h_prev]; h=2*p1 -p3; h_prev=h_now; h_now=h; endfor if nargin == 3 h=polyval(h,val); endif endfunction %!test %! x = logspace(-2, 2, 30); %! maxdeg = 10; %! for n = 1:maxdeg %! assert( chebyshevpoly(1,n,cos(x)), cos(n*x), 1E3*eps ) %! assert( chebyshevpoly(2,n,cos(x)) .* sin(x), sin((n+1)*x), 1E3*eps ) %! endfor miscellaneous-1.3.1/inst/clip.m0000644000000000000000000000425614650254633013406 0ustar00## Copyright (C) 1999 Paul Kienzle ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function File} {@var{x} =} clip (@var{x}) ## @deftypefnx {Function File} {@var{x} =} clip (@var{x}, @var{hi}) ## @deftypefnx {Function File} {@var{x} =} clip (@var{x}, [@var{lo}, @var{hi}]) ## Clip @var{x} values outside the range.to the value at the boundary of the ## range. ## ## Range boundaries, @var{lo} and @var{hi}, default to 0 and 1 respectively. ## ## @var{x} = clip (@var{x}) ## Clip to range [0, 1] ## ## @var{x} = clip (@var{x}, @var{hi}) ## Clip to range [0, @var{hi}] ## ## @var{x} = clip (@var{x}, [@var{lo}, @var{hi}]) ## Clip to range [@var{lo}, @var{hi}] ## @end deftypefn ## TODO: more clip modes, such as three level clip(X, [lo, mid, hi]), which ## TODO: sends everything above hi to hi, below lo to lo and between to ## TODO: mid; or infinite peak clipping, which sends everything above mid ## TODO: to hi and below mid to lo. function x = clip (x, range = [0, 1]) if (nargin < 1 || nargin > 2) print_usage; else if (numel (range) == 2) ## do nothing, it's good elseif (numel (range) == 1) range = [0, range]; else print_usage; endif endif x (x > range (2)) = range (2); x (x < range (1)) = range (1); endfunction %!error clip %!error clip(1,2,3) %!assert (clip(pi), 1) %!assert (clip(-pi), 0) %!assert (clip([-1.5, 0, 1.5], [-1, 1]), [-1, 0, 1]); %!assert (clip([-1.5, 0, 1.5]', [-1, 1]'), [-1, 0, 1]'); %!assert (clip([-1.5, 1; 0, 1.5], [-1, 1]), [-1, 1; 0, 1]); %!assert (isempty(clip([],1))); miscellaneous-1.3.1/inst/colorboard.m0000644000000000000000000001127114650254633014600 0ustar00## Copyright (C) 2009 VZLU Prague, a.s. ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn{Function File} colorboard (@var{m}, @var{palette}, @var{options}) ## Displays a color board corresponding to a numeric matrix @var{m}. ## @var{m} should contain zero-based indices of colors. ## The available range of indices is given by the @var{palette} argument, ## which can be one of the following: ## ## @itemize ## @item "b&w" ## Black & white, using reverse video mode. This is the default if @var{m} is logical. ## @item "ansi8" ## The standard ANSI 8 color palette. This is the default unless @var{m} is logical. ## @item "aix16" ## The AIXTerm extended 16-color palette. Uses codes 100:107 for bright colors. ## @item "xterm16" ## The first 16 system colors of the Xterm 256-color palette. ## @item "xterm216" ## The 6x6x6 color cube of the Xterm 256-color palette. ## In this case, matrix can also be passed as a MxNx3 RGB array with values 0..5. ## @item "grayscale" ## The 24 grayscale levels of the Xterm 256-color palette. ## @item "xterm256" ## The full Xterm 256-color palette. The three above palettes together. ## @end itemize ## ## @var{options} comprises additional options. The recognized options are: ## ## @itemize ## @item "indent" ## The number of spaces by which the board is indented. Default 2. ## @item "spaces" ## The number of spaces forming one field. Default 2. ## @item "horizontalseparator" ## The character used for horizontal separation of the table. Default "#". ## @item "verticalseparator" ## The character used for vertical separation of the table. Default "|". ## @end itemize ## @end deftypefn function colorboard (m, palette, varargin) if (nargin < 1) print_usage (); endif nopt = length (varargin); ## default options indent = 2; spc = 2; vsep = "|"; hsep = "#"; ## parse options while (nopt > 1) switch (tolower (varargin{nopt-1})) case "indent" indent = varargin{nopt}; case "spaces" spc = varargin{nopt}; case "verticalseparator" vsep = varargin{nopt}; case "horizontalseparator" hsep = varargin{nopt}; otherwise error ("unknown option: %s", varargin{nopt-1}); endswitch nopt -= 2; endwhile if (nargin == 1) if (islogical (m)) palette = "b&w"; else palette = "ansi8"; endif endif persistent digs = char (48:55); # digits 0..7 switch (palette) case "b&w" colors = ["07"; "27"]; case "ansi8" i = ones (1, 8); colors = (["4"(i, 1), digs.']); case "aix16" i = ones (1, 8); colors = (["04"(i, :), digs.'; "10"(i, :), digs.']); case "xterm16" colors = xterm_palette (0:15); case "xterm216" colors = xterm_palette (16:231); if (size (m, 3) == 3) m = (m(:,:,1)*6 + m(:,:,2))*6 + m(:,:,3); endif case "grayscale" colors = xterm_palette (232:255); case "xterm256" colors = xterm_palette (0:255); otherwise error ("colorboard: invalid palette"); endswitch nc = rows (colors); persistent esc = char (27); escl = [esc, "["](ones (1, nc), :); escr = ["m", blanks(spc)](ones (1, nc), :); colors = [escl, colors, escr].'; [rm, cm] = size (m); if (isreal (m) && max (m(:)) <= 1) m = min (floor (nc * m), nc-1); endif try board = reshape (colors(:, m + 1), [], rm, cm); catch error ("colorboard: m is not a valid index into palette"); end_try_catch board = permute (board, [2, 1, 3])(:, :); persistent reset = [esc, "[0m"]; indent = blanks (indent); vline = [indent, hsep(1, ones (1, spc*cm+2))]; hlinel = [indent, vsep](ones (1, rm), :); hliner = [reset, vsep](ones (1, rm), :); oldpso = page_screen_output (0); unwind_protect disp (""); disp (vline); disp ([hlinel, board, hliner]); disp (vline); disp (""); puts (reset); # reset terminal unwind_protect_cleanup page_screen_output (oldpso); end_unwind_protect endfunction function pal = xterm_palette (r) if (max (r) < 100) fmt = "48;5;%02d"; l = 7; else fmt = "48;5;%03d"; l = 8; endif pal = reshape (sprintf (fmt, r), l, length (r)).'; endfunction miscellaneous-1.3.1/inst/csv2latex.m0000644000000000000000000001414114650254633014364 0ustar00## Copyright (C) 2006 Hansgeorg Schwibbe ## Copyright (C) 2019 John Donoghue ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {} csv2latex(@var{csv_file}, @var{csv_sep}, @var{latex_file}) ## @deftypefnx {} csv2latex(@var{csv_file}, @var{csv_sep}, @var{latex_file},@ ## @var{tabular_alignments}) ## @deftypefnx {} csv2latex(@var{csv_file}, @var{csv_sep}, @var{latex_file},@ ## @var{tabular_alignments}, @var{has_hline}) ## @deftypefnx {} csv2latex(@var{csv_file}, @var{csv_sep}, @var{latex_file}, @ ## @var{tabular_alignments}, @var{has_hline}, @var{column_titles}) ## @deftypefnx {} csv2latex(@var{csv_file}, @var{csv_sep}, @var{latex_file},@ ## @var{tabular_alignments}, @var{has_hline},@ ## @var{column_titles}, @var{row_titles}) ## ## Creates a latex file from a csv file. The generated latex file contains a ## tabular with all values of the csv file. The tabular can be decorated with ## row and column titles. The generated latex file can be inserted in any latex ## document by using the '\input@{latex file name without .tex@}' statement. ## ## csv_file - the path to an existing csv file@* ## csv_sep - the seperator of the csv values@* ## latex_file - the path of the latex file to create@* ## tabular_alignments - the tabular alignment preamble ## (default = @{'l','l',...@})@* ## has_hline - indicates horizontal line seperator (default = false)@* ## column_titles - array with the column titles of the tabular ## (default = @{@})@* ## row_titles - array with the row titles of the tabular (default = @{@})@* ## ## Examples: ## ## @example ## # creates the latex file 'example.tex' from the csv file 'example.csv' ## csv2latex("example.csv", '\t', "example.tex"); ## ## # creates the latex file with horizontal and vertical lines ## csv2latex('example.csv', '\t', 'example.tex', @{'|l|', 'l|'@}, true); ## ## # creates the latex file with row and column titles ## csv2latex('example.csv', '\t', 'example.tex', @{'|l|', 'l|'@}, true, ## @{'Column 1', 'Column 2', 'Column 3'@}, @{'Row 1', 'Row 2'@}); ## @end example ## @end deftypefn function csv2latex (csv_file, csv_sep, latex_file, tabular_alignments, has_hline, column_titles, row_titles) ## set up the default values if nargin < 7 row_titles = {}; endif if nargin < 6 column_titles = {}; endif if nargin < 5 has_hline = false; endif if nargin < 4 tabular_alignments = {}; endif ## load the csv file and create the csv cell [fid, msg] = fopen (csv_file, 'r'); # open the csv file to read csv = cell(); if fid != -1 [val, count] = fread(fid); # read all data from the file fclose(fid); # close the csv file after reading csv_value = ''; line_index = 1; value_index = 1; for index = 1:count if val(index) == csv_sep csv(line_index, value_index) = csv_value; value_index++; csv_value = ''; elseif (val(index) == '\n' || (val(index) == '\r' && val(index+1) == '\r')) csv(line_index, value_index) = csv_value; value_index++; csv_value = ''; value_index = 1; line_index++; else csv_value = sprintf('%s%c', csv_value, val(index)); endif endfor endif ## get the size and length values [row_size, col_size] = size(csv); alignment_size = length(tabular_alignments); column_title_size = length(column_titles); row_title_size = length(row_titles); ## create the alignment preamble and the column titles alignment_preamble = ''; tabular_headline = ''; if row_title_size != 0 current_size = col_size + 1; else current_size = col_size; endif for col_index = 1:current_size if col_index <= alignment_size alignment_preamble = sprintf ('%s%s', alignment_preamble, tabular_alignments(col_index)); else alignment_preamble = sprintf ('%sl', alignment_preamble); endif if column_title_size != 0 if col_index <= column_title_size if col_index == 1 tabular_headline = sprintf ('%s', column_titles(col_index)); else tabular_headline = sprintf ('%s & %s', tabular_headline, column_titles(col_index)); endif else tabular_headline = sprintf ('%s &', tabular_headline); endif endif endfor ## print latex file [fid, msg] = fopen (latex_file, 'w'); # open the latex file for writing if fid != -1 fprintf (fid, '\\begin{tabular}{%s}\n', alignment_preamble); # print the begin of the tabular if column_title_size != 0 if has_hline == true fprintf (fid, ' \\hline\n'); endif fprintf (fid, ' %s \\\\\n', tabular_headline); # print the headline of the tabular endif for row_index = 1:row_size if has_hline == true fprintf (fid, ' \\hline\n'); endif for col_index = 1:col_size if col_index == 1 if row_title_size != 0 if row_index <= row_title_size fprintf (fid, ' %s & ', row_titles(row_index)); # print the row title else fprintf (fid, ' & '); # print an empty row title endif endif fprintf (fid, ' %s ', csv{row_index, col_index}); else fprintf (fid, '& %s ', csv{row_index, col_index}); endif endfor fprintf (fid, '\\\\\n'); endfor if has_hline == true fprintf (fid, ' \\hline\n'); endif fprintf (fid, '\\end{tabular}', alignment_preamble); # print the end of the tabular fclose(fid); # close the latex file after writing endif endfunction miscellaneous-1.3.1/inst/gameoflife.m0000644000000000000000000000344114650254633014550 0ustar00## Copyright (C) 2010 VZLU Prague, a.s. ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn{Function File} {B =} gameoflife (A, ngen, delay) ## Runs the Conways' game of life from a given initial state for a given ## number of generations and visualizes the process. ## If ngen is infinity, the process is run as long as A changes. ## Delay sets the pause between two frames. If zero, visualization is not done. ## @end deftypefn function B = gameoflife (A, ngen, delay = 0.2) B = A != 0; igen = 0; CSI = char ([27, 91]); oldpso = page_screen_output (delay != 0); unwind_protect if (delay > 0) puts (["\n", CSI, "s"]); printf ("generation 0\n"); colorboard (! B); pause (delay); endif while (igen < ngen) C = conv2 (B, ones (3), "same") - B; B1 = C == 3 | (B & C == 2); igen++; if (isinf (ngen) && all ((B1 == B)(:))) break; endif B = B1; if (delay > 0) puts (["\n", CSI, "u"]); printf ("generation %d\n", igen); colorboard (! B); pause (delay); endif endwhile unwind_protect_cleanup page_screen_output (oldpso); end_unwind_protect endfunction miscellaneous-1.3.1/inst/hc2ind.m0000644000000000000000000000256414650254633013626 0ustar00## Copyright (C) 2017 - Juan Pablo Carbajal ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . ## Author: Juan Pablo Carbajal ## -*- texinfo -*- ## @deffn {@var{k}} = hc2ind (@var{Z}) ## @deffnx {@var{k}} = hc2ind (@var{X},@var{Y}) ## Converts Hilbert curve to linear matrix indices. ## ## @example ## [x,y] = hilbert_curve (2); ## hc2ind (x, y); ## ans = ## 1 ## 2 ## 4 ## 3 ## @end example ## ## @end deffn function [k,I,J] = hc2ind (x, y) # convert the coords to subindexes # blocks in row-major order (with u-d flips) I = y + 1; J = x + 1; # convert the subs to indices sz = sqrt (length (x)) * [1 1]; k = sub2ind (sz, I, J); endfunction %!demo %! M = idxmatrix (4) %! [x, y] = hilbert_curve (4); %! ind = hc2ind (x, y); %! M(ind) miscellaneous-1.3.1/inst/hermitepoly.m0000644000000000000000000011675414650254633015027 0ustar00## Copyright (C) 2007 Muthiah Annamalai ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function File} {@var{coefs}=} hermitepoly (@var{order},@var{x}) ## ## Compute the coefficients of the Hermite polynomial, given the ## @var{order}. We calculate the Hermite polynomial using the recurrence ## relations, Hn+1(x) = 2x.Hn(x) - 2nHn-1(x). ## ## If the value @var{x} is specified, the polynomial is also evaluated, ## otherwise just the return the coefficients. ## ## @end deftypefn function h = hermitepoly (order, val) if nargin < 1, print_usage, end ## contains the first 50 hermite-polynomials H = [ 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 2.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 4.00000000e+00 0.00000000e+00 -2.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 8.00000000e+00 0.00000000e+00 -1.20000000e+01 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.60000000e+01 0.00000000e+00 -4.80000000e+01 0.00000000e+00 1.20000000e+01 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 3.20000000e+01 0.00000000e+00 -1.60000000e+02 0.00000000e+00 1.20000000e+02 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 6.40000000e+01 0.00000000e+00 -4.80000000e+02 0.00000000e+00 7.20000000e+02 0.00000000e+00 -1.20000000e+02 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.28000000e+02 0.00000000e+00 -1.34400000e+03 0.00000000e+00 3.36000000e+03 0.00000000e+00 -1.68000000e+03 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 2.56000000e+02 0.00000000e+00 -3.58400000e+03 0.00000000e+00 1.34400000e+04 0.00000000e+00 -1.34400000e+04 0.00000000e+00 1.68000000e+03 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 5.12000000e+02 0.00000000e+00 -9.21600000e+03 0.00000000e+00 4.83840000e+04 0.00000000e+00 -8.06400000e+04 0.00000000e+00 3.02400000e+04 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.02400000e+03 0.00000000e+00 -2.30400000e+04 0.00000000e+00 1.61280000e+05 0.00000000e+00 -4.03200000e+05 0.00000000e+00 3.02400000e+05 0.00000000e+00 -3.02400000e+04 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 2.04800000e+03 0.00000000e+00 -5.63200000e+04 0.00000000e+00 5.06880000e+05 0.00000000e+00 -1.77408000e+06 0.00000000e+00 2.21760000e+06 0.00000000e+00 -6.65280000e+05 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 4.09600000e+03 0.00000000e+00 -1.35168000e+05 0.00000000e+00 1.52064000e+06 0.00000000e+00 -7.09632000e+06 0.00000000e+00 1.33056000e+07 0.00000000e+00 -7.98336000e+06 0.00000000e+00 6.65280000e+05 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 8.19200000e+03 0.00000000e+00 -3.19488000e+05 0.00000000e+00 4.39296000e+06 0.00000000e+00 -2.63577600e+07 0.00000000e+00 6.91891200e+07 0.00000000e+00 -6.91891200e+07 0.00000000e+00 1.72972800e+07 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.63840000e+04 0.00000000e+00 -7.45472000e+05 0.00000000e+00 1.23002880e+07 0.00000000e+00 -9.22521600e+07 0.00000000e+00 3.22882560e+08 0.00000000e+00 -4.84323840e+08 0.00000000e+00 2.42161920e+08 0.00000000e+00 -1.72972800e+07 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 3.27680000e+04 0.00000000e+00 -1.72032000e+06 0.00000000e+00 3.35462400e+07 0.00000000e+00 -3.07507200e+08 0.00000000e+00 1.38378240e+09 0.00000000e+00 -2.90594304e+09 0.00000000e+00 2.42161920e+09 0.00000000e+00 -5.18918400e+08 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 6.55360000e+04 0.00000000e+00 -3.93216000e+06 0.00000000e+00 8.94566400e+07 0.00000000e+00 -9.84023040e+08 0.00000000e+00 5.53512960e+09 0.00000000e+00 -1.54983629e+10 0.00000000e+00 1.93729536e+10 0.00000000e+00 -8.30269440e+09 0.00000000e+00 5.18918400e+08 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.31072000e+05 0.00000000e+00 -8.91289600e+06 0.00000000e+00 2.33963520e+08 0.00000000e+00 -3.04152576e+09 0.00000000e+00 2.09104896e+10 0.00000000e+00 -7.52777626e+10 0.00000000e+00 1.31736084e+11 0.00000000e+00 -9.40972032e+10 0.00000000e+00 1.76432256e+10 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 2.62144000e+05 0.00000000e+00 -2.00540160e+07 0.00000000e+00 6.01620480e+08 0.00000000e+00 -9.12457728e+09 0.00000000e+00 7.52777626e+10 0.00000000e+00 -3.38749932e+11 0.00000000e+00 7.90416507e+11 0.00000000e+00 -8.46874829e+11 0.00000000e+00 3.17578061e+11 0.00000000e+00 -1.76432256e+10 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 5.24288000e+05 0.00000000e+00 -4.48266240e+07 0.00000000e+00 1.52410522e+09 0.00000000e+00 -2.66718413e+10 0.00000000e+00 2.60050452e+11 0.00000000e+00 -1.43027749e+12 0.00000000e+00 4.29083247e+12 0.00000000e+00 -6.43624870e+12 0.00000000e+00 4.02265544e+12 0.00000000e+00 -6.70442573e+11 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.04857600e+06 0.00000000e+00 -9.96147200e+07 0.00000000e+00 3.81026304e+09 0.00000000e+00 -7.62052608e+10 0.00000000e+00 8.66834842e+11 0.00000000e+00 -5.72110995e+12 0.00000000e+00 2.14541623e+13 0.00000000e+00 -4.29083247e+13 0.00000000e+00 4.02265544e+13 0.00000000e+00 -1.34088515e+13 0.00000000e+00 6.70442573e+11 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 2.09715200e+06 0.00000000e+00 -2.20200960e+08 0.00000000e+00 9.41359104e+09 0.00000000e+00 -2.13374730e+11 0.00000000e+00 2.80054333e+12 0.00000000e+00 -2.18442380e+13 0.00000000e+00 1.00119424e+14 0.00000000e+00 -2.57449948e+14 0.00000000e+00 3.37903057e+14 0.00000000e+00 -1.87723920e+14 0.00000000e+00 2.81585881e+13 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 4.19430400e+06 0.00000000e+00 -4.84442112e+08 0.00000000e+00 2.30110003e+10 0.00000000e+00 -5.86780508e+11 0.00000000e+00 8.80170762e+12 0.00000000e+00 -8.00955394e+13 0.00000000e+00 4.40525467e+14 0.00000000e+00 -1.41597471e+15 0.00000000e+00 2.47795575e+15 0.00000000e+00 -2.06496312e+15 0.00000000e+00 6.19488937e+14 0.00000000e+00 -2.81585881e+13 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 8.38860800e+06 0.00000000e+00 -1.06115891e+09 0.00000000e+00 5.57108429e+10 0.00000000e+00 -1.58775902e+12 0.00000000e+00 2.69919034e+13 0.00000000e+00 -2.83414985e+14 0.00000000e+00 1.84219741e+15 0.00000000e+00 -7.23720409e+15 0.00000000e+00 1.62837092e+16 0.00000000e+00 -1.89976607e+16 0.00000000e+00 9.49883037e+15 0.00000000e+00 -1.29529505e+15 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.67772160e+07 0.00000000e+00 -2.31525581e+09 0.00000000e+00 1.33706023e+11 0.00000000e+00 -4.23402406e+12 0.00000000e+00 8.09757101e+13 0.00000000e+00 -9.71708522e+14 0.00000000e+00 7.36878962e+15 0.00000000e+00 -3.47385796e+16 0.00000000e+00 9.77022552e+16 0.00000000e+00 -1.51981286e+17 0.00000000e+00 1.13985964e+17 0.00000000e+00 -3.10870812e+16 0.00000000e+00 1.29529505e+15 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 3.35544320e+07 0.00000000e+00 -5.03316480e+09 0.00000000e+00 3.18347674e+11 0.00000000e+00 -1.11421686e+13 0.00000000e+00 2.38163853e+14 0.00000000e+00 -3.23902841e+15 0.00000000e+00 2.83414985e+16 0.00000000e+00 -1.57902635e+17 0.00000000e+00 5.42790307e+17 0.00000000e+00 -1.08558061e+18 0.00000000e+00 1.13985964e+18 0.00000000e+00 -5.18118020e+17 0.00000000e+00 6.47647525e+16 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 6.71088640e+07 0.00000000e+00 -1.09051904e+10 0.00000000e+00 7.52458138e+11 0.00000000e+00 -2.89696383e+13 0.00000000e+00 6.88028910e+14 0.00000000e+00 -1.05268423e+16 0.00000000e+00 1.05268423e+17 0.00000000e+00 -6.84244751e+17 0.00000000e+00 2.82250960e+18 0.00000000e+00 -7.05627399e+18 0.00000000e+00 9.87878359e+18 0.00000000e+00 -6.73553426e+18 0.00000000e+00 1.68388357e+18 0.00000000e+00 -6.47647525e+16 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.34217728e+08 0.00000000e+00 -2.35552113e+10 0.00000000e+00 1.76664084e+12 0.00000000e+00 -7.44933556e+13 0.00000000e+00 1.95545059e+15 0.00000000e+00 -3.34382050e+16 0.00000000e+00 3.78966323e+17 0.00000000e+00 -2.84224743e+18 0.00000000e+00 1.38559562e+19 0.00000000e+00 -4.23376439e+19 0.00000000e+00 7.62077591e+19 0.00000000e+00 -7.27437700e+19 0.00000000e+00 3.03099042e+19 0.00000000e+00 -3.49729664e+18 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 2.68435456e+08 0.00000000e+00 -5.07343012e+10 0.00000000e+00 4.12216197e+12 0.00000000e+00 -1.89619451e+14 0.00000000e+00 5.47526164e+15 0.00000000e+00 -1.04029971e+17 0.00000000e+00 1.32638213e+18 0.00000000e+00 -1.13689897e+19 0.00000000e+00 6.46611289e+19 0.00000000e+00 -2.37090806e+20 0.00000000e+00 5.33454314e+20 0.00000000e+00 -6.78941854e+20 0.00000000e+00 4.24338659e+20 0.00000000e+00 -9.79243058e+19 0.00000000e+00 3.49729664e+18 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 5.36870912e+08 0.00000000e+00 -1.08984795e+11 0.00000000e+00 9.56341577e+12 0.00000000e+00 -4.78170789e+14 0.00000000e+00 1.51221512e+16 0.00000000e+00 -3.17565175e+17 0.00000000e+00 4.52530374e+18 0.00000000e+00 -4.39600935e+19 0.00000000e+00 2.88488114e+20 0.00000000e+00 -1.25011516e+21 0.00000000e+00 3.43781669e+21 0.00000000e+00 -5.62551822e+21 0.00000000e+00 4.92232844e+21 0.00000000e+00 -1.89320325e+21 0.00000000e+00 2.02843205e+20 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.07374182e+09 0.00000000e+00 -2.33538847e+11 0.00000000e+00 2.20694210e+13 0.00000000e+00 -1.19542697e+15 0.00000000e+00 4.12422305e+16 0.00000000e+00 -9.52695525e+17 0.00000000e+00 1.50843458e+19 0.00000000e+00 -1.64850351e+20 0.00000000e+00 1.23637763e+21 0.00000000e+00 -6.25057580e+21 0.00000000e+00 2.06269001e+22 0.00000000e+00 -4.21913866e+22 0.00000000e+00 4.92232844e+22 0.00000000e+00 -2.83980487e+22 0.00000000e+00 6.08529615e+21 0.00000000e+00 -2.02843205e+20 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 2.14748365e+09 0.00000000e+00 -4.99289948e+11 0.00000000e+00 5.06779297e+13 0.00000000e+00 -2.96465889e+15 0.00000000e+00 1.11174708e+17 0.00000000e+00 -2.81272012e+18 0.00000000e+00 4.92226021e+19 0.00000000e+00 -6.01218926e+20 0.00000000e+00 5.11036087e+21 0.00000000e+00 -2.98104384e+22 0.00000000e+00 1.16260710e+23 0.00000000e+00 -2.90651775e+23 0.00000000e+00 4.35977662e+23 0.00000000e+00 -3.52135804e+23 0.00000000e+00 1.25762787e+23 0.00000000e+00 -1.25762787e+22 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 4.29496730e+09 0.00000000e+00 -1.06515189e+12 0.00000000e+00 1.15835268e+14 0.00000000e+00 -7.29762188e+15 0.00000000e+00 2.96465889e+17 0.00000000e+00 -8.18245854e+18 0.00000000e+00 1.57512327e+20 0.00000000e+00 -2.13766729e+21 0.00000000e+00 2.04414435e+22 0.00000000e+00 -1.36276290e+23 0.00000000e+00 6.20057119e+23 0.00000000e+00 -1.86017136e+24 0.00000000e+00 3.48782129e+24 0.00000000e+00 -3.75611524e+24 0.00000000e+00 2.01220459e+24 0.00000000e+00 -4.02440919e+23 0.00000000e+00 1.25762787e+22 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 8.58993459e+09 0.00000000e+00 -2.26774273e+12 0.00000000e+00 2.63625093e+14 0.00000000e+00 -1.78386313e+16 0.00000000e+00 7.82669947e+17 0.00000000e+00 -2.34800984e+19 0.00000000e+00 4.95038741e+20 0.00000000e+00 -7.42558112e+21 0.00000000e+00 7.93608982e+22 0.00000000e+00 -5.99615676e+23 0.00000000e+00 3.14798230e+24 0.00000000e+00 -1.11610281e+25 0.00000000e+00 2.55773562e+25 0.00000000e+00 -3.54148008e+25 0.00000000e+00 2.65611006e+25 0.00000000e+00 -8.85370021e+24 0.00000000e+00 8.30034395e+23 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.71798692e+10 0.00000000e+00 -4.81895331e+12 0.00000000e+00 5.97550210e+14 0.00000000e+00 -4.33223902e+16 0.00000000e+00 2.04698294e+18 0.00000000e+00 -6.65269455e+19 0.00000000e+00 1.53011975e+21 0.00000000e+00 -2.52469758e+22 0.00000000e+00 2.99807838e+23 0.00000000e+00 -2.54836662e+24 0.00000000e+00 1.52901997e+25 0.00000000e+00 -6.32458261e+25 0.00000000e+00 1.73926022e+26 0.00000000e+00 -3.01025807e+26 0.00000000e+00 3.01025807e+26 0.00000000e+00 -1.50512904e+26 0.00000000e+00 2.82211694e+25 0.00000000e+00 -8.30034395e+23 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 3.43597384e+10 0.00000000e+00 -1.02220222e+13 0.00000000e+00 1.34930693e+15 0.00000000e+00 -1.04571287e+17 0.00000000e+00 5.30699280e+18 0.00000000e+00 -1.86275447e+20 0.00000000e+00 4.65688618e+21 0.00000000e+00 -8.41565860e+22 0.00000000e+00 1.10455519e+24 0.00000000e+00 -1.04932743e+25 0.00000000e+00 7.13542654e+25 0.00000000e+00 -3.40554448e+26 0.00000000e+00 1.10680196e+27 0.00000000e+00 -2.34131183e+27 0.00000000e+00 3.01025807e+27 0.00000000e+00 -2.10718065e+27 0.00000000e+00 6.58493953e+26 0.00000000e+00 -5.81024076e+25 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 6.87194767e+10 0.00000000e+00 -2.16466352e+13 0.00000000e+00 3.03594058e+15 0.00000000e+00 -2.50971088e+17 0.00000000e+00 1.36465529e+19 0.00000000e+00 -5.15839700e+20 0.00000000e+00 1.39706586e+22 0.00000000e+00 -2.75421554e+23 0.00000000e+00 3.97639869e+24 0.00000000e+00 -4.19730973e+25 0.00000000e+00 3.21094194e+26 0.00000000e+00 -1.75142288e+27 0.00000000e+00 6.64081174e+27 0.00000000e+00 -1.68574452e+28 0.00000000e+00 2.70923226e+28 0.00000000e+00 -2.52861678e+28 0.00000000e+00 1.18528912e+28 0.00000000e+00 -2.09168667e+27 0.00000000e+00 5.81024076e+25 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.37438953e+11 0.00000000e+00 -4.57671715e+13 0.00000000e+00 6.80786676e+15 0.00000000e+00 -5.99092275e+17 0.00000000e+00 3.48222385e+19 0.00000000e+00 -1.41378288e+21 0.00000000e+00 4.13531493e+22 0.00000000e+00 -8.86138914e+23 0.00000000e+00 1.40120716e+25 0.00000000e+00 -1.63474168e+26 0.00000000e+00 1.39770414e+27 0.00000000e+00 -8.64035286e+27 0.00000000e+00 3.78015438e+28 0.00000000e+00 -1.13404631e+29 0.00000000e+00 2.22759097e+29 0.00000000e+00 -2.67310917e+29 0.00000000e+00 1.75422789e+29 0.00000000e+00 -5.15949380e+28 0.00000000e+00 4.29957816e+27 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 2.74877907e+11 0.00000000e+00 -9.66195843e+13 0.00000000e+00 1.52175845e+16 0.00000000e+00 -1.42284415e+18 0.00000000e+00 8.82163375e+19 0.00000000e+00 -3.83741068e+21 0.00000000e+00 1.20878436e+23 0.00000000e+00 -2.80610656e+24 0.00000000e+00 4.84053382e+25 0.00000000e+00 -6.21201840e+26 0.00000000e+00 5.90141748e+27 0.00000000e+00 -4.10416761e+28 0.00000000e+00 2.05208381e+29 0.00000000e+00 -7.18229332e+29 0.00000000e+00 1.69296914e+30 0.00000000e+00 -2.53945371e+30 0.00000000e+00 2.22202200e+30 0.00000000e+00 -9.80303821e+29 0.00000000e+00 1.63383970e+29 0.00000000e+00 -4.29957816e+27 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 5.49755814e+11 0.00000000e+00 -2.03684529e+14 0.00000000e+00 3.39134741e+16 0.00000000e+00 -3.36308618e+18 0.00000000e+00 2.21963688e+20 0.00000000e+00 -1.03213115e+22 0.00000000e+00 3.49204372e+23 0.00000000e+00 -8.75505247e+24 0.00000000e+00 1.64157234e+26 0.00000000e+00 -2.30732112e+27 0.00000000e+00 2.42268718e+28 0.00000000e+00 -1.88308867e+29 0.00000000e+00 1.06708358e+30 0.00000000e+00 -4.30937599e+30 0.00000000e+00 1.20046903e+31 0.00000000e+00 -2.20085988e+31 0.00000000e+00 2.47596737e+31 0.00000000e+00 -1.52927396e+31 0.00000000e+00 4.24798323e+30 0.00000000e+00 -3.35367097e+29 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.09951163e+12 0.00000000e+00 -4.28809535e+14 0.00000000e+00 7.53632757e+16 0.00000000e+00 -7.91314395e+18 0.00000000e+00 5.54909220e+20 0.00000000e+00 -2.75234973e+22 0.00000000e+00 9.97726777e+23 0.00000000e+00 -2.69386230e+25 0.00000000e+00 5.47190779e+26 0.00000000e+00 -8.39025862e+27 0.00000000e+00 9.69074870e+28 0.00000000e+00 -8.36928297e+29 0.00000000e+00 5.33541789e+30 0.00000000e+00 -2.46250057e+31 0.00000000e+00 8.00312684e+31 0.00000000e+00 -1.76068790e+32 0.00000000e+00 2.47596737e+32 0.00000000e+00 -2.03903195e+32 0.00000000e+00 8.49596645e+31 0.00000000e+00 -1.34146839e+31 0.00000000e+00 3.35367097e+29 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 2.19902326e+12 0.00000000e+00 -9.01599535e+14 0.00000000e+00 1.67021314e+17 0.00000000e+00 -1.85393658e+19 0.00000000e+00 1.37886533e+21 0.00000000e+00 -7.28040896e+22 0.00000000e+00 2.82115847e+24 0.00000000e+00 -8.18135957e+25 0.00000000e+00 1.79478576e+27 0.00000000e+00 -2.99130959e+28 0.00000000e+00 3.78400664e+29 0.00000000e+00 -3.61200633e+30 0.00000000e+00 2.57355451e+31 0.00000000e+00 -1.34616698e+32 0.00000000e+00 5.04812616e+32 0.00000000e+00 -1.31251280e+33 0.00000000e+00 2.25588138e+33 0.00000000e+00 -2.38858028e+33 0.00000000e+00 1.39333850e+33 0.00000000e+00 -3.66668026e+32 0.00000000e+00 2.75001019e+31 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 4.39804651e+12 0.00000000e+00 -1.89335902e+15 0.00000000e+00 3.69205009e+17 0.00000000e+00 -4.32585203e+19 0.00000000e+00 3.40660847e+21 0.00000000e+00 -1.91110735e+23 0.00000000e+00 7.89924372e+24 0.00000000e+00 -2.45440787e+26 0.00000000e+00 5.79853860e+27 0.00000000e+00 -1.04695836e+29 0.00000000e+00 1.44480253e+30 0.00000000e+00 -1.51704266e+31 0.00000000e+00 1.20099211e+32 0.00000000e+00 -7.06737662e+32 0.00000000e+00 3.02887570e+33 0.00000000e+00 -9.18758961e+33 0.00000000e+00 1.89494036e+34 0.00000000e+00 -2.50800930e+34 0.00000000e+00 1.95067390e+34 0.00000000e+00 -7.70002854e+33 0.00000000e+00 1.15500428e+33 0.00000000e+00 -2.75001019e+31 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 8.79609302e+12 0.00000000e+00 -3.97143600e+15 0.00000000e+00 8.14144380e+17 0.00000000e+00 -1.00546831e+20 0.00000000e+00 8.37052367e+21 0.00000000e+00 -4.98046159e+23 0.00000000e+00 2.19140310e+25 0.00000000e+00 -7.27858886e+26 0.00000000e+00 1.84694192e+28 0.00000000e+00 -3.60153675e+29 0.00000000e+00 5.40230513e+30 0.00000000e+00 -6.21265089e+31 0.00000000e+00 5.43606953e+32 0.00000000e+00 -3.57526112e+33 0.00000000e+00 1.73655540e+34 0.00000000e+00 -6.07794390e+34 0.00000000e+00 1.48149882e+35 0.00000000e+00 -2.39654222e+35 0.00000000e+00 2.39654222e+35 0.00000000e+00 -1.32440491e+35 0.00000000e+00 3.31101227e+34 0.00000000e+00 -2.36500877e+33 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.75921860e+13 0.00000000e+00 -8.32110400e+15 0.00000000e+00 1.79111764e+18 0.00000000e+00 -2.32845293e+20 0.00000000e+00 2.04612801e+22 0.00000000e+00 -1.28906065e+24 0.00000000e+00 6.02635852e+25 0.00000000e+00 -2.13505273e+27 0.00000000e+00 5.80467462e+28 0.00000000e+00 -1.21898167e+30 0.00000000e+00 1.98084521e+31 0.00000000e+00 -2.48506036e+32 0.00000000e+00 2.39187059e+33 0.00000000e+00 -1.74790543e+34 0.00000000e+00 9.55105470e+34 0.00000000e+00 -3.82042188e+35 0.00000000e+00 1.08643247e+36 0.00000000e+00 -2.10895715e+36 0.00000000e+00 2.63619644e+36 0.00000000e+00 -1.94246053e+36 0.00000000e+00 7.28422700e+35 0.00000000e+00 -1.04060386e+35 0.00000000e+00 2.36500877e+33 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 3.51843721e+13 0.00000000e+00 -1.74162642e+16 0.00000000e+00 3.93172164e+18 0.00000000e+00 -5.37335291e+20 0.00000000e+00 4.97706813e+22 0.00000000e+00 -3.31472737e+24 0.00000000e+00 1.64355232e+26 0.00000000e+00 -6.19854019e+27 0.00000000e+00 1.80145074e+29 0.00000000e+00 -4.06327223e+30 0.00000000e+00 7.13104277e+31 0.00000000e+00 -9.72414923e+32 0.00000000e+00 1.02508740e+34 0.00000000e+00 -8.27955206e+34 0.00000000e+00 5.05644072e+35 0.00000000e+00 -2.29225313e+36 0.00000000e+00 7.52145557e+36 0.00000000e+00 -1.72551040e+37 0.00000000e+00 2.63619644e+37 0.00000000e+00 -2.49744926e+37 0.00000000e+00 1.31116086e+37 0.00000000e+00 -3.12181157e+36 0.00000000e+00 2.12850789e+35 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 7.03687442e+13 0.00000000e+00 -3.64158251e+16 0.00000000e+00 8.61234264e+18 0.00000000e+00 -1.23587117e+21 0.00000000e+00 1.20497439e+23 0.00000000e+00 -8.47096996e+24 0.00000000e+00 4.44725923e+26 0.00000000e+00 -1.78208030e+28 0.00000000e+00 5.52444895e+29 0.00000000e+00 -1.33507516e+31 0.00000000e+00 2.52329206e+32 0.00000000e+00 -3.72759054e+33 0.00000000e+00 4.28672912e+34 0.00000000e+00 -3.80859395e+35 0.00000000e+00 2.58440304e+36 0.00000000e+00 -1.31804555e+37 0.00000000e+00 4.94267080e+37 0.00000000e+00 -1.32289130e+38 0.00000000e+00 2.42530072e+38 0.00000000e+00 -2.87206665e+38 0.00000000e+00 2.01044665e+38 0.00000000e+00 -7.18016662e+37 0.00000000e+00 9.79113629e+36 0.00000000e+00 -2.12850789e+35 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.40737488e+14 0.00000000e+00 -7.60686125e+16 0.00000000e+00 1.88269816e+19 0.00000000e+00 -2.83346073e+21 0.00000000e+00 2.90429725e+23 0.00000000e+00 -2.15208426e+25 0.00000000e+00 1.19440676e+27 0.00000000e+00 -5.07622875e+28 0.00000000e+00 1.67515549e+30 0.00000000e+00 -4.32748501e+31 0.00000000e+00 8.78479456e+32 0.00000000e+00 -1.40157404e+34 0.00000000e+00 1.75196755e+35 0.00000000e+00 -1.70479920e+36 0.00000000e+00 1.27859940e+37 0.00000000e+00 -7.28801656e+37 0.00000000e+00 3.09740704e+38 0.00000000e+00 -9.56552173e+38 0.00000000e+00 2.07252971e+39 0.00000000e+00 -2.99971405e+39 0.00000000e+00 2.69974265e+39 0.00000000e+00 -1.34987132e+39 0.00000000e+00 3.06788937e+38 0.00000000e+00 -2.00079742e+37 0.00000000e+00 0.00000000e+00 0.00000000e+00 2.81474977e+14 0.00000000e+00 -1.58751887e+17 0.00000000e+00 4.10770507e+19 0.00000000e+00 -6.47648166e+21 0.00000000e+00 6.97031339e+23 0.00000000e+00 -5.43684445e+25 0.00000000e+00 3.18508470e+27 0.00000000e+00 -1.43328812e+29 0.00000000e+00 5.02546646e+30 0.00000000e+00 -1.38479520e+32 0.00000000e+00 3.01192956e+33 0.00000000e+00 -5.17504262e+34 0.00000000e+00 7.00787021e+35 0.00000000e+00 -7.43912376e+36 0.00000000e+00 6.13727710e+37 0.00000000e+00 -3.88694216e+38 0.00000000e+00 1.85844422e+39 0.00000000e+00 -6.55921490e+39 0.00000000e+00 1.65802377e+40 0.00000000e+00 -2.87972549e+40 0.00000000e+00 3.23969118e+40 0.00000000e+00 -2.15979412e+40 0.00000000e+00 7.36293449e+39 0.00000000e+00 -9.60382760e+38 0.00000000e+00 2.00079742e+37 0.00000000e+00 5.62949953e+14 0.00000000e+00 -3.31014573e+17 0.00000000e+00 8.94566882e+19 0.00000000e+00 -1.47603536e+22 0.00000000e+00 1.66607491e+24 0.00000000e+00 -1.36618142e+26 0.00000000e+00 8.43617030e+27 0.00000000e+00 -4.01320673e+29 0.00000000e+00 1.49241125e+31 0.00000000e+00 -4.37773967e+32 0.00000000e+00 1.01782447e+34 0.00000000e+00 -1.87834880e+35 0.00000000e+00 2.74708512e+36 0.00000000e+00 -3.16971360e+37 0.00000000e+00 2.86406265e+38 0.00000000e+00 -2.00484385e+39 0.00000000e+00 1.07133843e+40 0.00000000e+00 -4.28535374e+40 0.00000000e+00 1.24989484e+41 0.00000000e+00 -2.56557362e+41 0.00000000e+00 3.52766373e+41 0.00000000e+00 -3.02371176e+41 0.00000000e+00 1.44313516e+41 0.00000000e+00 -3.13725035e+40 0.00000000e+00 1.96078147e+39 0.00000000e+00 1.12589991e+15 0.00000000e+00 -6.89613693e+17 0.00000000e+00 1.94471061e+20 0.00000000e+00 -3.35462581e+22 0.00000000e+00 3.96684502e+24 0.00000000e+00 -3.41545356e+26 0.00000000e+00 2.22004482e+28 0.00000000e+00 -1.11477965e+30 0.00000000e+00 4.38944486e+31 0.00000000e+00 -1.36804365e+33 0.00000000e+00 3.39274825e+34 0.00000000e+00 -6.70838858e+35 0.00000000e+00 1.05657120e+37 0.00000000e+00 -1.32071400e+38 0.00000000e+00 1.30184666e+39 0.00000000e+00 -1.00242193e+40 0.00000000e+00 5.95188019e+40 0.00000000e+00 -2.67834609e+41 0.00000000e+00 8.92782029e+41 0.00000000e+00 -2.13797802e+42 0.00000000e+00 3.52766373e+42 0.00000000e+00 -3.77963971e+42 0.00000000e+00 2.40522527e+42 0.00000000e+00 -7.84312587e+41 0.00000000e+00 9.80390734e+40 0.00000000e+00 -1.96078147e+39]; h_prev=[0 1]; h_now=[2 0]; if order == 0 h=h_prev; else h=h_now; end if ( order >= 1 && order <= 50) h = H(order,51-order:end); end h_prev = H(49,2:end); h_now = H(50,1:end); if ( order > 50 ) for ord=51:order x=[];y=[]; if (length(h_now) < (1+ord)) x=0; end; y=zeros(1,(1+ord)-length(h_prev)); h=[2*h_now, x] -[y, 2*(ord-1)*h_prev]; h_prev=h_now; h_now=h; end end if nargin == 2 h = polyval(h,val); end endfunction miscellaneous-1.3.1/inst/hilbert_curve.m0000644000000000000000000000530614650254633015311 0ustar00## Copyright (C) 2009 Javier Enciso ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function file} {@var{x}, @var{y}} hilbert_curve (@var{n}) ## Creates an iteration of the Hilbert space-filling curve with @var{n} points. ## The argument @var{n} must be of the form @code{2^M}, where @var{m} is an ## integer greater than 0. ## ## @example ## n = 8 ## [x ,y] = hilbert_curve (n); ## line (x, y, "linewidth", 4, "color", "blue"); ## @end example ## ## @end deftypefn function [x, y] = hilbert_curve (n) if (nargin != 1) print_usage (); endif exp2 = log (n) / log (2); if (exp2 != floor (exp2)) error ('Octave:invalid-input-arg', 'hilbert_curve: input argument must be a power of 2.'); endif [x, y] = hc_recursion (n); endfunction function [x, y] = hc_recursion (n) if (n == 2) x = [0; 0; 1; 1]; y = [0; 1; 1; 0]; else nh = n / 2; [x1, y1] = hc_recursion (nh); x = [y1; x1; nh + x1; n - 1 - y1]; nhy1 = nh + y1; y = [x1; nhy1; nhy1; nh - 1 - x1]; endif endfunction %!test %! n = 2; %! expect = [0, 0, 1, 1; 0, 1, 1, 0]; %! [get(1,:), get(2,:)] = hilbert_curve (n); %! if (any(size (expect) != size (get))) %! error ("wrong size: expected %d,%d but got %d,%d", size (expect), size (get)); %! elseif (any (any (expect!=get))) %! error ("didn't get what was expected."); %! endif %!test %! n = 5; %!error hilbert_curve (n); %!demo %! clf %! n = 4; %! [x, y] = hilbert_curve (n); %! line (x, y, "linewidth", 4, "color", "blue"); %! % ----------------------------------------------------------------------- %! % the figure window shows an iteration of the Hilbert space-fillig curve %! % with 4 points on each axis. %!demo %! clf %! n = 64; %! [x, y] = hilbert_curve (n); %! line (x, y, "linewidth", 2, "color", "blue"); %! % ---------------------------------------------------------------------- %! % the figure window shows an iteration of the Hilbert space-fillig curve %! % with 64 points on each axis. miscellaneous-1.3.1/inst/idxmatrix.m0000644000000000000000000000350414650254633014463 0ustar00## Copyright (C) 2017 - Juan Pablo Carbajal ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . ## Author: Juan Pablo Carbajal ## -*- texinfo -*- ## @defun {@var{m} =} idxmatrix (@var{sz}) ## Create matrix of subindexes ## ## Create a matrix with each element correspoding ## to its subindex in the matrix, i.e. ## ## @example ## @var{m}(i,j,k) = i * 100 + j * 10 + k = ijk ## @end example ## ## The input @var{sz} defines the size of the matrix. ## ## Example: ## ## @example ## ## M = idxmatrix ([2 3 2]) ## ans(:,:,1) = ## ## 111 121 131 ## 211 221 231 ## ##ans(:,:,2) = ## ## 112 122 132 ## 212 222 232 ## @end example ## ## @seealso{sub2ind} ## @end defun function M = idxmatrix (sz) # Check input if (isscalar (sz)) if (sz == 0) M = []; return; else sz = [sz sz]; endif endif if (any(sz < 0) || isempty (sz)) error ('Octave:invalid-input-arg', ... 'Size should contain non-negative integers'); endif ###### M = 0; n = length (sz); for i = (n-1):-1:0; M = ( M + 10^i * (1:sz(n-i)) )(:); endfor M = reshape (M, sz); endfunction %!error (idxmatrix ([])) %!assert (idxmatrix (0), []) %!assert (idxmatrix (2), idxmatrix ([2 2])) miscellaneous-1.3.1/inst/infoskeleton.m0000644000000000000000000000701014650254633015146 0ustar00## Copyright (C) 2008 Muthiah Annamalai ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ##-*- texinfo -*- ## @deftypefn{Function File} infoskeleton(@var{prototype}, @var{index_str}, @var{see_also}) ## Generate TeXinfo skeleton documentation of @var{prototype}. ## ## Optionally @var{index_str} and @var{see_also} can be specified. ## ## Usage of this function is typically, ## @example ## infoskeleton('[V,Q] = eig( A )','linear algebra','eigs, chol, qr, det') ## @end example ## @seealso{info} ## @end deftypefn function infoskeleton( prototype , index_str, seealso) ## FIXME: add placeholders for math TeX code, examples etc. if nargin < 1 print_usage(); end if nargin < 2 index_str = ""; end if nargin < 3 seealso = ""; end ## ## try to parse the function prototype ## as: ## function retval = fname ( arg1, arg2, etc )" ## prototype = strtrim( prototype ); idx = strfind( prototype, "function" ); if ( !isempty( idx ) ) prototype(idx:idx+7) = ""; end idx = strfind( prototype, "=" ); retval = ""; if( !isempty( idx ) ) retval = strtrim ( prototype( 1 : idx(1)-1 ) ); prototype = prototype ( idx(1) + 1: end ); end idx = strfind( prototype, "(" ); fname = prototype; if( !isempty( idx ) ) fname = strtrim( prototype(1:idx(1)-1) ); prototype = prototype(idx(1) + 1:end); end ## next time, use strtok() very easy & simple pos = 0; args = {}; idx = strfind( prototype , "," ); if ( !isempty( idx ) ) prev = [ 0, idx ]; for pos=1:length( idx ) args{ pos } = strtrim ( prototype(prev( pos )+1 :idx(pos)-1) ); end prototype = prototype(idx(end) + 1:end); end idx = strfind( prototype, ")" ); if ( !isempty( idx ) ) lvar = strtrim ( prototype(1:idx(1)-1) ); if ( length( lvar ) > 0 ) args{ pos + 1 } = lvar; end end ## generate the code fprintf("## -*- texinfo -*-\n") if ( length( retval ) > 0 ) fprintf("## @deftypefn{Function File} {@var{%s} = } %s (", ... retval,fname ); else fprintf("## @deftypefn{Function File} { } %s (", ... fname ); end pos = 0; for pos = 1:length(args)-1 fprintf(" %s,", args{pos} ); end if ( length(args) > 0 ) fprintf(" %s ) \n", args{pos+1} ); end fprintf("## @cindex %s \n",index_str); fprintf("## The function %s calculates where",fname ); pos = 0; for pos = 1:length(args)-1 fprintf(" @var{%s} is ,", args{pos} ); end if ( length(args) > 0 ) fprintf(" @var{%s} is .\n", args{pos+1} ); end fprintf("## @example\n"); fprintf("## \n"); fprintf("## @end example\n"); fprintf("## @seealso{%s}\n",seealso); fprintf("## @end deftypefn\n"); end %!demo infoskeleton( ' [x,y,z]=infoskeleton(func , z , z9 , jj, fjh, x) ') %!demo infoskeleton('[V,Q] = eig( A )','linear algebra','eigs, chol, qr, det') %!demo infoskeleton( 'function [x,y,z] = indian_languages ( x) ') miscellaneous-1.3.1/inst/laguerrepoly.m0000644000000000000000000000336414650254633015170 0ustar00## Copyright (C) 2007 Muthiah Annamalai ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function File} {@var{coefs}=} laguerrepoly (@var{order},@var{x}) ## ## Compute the coefficients of the Laguerre polynomial, given the ## @var{order}. We calculate the Laguerre polynomial using the recurrence ## relations, Ln+1(x) = inv(n+1)*((2n+1-x)Ln(x) - nLn-1(x)). ## ## If the value @var{x} is specified, the polynomial is also evaluated, ## otherwise just the return the coefficients of the polynomial are returned. ## ## This is NOT the generalized Laguerre polynomial. ## ## @end deftypefn function h = laguerrepoly (order, val) if (nargin < 1 || nargin > 2) print_usage endif h_prev=[0 1]; h_now=[-1 1]; if order == 0 h=h_prev; else h=h_now; endif for ord=2:order x=[]; y=[]; if (length(h_now) < (1+ord)) x=0; endif y=zeros(1,(1+ord)-length(h_prev)); p1=[h_now, x]; p2=[x, h_now]; p3=[y, h_prev]; h=((2*ord -1).*p2 -p1 -(ord -1).*p3)./(ord); h_prev=h_now; h_now=h; endfor if nargin == 2 h=polyval(h,val); endif endfunction miscellaneous-1.3.1/inst/legendrepoly.m0000644000000000000000000000334314650254633015144 0ustar00## Copyright (C) 2007 Muthiah Annamalai ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function File} {@var{coefs}=} legendrepoly (@var{order},@var{x}) ## ## Compute the coefficients of the Legendre polynomial, given the ## @var{order}. We calculate the Legendre polynomial using the recurrence ## relations, Pn+1(x) = inv(n+1)*((2n+1)*x*Pn(x) - nPn-1(x)). ## ## If the value @var{x} is specified, the polynomial is also evaluated, ## otherwise just the return the coefficients of the polynomial are returned. ## ## This is NOT the generalized Legendre polynomial. ## ## @end deftypefn function h = legendrepoly (order, val) if (nargin < 1 || nargin > 2) print_usage endif h_prev = [0 1]; h_now = [1 0]; if order == 0 h=h_prev; else h=h_now; endif for ord=2:order x=[]; y=[]; if (length(h_now) < (1+ord)) x=0; endif y=zeros(1,(1+ord)-length(h_prev)); p1=[h_now, x]; p3=[y, h_prev]; h=((2*ord -1).*p1 -(ord -1).*p3)./(ord); h_prev=h_now; h_now=h; endfor if nargin == 2 h=polyval(h,val); endif endfunction miscellaneous-1.3.1/inst/match.m0000644000000000000000000000530214650254633013544 0ustar00## Copyright (C) 2007 Muthiah Annamalai ## Copyright (C) 2012 Carnë Draug ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function File} @var{result} = {} match ( @var{fun_handle}, @var{iterable} ) ## match is filter, like Lisp's ( & numerous other language's ) function for ## Python has a built-in filter function which takes two arguments, ## a function and a list, and returns a list. 'match' performs the same ## operation like filter in Python. The match applies the ## function to each of the element in the @var{iterable} and collects ## that the result of a function applied to each of the data structure's ## elements in turn, and the return values are collected as a list of ## input arguments, whenever the function-result is 'true' in Octave ## sense. Anything (1,true,?) evaluating to true, the argument is ## saved into the return value. ## ## @var{fun_handle} can either be a function name string or a ## function handle (recommended). ## ## Typically you can use it as, ## @example ## match(@@(x) ( x >= 1 ), [-1 0 1 2]) ## @result{} 1 2 ## @end example ## @seealso{reduce, cellfun, arrayfun, cellfun, structfun, spfun} ## @end deftypefn function rval = match (fun_handle, data) if (nargin != 2) print_usage; endif if (isa (fun_handle, "function_handle")) ##do nothing elseif (ischar (fun_handle)) fun_handle = str2func (fun_handle); else error ("fun_handle must either be a function handle or the name of a function"); endif LD = length(data); if (iscell (data)) rval = {}; for idx=1:LD if fun_handle(data{idx}), rval = [rval, data{idx}]; endif endfor elseif (ismatrix (data)) rval = []; for idx=1:LD if fun_handle(data(idx)), rval = [rval, data(idx)]; endif endfor else error("data must either be a cell array or matrix"); endif endfunction %!assert(match(@(x) mod(x,2),1:10),[1:2:10],0) %!assert(match(@sin,1:10),[1:10],0) %!assert(match(@(x) strcmp('Octave',x),{'Matlab','Octave'}),{'Octave'},0) %!assert(match(@(x) (x>0), [-10:+10]),[1:10],0) miscellaneous-1.3.1/inst/normc.m0000644000000000000000000000346614650254633013577 0ustar00## Copyright (C) 2011 Thomas Weber ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function File} {@var{x} =} normc (@var{M}) ## Normalize the columns of a matrix to a length of 1 and return the matrix. ## ## @example ## M=[1,2; 3,4]; ## normc(M) ## ## ans = ## ## 0.31623 0.44721 ## 0.94868 0.89443 ## ## @end example ## @seealso{normr} ## @end deftypefn function X = normc(M) if (1 != nargin) print_usage; endif X = normr(M.').'; endfunction %% test for real and complex matrices %!test %! M = [1,2; 3,4]; %! expected = [0.316227766016838, 0.447213595499958; %! 0.948683298050514, 0.894427190999916]; %! assert(normc(M), expected, eps); %!test %! M = [i,2*i; 3*I,4*I]; %! expected = [0.316227766016838*I, 0.447213595499958*I; %! 0.948683298050514*I, 0.894427190999916*I]; %! assert(normc(M), expected, eps); %!test %! M = [1+2*I, 3+4*I; 5+6*I, 7+8*I]; %! expected = [0.123091490979333 + 0.246182981958665i, 0.255376959227625 + 0.340502612303499i; %! 0.615457454896664 + 0.738548945875996i, 0.595879571531124 + 0.681005224606999i]; %! assert(normc(M), expected, 10*eps); %% test error/usage handling %!error normc(); miscellaneous-1.3.1/inst/normr.m0000644000000000000000000000341114650254633013604 0ustar00## Copyright (C) 2011 Thomas Weber ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function File} {@var{x} = } normr (@var{M}) ## Normalize the rows of a matrix to a length of 1 and return the matrix. ## ## @example ## M=[1,2; 3,4]; ## normr(M) ## ## ans = ## ## 0.44721 0.89443 ## 0.60000 0.80000 ## ## @end example ## @seealso{normc} ## @end deftypefn function X = normr(M) if (1 != nargin) print_usage; endif norm = sqrt(sum(M .* conj(M),2)); X = diag(1./norm) * M; endfunction %% test for real and complex matrices %!test %! M = [1,2; 3,4]; %! expected = [0.447213595499958, 0.894427190999916; 0.6, 0.8]; %! assert(normr(M), expected, eps); %!test %! M = [i,2*i; 3*I,4*I]; %! expected = [0.447213595499958*I, 0.894427190999916*I; 0.6*I, 0.8*I]; %! assert(normr(M), expected, eps); %!test %! M = [1+2*I, 3+4*I; 5+6*I, 7+8*I]; %! expected = [0.182574185835055 + 0.365148371670111i, 0.547722557505166 + 0.730296743340221i %! 0.379049021789452 + 0.454858826147342i, 0.530668630505232 + 0.606478434863123i]; %! assert(normr(M), expected, 10*eps); %% test error/usage handling %!error normr(); miscellaneous-1.3.1/inst/nze.m0000644000000000000000000000216214650254633013245 0ustar00## Copyright (C) 2010 VZLU Prague ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn{Function File} {[@var{y}, @var{f}] = } nze (@var{x}) ## Extract nonzero elements of @var{x}. Equivalent to @code{@var{x}(@var{x} != 0)}. ## Optionally, returns also linear indices. ## @end deftypefn ## Author: Etienne Grossmann ## Author: Jaroslav Hajek function [y, f] = nze (x) nz = x != 0; y = x(nz); if (nargout > 1) f = find (nz); endif endfunction miscellaneous-1.3.1/inst/peano_curve.m0000644000000000000000000000567714650254633014775 0ustar00## Copyright (C) 2009 Javier Enciso ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function file} {@var{x}, @var{y}} peano_curve (@var{n}) ## Creates an iteration of the Peano space-filling curve with @var{n} points. ## The argument @var{n} must be of the form @code{3^M}, where @var{m} is an ## integer greater than 0. ## ## @example ## n = 9; ## [x, y] = peano_curve (n); ## line (x, y, "linewidth", 4, "color", "red"); ## @end example ## ## @end deftypefn function [x, y] = peano_curve (n) if (nargin != 1) print_usage (); endif check_power_of_three (n); if (n == 3) x = [0, 0, 0, 1, 1, 1, 2, 2, 2]; y = [0, 1, 2, 2, 1, 0, 0, 1, 2]; else [x1, y1] = peano_curve (n/3); x2 = n/3 - 1 - x1; x3 = n/3 + x1; x4 = n - n/3 - 1 - x1; x5 = n - n/3 + x1; x6 = n - 1 - x1; y2 = n/3 + y1; y3 = n - n/3 + y1; y4 = n - 1 - y1; y5 = n - n/3 - 1 - y1; y6 = n/3 - 1 - y1; x = [x1, x2, x1, x3, x4, x3, x5, x6, x5]; y = [y1, y2, y3, y4, y5, y6, y1, y2, y3]; endif endfunction function check_power_of_three (n) if (frac_part (log (n) / log (3)) != 0) error ("peano_curve: input argument must be a power of 3.") endif endfunction function d = frac_part (f) d = f - floor (f); endfunction %!test %! n = 3; %! expect(1,:) = [0, 0, 0, 1, 1, 1, 2, 2, 2]; %! expect(2,:) = [0, 1, 2, 2, 1, 0, 0, 1, 2]; %! [get(1,:), get(2,:)] = peano_curve (n); %! if (any(size (expect) != size (get))) %! error ("wrong size: expected %d,%d but got %d,%d", size (expect), size (get)); %! elseif (any (any (expect!=get))) %! error ("didn't get what was expected."); %! endif %!test %! n = 5; %!error peano_curve (n); %!demo %! clf %! n = 9; %! [x, y] = peano_curve (n); %! line (x, y, "linewidth", 4, "color", "red"); %! % -------------------------------------------------------------------- %! % the figure window shows an iteration of the Peano space-fillig curve %! % with 9 points on each axis. %!demo %! clf %! n = 81; %! [x, y] = peano_curve (n); %! line (x, y, "linewidth", 2, "color", "red"); %! % -------------------------------------------------------------------- %! % the figure window shows an iteration of the Peano space-fillig curve %! % with 81 points on each axis. miscellaneous-1.3.1/inst/physical_constant.m0000644000000000000000000026454214650254633016212 0ustar00## Copyright (C) 2007 Muthiah Annamalai ## Copyright (C) 2012 Carnë Draug ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function File} {[@var{names}] =} physical_constant ## @deftypefnx {Function File} {[@var{val}, @var{uncertainty}, @var{unit}] =} physical_constant (@var{name}) ## @deftypefnx {Function File} {[@var{constants}] =} physical_constant ("all") ## Get physical constant @var{arg}. ## ## If no arguments are given, returns a cell array with all possible @var{name}s. ## Alternatively, @var{name} can be `all' in which case @var{val} is a structure ## array with 4 fields (name, value, uncertainty, units). ## ## Since the long list of values needs to be parsed on each call to this function ## it is much more efficient to store the values in a variable rather make multiple ## calls to this function with the same argument ## ## The values are the ones recommended by CODATA. This function was autogenerated ## on Tue Jan 10 14:20:56 2017 from NIST database at @uref{http://physics.nist.gov/constants} ## @end deftypefn ## DO NOT EDIT THIS FILE ## This function file is generated automatically by physical_constant.py function [rval, uncert, unit] = physical_constant (arg) persistent unit_data; if (isempty(unit_data)) unit_data = get_data; endif if (nargin > 1 || (nargin == 1 && !ischar (arg))) print_usage; elseif (nargin == 0) rval = reshape ({unit_data(:).name}, size (unit_data)); return elseif (nargin == 1 && strcmpi (arg, "all")) rval = unit_data; return endif val = reshape ({unit_data(:).name}, size (unit_data)); map = strcmpi (val, arg); if (any (map)) val = unit_data(map); rval = val.value; uncert = val.uncertainty; unit = val.units; else error ("No constant with name '%s' found", arg) endif endfunction function unit_data = get_data unit_data(1).name = "Angstrom star"; unit_data(1).value = 1.00001495e-10; unit_data(1).uncertainty = 0.00000090e-10; unit_data(1).units = "m"; unit_data(2).name = "Avogadro constant"; unit_data(2).value = 6.022140857e23; unit_data(2).uncertainty = 0.000000074e23; unit_data(2).units = "mol^-1"; unit_data(3).name = "Bohr magneton"; unit_data(3).value = 927.4009994e-26; unit_data(3).uncertainty = 0.0000057e-26; unit_data(3).units = "J T^-1"; unit_data(4).name = "Bohr magneton in Hz/T"; unit_data(4).value = 13.996245042e9; unit_data(4).uncertainty = 0.000000086e9; unit_data(4).units = "Hz T^-1"; unit_data(5).name = "Bohr magneton in K/T"; unit_data(5).value = 0.67171405; unit_data(5).uncertainty = 0.00000039; unit_data(5).units = "K T^-1"; unit_data(6).name = "Bohr magneton in eV/T"; unit_data(6).value = 5.7883818012e-5; unit_data(6).uncertainty = 0.0000000026e-5; unit_data(6).units = "eV T^-1"; unit_data(7).name = "Bohr magneton in inverse meters per tesla"; unit_data(7).value = 46.68644814; unit_data(7).uncertainty = 0.00000029; unit_data(7).units = "m^-1 T^-1"; unit_data(8).name = "Bohr radius"; unit_data(8).value = 0.52917721067e-10; unit_data(8).uncertainty = 0.00000000012e-10; unit_data(8).units = "m"; unit_data(9).name = "Boltzmann constant"; unit_data(9).value = 1.38064852e-23; unit_data(9).uncertainty = 0.00000079e-23; unit_data(9).units = "J K^-1"; unit_data(10).name = "Boltzmann constant in Hz/K"; unit_data(10).value = 2.0836612e10; unit_data(10).uncertainty = 0.0000012e10; unit_data(10).units = "Hz K^-1"; unit_data(11).name = "Boltzmann constant in eV/K"; unit_data(11).value = 8.6173303e-5; unit_data(11).uncertainty = 0.0000050e-5; unit_data(11).units = "eV K^-1"; unit_data(12).name = "Boltzmann constant in inverse meters per kelvin"; unit_data(12).value = 69.503457; unit_data(12).uncertainty = 0.000040; unit_data(12).units = "m^-1 K^-1"; unit_data(13).name = "Compton wavelength"; unit_data(13).value = 2.4263102367e-12; unit_data(13).uncertainty = 0.0000000011e-12; unit_data(13).units = "m"; unit_data(14).name = "Compton wavelength over 2 pi"; unit_data(14).value = 386.15926764e-15; unit_data(14).uncertainty = 0.00000018e-15; unit_data(14).units = "m"; unit_data(15).name = "Cu x unit"; unit_data(15).value = 1.00207697e-13; unit_data(15).uncertainty = 0.00000028e-13; unit_data(15).units = "m"; unit_data(16).name = "Faraday constant"; unit_data(16).value = 96485.33289; unit_data(16).uncertainty = 0.00059; unit_data(16).units = "C mol^-1"; unit_data(17).name = "Faraday constant for conventional electric current"; unit_data(17).value = 96485.3251; unit_data(17).uncertainty = 0.0012; unit_data(17).units = "C_90 mol^-1"; unit_data(18).name = "Fermi coupling constant"; unit_data(18).value = 1.1663787e-5; unit_data(18).uncertainty = 0.0000006e-5; unit_data(18).units = "GeV^-2"; unit_data(19).name = "Hartree energy"; unit_data(19).value = 4.359744650e-18; unit_data(19).uncertainty = 0.000000054e-18; unit_data(19).units = "J"; unit_data(20).name = "Hartree energy in eV"; unit_data(20).value = 27.21138602; unit_data(20).uncertainty = 0.00000017; unit_data(20).units = "eV"; unit_data(21).name = "Josephson constant"; unit_data(21).value = 483597.8525e9; unit_data(21).uncertainty = 0.0030e9; unit_data(21).units = "Hz V^-1"; unit_data(22).name = "Loschmidt constant (273.15 K, 100 kPa)"; unit_data(22).value = 2.6516467e25; unit_data(22).uncertainty = 0.0000015e25; unit_data(22).units = "m^-3"; unit_data(23).name = "Loschmidt constant (273.15 K, 101.325 kPa)"; unit_data(23).value = 2.6867811e25; unit_data(23).uncertainty = 0.0000015e25; unit_data(23).units = "m^-3"; unit_data(24).name = "Mo x unit"; unit_data(24).value = 1.00209952e-13; unit_data(24).uncertainty = 0.00000053e-13; unit_data(24).units = "m"; unit_data(25).name = "Newtonian constant of gravitation"; unit_data(25).value = 6.67408e-11; unit_data(25).uncertainty = 0.00031e-11; unit_data(25).units = "m^3 kg^-1 s^-2"; unit_data(26).name = "Newtonian constant of gravitation over h-bar c"; unit_data(26).value = 6.70861e-39; unit_data(26).uncertainty = 0.00031e-39; unit_data(26).units = "(GeV/c^2)^-2"; unit_data(27).name = "Planck constant"; unit_data(27).value = 6.626070040e-34; unit_data(27).uncertainty = 0.000000081e-34; unit_data(27).units = "J s"; unit_data(28).name = "Planck constant in eV s"; unit_data(28).value = 4.135667662e-15; unit_data(28).uncertainty = 0.000000025e-15; unit_data(28).units = "eV s"; unit_data(29).name = "Planck constant over 2 pi"; unit_data(29).value = 1.054571800e-34; unit_data(29).uncertainty = 0.000000013e-34; unit_data(29).units = "J s"; unit_data(30).name = "Planck constant over 2 pi in eV s"; unit_data(30).value = 6.582119514e-16; unit_data(30).uncertainty = 0.000000040e-16; unit_data(30).units = "eV s"; unit_data(31).name = "Planck constant over 2 pi times c in MeV fm"; unit_data(31).value = 197.3269788; unit_data(31).uncertainty = 0.0000012; unit_data(31).units = "MeV fm"; unit_data(32).name = "Planck length"; unit_data(32).value = 1.616229e-35; unit_data(32).uncertainty = 0.000038e-35; unit_data(32).units = "m"; unit_data(33).name = "Planck mass"; unit_data(33).value = 2.176470e-8; unit_data(33).uncertainty = 0.000051e-8; unit_data(33).units = "kg"; unit_data(34).name = "Planck mass energy equivalent in GeV"; unit_data(34).value = 1.220910e19; unit_data(34).uncertainty = 0.000029e19; unit_data(34).units = "GeV"; unit_data(35).name = "Planck temperature"; unit_data(35).value = 1.416808e32; unit_data(35).uncertainty = 0.000033e32; unit_data(35).units = "K"; unit_data(36).name = "Planck time"; unit_data(36).value = 5.39116e-44; unit_data(36).uncertainty = 0.00013e-44; unit_data(36).units = "s"; unit_data(37).name = "Rydberg constant"; unit_data(37).value = 10973731.568508; unit_data(37).uncertainty = 0.000065; unit_data(37).units = "m^-1"; unit_data(38).name = "Rydberg constant times c in Hz"; unit_data(38).value = 3.289841960355e15; unit_data(38).uncertainty = 0.000000000019e15; unit_data(38).units = "Hz"; unit_data(39).name = "Rydberg constant times hc in J"; unit_data(39).value = 2.179872325e-18; unit_data(39).uncertainty = 0.000000027e-18; unit_data(39).units = "J"; unit_data(40).name = "Rydberg constant times hc in eV"; unit_data(40).value = 13.605693009; unit_data(40).uncertainty = 0.000000084; unit_data(40).units = "eV"; unit_data(41).name = "Sackur-Tetrode constant (1 K, 100 kPa)"; unit_data(41).value = -1.1517084; unit_data(41).uncertainty = 0.0000014; unit_data(41).units = ""; unit_data(42).name = "Sackur-Tetrode constant (1 K, 101.325 kPa)"; unit_data(42).value = -1.1648714; unit_data(42).uncertainty = 0.0000014; unit_data(42).units = ""; unit_data(43).name = "Stefan-Boltzmann constant"; unit_data(43).value = 5.670367e-8; unit_data(43).uncertainty = 0.000013e-8; unit_data(43).units = "W m^-2 K^-4"; unit_data(44).name = "Thomson cross section"; unit_data(44).value = 0.66524587158e-28; unit_data(44).uncertainty = 0.00000000091e-28; unit_data(44).units = "m^2"; unit_data(45).name = "Wien frequency displacement law constant"; unit_data(45).value = 5.8789238e10; unit_data(45).uncertainty = 0.0000034e10; unit_data(45).units = "Hz K^-1"; unit_data(46).name = "Wien wavelength displacement law constant"; unit_data(46).value = 2.8977729e-3; unit_data(46).uncertainty = 0.0000017e-3; unit_data(46).units = "m K"; unit_data(47).name = "alpha particle mass"; unit_data(47).value = 6.644657230e-27; unit_data(47).uncertainty = 0.000000082e-27; unit_data(47).units = "kg"; unit_data(48).name = "alpha particle mass energy equivalent"; unit_data(48).value = 5.971920097e-10; unit_data(48).uncertainty = 0.000000073e-10; unit_data(48).units = "J"; unit_data(49).name = "alpha particle mass energy equivalent in MeV"; unit_data(49).value = 3727.379378; unit_data(49).uncertainty = 0.000023; unit_data(49).units = "MeV"; unit_data(50).name = "alpha particle mass in u"; unit_data(50).value = 4.001506179127; unit_data(50).uncertainty = 0.000000000063; unit_data(50).units = "u"; unit_data(51).name = "alpha particle molar mass"; unit_data(51).value = 4.001506179127e-3; unit_data(51).uncertainty = 0.000000000063e-3; unit_data(51).units = "kg mol^-1"; unit_data(52).name = "alpha particle-electron mass ratio"; unit_data(52).value = 7294.29954136; unit_data(52).uncertainty = 0.00000024; unit_data(52).units = ""; unit_data(53).name = "alpha particle-proton mass ratio"; unit_data(53).value = 3.97259968907; unit_data(53).uncertainty = 0.00000000036; unit_data(53).units = ""; unit_data(54).name = "atomic mass constant"; unit_data(54).value = 1.660539040e-27; unit_data(54).uncertainty = 0.000000020e-27; unit_data(54).units = "kg"; unit_data(55).name = "atomic mass constant energy equivalent"; unit_data(55).value = 1.492418062e-10; unit_data(55).uncertainty = 0.000000018e-10; unit_data(55).units = "J"; unit_data(56).name = "atomic mass constant energy equivalent in MeV"; unit_data(56).value = 931.4940954; unit_data(56).uncertainty = 0.0000057; unit_data(56).units = "MeV"; unit_data(57).name = "atomic mass unit-electron volt relationship"; unit_data(57).value = 931.4940954e6; unit_data(57).uncertainty = 0.0000057e6; unit_data(57).units = "eV"; unit_data(58).name = "atomic mass unit-hartree relationship"; unit_data(58).value = 3.4231776902e7; unit_data(58).uncertainty = 0.0000000016e7; unit_data(58).units = "E_h"; unit_data(59).name = "atomic mass unit-hertz relationship"; unit_data(59).value = 2.2523427206e23; unit_data(59).uncertainty = 0.0000000010e23; unit_data(59).units = "Hz"; unit_data(60).name = "atomic mass unit-inverse meter relationship"; unit_data(60).value = 7.5130066166e14; unit_data(60).uncertainty = 0.0000000034e14; unit_data(60).units = "m^-1"; unit_data(61).name = "atomic mass unit-joule relationship"; unit_data(61).value = 1.492418062e-10; unit_data(61).uncertainty = 0.000000018e-10; unit_data(61).units = "J"; unit_data(62).name = "atomic mass unit-kelvin relationship"; unit_data(62).value = 1.08095438e13; unit_data(62).uncertainty = 0.00000062e13; unit_data(62).units = "K"; unit_data(63).name = "atomic mass unit-kilogram relationship"; unit_data(63).value = 1.660539040e-27; unit_data(63).uncertainty = 0.000000020e-27; unit_data(63).units = "kg"; unit_data(64).name = "atomic unit of 1st hyperpolarizability"; unit_data(64).value = 3.206361329e-53; unit_data(64).uncertainty = 0.000000020e-53; unit_data(64).units = "C^3 m^3 J^-2"; unit_data(65).name = "atomic unit of 2nd hyperpolarizability"; unit_data(65).value = 6.235380085e-65; unit_data(65).uncertainty = 0.000000077e-65; unit_data(65).units = "C^4 m^4 J^-3"; unit_data(66).name = "atomic unit of action"; unit_data(66).value = 1.054571800e-34; unit_data(66).uncertainty = 0.000000013e-34; unit_data(66).units = "J s"; unit_data(67).name = "atomic unit of charge"; unit_data(67).value = 1.6021766208e-19; unit_data(67).uncertainty = 0.0000000098e-19; unit_data(67).units = "C"; unit_data(68).name = "atomic unit of charge density"; unit_data(68).value = 1.0812023770e12; unit_data(68).uncertainty = 0.0000000067e12; unit_data(68).units = "C m^-3"; unit_data(69).name = "atomic unit of current"; unit_data(69).value = 6.623618183e-3; unit_data(69).uncertainty = 0.000000041e-3; unit_data(69).units = "A"; unit_data(70).name = "atomic unit of electric dipole mom."; unit_data(70).value = 8.478353552e-30; unit_data(70).uncertainty = 0.000000052e-30; unit_data(70).units = "C m"; unit_data(71).name = "atomic unit of electric field"; unit_data(71).value = 5.142206707e11; unit_data(71).uncertainty = 0.000000032e11; unit_data(71).units = "V m^-1"; unit_data(72).name = "atomic unit of electric field gradient"; unit_data(72).value = 9.717362356e21; unit_data(72).uncertainty = 0.000000060e21; unit_data(72).units = "V m^-2"; unit_data(73).name = "atomic unit of electric polarizability"; unit_data(73).value = 1.6487772731e-41; unit_data(73).uncertainty = 0.0000000011e-41; unit_data(73).units = "C^2 m^2 J^-1"; unit_data(74).name = "atomic unit of electric potential"; unit_data(74).value = 27.21138602; unit_data(74).uncertainty = 0.00000017; unit_data(74).units = "V"; unit_data(75).name = "atomic unit of electric quadrupole mom."; unit_data(75).value = 4.486551484e-40; unit_data(75).uncertainty = 0.000000028e-40; unit_data(75).units = "C m^2"; unit_data(76).name = "atomic unit of energy"; unit_data(76).value = 4.359744650e-18; unit_data(76).uncertainty = 0.000000054e-18; unit_data(76).units = "J"; unit_data(77).name = "atomic unit of force"; unit_data(77).value = 8.23872336e-8; unit_data(77).uncertainty = 0.00000010e-8; unit_data(77).units = "N"; unit_data(78).name = "atomic unit of length"; unit_data(78).value = 0.52917721067e-10; unit_data(78).uncertainty = 0.00000000012e-10; unit_data(78).units = "m"; unit_data(79).name = "atomic unit of mag. dipole mom."; unit_data(79).value = 1.854801999e-23; unit_data(79).uncertainty = 0.000000011e-23; unit_data(79).units = "J T^-1"; unit_data(80).name = "atomic unit of mag. flux density"; unit_data(80).value = 2.350517550e5; unit_data(80).uncertainty = 0.000000014e5; unit_data(80).units = "T"; unit_data(81).name = "atomic unit of magnetizability"; unit_data(81).value = 7.8910365886e-29; unit_data(81).uncertainty = 0.0000000090e-29; unit_data(81).units = "J T^-2"; unit_data(82).name = "atomic unit of mass"; unit_data(82).value = 9.10938356e-31; unit_data(82).uncertainty = 0.00000011e-31; unit_data(82).units = "kg"; unit_data(83).name = "atomic unit of mom.um"; unit_data(83).value = 1.992851882e-24; unit_data(83).uncertainty = 0.000000024e-24; unit_data(83).units = "kg m s^-1"; unit_data(84).name = "atomic unit of permittivity"; unit_data(84).value = 1.112650056e-10; unit_data(84).uncertainty = 0.0; unit_data(84).units = "F m^-1"; unit_data(85).name = "atomic unit of time"; unit_data(85).value = 2.418884326509e-17; unit_data(85).uncertainty = 0.000000000014e-17; unit_data(85).units = "s"; unit_data(86).name = "atomic unit of velocity"; unit_data(86).value = 2.18769126277e6; unit_data(86).uncertainty = 0.00000000050e6; unit_data(86).units = "m s^-1"; unit_data(87).name = "characteristic impedance of vacuum"; unit_data(87).value = 376.730313461; unit_data(87).uncertainty = 0.0; unit_data(87).units = "ohm"; unit_data(88).name = "classical electron radius"; unit_data(88).value = 2.8179403227e-15; unit_data(88).uncertainty = 0.0000000019e-15; unit_data(88).units = "m"; unit_data(89).name = "conductance quantum"; unit_data(89).value = 7.7480917310e-5; unit_data(89).uncertainty = 0.0000000018e-5; unit_data(89).units = "S"; unit_data(90).name = "conventional value of Josephson constant"; unit_data(90).value = 483597.9e9; unit_data(90).uncertainty = 0.0; unit_data(90).units = "Hz V^-1"; unit_data(91).name = "conventional value of von Klitzing constant"; unit_data(91).value = 25812.807; unit_data(91).uncertainty = 0.0; unit_data(91).units = "ohm"; unit_data(92).name = "deuteron g factor"; unit_data(92).value = 0.8574382311; unit_data(92).uncertainty = 0.0000000048; unit_data(92).units = ""; unit_data(93).name = "deuteron mag. mom."; unit_data(93).value = 0.4330735040e-26; unit_data(93).uncertainty = 0.0000000036e-26; unit_data(93).units = "J T^-1"; unit_data(94).name = "deuteron mag. mom. to Bohr magneton ratio"; unit_data(94).value = 0.4669754554e-3; unit_data(94).uncertainty = 0.0000000026e-3; unit_data(94).units = ""; unit_data(95).name = "deuteron mag. mom. to nuclear magneton ratio"; unit_data(95).value = 0.8574382311; unit_data(95).uncertainty = 0.0000000048; unit_data(95).units = ""; unit_data(96).name = "deuteron mass"; unit_data(96).value = 3.343583719e-27; unit_data(96).uncertainty = 0.000000041e-27; unit_data(96).units = "kg"; unit_data(97).name = "deuteron mass energy equivalent"; unit_data(97).value = 3.005063183e-10; unit_data(97).uncertainty = 0.000000037e-10; unit_data(97).units = "J"; unit_data(98).name = "deuteron mass energy equivalent in MeV"; unit_data(98).value = 1875.612928; unit_data(98).uncertainty = 0.000012; unit_data(98).units = "MeV"; unit_data(99).name = "deuteron mass in u"; unit_data(99).value = 2.013553212745; unit_data(99).uncertainty = 0.000000000040; unit_data(99).units = "u"; unit_data(100).name = "deuteron molar mass"; unit_data(100).value = 2.013553212745e-3; unit_data(100).uncertainty = 0.000000000040e-3; unit_data(100).units = "kg mol^-1"; unit_data(101).name = "deuteron rms charge radius"; unit_data(101).value = 2.1413e-15; unit_data(101).uncertainty = 0.0025e-15; unit_data(101).units = "m"; unit_data(102).name = "deuteron-electron mag. mom. ratio"; unit_data(102).value = -4.664345535e-4; unit_data(102).uncertainty = 0.000000026e-4; unit_data(102).units = ""; unit_data(103).name = "deuteron-electron mass ratio"; unit_data(103).value = 3670.48296785; unit_data(103).uncertainty = 0.00000013; unit_data(103).units = ""; unit_data(104).name = "deuteron-neutron mag. mom. ratio"; unit_data(104).value = -0.44820652; unit_data(104).uncertainty = 0.00000011; unit_data(104).units = ""; unit_data(105).name = "deuteron-proton mag. mom. ratio"; unit_data(105).value = 0.3070122077; unit_data(105).uncertainty = 0.0000000015; unit_data(105).units = ""; unit_data(106).name = "deuteron-proton mass ratio"; unit_data(106).value = 1.99900750087; unit_data(106).uncertainty = 0.00000000019; unit_data(106).units = ""; unit_data(107).name = "electric constant"; unit_data(107).value = 8.854187817e-12; unit_data(107).uncertainty = 0.0; unit_data(107).units = "F m^-1"; unit_data(108).name = "electron charge to mass quotient"; unit_data(108).value = -1.758820024e11; unit_data(108).uncertainty = 0.000000011e11; unit_data(108).units = "C kg^-1"; unit_data(109).name = "electron g factor"; unit_data(109).value = -2.00231930436182; unit_data(109).uncertainty = 0.00000000000052; unit_data(109).units = ""; unit_data(110).name = "electron gyromag. ratio"; unit_data(110).value = 1.760859644e11; unit_data(110).uncertainty = 0.000000011e11; unit_data(110).units = "s^-1 T^-1"; unit_data(111).name = "electron gyromag. ratio over 2 pi"; unit_data(111).value = 28024.95164; unit_data(111).uncertainty = 0.00017; unit_data(111).units = "MHz T^-1"; unit_data(112).name = "electron mag. mom."; unit_data(112).value = -928.4764620e-26; unit_data(112).uncertainty = 0.0000057e-26; unit_data(112).units = "J T^-1"; unit_data(113).name = "electron mag. mom. anomaly"; unit_data(113).value = 1.15965218091e-3; unit_data(113).uncertainty = 0.00000000026e-3; unit_data(113).units = ""; unit_data(114).name = "electron mag. mom. to Bohr magneton ratio"; unit_data(114).value = -1.00115965218091; unit_data(114).uncertainty = 0.00000000000026; unit_data(114).units = ""; unit_data(115).name = "electron mag. mom. to nuclear magneton ratio"; unit_data(115).value = -1838.28197234; unit_data(115).uncertainty = 0.00000017; unit_data(115).units = ""; unit_data(116).name = "electron mass"; unit_data(116).value = 9.10938356e-31; unit_data(116).uncertainty = 0.00000011e-31; unit_data(116).units = "kg"; unit_data(117).name = "electron mass energy equivalent"; unit_data(117).value = 8.18710565e-14; unit_data(117).uncertainty = 0.00000010e-14; unit_data(117).units = "J"; unit_data(118).name = "electron mass energy equivalent in MeV"; unit_data(118).value = 0.5109989461; unit_data(118).uncertainty = 0.0000000031; unit_data(118).units = "MeV"; unit_data(119).name = "electron mass in u"; unit_data(119).value = 5.48579909070e-4; unit_data(119).uncertainty = 0.00000000016e-4; unit_data(119).units = "u"; unit_data(120).name = "electron molar mass"; unit_data(120).value = 5.48579909070e-7; unit_data(120).uncertainty = 0.00000000016e-7; unit_data(120).units = "kg mol^-1"; unit_data(121).name = "electron to alpha particle mass ratio"; unit_data(121).value = 1.370933554798e-4; unit_data(121).uncertainty = 0.000000000045e-4; unit_data(121).units = ""; unit_data(122).name = "electron to shielded helion mag. mom. ratio"; unit_data(122).value = 864.058257; unit_data(122).uncertainty = 0.000010; unit_data(122).units = ""; unit_data(123).name = "electron to shielded proton mag. mom. ratio"; unit_data(123).value = -658.2275971; unit_data(123).uncertainty = 0.0000072; unit_data(123).units = ""; unit_data(124).name = "electron volt"; unit_data(124).value = 1.6021766208e-19; unit_data(124).uncertainty = 0.0000000098e-19; unit_data(124).units = "J"; unit_data(125).name = "electron volt-atomic mass unit relationship"; unit_data(125).value = 1.0735441105e-9; unit_data(125).uncertainty = 0.0000000066e-9; unit_data(125).units = "u"; unit_data(126).name = "electron volt-hartree relationship"; unit_data(126).value = 3.674932248e-2; unit_data(126).uncertainty = 0.000000023e-2; unit_data(126).units = "E_h"; unit_data(127).name = "electron volt-hertz relationship"; unit_data(127).value = 2.417989262e14; unit_data(127).uncertainty = 0.000000015e14; unit_data(127).units = "Hz"; unit_data(128).name = "electron volt-inverse meter relationship"; unit_data(128).value = 8.065544005e5; unit_data(128).uncertainty = 0.000000050e5; unit_data(128).units = "m^-1"; unit_data(129).name = "electron volt-joule relationship"; unit_data(129).value = 1.6021766208e-19; unit_data(129).uncertainty = 0.0000000098e-19; unit_data(129).units = "J"; unit_data(130).name = "electron volt-kelvin relationship"; unit_data(130).value = 1.16045221e4; unit_data(130).uncertainty = 0.00000067e4; unit_data(130).units = "K"; unit_data(131).name = "electron volt-kilogram relationship"; unit_data(131).value = 1.782661907e-36; unit_data(131).uncertainty = 0.000000011e-36; unit_data(131).units = "kg"; unit_data(132).name = "electron-deuteron mag. mom. ratio"; unit_data(132).value = -2143.923499; unit_data(132).uncertainty = 0.000012; unit_data(132).units = ""; unit_data(133).name = "electron-deuteron mass ratio"; unit_data(133).value = 2.724437107484e-4; unit_data(133).uncertainty = 0.000000000096e-4; unit_data(133).units = ""; unit_data(134).name = "electron-helion mass ratio"; unit_data(134).value = 1.819543074854e-4; unit_data(134).uncertainty = 0.000000000088e-4; unit_data(134).units = ""; unit_data(135).name = "electron-muon mag. mom. ratio"; unit_data(135).value = 206.7669880; unit_data(135).uncertainty = 0.0000046; unit_data(135).units = ""; unit_data(136).name = "electron-muon mass ratio"; unit_data(136).value = 4.83633170e-3; unit_data(136).uncertainty = 0.00000011e-3; unit_data(136).units = ""; unit_data(137).name = "electron-neutron mag. mom. ratio"; unit_data(137).value = 960.92050; unit_data(137).uncertainty = 0.00023; unit_data(137).units = ""; unit_data(138).name = "electron-neutron mass ratio"; unit_data(138).value = 5.4386734428e-4; unit_data(138).uncertainty = 0.0000000027e-4; unit_data(138).units = ""; unit_data(139).name = "electron-proton mag. mom. ratio"; unit_data(139).value = -658.2106866; unit_data(139).uncertainty = 0.0000020; unit_data(139).units = ""; unit_data(140).name = "electron-proton mass ratio"; unit_data(140).value = 5.44617021352e-4; unit_data(140).uncertainty = 0.00000000052e-4; unit_data(140).units = ""; unit_data(141).name = "electron-tau mass ratio"; unit_data(141).value = 2.87592e-4; unit_data(141).uncertainty = 0.00026e-4; unit_data(141).units = ""; unit_data(142).name = "electron-triton mass ratio"; unit_data(142).value = 1.819200062203e-4; unit_data(142).uncertainty = 0.000000000084e-4; unit_data(142).units = ""; unit_data(143).name = "elementary charge"; unit_data(143).value = 1.6021766208e-19; unit_data(143).uncertainty = 0.0000000098e-19; unit_data(143).units = "C"; unit_data(144).name = "elementary charge over h"; unit_data(144).value = 2.417989262e14; unit_data(144).uncertainty = 0.000000015e14; unit_data(144).units = "A J^-1"; unit_data(145).name = "fine-structure constant"; unit_data(145).value = 7.2973525664e-3; unit_data(145).uncertainty = 0.0000000017e-3; unit_data(145).units = ""; unit_data(146).name = "first radiation constant"; unit_data(146).value = 3.741771790e-16; unit_data(146).uncertainty = 0.000000046e-16; unit_data(146).units = "W m^2"; unit_data(147).name = "first radiation constant for spectral radiance"; unit_data(147).value = 1.191042953e-16; unit_data(147).uncertainty = 0.000000015e-16; unit_data(147).units = "W m^2 sr^-1"; unit_data(148).name = "hartree-atomic mass unit relationship"; unit_data(148).value = 2.9212623197e-8; unit_data(148).uncertainty = 0.0000000013e-8; unit_data(148).units = "u"; unit_data(149).name = "hartree-electron volt relationship"; unit_data(149).value = 27.21138602; unit_data(149).uncertainty = 0.00000017; unit_data(149).units = "eV"; unit_data(150).name = "hartree-hertz relationship"; unit_data(150).value = 6.579683920711e15; unit_data(150).uncertainty = 0.000000000039e15; unit_data(150).units = "Hz"; unit_data(151).name = "hartree-inverse meter relationship"; unit_data(151).value = 2.194746313702e7; unit_data(151).uncertainty = 0.000000000013e7; unit_data(151).units = "m^-1"; unit_data(152).name = "hartree-joule relationship"; unit_data(152).value = 4.359744650e-18; unit_data(152).uncertainty = 0.000000054e-18; unit_data(152).units = "J"; unit_data(153).name = "hartree-kelvin relationship"; unit_data(153).value = 3.1577513e5; unit_data(153).uncertainty = 0.0000018e5; unit_data(153).units = "K"; unit_data(154).name = "hartree-kilogram relationship"; unit_data(154).value = 4.850870129e-35; unit_data(154).uncertainty = 0.000000060e-35; unit_data(154).units = "kg"; unit_data(155).name = "helion g factor"; unit_data(155).value = -4.255250616; unit_data(155).uncertainty = 0.000000050; unit_data(155).units = ""; unit_data(156).name = "helion mag. mom."; unit_data(156).value = -1.074617522e-26; unit_data(156).uncertainty = 0.000000014e-26; unit_data(156).units = "J T^-1"; unit_data(157).name = "helion mag. mom. to Bohr magneton ratio"; unit_data(157).value = -1.158740958e-3; unit_data(157).uncertainty = 0.000000014e-3; unit_data(157).units = ""; unit_data(158).name = "helion mag. mom. to nuclear magneton ratio"; unit_data(158).value = -2.127625308; unit_data(158).uncertainty = 0.000000025; unit_data(158).units = ""; unit_data(159).name = "helion mass"; unit_data(159).value = 5.006412700e-27; unit_data(159).uncertainty = 0.000000062e-27; unit_data(159).units = "kg"; unit_data(160).name = "helion mass energy equivalent"; unit_data(160).value = 4.499539341e-10; unit_data(160).uncertainty = 0.000000055e-10; unit_data(160).units = "J"; unit_data(161).name = "helion mass energy equivalent in MeV"; unit_data(161).value = 2808.391586; unit_data(161).uncertainty = 0.000017; unit_data(161).units = "MeV"; unit_data(162).name = "helion mass in u"; unit_data(162).value = 3.01493224673; unit_data(162).uncertainty = 0.00000000012; unit_data(162).units = "u"; unit_data(163).name = "helion molar mass"; unit_data(163).value = 3.01493224673e-3; unit_data(163).uncertainty = 0.00000000012e-3; unit_data(163).units = "kg mol^-1"; unit_data(164).name = "helion-electron mass ratio"; unit_data(164).value = 5495.88527922; unit_data(164).uncertainty = 0.00000027; unit_data(164).units = ""; unit_data(165).name = "helion-proton mass ratio"; unit_data(165).value = 2.99315267046; unit_data(165).uncertainty = 0.00000000029; unit_data(165).units = ""; unit_data(166).name = "hertz-atomic mass unit relationship"; unit_data(166).value = 4.4398216616e-24; unit_data(166).uncertainty = 0.0000000020e-24; unit_data(166).units = "u"; unit_data(167).name = "hertz-electron volt relationship"; unit_data(167).value = 4.135667662e-15; unit_data(167).uncertainty = 0.000000025e-15; unit_data(167).units = "eV"; unit_data(168).name = "hertz-hartree relationship"; unit_data(168).value = 1.5198298460088e-16; unit_data(168).uncertainty = 0.0000000000090e-16; unit_data(168).units = "E_h"; unit_data(169).name = "hertz-inverse meter relationship"; unit_data(169).value = 3.335640951e-9; unit_data(169).uncertainty = 0.0; unit_data(169).units = "m^-1"; unit_data(170).name = "hertz-joule relationship"; unit_data(170).value = 6.626070040e-34; unit_data(170).uncertainty = 0.000000081e-34; unit_data(170).units = "J"; unit_data(171).name = "hertz-kelvin relationship"; unit_data(171).value = 4.7992447e-11; unit_data(171).uncertainty = 0.0000028e-11; unit_data(171).units = "K"; unit_data(172).name = "hertz-kilogram relationship"; unit_data(172).value = 7.372497201e-51; unit_data(172).uncertainty = 0.000000091e-51; unit_data(172).units = "kg"; unit_data(173).name = "inverse fine-structure constant"; unit_data(173).value = 137.035999139; unit_data(173).uncertainty = 0.000000031; unit_data(173).units = ""; unit_data(174).name = "inverse meter-atomic mass unit relationship"; unit_data(174).value = 1.33102504900e-15; unit_data(174).uncertainty = 0.00000000061e-15; unit_data(174).units = "u"; unit_data(175).name = "inverse meter-electron volt relationship"; unit_data(175).value = 1.2398419739e-6; unit_data(175).uncertainty = 0.0000000076e-6; unit_data(175).units = "eV"; unit_data(176).name = "inverse meter-hartree relationship"; unit_data(176).value = 4.556335252767e-8; unit_data(176).uncertainty = 0.000000000027e-8; unit_data(176).units = "E_h"; unit_data(177).name = "inverse meter-hertz relationship"; unit_data(177).value = 299792458; unit_data(177).uncertainty = 0.0; unit_data(177).units = "Hz"; unit_data(178).name = "inverse meter-joule relationship"; unit_data(178).value = 1.986445824e-25; unit_data(178).uncertainty = 0.000000024e-25; unit_data(178).units = "J"; unit_data(179).name = "inverse meter-kelvin relationship"; unit_data(179).value = 1.43877736e-2; unit_data(179).uncertainty = 0.00000083e-2; unit_data(179).units = "K"; unit_data(180).name = "inverse meter-kilogram relationship"; unit_data(180).value = 2.210219057e-42; unit_data(180).uncertainty = 0.000000027e-42; unit_data(180).units = "kg"; unit_data(181).name = "inverse of conductance quantum"; unit_data(181).value = 12906.4037278; unit_data(181).uncertainty = 0.0000029; unit_data(181).units = "ohm"; unit_data(182).name = "joule-atomic mass unit relationship"; unit_data(182).value = 6.700535363e9; unit_data(182).uncertainty = 0.000000082e9; unit_data(182).units = "u"; unit_data(183).name = "joule-electron volt relationship"; unit_data(183).value = 6.241509126e18; unit_data(183).uncertainty = 0.000000038e18; unit_data(183).units = "eV"; unit_data(184).name = "joule-hartree relationship"; unit_data(184).value = 2.293712317e17; unit_data(184).uncertainty = 0.000000028e17; unit_data(184).units = "E_h"; unit_data(185).name = "joule-hertz relationship"; unit_data(185).value = 1.509190205e33; unit_data(185).uncertainty = 0.000000019e33; unit_data(185).units = "Hz"; unit_data(186).name = "joule-inverse meter relationship"; unit_data(186).value = 5.034116651e24; unit_data(186).uncertainty = 0.000000062e24; unit_data(186).units = "m^-1"; unit_data(187).name = "joule-kelvin relationship"; unit_data(187).value = 7.2429731e22; unit_data(187).uncertainty = 0.0000042e22; unit_data(187).units = "K"; unit_data(188).name = "joule-kilogram relationship"; unit_data(188).value = 1.112650056e-17; unit_data(188).uncertainty = 0.0; unit_data(188).units = "kg"; unit_data(189).name = "kelvin-atomic mass unit relationship"; unit_data(189).value = 9.2510842e-14; unit_data(189).uncertainty = 0.0000053e-14; unit_data(189).units = "u"; unit_data(190).name = "kelvin-electron volt relationship"; unit_data(190).value = 8.6173303e-5; unit_data(190).uncertainty = 0.0000050e-5; unit_data(190).units = "eV"; unit_data(191).name = "kelvin-hartree relationship"; unit_data(191).value = 3.1668105e-6; unit_data(191).uncertainty = 0.0000018e-6; unit_data(191).units = "E_h"; unit_data(192).name = "kelvin-hertz relationship"; unit_data(192).value = 2.0836612e10; unit_data(192).uncertainty = 0.0000012e10; unit_data(192).units = "Hz"; unit_data(193).name = "kelvin-inverse meter relationship"; unit_data(193).value = 69.503457; unit_data(193).uncertainty = 0.000040; unit_data(193).units = "m^-1"; unit_data(194).name = "kelvin-joule relationship"; unit_data(194).value = 1.38064852e-23; unit_data(194).uncertainty = 0.00000079e-23; unit_data(194).units = "J"; unit_data(195).name = "kelvin-kilogram relationship"; unit_data(195).value = 1.53617865e-40; unit_data(195).uncertainty = 0.00000088e-40; unit_data(195).units = "kg"; unit_data(196).name = "kilogram-atomic mass unit relationship"; unit_data(196).value = 6.022140857e26; unit_data(196).uncertainty = 0.000000074e26; unit_data(196).units = "u"; unit_data(197).name = "kilogram-electron volt relationship"; unit_data(197).value = 5.609588650e35; unit_data(197).uncertainty = 0.000000034e35; unit_data(197).units = "eV"; unit_data(198).name = "kilogram-hartree relationship"; unit_data(198).value = 2.061485823e34; unit_data(198).uncertainty = 0.000000025e34; unit_data(198).units = "E_h"; unit_data(199).name = "kilogram-hertz relationship"; unit_data(199).value = 1.356392512e50; unit_data(199).uncertainty = 0.000000017e50; unit_data(199).units = "Hz"; unit_data(200).name = "kilogram-inverse meter relationship"; unit_data(200).value = 4.524438411e41; unit_data(200).uncertainty = 0.000000056e41; unit_data(200).units = "m^-1"; unit_data(201).name = "kilogram-joule relationship"; unit_data(201).value = 8.987551787e16; unit_data(201).uncertainty = 0.0; unit_data(201).units = "J"; unit_data(202).name = "kilogram-kelvin relationship"; unit_data(202).value = 6.5096595e39; unit_data(202).uncertainty = 0.0000037e39; unit_data(202).units = "K"; unit_data(203).name = "lattice parameter of silicon"; unit_data(203).value = 543.1020504e-12; unit_data(203).uncertainty = 0.0000089e-12; unit_data(203).units = "m"; unit_data(204).name = "mag. constant"; unit_data(204).value = 12.566370614e-7; unit_data(204).uncertainty = 0.0; unit_data(204).units = "N A^-2"; unit_data(205).name = "mag. flux quantum"; unit_data(205).value = 2.067833831e-15; unit_data(205).uncertainty = 0.000000013e-15; unit_data(205).units = "Wb"; unit_data(206).name = "molar Planck constant"; unit_data(206).value = 3.9903127110e-10; unit_data(206).uncertainty = 0.0000000018e-10; unit_data(206).units = "J s mol^-1"; unit_data(207).name = "molar Planck constant times c"; unit_data(207).value = 0.119626565582; unit_data(207).uncertainty = 0.000000000054; unit_data(207).units = "J m mol^-1"; unit_data(208).name = "molar gas constant"; unit_data(208).value = 8.3144598; unit_data(208).uncertainty = 0.0000048; unit_data(208).units = "J mol^-1 K^-1"; unit_data(209).name = "molar mass constant"; unit_data(209).value = 1e-3; unit_data(209).uncertainty = 0.0; unit_data(209).units = "kg mol^-1"; unit_data(210).name = "molar mass of carbon-12"; unit_data(210).value = 12e-3; unit_data(210).uncertainty = 0.0; unit_data(210).units = "kg mol^-1"; unit_data(211).name = "molar volume of ideal gas (273.15 K, 100 kPa)"; unit_data(211).value = 22.710947e-3; unit_data(211).uncertainty = 0.000013e-3; unit_data(211).units = "m^3 mol^-1"; unit_data(212).name = "molar volume of ideal gas (273.15 K, 101.325 kPa)"; unit_data(212).value = 22.413962e-3; unit_data(212).uncertainty = 0.000013e-3; unit_data(212).units = "m^3 mol^-1"; unit_data(213).name = "molar volume of silicon"; unit_data(213).value = 12.05883214e-6; unit_data(213).uncertainty = 0.00000061e-6; unit_data(213).units = "m^3 mol^-1"; unit_data(214).name = "muon Compton wavelength"; unit_data(214).value = 11.73444111e-15; unit_data(214).uncertainty = 0.00000026e-15; unit_data(214).units = "m"; unit_data(215).name = "muon Compton wavelength over 2 pi"; unit_data(215).value = 1.867594308e-15; unit_data(215).uncertainty = 0.000000042e-15; unit_data(215).units = "m"; unit_data(216).name = "muon g factor"; unit_data(216).value = -2.0023318418; unit_data(216).uncertainty = 0.0000000013; unit_data(216).units = ""; unit_data(217).name = "muon mag. mom."; unit_data(217).value = -4.49044826e-26; unit_data(217).uncertainty = 0.00000010e-26; unit_data(217).units = "J T^-1"; unit_data(218).name = "muon mag. mom. anomaly"; unit_data(218).value = 1.16592089e-3; unit_data(218).uncertainty = 0.00000063e-3; unit_data(218).units = ""; unit_data(219).name = "muon mag. mom. to Bohr magneton ratio"; unit_data(219).value = -4.84197048e-3; unit_data(219).uncertainty = 0.00000011e-3; unit_data(219).units = ""; unit_data(220).name = "muon mag. mom. to nuclear magneton ratio"; unit_data(220).value = -8.89059705; unit_data(220).uncertainty = 0.00000020; unit_data(220).units = ""; unit_data(221).name = "muon mass"; unit_data(221).value = 1.883531594e-28; unit_data(221).uncertainty = 0.000000048e-28; unit_data(221).units = "kg"; unit_data(222).name = "muon mass energy equivalent"; unit_data(222).value = 1.692833774e-11; unit_data(222).uncertainty = 0.000000043e-11; unit_data(222).units = "J"; unit_data(223).name = "muon mass energy equivalent in MeV"; unit_data(223).value = 105.6583745; unit_data(223).uncertainty = 0.0000024; unit_data(223).units = "MeV"; unit_data(224).name = "muon mass in u"; unit_data(224).value = 0.1134289257; unit_data(224).uncertainty = 0.0000000025; unit_data(224).units = "u"; unit_data(225).name = "muon molar mass"; unit_data(225).value = 0.1134289257e-3; unit_data(225).uncertainty = 0.0000000025e-3; unit_data(225).units = "kg mol^-1"; unit_data(226).name = "muon-electron mass ratio"; unit_data(226).value = 206.7682826; unit_data(226).uncertainty = 0.0000046; unit_data(226).units = ""; unit_data(227).name = "muon-neutron mass ratio"; unit_data(227).value = 0.1124545167; unit_data(227).uncertainty = 0.0000000025; unit_data(227).units = ""; unit_data(228).name = "muon-proton mag. mom. ratio"; unit_data(228).value = -3.183345142; unit_data(228).uncertainty = 0.000000071; unit_data(228).units = ""; unit_data(229).name = "muon-proton mass ratio"; unit_data(229).value = 0.1126095262; unit_data(229).uncertainty = 0.0000000025; unit_data(229).units = ""; unit_data(230).name = "muon-tau mass ratio"; unit_data(230).value = 5.94649e-2; unit_data(230).uncertainty = 0.00054e-2; unit_data(230).units = ""; unit_data(231).name = "natural unit of action"; unit_data(231).value = 1.054571800e-34; unit_data(231).uncertainty = 0.000000013e-34; unit_data(231).units = "J s"; unit_data(232).name = "natural unit of action in eV s"; unit_data(232).value = 6.582119514e-16; unit_data(232).uncertainty = 0.000000040e-16; unit_data(232).units = "eV s"; unit_data(233).name = "natural unit of energy"; unit_data(233).value = 8.18710565e-14; unit_data(233).uncertainty = 0.00000010e-14; unit_data(233).units = "J"; unit_data(234).name = "natural unit of energy in MeV"; unit_data(234).value = 0.5109989461; unit_data(234).uncertainty = 0.0000000031; unit_data(234).units = "MeV"; unit_data(235).name = "natural unit of length"; unit_data(235).value = 386.15926764e-15; unit_data(235).uncertainty = 0.00000018e-15; unit_data(235).units = "m"; unit_data(236).name = "natural unit of mass"; unit_data(236).value = 9.10938356e-31; unit_data(236).uncertainty = 0.00000011e-31; unit_data(236).units = "kg"; unit_data(237).name = "natural unit of mom.um"; unit_data(237).value = 2.730924488e-22; unit_data(237).uncertainty = 0.000000034e-22; unit_data(237).units = "kg m s^-1"; unit_data(238).name = "natural unit of mom.um in MeV/c"; unit_data(238).value = 0.5109989461; unit_data(238).uncertainty = 0.0000000031; unit_data(238).units = "MeV/c"; unit_data(239).name = "natural unit of time"; unit_data(239).value = 1.28808866712e-21; unit_data(239).uncertainty = 0.00000000058e-21; unit_data(239).units = "s"; unit_data(240).name = "natural unit of velocity"; unit_data(240).value = 299792458; unit_data(240).uncertainty = 0.0; unit_data(240).units = "m s^-1"; unit_data(241).name = "neutron Compton wavelength"; unit_data(241).value = 1.31959090481e-15; unit_data(241).uncertainty = 0.00000000088e-15; unit_data(241).units = "m"; unit_data(242).name = "neutron Compton wavelength over 2 pi"; unit_data(242).value = 0.21001941536e-15; unit_data(242).uncertainty = 0.00000000014e-15; unit_data(242).units = "m"; unit_data(243).name = "neutron g factor"; unit_data(243).value = -3.82608545; unit_data(243).uncertainty = 0.00000090; unit_data(243).units = ""; unit_data(244).name = "neutron gyromag. ratio"; unit_data(244).value = 1.83247172e8; unit_data(244).uncertainty = 0.00000043e8; unit_data(244).units = "s^-1 T^-1"; unit_data(245).name = "neutron gyromag. ratio over 2 pi"; unit_data(245).value = 29.1646933; unit_data(245).uncertainty = 0.0000069; unit_data(245).units = "MHz T^-1"; unit_data(246).name = "neutron mag. mom."; unit_data(246).value = -0.96623650e-26; unit_data(246).uncertainty = 0.00000023e-26; unit_data(246).units = "J T^-1"; unit_data(247).name = "neutron mag. mom. to Bohr magneton ratio"; unit_data(247).value = -1.04187563e-3; unit_data(247).uncertainty = 0.00000025e-3; unit_data(247).units = ""; unit_data(248).name = "neutron mag. mom. to nuclear magneton ratio"; unit_data(248).value = -1.91304273; unit_data(248).uncertainty = 0.00000045; unit_data(248).units = ""; unit_data(249).name = "neutron mass"; unit_data(249).value = 1.674927471e-27; unit_data(249).uncertainty = 0.000000021e-27; unit_data(249).units = "kg"; unit_data(250).name = "neutron mass energy equivalent"; unit_data(250).value = 1.505349739e-10; unit_data(250).uncertainty = 0.000000019e-10; unit_data(250).units = "J"; unit_data(251).name = "neutron mass energy equivalent in MeV"; unit_data(251).value = 939.5654133; unit_data(251).uncertainty = 0.0000058; unit_data(251).units = "MeV"; unit_data(252).name = "neutron mass in u"; unit_data(252).value = 1.00866491588; unit_data(252).uncertainty = 0.00000000049; unit_data(252).units = "u"; unit_data(253).name = "neutron molar mass"; unit_data(253).value = 1.00866491588e-3; unit_data(253).uncertainty = 0.00000000049e-3; unit_data(253).units = "kg mol^-1"; unit_data(254).name = "neutron to shielded proton mag. mom. ratio"; unit_data(254).value = -0.68499694; unit_data(254).uncertainty = 0.00000016; unit_data(254).units = ""; unit_data(255).name = "neutron-electron mag. mom. ratio"; unit_data(255).value = 1.04066882e-3; unit_data(255).uncertainty = 0.00000025e-3; unit_data(255).units = ""; unit_data(256).name = "neutron-electron mass ratio"; unit_data(256).value = 1838.68366158; unit_data(256).uncertainty = 0.00000090; unit_data(256).units = ""; unit_data(257).name = "neutron-muon mass ratio"; unit_data(257).value = 8.89248408; unit_data(257).uncertainty = 0.00000020; unit_data(257).units = ""; unit_data(258).name = "neutron-proton mag. mom. ratio"; unit_data(258).value = -0.68497934; unit_data(258).uncertainty = 0.00000016; unit_data(258).units = ""; unit_data(259).name = "neutron-proton mass difference"; unit_data(259).value = 2.30557377e-30; unit_data(259).uncertainty = 0.00000085e-30; unit_data(259).units = ""; unit_data(260).name = "neutron-proton mass difference energy equivalent"; unit_data(260).value = 2.07214637e-13; unit_data(260).uncertainty = 0.00000076e-13; unit_data(260).units = ""; unit_data(261).name = "neutron-proton mass difference energy equivalent in MeV"; unit_data(261).value = 1.29333205; unit_data(261).uncertainty = 0.00000048; unit_data(261).units = ""; unit_data(262).name = "neutron-proton mass difference in u"; unit_data(262).value = 0.00138844900; unit_data(262).uncertainty = 0.00000000051; unit_data(262).units = ""; unit_data(263).name = "neutron-proton mass ratio"; unit_data(263).value = 1.00137841898; unit_data(263).uncertainty = 0.00000000051; unit_data(263).units = ""; unit_data(264).name = "neutron-tau mass ratio"; unit_data(264).value = 0.528790; unit_data(264).uncertainty = 0.000048; unit_data(264).units = ""; unit_data(265).name = "nuclear magneton"; unit_data(265).value = 5.050783699e-27; unit_data(265).uncertainty = 0.000000031e-27; unit_data(265).units = "J T^-1"; unit_data(266).name = "nuclear magneton in K/T"; unit_data(266).value = 3.6582690e-4; unit_data(266).uncertainty = 0.0000021e-4; unit_data(266).units = "K T^-1"; unit_data(267).name = "nuclear magneton in MHz/T"; unit_data(267).value = 7.622593285; unit_data(267).uncertainty = 0.000000047; unit_data(267).units = "MHz T^-1"; unit_data(268).name = "nuclear magneton in eV/T"; unit_data(268).value = 3.1524512550e-8; unit_data(268).uncertainty = 0.0000000015e-8; unit_data(268).units = "eV T^-1"; unit_data(269).name = "nuclear magneton in inverse meters per tesla"; unit_data(269).value = 2.542623432e-2; unit_data(269).uncertainty = 0.000000016e-2; unit_data(269).units = "m^-1 T^-1"; unit_data(270).name = "proton Compton wavelength"; unit_data(270).value = 1.32140985396e-15; unit_data(270).uncertainty = 0.00000000061e-15; unit_data(270).units = "m"; unit_data(271).name = "proton Compton wavelength over 2 pi"; unit_data(271).value = 0.210308910109e-15; unit_data(271).uncertainty = 0.000000000097e-15; unit_data(271).units = "m"; unit_data(272).name = "proton charge to mass quotient"; unit_data(272).value = 9.578833226e7; unit_data(272).uncertainty = 0.000000059e7; unit_data(272).units = "C kg^-1"; unit_data(273).name = "proton g factor"; unit_data(273).value = 5.585694702; unit_data(273).uncertainty = 0.000000017; unit_data(273).units = ""; unit_data(274).name = "proton gyromag. ratio"; unit_data(274).value = 2.675221900e8; unit_data(274).uncertainty = 0.000000018e8; unit_data(274).units = "s^-1 T^-1"; unit_data(275).name = "proton gyromag. ratio over 2 pi"; unit_data(275).value = 42.57747892; unit_data(275).uncertainty = 0.00000029; unit_data(275).units = "MHz T^-1"; unit_data(276).name = "proton mag. mom."; unit_data(276).value = 1.4106067873e-26; unit_data(276).uncertainty = 0.0000000097e-26; unit_data(276).units = "J T^-1"; unit_data(277).name = "proton mag. mom. to Bohr magneton ratio"; unit_data(277).value = 1.5210322053e-3; unit_data(277).uncertainty = 0.0000000046e-3; unit_data(277).units = ""; unit_data(278).name = "proton mag. mom. to nuclear magneton ratio"; unit_data(278).value = 2.7928473508; unit_data(278).uncertainty = 0.0000000085; unit_data(278).units = ""; unit_data(279).name = "proton mag. shielding correction"; unit_data(279).value = 25.691e-6; unit_data(279).uncertainty = 0.011e-6; unit_data(279).units = ""; unit_data(280).name = "proton mass"; unit_data(280).value = 1.672621898e-27; unit_data(280).uncertainty = 0.000000021e-27; unit_data(280).units = "kg"; unit_data(281).name = "proton mass energy equivalent"; unit_data(281).value = 1.503277593e-10; unit_data(281).uncertainty = 0.000000018e-10; unit_data(281).units = "J"; unit_data(282).name = "proton mass energy equivalent in MeV"; unit_data(282).value = 938.2720813; unit_data(282).uncertainty = 0.0000058; unit_data(282).units = "MeV"; unit_data(283).name = "proton mass in u"; unit_data(283).value = 1.007276466879; unit_data(283).uncertainty = 0.000000000091; unit_data(283).units = "u"; unit_data(284).name = "proton molar mass"; unit_data(284).value = 1.007276466879e-3; unit_data(284).uncertainty = 0.000000000091e-3; unit_data(284).units = "kg mol^-1"; unit_data(285).name = "proton rms charge radius"; unit_data(285).value = 0.8751e-15; unit_data(285).uncertainty = 0.0061e-15; unit_data(285).units = "m"; unit_data(286).name = "proton-electron mass ratio"; unit_data(286).value = 1836.15267389; unit_data(286).uncertainty = 0.00000017; unit_data(286).units = ""; unit_data(287).name = "proton-muon mass ratio"; unit_data(287).value = 8.88024338; unit_data(287).uncertainty = 0.00000020; unit_data(287).units = ""; unit_data(288).name = "proton-neutron mag. mom. ratio"; unit_data(288).value = -1.45989805; unit_data(288).uncertainty = 0.00000034; unit_data(288).units = ""; unit_data(289).name = "proton-neutron mass ratio"; unit_data(289).value = 0.99862347844; unit_data(289).uncertainty = 0.00000000051; unit_data(289).units = ""; unit_data(290).name = "proton-tau mass ratio"; unit_data(290).value = 0.528063; unit_data(290).uncertainty = 0.000048; unit_data(290).units = ""; unit_data(291).name = "quantum of circulation"; unit_data(291).value = 3.6369475486e-4; unit_data(291).uncertainty = 0.0000000017e-4; unit_data(291).units = "m^2 s^-1"; unit_data(292).name = "quantum of circulation times 2"; unit_data(292).value = 7.2738950972e-4; unit_data(292).uncertainty = 0.0000000033e-4; unit_data(292).units = "m^2 s^-1"; unit_data(293).name = "second radiation constant"; unit_data(293).value = 1.43877736e-2; unit_data(293).uncertainty = 0.00000083e-2; unit_data(293).units = "m K"; unit_data(294).name = "shielded helion gyromag. ratio"; unit_data(294).value = 2.037894585e8; unit_data(294).uncertainty = 0.000000027e8; unit_data(294).units = "s^-1 T^-1"; unit_data(295).name = "shielded helion gyromag. ratio over 2 pi"; unit_data(295).value = 32.43409966; unit_data(295).uncertainty = 0.00000043; unit_data(295).units = "MHz T^-1"; unit_data(296).name = "shielded helion mag. mom."; unit_data(296).value = -1.074553080e-26; unit_data(296).uncertainty = 0.000000014e-26; unit_data(296).units = "J T^-1"; unit_data(297).name = "shielded helion mag. mom. to Bohr magneton ratio"; unit_data(297).value = -1.158671471e-3; unit_data(297).uncertainty = 0.000000014e-3; unit_data(297).units = ""; unit_data(298).name = "shielded helion mag. mom. to nuclear magneton ratio"; unit_data(298).value = -2.127497720; unit_data(298).uncertainty = 0.000000025; unit_data(298).units = ""; unit_data(299).name = "shielded helion to proton mag. mom. ratio"; unit_data(299).value = -0.7617665603; unit_data(299).uncertainty = 0.0000000092; unit_data(299).units = ""; unit_data(300).name = "shielded helion to shielded proton mag. mom. ratio"; unit_data(300).value = -0.7617861313; unit_data(300).uncertainty = 0.0000000033; unit_data(300).units = ""; unit_data(301).name = "shielded proton gyromag. ratio"; unit_data(301).value = 2.675153171e8; unit_data(301).uncertainty = 0.000000033e8; unit_data(301).units = "s^-1 T^-1"; unit_data(302).name = "shielded proton gyromag. ratio over 2 pi"; unit_data(302).value = 42.57638507; unit_data(302).uncertainty = 0.00000053; unit_data(302).units = "MHz T^-1"; unit_data(303).name = "shielded proton mag. mom."; unit_data(303).value = 1.410570547e-26; unit_data(303).uncertainty = 0.000000018e-26; unit_data(303).units = "J T^-1"; unit_data(304).name = "shielded proton mag. mom. to Bohr magneton ratio"; unit_data(304).value = 1.520993128e-3; unit_data(304).uncertainty = 0.000000017e-3; unit_data(304).units = ""; unit_data(305).name = "shielded proton mag. mom. to nuclear magneton ratio"; unit_data(305).value = 2.792775600; unit_data(305).uncertainty = 0.000000030; unit_data(305).units = ""; unit_data(306).name = "speed of light in vacuum"; unit_data(306).value = 299792458; unit_data(306).uncertainty = 0.0; unit_data(306).units = "m s^-1"; unit_data(307).name = "standard acceleration of gravity"; unit_data(307).value = 9.80665; unit_data(307).uncertainty = 0.0; unit_data(307).units = "m s^-2"; unit_data(308).name = "standard atmosphere"; unit_data(308).value = 101325; unit_data(308).uncertainty = 0.0; unit_data(308).units = "Pa"; unit_data(309).name = "standard-state pressure"; unit_data(309).value = 100000; unit_data(309).uncertainty = 0.0; unit_data(309).units = "Pa"; unit_data(310).name = "tau Compton wavelength"; unit_data(310).value = 0.697787e-15; unit_data(310).uncertainty = 0.000063e-15; unit_data(310).units = "m"; unit_data(311).name = "tau Compton wavelength over 2 pi"; unit_data(311).value = 0.111056e-15; unit_data(311).uncertainty = 0.000010e-15; unit_data(311).units = "m"; unit_data(312).name = "tau mass"; unit_data(312).value = 3.16747e-27; unit_data(312).uncertainty = 0.00029e-27; unit_data(312).units = "kg"; unit_data(313).name = "tau mass energy equivalent"; unit_data(313).value = 2.84678e-10; unit_data(313).uncertainty = 0.00026e-10; unit_data(313).units = "J"; unit_data(314).name = "tau mass energy equivalent in MeV"; unit_data(314).value = 1776.82; unit_data(314).uncertainty = 0.16; unit_data(314).units = "MeV"; unit_data(315).name = "tau mass in u"; unit_data(315).value = 1.90749; unit_data(315).uncertainty = 0.00017; unit_data(315).units = "u"; unit_data(316).name = "tau molar mass"; unit_data(316).value = 1.90749e-3; unit_data(316).uncertainty = 0.00017e-3; unit_data(316).units = "kg mol^-1"; unit_data(317).name = "tau-electron mass ratio"; unit_data(317).value = 3477.15; unit_data(317).uncertainty = 0.31; unit_data(317).units = ""; unit_data(318).name = "tau-muon mass ratio"; unit_data(318).value = 16.8167; unit_data(318).uncertainty = 0.0015; unit_data(318).units = ""; unit_data(319).name = "tau-neutron mass ratio"; unit_data(319).value = 1.89111; unit_data(319).uncertainty = 0.00017; unit_data(319).units = ""; unit_data(320).name = "tau-proton mass ratio"; unit_data(320).value = 1.89372; unit_data(320).uncertainty = 0.00017; unit_data(320).units = ""; unit_data(321).name = "triton g factor"; unit_data(321).value = 5.957924920; unit_data(321).uncertainty = 0.000000028; unit_data(321).units = ""; unit_data(322).name = "triton mag. mom."; unit_data(322).value = 1.504609503e-26; unit_data(322).uncertainty = 0.000000012e-26; unit_data(322).units = "J T^-1"; unit_data(323).name = "triton mag. mom. to Bohr magneton ratio"; unit_data(323).value = 1.6223936616e-3; unit_data(323).uncertainty = 0.0000000076e-3; unit_data(323).units = ""; unit_data(324).name = "triton mag. mom. to nuclear magneton ratio"; unit_data(324).value = 2.978962460; unit_data(324).uncertainty = 0.000000014; unit_data(324).units = ""; unit_data(325).name = "triton mass"; unit_data(325).value = 5.007356665e-27; unit_data(325).uncertainty = 0.000000062e-27; unit_data(325).units = "kg"; unit_data(326).name = "triton mass energy equivalent"; unit_data(326).value = 4.500387735e-10; unit_data(326).uncertainty = 0.000000055e-10; unit_data(326).units = "J"; unit_data(327).name = "triton mass energy equivalent in MeV"; unit_data(327).value = 2808.921112; unit_data(327).uncertainty = 0.000017; unit_data(327).units = "MeV"; unit_data(328).name = "triton mass in u"; unit_data(328).value = 3.01550071632; unit_data(328).uncertainty = 0.00000000011; unit_data(328).units = "u"; unit_data(329).name = "triton molar mass"; unit_data(329).value = 3.01550071632e-3; unit_data(329).uncertainty = 0.00000000011e-3; unit_data(329).units = "kg mol^-1"; unit_data(330).name = "triton-electron mass ratio"; unit_data(330).value = 5496.92153588; unit_data(330).uncertainty = 0.00000026; unit_data(330).units = ""; unit_data(331).name = "triton-proton mass ratio"; unit_data(331).value = 2.99371703348; unit_data(331).uncertainty = 0.00000000022; unit_data(331).units = ""; unit_data(332).name = "unified atomic mass unit"; unit_data(332).value = 1.660539040e-27; unit_data(332).uncertainty = 0.000000020e-27; unit_data(332).units = "kg"; unit_data(333).name = "von Klitzing constant"; unit_data(333).value = 25812.8074555; unit_data(333).uncertainty = 0.0000059; unit_data(333).units = "ohm"; unit_data(334).name = "weak mixing angle"; unit_data(334).value = 0.2223; unit_data(334).uncertainty = 0.0021; unit_data(334).units = ""; unit_data(335).name = "{220} lattice spacing of silicon"; unit_data(335).value = 192.0155714e-12; unit_data(335).uncertainty = 0.0000032e-12; unit_data(335).units = "m"; endfunction %!assert(physical_constant("Angstrom star"), 1.00001495e-10); %!assert(physical_constant("Avogadro constant"), 6.022140857e23); %!assert(physical_constant("Bohr magneton"), 927.4009994e-26); %!assert(physical_constant("Bohr magneton in Hz/T"), 13.996245042e9); %!assert(physical_constant("Bohr magneton in K/T"), 0.67171405); %!assert(physical_constant("Bohr magneton in eV/T"), 5.7883818012e-5); %!assert(physical_constant("Bohr magneton in inverse meters per tesla"), 46.68644814); %!assert(physical_constant("Bohr radius"), 0.52917721067e-10); %!assert(physical_constant("Boltzmann constant"), 1.38064852e-23); %!assert(physical_constant("Boltzmann constant in Hz/K"), 2.0836612e10); %!assert(physical_constant("Boltzmann constant in eV/K"), 8.6173303e-5); %!assert(physical_constant("Boltzmann constant in inverse meters per kelvin"), 69.503457); %!assert(physical_constant("Compton wavelength"), 2.4263102367e-12); %!assert(physical_constant("Compton wavelength over 2 pi"), 386.15926764e-15); %!assert(physical_constant("Cu x unit"), 1.00207697e-13); %!assert(physical_constant("Faraday constant"), 96485.33289); %!assert(physical_constant("Faraday constant for conventional electric current"), 96485.3251); %!assert(physical_constant("Fermi coupling constant"), 1.1663787e-5); %!assert(physical_constant("Hartree energy"), 4.359744650e-18); %!assert(physical_constant("Hartree energy in eV"), 27.21138602); %!assert(physical_constant("Josephson constant"), 483597.8525e9); %!assert(physical_constant("Loschmidt constant (273.15 K, 100 kPa)"), 2.6516467e25); %!assert(physical_constant("Loschmidt constant (273.15 K, 101.325 kPa)"), 2.6867811e25); %!assert(physical_constant("Mo x unit"), 1.00209952e-13); %!assert(physical_constant("Newtonian constant of gravitation"), 6.67408e-11); %!assert(physical_constant("Newtonian constant of gravitation over h-bar c"), 6.70861e-39); %!assert(physical_constant("Planck constant"), 6.626070040e-34); %!assert(physical_constant("Planck constant in eV s"), 4.135667662e-15); %!assert(physical_constant("Planck constant over 2 pi"), 1.054571800e-34); %!assert(physical_constant("Planck constant over 2 pi in eV s"), 6.582119514e-16); %!assert(physical_constant("Planck constant over 2 pi times c in MeV fm"), 197.3269788); %!assert(physical_constant("Planck length"), 1.616229e-35); %!assert(physical_constant("Planck mass"), 2.176470e-8); %!assert(physical_constant("Planck mass energy equivalent in GeV"), 1.220910e19); %!assert(physical_constant("Planck temperature"), 1.416808e32); %!assert(physical_constant("Planck time"), 5.39116e-44); %!assert(physical_constant("Rydberg constant"), 10973731.568508); %!assert(physical_constant("Rydberg constant times c in Hz"), 3.289841960355e15); %!assert(physical_constant("Rydberg constant times hc in J"), 2.179872325e-18); %!assert(physical_constant("Rydberg constant times hc in eV"), 13.605693009); %!assert(physical_constant("Sackur-Tetrode constant (1 K, 100 kPa)"), -1.1517084); %!assert(physical_constant("Sackur-Tetrode constant (1 K, 101.325 kPa)"), -1.1648714); %!assert(physical_constant("Stefan-Boltzmann constant"), 5.670367e-8); %!assert(physical_constant("Thomson cross section"), 0.66524587158e-28); %!assert(physical_constant("Wien frequency displacement law constant"), 5.8789238e10); %!assert(physical_constant("Wien wavelength displacement law constant"), 2.8977729e-3); %!assert(physical_constant("alpha particle mass"), 6.644657230e-27); %!assert(physical_constant("alpha particle mass energy equivalent"), 5.971920097e-10); %!assert(physical_constant("alpha particle mass energy equivalent in MeV"), 3727.379378); %!assert(physical_constant("alpha particle mass in u"), 4.001506179127); %!assert(physical_constant("alpha particle molar mass"), 4.001506179127e-3); %!assert(physical_constant("alpha particle-electron mass ratio"), 7294.29954136); %!assert(physical_constant("alpha particle-proton mass ratio"), 3.97259968907); %!assert(physical_constant("atomic mass constant"), 1.660539040e-27); %!assert(physical_constant("atomic mass constant energy equivalent"), 1.492418062e-10); %!assert(physical_constant("atomic mass constant energy equivalent in MeV"), 931.4940954); %!assert(physical_constant("atomic mass unit-electron volt relationship"), 931.4940954e6); %!assert(physical_constant("atomic mass unit-hartree relationship"), 3.4231776902e7); %!assert(physical_constant("atomic mass unit-hertz relationship"), 2.2523427206e23); %!assert(physical_constant("atomic mass unit-inverse meter relationship"), 7.5130066166e14); %!assert(physical_constant("atomic mass unit-joule relationship"), 1.492418062e-10); %!assert(physical_constant("atomic mass unit-kelvin relationship"), 1.08095438e13); %!assert(physical_constant("atomic mass unit-kilogram relationship"), 1.660539040e-27); %!assert(physical_constant("atomic unit of 1st hyperpolarizability"), 3.206361329e-53); %!assert(physical_constant("atomic unit of 2nd hyperpolarizability"), 6.235380085e-65); %!assert(physical_constant("atomic unit of action"), 1.054571800e-34); %!assert(physical_constant("atomic unit of charge"), 1.6021766208e-19); %!assert(physical_constant("atomic unit of charge density"), 1.0812023770e12); %!assert(physical_constant("atomic unit of current"), 6.623618183e-3); %!assert(physical_constant("atomic unit of electric dipole mom."), 8.478353552e-30); %!assert(physical_constant("atomic unit of electric field"), 5.142206707e11); %!assert(physical_constant("atomic unit of electric field gradient"), 9.717362356e21); %!assert(physical_constant("atomic unit of electric polarizability"), 1.6487772731e-41); %!assert(physical_constant("atomic unit of electric potential"), 27.21138602); %!assert(physical_constant("atomic unit of electric quadrupole mom."), 4.486551484e-40); %!assert(physical_constant("atomic unit of energy"), 4.359744650e-18); %!assert(physical_constant("atomic unit of force"), 8.23872336e-8); %!assert(physical_constant("atomic unit of length"), 0.52917721067e-10); %!assert(physical_constant("atomic unit of mag. dipole mom."), 1.854801999e-23); %!assert(physical_constant("atomic unit of mag. flux density"), 2.350517550e5); %!assert(physical_constant("atomic unit of magnetizability"), 7.8910365886e-29); %!assert(physical_constant("atomic unit of mass"), 9.10938356e-31); %!assert(physical_constant("atomic unit of mom.um"), 1.992851882e-24); %!assert(physical_constant("atomic unit of permittivity"), 1.112650056e-10); %!assert(physical_constant("atomic unit of time"), 2.418884326509e-17); %!assert(physical_constant("atomic unit of velocity"), 2.18769126277e6); %!assert(physical_constant("characteristic impedance of vacuum"), 376.730313461); %!assert(physical_constant("classical electron radius"), 2.8179403227e-15); %!assert(physical_constant("conductance quantum"), 7.7480917310e-5); %!assert(physical_constant("conventional value of Josephson constant"), 483597.9e9); %!assert(physical_constant("conventional value of von Klitzing constant"), 25812.807); %!assert(physical_constant("deuteron g factor"), 0.8574382311); %!assert(physical_constant("deuteron mag. mom."), 0.4330735040e-26); %!assert(physical_constant("deuteron mag. mom. to Bohr magneton ratio"), 0.4669754554e-3); %!assert(physical_constant("deuteron mag. mom. to nuclear magneton ratio"), 0.8574382311); %!assert(physical_constant("deuteron mass"), 3.343583719e-27); %!assert(physical_constant("deuteron mass energy equivalent"), 3.005063183e-10); %!assert(physical_constant("deuteron mass energy equivalent in MeV"), 1875.612928); %!assert(physical_constant("deuteron mass in u"), 2.013553212745); %!assert(physical_constant("deuteron molar mass"), 2.013553212745e-3); %!assert(physical_constant("deuteron rms charge radius"), 2.1413e-15); %!assert(physical_constant("deuteron-electron mag. mom. ratio"), -4.664345535e-4); %!assert(physical_constant("deuteron-electron mass ratio"), 3670.48296785); %!assert(physical_constant("deuteron-neutron mag. mom. ratio"), -0.44820652); %!assert(physical_constant("deuteron-proton mag. mom. ratio"), 0.3070122077); %!assert(physical_constant("deuteron-proton mass ratio"), 1.99900750087); %!assert(physical_constant("electric constant"), 8.854187817e-12); %!assert(physical_constant("electron charge to mass quotient"), -1.758820024e11); %!assert(physical_constant("electron g factor"), -2.00231930436182); %!assert(physical_constant("electron gyromag. ratio"), 1.760859644e11); %!assert(physical_constant("electron gyromag. ratio over 2 pi"), 28024.95164); %!assert(physical_constant("electron mag. mom."), -928.4764620e-26); %!assert(physical_constant("electron mag. mom. anomaly"), 1.15965218091e-3); %!assert(physical_constant("electron mag. mom. to Bohr magneton ratio"), -1.00115965218091); %!assert(physical_constant("electron mag. mom. to nuclear magneton ratio"), -1838.28197234); %!assert(physical_constant("electron mass"), 9.10938356e-31); %!assert(physical_constant("electron mass energy equivalent"), 8.18710565e-14); %!assert(physical_constant("electron mass energy equivalent in MeV"), 0.5109989461); %!assert(physical_constant("electron mass in u"), 5.48579909070e-4); %!assert(physical_constant("electron molar mass"), 5.48579909070e-7); %!assert(physical_constant("electron to alpha particle mass ratio"), 1.370933554798e-4); %!assert(physical_constant("electron to shielded helion mag. mom. ratio"), 864.058257); %!assert(physical_constant("electron to shielded proton mag. mom. ratio"), -658.2275971); %!assert(physical_constant("electron volt"), 1.6021766208e-19); %!assert(physical_constant("electron volt-atomic mass unit relationship"), 1.0735441105e-9); %!assert(physical_constant("electron volt-hartree relationship"), 3.674932248e-2); %!assert(physical_constant("electron volt-hertz relationship"), 2.417989262e14); %!assert(physical_constant("electron volt-inverse meter relationship"), 8.065544005e5); %!assert(physical_constant("electron volt-joule relationship"), 1.6021766208e-19); %!assert(physical_constant("electron volt-kelvin relationship"), 1.16045221e4); %!assert(physical_constant("electron volt-kilogram relationship"), 1.782661907e-36); %!assert(physical_constant("electron-deuteron mag. mom. ratio"), -2143.923499); %!assert(physical_constant("electron-deuteron mass ratio"), 2.724437107484e-4); %!assert(physical_constant("electron-helion mass ratio"), 1.819543074854e-4); %!assert(physical_constant("electron-muon mag. mom. ratio"), 206.7669880); %!assert(physical_constant("electron-muon mass ratio"), 4.83633170e-3); %!assert(physical_constant("electron-neutron mag. mom. ratio"), 960.92050); %!assert(physical_constant("electron-neutron mass ratio"), 5.4386734428e-4); %!assert(physical_constant("electron-proton mag. mom. ratio"), -658.2106866); %!assert(physical_constant("electron-proton mass ratio"), 5.44617021352e-4); %!assert(physical_constant("electron-tau mass ratio"), 2.87592e-4); %!assert(physical_constant("electron-triton mass ratio"), 1.819200062203e-4); %!assert(physical_constant("elementary charge"), 1.6021766208e-19); %!assert(physical_constant("elementary charge over h"), 2.417989262e14); %!assert(physical_constant("fine-structure constant"), 7.2973525664e-3); %!assert(physical_constant("first radiation constant"), 3.741771790e-16); %!assert(physical_constant("first radiation constant for spectral radiance"), 1.191042953e-16); %!assert(physical_constant("hartree-atomic mass unit relationship"), 2.9212623197e-8); %!assert(physical_constant("hartree-electron volt relationship"), 27.21138602); %!assert(physical_constant("hartree-hertz relationship"), 6.579683920711e15); %!assert(physical_constant("hartree-inverse meter relationship"), 2.194746313702e7); %!assert(physical_constant("hartree-joule relationship"), 4.359744650e-18); %!assert(physical_constant("hartree-kelvin relationship"), 3.1577513e5); %!assert(physical_constant("hartree-kilogram relationship"), 4.850870129e-35); %!assert(physical_constant("helion g factor"), -4.255250616); %!assert(physical_constant("helion mag. mom."), -1.074617522e-26); %!assert(physical_constant("helion mag. mom. to Bohr magneton ratio"), -1.158740958e-3); %!assert(physical_constant("helion mag. mom. to nuclear magneton ratio"), -2.127625308); %!assert(physical_constant("helion mass"), 5.006412700e-27); %!assert(physical_constant("helion mass energy equivalent"), 4.499539341e-10); %!assert(physical_constant("helion mass energy equivalent in MeV"), 2808.391586); %!assert(physical_constant("helion mass in u"), 3.01493224673); %!assert(physical_constant("helion molar mass"), 3.01493224673e-3); %!assert(physical_constant("helion-electron mass ratio"), 5495.88527922); %!assert(physical_constant("helion-proton mass ratio"), 2.99315267046); %!assert(physical_constant("hertz-atomic mass unit relationship"), 4.4398216616e-24); %!assert(physical_constant("hertz-electron volt relationship"), 4.135667662e-15); %!assert(physical_constant("hertz-hartree relationship"), 1.5198298460088e-16); %!assert(physical_constant("hertz-inverse meter relationship"), 3.335640951e-9); %!assert(physical_constant("hertz-joule relationship"), 6.626070040e-34); %!assert(physical_constant("hertz-kelvin relationship"), 4.7992447e-11); %!assert(physical_constant("hertz-kilogram relationship"), 7.372497201e-51); %!assert(physical_constant("inverse fine-structure constant"), 137.035999139); %!assert(physical_constant("inverse meter-atomic mass unit relationship"), 1.33102504900e-15); %!assert(physical_constant("inverse meter-electron volt relationship"), 1.2398419739e-6); %!assert(physical_constant("inverse meter-hartree relationship"), 4.556335252767e-8); %!assert(physical_constant("inverse meter-hertz relationship"), 299792458); %!assert(physical_constant("inverse meter-joule relationship"), 1.986445824e-25); %!assert(physical_constant("inverse meter-kelvin relationship"), 1.43877736e-2); %!assert(physical_constant("inverse meter-kilogram relationship"), 2.210219057e-42); %!assert(physical_constant("inverse of conductance quantum"), 12906.4037278); %!assert(physical_constant("joule-atomic mass unit relationship"), 6.700535363e9); %!assert(physical_constant("joule-electron volt relationship"), 6.241509126e18); %!assert(physical_constant("joule-hartree relationship"), 2.293712317e17); %!assert(physical_constant("joule-hertz relationship"), 1.509190205e33); %!assert(physical_constant("joule-inverse meter relationship"), 5.034116651e24); %!assert(physical_constant("joule-kelvin relationship"), 7.2429731e22); %!assert(physical_constant("joule-kilogram relationship"), 1.112650056e-17); %!assert(physical_constant("kelvin-atomic mass unit relationship"), 9.2510842e-14); %!assert(physical_constant("kelvin-electron volt relationship"), 8.6173303e-5); %!assert(physical_constant("kelvin-hartree relationship"), 3.1668105e-6); %!assert(physical_constant("kelvin-hertz relationship"), 2.0836612e10); %!assert(physical_constant("kelvin-inverse meter relationship"), 69.503457); %!assert(physical_constant("kelvin-joule relationship"), 1.38064852e-23); %!assert(physical_constant("kelvin-kilogram relationship"), 1.53617865e-40); %!assert(physical_constant("kilogram-atomic mass unit relationship"), 6.022140857e26); %!assert(physical_constant("kilogram-electron volt relationship"), 5.609588650e35); %!assert(physical_constant("kilogram-hartree relationship"), 2.061485823e34); %!assert(physical_constant("kilogram-hertz relationship"), 1.356392512e50); %!assert(physical_constant("kilogram-inverse meter relationship"), 4.524438411e41); %!assert(physical_constant("kilogram-joule relationship"), 8.987551787e16); %!assert(physical_constant("kilogram-kelvin relationship"), 6.5096595e39); %!assert(physical_constant("lattice parameter of silicon"), 543.1020504e-12); %!assert(physical_constant("mag. constant"), 12.566370614e-7); %!assert(physical_constant("mag. flux quantum"), 2.067833831e-15); %!assert(physical_constant("molar Planck constant"), 3.9903127110e-10); %!assert(physical_constant("molar Planck constant times c"), 0.119626565582); %!assert(physical_constant("molar gas constant"), 8.3144598); %!assert(physical_constant("molar mass constant"), 1e-3); %!assert(physical_constant("molar mass of carbon-12"), 12e-3); %!assert(physical_constant("molar volume of ideal gas (273.15 K, 100 kPa)"), 22.710947e-3); %!assert(physical_constant("molar volume of ideal gas (273.15 K, 101.325 kPa)"), 22.413962e-3); %!assert(physical_constant("molar volume of silicon"), 12.05883214e-6); %!assert(physical_constant("muon Compton wavelength"), 11.73444111e-15); %!assert(physical_constant("muon Compton wavelength over 2 pi"), 1.867594308e-15); %!assert(physical_constant("muon g factor"), -2.0023318418); %!assert(physical_constant("muon mag. mom."), -4.49044826e-26); %!assert(physical_constant("muon mag. mom. anomaly"), 1.16592089e-3); %!assert(physical_constant("muon mag. mom. to Bohr magneton ratio"), -4.84197048e-3); %!assert(physical_constant("muon mag. mom. to nuclear magneton ratio"), -8.89059705); %!assert(physical_constant("muon mass"), 1.883531594e-28); %!assert(physical_constant("muon mass energy equivalent"), 1.692833774e-11); %!assert(physical_constant("muon mass energy equivalent in MeV"), 105.6583745); %!assert(physical_constant("muon mass in u"), 0.1134289257); %!assert(physical_constant("muon molar mass"), 0.1134289257e-3); %!assert(physical_constant("muon-electron mass ratio"), 206.7682826); %!assert(physical_constant("muon-neutron mass ratio"), 0.1124545167); %!assert(physical_constant("muon-proton mag. mom. ratio"), -3.183345142); %!assert(physical_constant("muon-proton mass ratio"), 0.1126095262); %!assert(physical_constant("muon-tau mass ratio"), 5.94649e-2); %!assert(physical_constant("natural unit of action"), 1.054571800e-34); %!assert(physical_constant("natural unit of action in eV s"), 6.582119514e-16); %!assert(physical_constant("natural unit of energy"), 8.18710565e-14); %!assert(physical_constant("natural unit of energy in MeV"), 0.5109989461); %!assert(physical_constant("natural unit of length"), 386.15926764e-15); %!assert(physical_constant("natural unit of mass"), 9.10938356e-31); %!assert(physical_constant("natural unit of mom.um"), 2.730924488e-22); %!assert(physical_constant("natural unit of mom.um in MeV/c"), 0.5109989461); %!assert(physical_constant("natural unit of time"), 1.28808866712e-21); %!assert(physical_constant("natural unit of velocity"), 299792458); %!assert(physical_constant("neutron Compton wavelength"), 1.31959090481e-15); %!assert(physical_constant("neutron Compton wavelength over 2 pi"), 0.21001941536e-15); %!assert(physical_constant("neutron g factor"), -3.82608545); %!assert(physical_constant("neutron gyromag. ratio"), 1.83247172e8); %!assert(physical_constant("neutron gyromag. ratio over 2 pi"), 29.1646933); %!assert(physical_constant("neutron mag. mom."), -0.96623650e-26); %!assert(physical_constant("neutron mag. mom. to Bohr magneton ratio"), -1.04187563e-3); %!assert(physical_constant("neutron mag. mom. to nuclear magneton ratio"), -1.91304273); %!assert(physical_constant("neutron mass"), 1.674927471e-27); %!assert(physical_constant("neutron mass energy equivalent"), 1.505349739e-10); %!assert(physical_constant("neutron mass energy equivalent in MeV"), 939.5654133); %!assert(physical_constant("neutron mass in u"), 1.00866491588); %!assert(physical_constant("neutron molar mass"), 1.00866491588e-3); %!assert(physical_constant("neutron to shielded proton mag. mom. ratio"), -0.68499694); %!assert(physical_constant("neutron-electron mag. mom. ratio"), 1.04066882e-3); %!assert(physical_constant("neutron-electron mass ratio"), 1838.68366158); %!assert(physical_constant("neutron-muon mass ratio"), 8.89248408); %!assert(physical_constant("neutron-proton mag. mom. ratio"), -0.68497934); %!assert(physical_constant("neutron-proton mass difference"), 2.30557377e-30); %!assert(physical_constant("neutron-proton mass difference energy equivalent"), 2.07214637e-13); %!assert(physical_constant("neutron-proton mass difference energy equivalent in MeV"), 1.29333205); %!assert(physical_constant("neutron-proton mass difference in u"), 0.00138844900); %!assert(physical_constant("neutron-proton mass ratio"), 1.00137841898); %!assert(physical_constant("neutron-tau mass ratio"), 0.528790); %!assert(physical_constant("nuclear magneton"), 5.050783699e-27); %!assert(physical_constant("nuclear magneton in K/T"), 3.6582690e-4); %!assert(physical_constant("nuclear magneton in MHz/T"), 7.622593285); %!assert(physical_constant("nuclear magneton in eV/T"), 3.1524512550e-8); %!assert(physical_constant("nuclear magneton in inverse meters per tesla"), 2.542623432e-2); %!assert(physical_constant("proton Compton wavelength"), 1.32140985396e-15); %!assert(physical_constant("proton Compton wavelength over 2 pi"), 0.210308910109e-15); %!assert(physical_constant("proton charge to mass quotient"), 9.578833226e7); %!assert(physical_constant("proton g factor"), 5.585694702); %!assert(physical_constant("proton gyromag. ratio"), 2.675221900e8); %!assert(physical_constant("proton gyromag. ratio over 2 pi"), 42.57747892); %!assert(physical_constant("proton mag. mom."), 1.4106067873e-26); %!assert(physical_constant("proton mag. mom. to Bohr magneton ratio"), 1.5210322053e-3); %!assert(physical_constant("proton mag. mom. to nuclear magneton ratio"), 2.7928473508); %!assert(physical_constant("proton mag. shielding correction"), 25.691e-6); %!assert(physical_constant("proton mass"), 1.672621898e-27); %!assert(physical_constant("proton mass energy equivalent"), 1.503277593e-10); %!assert(physical_constant("proton mass energy equivalent in MeV"), 938.2720813); %!assert(physical_constant("proton mass in u"), 1.007276466879); %!assert(physical_constant("proton molar mass"), 1.007276466879e-3); %!assert(physical_constant("proton rms charge radius"), 0.8751e-15); %!assert(physical_constant("proton-electron mass ratio"), 1836.15267389); %!assert(physical_constant("proton-muon mass ratio"), 8.88024338); %!assert(physical_constant("proton-neutron mag. mom. ratio"), -1.45989805); %!assert(physical_constant("proton-neutron mass ratio"), 0.99862347844); %!assert(physical_constant("proton-tau mass ratio"), 0.528063); %!assert(physical_constant("quantum of circulation"), 3.6369475486e-4); %!assert(physical_constant("quantum of circulation times 2"), 7.2738950972e-4); %!assert(physical_constant("second radiation constant"), 1.43877736e-2); %!assert(physical_constant("shielded helion gyromag. ratio"), 2.037894585e8); %!assert(physical_constant("shielded helion gyromag. ratio over 2 pi"), 32.43409966); %!assert(physical_constant("shielded helion mag. mom."), -1.074553080e-26); %!assert(physical_constant("shielded helion mag. mom. to Bohr magneton ratio"), -1.158671471e-3); %!assert(physical_constant("shielded helion mag. mom. to nuclear magneton ratio"), -2.127497720); %!assert(physical_constant("shielded helion to proton mag. mom. ratio"), -0.7617665603); %!assert(physical_constant("shielded helion to shielded proton mag. mom. ratio"), -0.7617861313); %!assert(physical_constant("shielded proton gyromag. ratio"), 2.675153171e8); %!assert(physical_constant("shielded proton gyromag. ratio over 2 pi"), 42.57638507); %!assert(physical_constant("shielded proton mag. mom."), 1.410570547e-26); %!assert(physical_constant("shielded proton mag. mom. to Bohr magneton ratio"), 1.520993128e-3); %!assert(physical_constant("shielded proton mag. mom. to nuclear magneton ratio"), 2.792775600); %!assert(physical_constant("speed of light in vacuum"), 299792458); %!assert(physical_constant("standard acceleration of gravity"), 9.80665); %!assert(physical_constant("standard atmosphere"), 101325); %!assert(physical_constant("standard-state pressure"), 100000); %!assert(physical_constant("tau Compton wavelength"), 0.697787e-15); %!assert(physical_constant("tau Compton wavelength over 2 pi"), 0.111056e-15); %!assert(physical_constant("tau mass"), 3.16747e-27); %!assert(physical_constant("tau mass energy equivalent"), 2.84678e-10); %!assert(physical_constant("tau mass energy equivalent in MeV"), 1776.82); %!assert(physical_constant("tau mass in u"), 1.90749); %!assert(physical_constant("tau molar mass"), 1.90749e-3); %!assert(physical_constant("tau-electron mass ratio"), 3477.15); %!assert(physical_constant("tau-muon mass ratio"), 16.8167); %!assert(physical_constant("tau-neutron mass ratio"), 1.89111); %!assert(physical_constant("tau-proton mass ratio"), 1.89372); %!assert(physical_constant("triton g factor"), 5.957924920); %!assert(physical_constant("triton mag. mom."), 1.504609503e-26); %!assert(physical_constant("triton mag. mom. to Bohr magneton ratio"), 1.6223936616e-3); %!assert(physical_constant("triton mag. mom. to nuclear magneton ratio"), 2.978962460); %!assert(physical_constant("triton mass"), 5.007356665e-27); %!assert(physical_constant("triton mass energy equivalent"), 4.500387735e-10); %!assert(physical_constant("triton mass energy equivalent in MeV"), 2808.921112); %!assert(physical_constant("triton mass in u"), 3.01550071632); %!assert(physical_constant("triton molar mass"), 3.01550071632e-3); %!assert(physical_constant("triton-electron mass ratio"), 5496.92153588); %!assert(physical_constant("triton-proton mass ratio"), 2.99371703348); %!assert(physical_constant("unified atomic mass unit"), 1.660539040e-27); %!assert(physical_constant("von Klitzing constant"), 25812.8074555); %!assert(physical_constant("weak mixing angle"), 0.2223); %!assert(physical_constant("{220} lattice spacing of silicon"), 192.0155714e-12); miscellaneous-1.3.1/inst/physical_constant.py0000755000000000000000000001707214650254633016403 0ustar00#!/usr/bin/python # -*- coding: utf-8 -*- ## Copyright (C) 2007 Muthiah Annamalai ## Copyright (C) 2012-2017 Carnë Draug ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## This is the code generator that works on the NIST file available for download ## at http://physics.nist.gov/cuu/Constants/Table/allascii.txt It downloads and ## parses the file automatically, only needs as argument the directory where to ## save the function file (if no arguments are supplied, it saves file in the ## directory as the script) from __future__ import print_function import time import sys import os.path ## For the sake of Python 2 and 3 compatibility try: from urllib.request import urlopen except ImportError: from urllib import urlopen def get_header (): header = [ '## Copyright (C) 2007 Muthiah Annamalai ', '## Copyright (C) 2012 Carnë Draug ', '##', '## This program is free software; you can redistribute it and/or modify it under', '## the terms of the GNU General Public License as published by the Free Software', '## Foundation; either version 3 of the License, or (at your option) any later', '## version.', '##', '## This program is distributed in the hope that it will be useful, but WITHOUT', '## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or', '## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more', '## details.', '##', '## You should have received a copy of the GNU General Public License along with', '## this program; if not, see .', '', '## -*- texinfo -*-', '## @deftypefn {Function File} {[@var{names}] =} physical_constant', '## @deftypefnx {Function File} {[@var{val}, @var{uncertainty}, @var{unit}] =} physical_constant (@var{name})', '## @deftypefnx {Function File} {[@var{constants}] =} physical_constant ("all")', '## Get physical constant @var{arg}.', '##', '## If no arguments are given, returns a cell array with all possible @var{name}s.', '## Alternatively, @var{name} can be `all\' in which case @var{val} is a structure', '## array with 4 fields (name, value, uncertainty, units).', '##', '## Since the long list of values needs to be parsed on each call to this function', '## it is much more efficient to store the values in a variable rather make multiple', '## calls to this function with the same argument', '##', '## The values are the ones recommended by CODATA. This function was autogenerated', '## on ' + str (time.ctime ()) + ' from NIST database at @uref{http://physics.nist.gov/constants}', '## @end deftypefn', '', '## DO NOT EDIT THIS FILE', '## This function file is generated automatically by physical_constant.py', ] return header def get_constants_table (): """Download and parse the current list of constants from NIST website""" url = 'http://physics.nist.gov/cuu/Constants/Table/allascii.txt' ## the ideal would be to parse the whole file in a smart way with regexp ## rather than relying on a fixed format which already broke this script ## before. By having the values here rather than hardcoded, it will make ## at least easier to fix it in the future. Even better would be if they ## supplied us a XML rather than a ASCII table. These are the guys from ## NIST to contact in case of problems: ## Barry N. Taylor ## David Newell ## Peter Mohr ini_skip = 10 # number of lines to skip (header) length_name = 60 # max length of the `quantity' column length_value = 25 # max length of the `value' column length_uncert = 25 # max length of the `uncertainty' column length_unit = 15 # max length of the `unit' column ascii = urlopen(url).read().decode("utf-8").split('\n')[ini_skip:] table = {} for line in ascii: if not line: continue # skip empty lines (at least the end of file) name = line[: length_name].strip() line = line[length_name :] value = line[: length_value].strip() line = line[length_value :] uncert = line[:length_uncert].strip() line = line[length_uncert:] unit = line[: length_unit].strip() ## do NOT adjust name. Old code would have description (the complete string) ## and name (which would have some changes). However, some constants that ## were defined twice (for different conditions) would appear only once ## without information on the conditions. See the old revisions ## adjust value and uncertainty for old, new in { ' ' : '', # remove spaces '...' : '', # is decimal }.items(): value = value.replace (old, new) uncert = uncert.replace (old, new) uncert = uncert.replace ('(exact)', '0.0') table[name] = [value, uncert, unit] return table ## Start script table = get_constants_table () ## if there's any argument, assume it's directory and save function there ## otherwise save function file on same directory as script if len (sys.argv) > 1: filepath = os.path.join(os.path.dirname (sys.argv[1]), 'physical_constant.m') else: filepath = os.path.join(os.path.dirname (sys.argv[0]), 'physical_constant.m') sys.stdout = open (filepath, "w") for line in get_header(): print (line) print (''' function [rval, uncert, unit] = physical_constant (arg) persistent unit_data; if (isempty(unit_data)) unit_data = get_data; endif if (nargin > 1 || (nargin == 1 && !ischar (arg))) print_usage; elseif (nargin == 0) rval = reshape ({unit_data(:).name}, size (unit_data)); return elseif (nargin == 1 && strcmpi (arg, "all")) rval = unit_data; return endif val = reshape ({unit_data(:).name}, size (unit_data)); map = strcmpi (val, arg); if (any (map)) val = unit_data(map); rval = val.value; uncert = val.uncertainty; unit = val.units; else error ("No constant with name '%s' found", arg) endif endfunction ''') print ('function unit_data = get_data') index = 1 for name, values in sorted(table.items()): print (' unit_data(' + str (index) + ').name = "' + name + '";') print (' unit_data(' + str (index) + ').value = ' + str (values[0]) + ';') print (' unit_data(' + str (index) + ').uncertainty = ' + str (values[1]) + ';') print (' unit_data(' + str (index) + ').units = "' + values[2] + '";') print ('') index += 1 print ('endfunction') for name, values in sorted(table.items()): print ('%!assert(physical_constant("' + name + '"), '+ str (values[0]) +');') miscellaneous-1.3.1/inst/read_options.m0000644000000000000000000001472214650254633015144 0ustar00## Copyright (C) 2002 Etienne Grossmann ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn{Function File} {@var{[op,nread]} = } read_options ( args, varargin ) ## @cindex ## The function read_options parses arguments to a function as, ## [ops,nread] = read_options (args,...) - Read options ## ## The input being @var{args} a list of options and values. ## The options can be any of the following, ## ## 'op0' , string : Space-separated names of opt taking no argument <''> ## ## 'op1' , string : Space-separated names of opt taking one argument <''> ## ## 'extra' , string : Name of nameless trailing arguments. <''> ## ## 'default', struct : Struct holding default option values ## ## 'prefix' , int : If false, only accept whole opt names. Otherwise, <0> ## recognize opt from first chars, and choose ## shortest if many opts start alike. ## ## 'nocase' , int : If set, ignore case in option names <0> ## ## 'quiet' , int : Behavior when a non-string or unknown opt is met <0> ## 0 - Produce an error ## 1 - Return quietly (can be diagnosed by checking 'nread') ## ## 'skipnan', int : Ignore NaNs if there is a default value. ## Note : At least one of 'op0' or 'op1' should be specified. ## ## The output variables are, ## @var{ops} : struct : Struct whose key/values are option names/values ## @var{nread} : int : Number of elements of args that were read ## ## USAGE ## @example ## # Define options and defaults ## op0 = "is_man is_plane flies" ## default = struct ("is_man",1, "flies",0); ## ## # Read the options ## ## s = read_options (list (all_va_args), "op0",op0,"default",default) ## ## # Create variables w/ same name as options ## ## [is_man, is_plane, flies] = getfields (s,"is_man", "is_plane", "flies") ## pre 2.1.39 function [op,nread] = read_options (args, ...) ## @end example ## @end deftypefn function [op,nread] = read_options (args, varargin) ## pos 2.1.39 verbose = 0; op = struct (); # Empty struct op0 = op1 = " "; skipnan = prefix = quiet = nocase = quiet = 0; extra = ""; nargs = nargin-1; # nargin is now a function if rem (nargs, 2), error ("odd number of optional args"); endif i=1; while i 1 # Ambiguous option name fullen = zeros (1,length (ii)); # Full length of each optio tmp = correct = ""; j = 0; for i = ii fullen(++j) = spi(find (spi > i,1))-i ; tmp = [tmp,"', '",opts(i:i+fullen(j)-1)]; endfor tmp = tmp(5:length(tmp)); if sum (fullen == min (fullen)) > 1 || ... ((min (fullen) != length(name)) && ! prefix) , error ("ambiguous option '%s'. Could be '%s'",oname,tmp); endif j = find (fullen == min (fullen), 1); ii = ii(j); endif # Full name of option (w/ correct case) fullname = opts_orig(ii:spi(find (spi > ii, 1))-1); if ii < iend if verbose, printf ("read_options : found boolean '%s'\n",fullname); endif op.(fullname) = 1; else if verbose, printf ("read_options : found '%s'\n",fullname); endif if nread < length (args) tmp = args{++nread}; if verbose, printf ("read_options : size is %i x %i\n",size(tmp)); endif if !isnumeric (tmp) || !all (isnan (tmp(:))) || ... !isfield (op, fullname) op.(fullname) = tmp; else if verbose, printf ("read_options : ignoring nan\n"); endif endif else error ("options end before I can read value of option '%s'",oname); endif endif endwhile endfunction miscellaneous-1.3.1/inst/reduce.m0000644000000000000000000000472414650254633013726 0ustar00## Copyright (C) 2007 Muthiah Annamalai ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function File} {@var{x} =} reduce (@var{function}, @var{sequence},@var{initializer}) ## @deftypefnx {Function File} {@var{x} =} reduce (@var{function}, @var{sequence}) ## Implements the 'reduce' operator like in Lisp, or Python. ## Apply function of two arguments cumulatively to the items of sequence, ## from left to right, so as to reduce the sequence to a single value. For example, ## reduce(@@(x,y)(x+y), [1, 2, 3, 4, 5]) calculates ((((1+2)+3)+4)+5). ## The left argument, x, is the accumulated value and the right argument, y, is the ## update value from the sequence. If the optional initializer is present, it is ## placed before the items of the sequence in the calculation, and serves as ## a default when the sequence is empty. If initializer is not given and sequence ## contains only one item, the first item is returned. ## ## @example ## reduce(@@plus,[1:10]) ## @result{} 55 ## reduce(@@(x,y)(x*y),[1:7]) ## @result{} 5040 (actually, 7!) ## @end example ## ## @end deftypefn ## Parts of documentation copied from the "Python Library Reference, v2.5" function rv = reduce (func, lst, init) if (nargin < 2 || nargin > 3) print_usage (); elseif (! isa (func, "function_handle")) error ("reduce: FUNCTION must be a function handle"); elseif (nargin < 3 && isempty (lst)) error ("reduce: LST must not be empty when INIT is undefined"); endif start = 1; if (nargin == 2) init = lst(1); start = 2; endif rv = init; for i = start:numel(lst) rv = func (rv, lst(i)); endfor endfunction %!assert(reduce(@(x,y)(x+y),[],-1),-1) %!assert(reduce(@(x,y)(x+y),[+1],-1),0) %!assert(reduce(@(x,y)(x+y),[-10:-1]),-55) %!assert(reduce(@(x,y)(x+y),[-10:-1],+55),0) %!assert(reduce(@(x,y)(y*x),[1:4],5),120) miscellaneous-1.3.1/inst/rolldices.m0000644000000000000000000000471514650254633014437 0ustar00## Copyright (C) 2009 Jaroslav Hajek ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn{Function File} rolldices (@var{n}) ## @deftypefnx{Function File} rolldices (@var{n}, @var{nrep}, @var{delay}) ## Returns @var{n} random numbers from the 1:6 range, displaying a visual selection ## effect. ## ## @var{nrep} sets the number of rolls, @var{delay} specifies time between ## successive rolls in seconds. Default is nrep = 25 and delay = 0.1. ## ## Requires a terminal with ANSI escape sequences enabled. ## @end deftypefn function numbers = rolldices (n, nrep = 25, delay = .1) if (nargin != 1) print_usage (); endif persistent matrices = getmatrices (); screen_cols = getenv ("COLUMNS"); if (isempty (screen_cols)) screen_cols = 80; else screen_cols = str2num (screen_cols); endif dices_per_row = floor ((screen_cols-1) / 7); oldpso = page_screen_output (0); numbers = []; unwind_protect while (n > 0) m = min (n, dices_per_row); for i = 1:nrep if (i > 1) puts (char ([27, 91, 51, 70])); sleep (delay); endif nums = ceil (6 * rand (1, m)); disp (matrices(:,:,nums)(:,:)); endfor numbers = [numbers, nums]; n -= m; puts ("\n"); endwhile unwind_protect_cleanup page_screen_output (oldpso); end_unwind_protect endfunction function matrices = getmatrices () lbrk = [27, 91, 55, 109](ones (1, 3), :); rbrk = [27, 91, 50, 55, 109](ones (1, 3), :); spcs = [32, 32; 32, 32; 32, 32]; dchrs = reshape( [" @ @ @ @@ @@ @"; " @ @ @ @ @"; " @ @@ @@ @@ @"], [3, 5, 6]); matrices = mat2cell (dchrs, 3, 5, ones (1, 6)); matrices = cellfun (@(mat) [spcs, lbrk, mat, rbrk], matrices, "UniformOutput", false); matrices = cat (3, matrices{:}); endfunction miscellaneous-1.3.1/inst/slurp_file.m0000644000000000000000000000316714650254633014623 0ustar00## Copyright (C) 2002 Etienne Grossmann ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn{Function File} {@var{s} = } slurp_file ( f ) ## @cindex ## slurp_file return a whole text file @var{f} as a string @var{s}. ## ## @var{f} : string : filename ## @var{s} : string : contents of the file ## ## If @var{f} is not an absolute filename, and ## is not an immediately accessible file, slurp_file () ## will look for @var{f} in the path. ## @end deftypefn function s = slurp_file (f) if (nargin != 1) print_usage; elseif ! ischar (f) error ("f is not a string"); elseif isempty (f) error ("f is empty"); endif s = ""; f0 = f; [st,err,msg] = stat (f); if err && f(1) != "/", f = file_in_loadpath (f); if isempty (f) ## Could not find it anywhere. Open will fail f = f0; error ("slurp_file : Can't find '%s' anywhere",f0); end end ## I'll even get decent error messages! [status, s] = system (sprintf ("cat '%s'",f), 1); endfunction miscellaneous-1.3.1/inst/solvesudoku.m0000644000000000000000000001171514650254633015040 0ustar00## Copyright (C) 2009 Jaroslav Hajek ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn{Function File} [@var{x}, @var{ntrial}] = solvesudoku (@var{s}) ## Solves a classical 9x9 sudoku. @var{s} should be a 9x9 array with ## numbers from 0:9. 0 indicates empty field. ## Returns the filled table or empty matrix if no solution exists. ## If requested, @var{ntrial} returns the number of trial-and-error steps needed. ## @end deftypefn ## This uses a recursive backtracking technique combined with revealing new singleton ## fields by logic. The beauty of it is that it is completely vectorized. function [x, ntrial] = solvesudoku (s) if (nargin != 1) print_usage (); endif if (! (ismatrix (s) && ndims (s) == 2 && all (size (s) == [9, 9]))) error ("needs a 9x9 matrix"); endif if (! ismember (unique (s(:)), 0:9)) error ("matrix must contain values from 0:9"); endif if (! verifysudoku (s)) error ("matrix is not a valid sudoku grid"); endif [x, ntrial] = solvesudoku_rec (s); endfunction function ok = verifysudoku (s) [i, j, k] = find (s); b = false (9, 9, 9); b(sub2ind ([9, 9, 9], i, j, k)) = true; okc = sum (b, 1) <= 1; okr = sum (b, 2) <= 1; b = reshape (b, [3, 3, 3, 3, 9]); ok3 = sum (sum (b, 1), 3) <= 1; ok = all (okc(:) & okr(:) & ok3(:)); endfunction function [x, ntrial] = solvesudoku_rec (s) x = s; ntrial = 0; ## Run until the logic is exhausted. do b = getoptions (x); s = x; x = getsingletons (b, x); finished = isempty (x) || all (x(:)); until (finished || all ((x == s)(:))); if (! finished) x = []; ## Find the field with minimum possibilities. sb = sum (b, 3); sb(s != 0) = 10; [msb, i] = min (sb(:)); [i, j] = ind2sub ([9, 9], i); ## Try all guesses. for k = find (b(i,j,:))' s(i,j) = k; [x, ntrial1] = solvesudoku_rec (s); ntrial += 1 + ntrial1; if (! isempty (x)) ## Found solutions. break; endif s(i,j) = 0; endfor endif endfunction ## Given a 9x9x9 logical array of allowed values, get the logical singletons. function s = getsingletons (b, s) n0 = sum (s(:) != 0); ## Check for fields with only one option. sb = sum (b, 3); if (any (sb(:) == 0)) s = []; return; else s1 = sb == 1; ## We want to return as soon as some new singletons are found. [s(s1), xx] = find (reshape (b, [], 9)(s1, :).'); if (sum (s(:) != 0) > n0) return; endif endif ## Check for columns where a number has only one field left. sb = squeeze (sum (b, 1)); if (any (sb(:) == 0)) s = []; return; else s1 = sb == 1; [j, k] = find (s1); [i, xx] = find (b(:, s1)); s(sub2ind ([9, 9], i, j)) = k; if (sum (s(:) != 0) > n0) return; endif endif ## Ditto for rows. sb = squeeze (sum (b, 2)); if (any (sb(:) == 0)) s = []; return; else s1 = sb == 1; [i, k] = find (s1); [j, xx] = find (permute (b, [2, 1, 3])(:, s1)); s(sub2ind ([9, 9], i, j)) = k; if (sum (s(:) != 0) > n0) return; endif endif ## 3x3 tiles. bb = reshape (b, [3, 3, 3, 3, 9]); sb = squeeze (sum (sum (bb, 1), 3)); if (any (sb(:) == 0)) s = []; return; else s1 = reshape (sb == 1, 9, 9); [j, k] = find (s1); [i, xx] = find (reshape (permute (bb, [1, 3, 2, 4, 5]), 9, 9*9)(:, s1)); [i1, i2] = ind2sub ([3, 3], i); [j1, j2] = ind2sub ([3, 3], j); s(sub2ind ([3, 3, 3, 3], i1, j1, i2, j2)) = k; if (sum (s(:) != 0) > n0) return; endif endif endfunction ## Given known values (singletons), calculate options. function b = getoptions (s) ## Find true values. [i, j, s] = find (s); ## Columns. bc = true (9, 9, 9); bc(:, sub2ind ([9, 9], j, s)) = false; ## Rows. br = true (9, 9, 9); br(:, sub2ind ([9, 9], i, s)) = false; ## 3x3 tiles. b3 = true (3, 3, 3, 3, 9); b3(:, :, sub2ind ([3, 3, 9], ceil (i/3), ceil (j/3), s)) = false; ## Permute elements to correct order. br = permute (br, [2, 1, 3]); b3 = reshape (permute (b3, [1, 3, 2, 4, 5]), [9, 9, 9]); ## The singleton fields themselves. bb = true (9*9, 9); bb(sub2ind ([9, 9], i, j), :) = false; bb = reshape (bb, [9, 9, 9]); ## Form result. b = bc & br & b3 & bb; ## Correct singleton fields. b = reshape (b, 9, 9, 9); b(sub2ind ([9, 9, 9], i, j, s)) = true; endfunction miscellaneous-1.3.1/inst/textable.m0000644000000000000000000001325614650254633014267 0ustar00## Copyright (C) 2012 Markus Bergholz ## Copyright (C) 2012 carnë Draug ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function File} {} textable (@var{matrix}) ## @deftypefnx {Function File} {} textable (@var{matrix}, @var{params}, @dots{}) ## Save @var{matrix} in LaTeX format (tabular or array). ## ## The input matrix must be numeric and two dimensional. ## ## The generated LaTeX source can be saved directly to a file with the option ## @command{file}. The file can then be inserted in any latex document by using ## the @code{\input@{latex file name without .tex@}} statement. ## ## Available parameters are: ## @itemize @bullet ## @item @code{file}: filename to save the generated LaTeX source. Requires a string ## as value. ## @item @code{rlines}: display row lines. ## @item @code{clines}: display column lines. ## @item @code{align}: column alignment. Valid values are `l', `c' and `r' for ## center, left and right (default). ## @item @code{math}: create table in array environment inside displaymath ## environment. It requires a string as value which will be the name of the matrix. ## @end itemize ## ## The basic usage is to generate the source for a table without lines and right ## alignment (default values): ## @example ## @group ## textable (data) ## @result{} ## \begin@{tabular@}@{rrr@} ## 0.889283 & 0.949328 & 0.205663 \\ ## 0.225978 & 0.426528 & 0.189561 \\ ## 0.245896 & 0.466162 & 0.225864 \\ ## \end@{tabular@} ## @end group ## @end example ## ## Alternatively, the source can be saved directly into a file: ## @example ## @group ## textable (data, "file", "data.tex"); ## @end group ## @end example ## ## The appearance of the table can be controled with switches and key values. The ## following generates a table with both row and column lines (rlines and clines), ## and center alignment: ## @example ## @group ## textable (data, "rlines", "clines", "align", "c") ## @result{} ## \begin@{tabular@}@{|c|c|c|@} ## \hline ## 0.889283 & 0.949328 & 0.205663 \\ ## \hline ## 0.225978 & 0.426528 & 0.189561 \\ ## \hline ## 0.245896 & 0.466162 & 0.225864 \\ ## \hline ## \end@{tabular@} ## @end group ## @end example ## ## Finnally, for math mode, it is also possible to place the matrix in an array ## environment and name the matrix: ## @example ## @group ## textable (data, "math", "matrix-name") ## @result{} ## \begin@{displaymath@} ## \mathbf@{matrix-name@} = ## \left( ## \begin@{array@}@{*@{ 3 @}@{rrr@}@} ## 0.889283 & 0.949328 & 0.205663 \\ ## 0.225978 & 0.426528 & 0.189561 \\ ## 0.245896 & 0.466162 & 0.225864 \\ ## \end@{array@} ## \right) ## \end@{displaymath@} ## @end group ## @end example ## ## @seealso{csv2latex, publish} ## @end deftypefn function [str] = textable (data, varargin) if (nargin < 1) print_usage; elseif (!isnumeric (data) || !ismatrix (data)|| ndims (data) != 2) error ("first argument must be a 2D numeric matrix"); endif p = inputParser; p.addSwitch ("clines"); p.addSwitch ("rlines"); p.addParamValue ("math", "X", @ischar); p.addParamValue ("file", "matrix.tex", @ischar); p.addParamValue ("align", "r", @(x) any(strcmpi(x, {"l", "c", "r"}))); p.parse (varargin{:}); ## if there is no filename given we won't print to file print_to_file = all (!strcmp ("file", p.UsingDefaults)); ## will we use an array environment (in displaymath) math = all (!strcmp ("math", p.UsingDefaults)); if (p.Results.clines) align = sprintf ("|%s", repmat (cstrcat (p.Results.align, "|"), [1, columns(data)])); ## if we are in a array environment, we need to remove the last | or we end ## with two lines at the end if (math), align = align(1:end-1); endif else align = sprintf ("%s", repmat (p.Results.align, [1, columns(data)])); endif ## start making table if (math) str = "\\begin{displaymath}\n"; str = strcat (str, sprintf (" \\mathbf{%s} =\n", p.Results.math)); str = strcat (str, " \\left(\n"); str = strcat (str, sprintf (" \\begin{array}{*{ %d }{%s}}\n", columns (data), align)); else str = sprintf ("\\begin{tabular}{%s}\n", align); endif if (p.Results.rlines) str = strcat (str, " \\hline \n"); endif for ii = 1:rows(data) str = strcat (str, sprintf (" %g", data (ii, 1))); str = strcat (str, sprintf (" & %g", data (ii, 2:end))); str = strcat (str, " \\\\\n"); if (p.Results.rlines) str = strcat (str, " \\hline \n"); endif endfor if (math) str = strcat (str, " \\end{array}\n \\right)\n\\end{displaymath}"); else str = strcat (str, "\\end{tabular}\n"); endif if (print_to_file) [fid, msg] = fopen (p.Results.file, "w"); if (fid == -1) error ("Could not fopen file '%s' for writing: %s", p.Results.file, msg); endif fputs (fid, str); fclose (fid); endif endfunction %!demo %! A = [1 2 3; 4 5 6]; %! textable (A) miscellaneous-1.3.1/inst/truncate.m0000644000000000000000000000321714650254633014300 0ustar00%% Copyright (c) 2012 Juan Pablo Carbajal %% %% This program is free software: you can redistribute it and/or modify %% it under the terms of the GNU General Public License as published by %% the Free Software Foundation, either version 3 of the License, or %% any later version. %% %% This program is distributed in the hope that it will be useful, %% but WITHOUT ANY WARRANTY; without even the implied warranty of %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %% GNU General Public License for more details. %% %% You should have received a copy of the GNU General Public License %% along with this program. If not, see . %% -*- texinfo -*- %% @deftypefn {Function File} {@var{y} =} truncate (@var{x}, @var{order}, @var{method}) %% @deftypefnx {Function File} {@var{y} =} truncate (@dots{}, @var{method}) %% Truncates @var{X} to @var{order} of magnitude. %% %% The optional argument @var{method} can be a hanlde to a function used to %% truncate the number. Default is @code{round}. %% %% Examples: %% @example %% format long %% x = 987654321.123456789; %% order = [3:-1:0 -(1:3)]'; %% y = truncate (x,order) %% y = %% 987654000.000000 %% 987654300.000000 %% 987654320.000000 %% 987654321.000000 %% 987654321.100000 %% 987654321.120000 %% 987654321.123000 %% %% format %% [truncate(0.127,-2), truncate(0.127,-2,@@floor)] %% ans = %% 0.13000 0.12000 %% %% @end example %% %% @seealso{round,fix,ceil,floor} %% @end deftypefn function y = truncate (x,order,method=@round) ino = 0.1.^order; o = 10.^order; y = method (x.*ino).*o; end miscellaneous-1.3.1/inst/units.m0000644000000000000000000001545514650254633013624 0ustar00## Copyright (C) 2005 Carl Osterwisch ## Copyright (C) 2013-2019 Carnë Draug ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function File} {} units (@var{fromUnit}, @var{toUnit}) ## @deftypefnx {Function File} {} units (@var{fromUnit}, @var{toUnit}, @var{x}) ## Return the conversion factor from @var{fromUnit} to @var{toUnit} measurements. ## ## This is an octave interface to the @strong{GNU Units} program which comes ## with an annotated, extendable database defining over two thousand ## measurement units. See @code{man units} or ## @url{http://www.gnu.org/software/units} for more information. ## If the optional argument @var{x} is supplied, return that argument ## multiplied by the conversion factor. For example, to ## convert three values from miles per hour into meters per second: ## ## @example ## units ("mile/hr", "m/sec", [30, 55, 75]) ## ans = ## ## 13.411 24.587 33.528 ## @end example ## @end deftypefn function y = units (fromUnit, toUnit, x = 1) if (nargin < 2 || nargin > 3) print_usage (); elseif (! ischar (fromUnit)) error ("units: FromUNIT must be a string"); elseif (! ischar (toUnit)) error ("units: ToUNIT must be a string"); elseif (! isnumeric (x)) error ("units: X must be numeric"); endif persistent cmd = check_units (); persistent compact = has_compact_option (cmd); persistent template = template_cmd (cmd, compact); ## We have to insert the template on the string this way, because it may have ## a %%.16g which we may want to keep for later use in non-linear conversion cmd = sprintf ([template ' "%s" "%s"'], fromUnit, toUnit); [status, rawoutput] = system (cmd); if (status) error ("units: %s", rawoutput); endif if (! compact) ## No compact or one-line option, we need to find the conversion factor ## from the text ourselves ini_factor = index (rawoutput, "*"); end_factor = index (rawoutput, "\n") - 1; if (isempty (ini_factor) || ini_factor > end_factor) error ("units: unable to parse output from units:\n%s", rawoutput); endif rawoutput = rawoutput(ini_factor+1:end_factor); endif c_factor = str2double (rawoutput); if (any (isnan (c_factor(:)))) if (index (rawoutput, "=") || index (rawoutput, "+") || index (rawoutput, "-") || index (rawoutput, "*") || index (rawoutput, "/")) ## If there's a mathematical operator in the output, it may be a formula ## for a non-linear conversion such as "tempC(x) = x K + stdtemp" ## We don't check for the equal only because some versions of units data ## file (not version of the units application, see bug #38270) have a ## very different syntax. if (nargin < 3) ## for a non-linear unit conversion, we need a value to convert error ("units: argument X is required for non-linear unit conversion"); endif y = zeros (size (x)); template_non_linear = function_template (template, fromUnit, toUnit); for ind = 1:numel(y) cmd = sprintf (template_non_linear, x(ind)); [status, rawoutput] = system (cmd); if (status) error ("units: %s", rawoutput); endif y(ind) = str2double (rawoutput); if (isnan (y(ind))) error ("units unable to parse non-linear conversion `%s'", rawoutput); endif endfor else error ("units: unable to parse output `%s' from units.", rawoutput); endif else y = x * c_factor; endif endfunction function name = check_units () ## See bug #38270 about why we're checking this way. ## Also try use gunits over units name = "gunits"; fpath = file_in_path (getenv ("PATH"), sprintf ("gunits%s", get_exeext())); if (isempty (fpath)) name = "units"; fpath = file_in_path (getenv ("PATH"), sprintf ("units%s", get_exeext())); endif if (isempty (fpath)) name = ""; error ("units: %s\nVerify that GNU units is installed in the current path.", rawoutput); endif endfunction function compact = has_compact_option (cmd) compact = true; ## We must give some units to convert because the only thing that would ## make it not do any work (--version) actually exits with exit value 3 # is_dos = (ispc() && !isunix()); if is_dos redirect = '2> NUL'; else redirect = '2> /dev/null'; endif [status, rawoutput] = system ([cmd ' --compact --one-line "in" "cm" ' redirect]); if (status) compact = false; endif endfunction function template = template_cmd (cmd, compact) ## do we have the format option? format = true; is_dos = (ispc() && !isunix()); if is_dos redirect = '2> NUL'; else redirect = '2> /dev/null'; endif [status, rawoutput] = system ([cmd ' --output-format "%.16g" "in" "cm" ' redirect]); if (status) format = false; endif template = [cmd " "]; if (format) template = [template '--output-format "%%.16g" ']; endif if (compact) template = [template '--compact --one-line ']; endif template = [template ' ' redirect ' ']; endfunction ## Test the correct way to do non-linear conversion. function template = function_template (template, from, to) ## First try the most common syntax distributed with the most recent ## units.dat file using parentheses "from(x)" as if it was a function. if (! system (sprintf ([template '"%s(1)" "%s"'], from, to), true)) template = sprintf ('%s "%s(%%.16g)" "%s"', template, from, to); ## If it doesn't work, try the oldest syntax of the style "x from" elseif (! system (sprintf ([template '"100 %s" "%s"'], from, to), true)) template = sprintf ('%s "%%.16g %s" "%s"', template, from, to); ## If it doesn't work, give up else error ("units: unable to identify correct syntax for non-linear conversion"); endif endfunction %!demo %! a.value = 100; a.unit = 'lb'; %! b.value = 50; b.unit = 'oz'; %! c.unit = 'kg'; %! c.value = units(a.unit, c.unit, a.value) + units(b.unit, c.unit, b.value) # test normal usage %!assert (units ("in", "mm"), 25.4) # multiple values %!assert (units ("in", "mm", [5 7; 8 9]), 25.4 * [5 7; 8 9]) # a non-linear conversion %!assert (units ("tempC", "tempF", 100), 212) %!error units ("tempC", "tempF") miscellaneous-1.3.1/inst/z_curve.m0000644000000000000000000000514514650254633014132 0ustar00## Copyright (C) 2009 Javier Enciso ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function file} {@var{x}, @var{y}} z_curve (@var{n}) ## Creates an iteration of the Z-order space-filling curve with @var{n} points. ## The argument @var{n} must be of the form @code{2^M}, where @var{m} is an ## integer greater than 0. ## ## @example ## n = 8 ## [x ,y] = z_curve (n); ## line (x, y, "linewidth", 4, "color", "blue"); ## @end example ## ## @end deftypefn function [x, y] = z_curve (n) if (nargin != 1) print_usage (); endif check_power_of_two (n); if (n == 2) x = [0, 1, 0, 1]; y = [0, 0, -1, -1]; else [x1, y1] = z_curve (n/2); x2 = n/2 + x1; y2 = y1 - n/2; x = [x1, x2, x1, x2]; y = [y1, y1, y2, y2]; endif endfunction function check_power_of_two (n) if (frac_part (log (n) / log (2)) != 0) error ("z_curve: input argument must be a power of 2.") endif endfunction function d = frac_part (f) d = f - floor (f); endfunction %!test %! n = 2; %! expect = [0, 1, 0, 1; 0, 0, -1, -1]; %! [get(1,:), get(2,:)] = z_curve (n); %! if (any(size (expect) != size (get))) %! error ("wrong size: expected %d,%d but got %d,%d", size (expect), size (get)); %! elseif (any (any (expect!=get))) %! error ("didn't get what was expected."); %! endif %!test %! n = 5; %!error z_curve (n); %!demo %! clf %! n = 4; %! [x, y] = z_curve (n); %! line (x, y, "linewidth", 4, "color", "blue"); %! % ----------------------------------------------------------------------- %! % the figure window shows an iteration of the Z-order space-fillig curve %! % with 4 points on each axis. %!demo %! clf %! n = 32; %! [x, y] = z_curve (n); %! line (x, y, "linewidth", 2, "color", "blue"); %! % ---------------------------------------------------------------------- %! % the figure window shows an iteration of the Z-order space-fillig curve %! % with 32 points on each axis. miscellaneous-1.3.1/inst/zagzig.m0000644000000000000000000000502614650254633013746 0ustar00## Copyright (C) 2006 Fredrik Bulow ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function File} {} zagzig (@var{mtrx}) ## Returns zagzig walk-off of the elements of @var{mtrx}. ## Essentially it walks the matrix in a Z-fashion. ## ## mat = ## 1 4 7 ## 2 5 8 ## 3 6 9 ## then zagzag(mat) gives the output, ## [1 4 2 3 5 7 8 6 9], by walking as ## shown in the figure from pt 1 in that order of output. ## The argument @var{mtrx} should be a MxN matrix. One use of ## zagzig the use with picking up DCT coefficients ## like in the JPEG algorithm for compression. ## ## An example of zagzig use: ## @example ## @group ## mat = reshape(1:9,3,3); ## zagzag(mat) ## ans =[1 4 2 3 5 7 8 6 9] ## ## @end group ## @end example ## ## @end deftypefn ## @seealso{zigzag} function rval = zagzig(mtrx) if nargin != 1 #Checking arguments. print_usage; endif if issquare(mtrx) #Square matrix (quick case) n=length(mtrx); ##We create a matrix of the same size as mtrx where odd elements are ##1, others 0. odd=kron(ones(n,n),eye(2))((1:n),(1:n)); ##We transpose even elements only. mtrx = (mtrx.*odd)' + (mtrx.*(1-odd)); ##Now we mirror the matrix. The desired vector is now the ##concatenation of the diagonals. mtrx=mtrx(:,1+size(mtrx,2)-(1:size(mtrx,2))); ##Picking out the diagonals. rval = []; for i = n-1:-1:1-n rval=[rval diag(mtrx,i)']; endfor else #Not square (Slow cases) n=size(mtrx); mtrx=mtrx(:,1+size(mtrx,2)-(1:size(mtrx,2))); ##Picking out the diagonals and reversing odd ones manually. rval = []; for i = n(2)-1:-1:1-n(1) new = diag(mtrx,i); if floor(i/2)==i/2 ##Even? rval=[rval new((1+length(new))-(1:length(new)))']; else ##Odd! rval=[rval new']; endif endfor endif endfunction %!assert(zagzig(reshape(1:9,3,3)),[1 4 2 3 5 7 8 6 9]) miscellaneous-1.3.1/inst/zigzag.m0000644000000000000000000000470214650254633013746 0ustar00## Copyright (C) 2006 Fredrik Bulow ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## This program is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ## details. ## ## You should have received a copy of the GNU General Public License along with ## this program; if not, see . ## -*- texinfo -*- ## @deftypefn {Function File} {} zigzag (@var{mtrx}) ## Returns zigzag walk-off of the elements of @var{mtrx}. ## Essentially it walks the matrix in a Z-fashion. ## ## mat = ## 1 4 7 ## 2 5 8 ## 3 6 9 ## then zigzag(mat) gives the output, ## [1 2 4 7 5 3 6 8 9], by walking as ## shown in the figure from pt 1 in that order of output. ## The argument @var{mtrx} should be a MxN matrix ## ## An example of zagzig use: ## @example ## @group ## mat = reshape(1:9,3,3); ## zigzag(mat) ## ans =[1 2 4 7 5 3 6 8 9] ## ## @end group ## @end example ## ## @end deftypefn ## @seealso{zagzig} function rval = zigzag(mtrx) if nargin != 1 print_usage; endif n=size(mtrx); if(issquare(mtrx)) #Square matrix (quick case) ##We create a matrix of the same size as mtrx where odd elements are ##1, others 0. odd=kron(ones(ceil(n/2)),eye(2))((1:n(1)),(1:n(2))); ##We transpose even elements only. mtrx = mtrx.*odd + (mtrx.*(1-odd))'; ##Now we mirror the matrix. The desired vector is now the ##concatenation of the diagonals. mtrx=mtrx(:,1+size(mtrx,2)-(1:size(mtrx,2))); ##Picking out the diagonals. rval = []; for i = n(2)-1:-1:1-n(1) rval=[rval diag(mtrx,i)']; endfor else #Not square (Slow cases) mtrx=mtrx(:,1+size(mtrx,2)-(1:size(mtrx,2))); ##Picking out the diagonals and reversing odd ones manually. rval = []; for i = n(2)-1:-1:1-n(1) new = diag(mtrx,i); if(floor(i/2)==i/2) ##Even? rval=[rval new']; else ##Odd! rval=[rval new((1+length(new))-(1:length(new)))']; endif endfor endif endfunction %!assert(zigzag(reshape(1:9,3,3)),[1 2 4 7 5 3 6 8 9]) miscellaneous-1.3.1/src/0000755000000000000000000000000014650254633012104 5ustar00miscellaneous-1.3.1/src/Makefile.in0000644000000000000000000000255514650254633014160 0ustar00MKOCTFILE ?= mkoctfile -Wall OCTAVE_CONFIG ?= @OCTAVE_CONFIG@ GREP ?= @GREP@ PROGS = $(patsubst %.cc,%.oct,$(wildcard *.cc)) ARCHDIR := "$(shell $(OCTAVE_CONFIG) -p CANONICAL_HOST_TYPE)-$(shell $(OCTAVE_CONFIG) -p API_VERSION)" CC_SOURCES := $(wildcard *.cc) CC_TST_SOURCES := $(shell $(GREP) --files-with-matches '^%!' $(CC_SOURCES)) TST_SOURCES := $(patsubst %.cc,../inst/$(ARCHDIR)/%.cc-tst,$(CC_TST_SOURCES)) all: $(PROGS) archtests ../inst/private/get_exeext.m %.oct: %.cc $(MKOCTFILE) $< .PHONY: archtests archtests: $(TST_SOURCES) ../inst/$(ARCHDIR): @mkdir -p "$@" ../inst/private: @mkdir -p "$@" ../inst/$(ARCHDIR)/%.cc-tst: %.cc | ../inst/$(ARCHDIR) @echo "Extracting tests from $< ..." @$(RM) -f "$@" "$@-t" @( echo "## Generated from $<"; \ $(GREP) '^%!' "$<") > "$@" ../inst/private/get_exeext.m: Makefile | ../inst/private @echo "Generating $@" @(echo '#auto generated private file'; \ echo 'function ext = get_exeext()'; \ echo ' ext = "@EXEEXT@";'; \ echo 'endfunction' ) > "$@" clean: $(RM) -f *.o octave-core core *.oct *~ ../inst/private/get_exeext.m test -e ../inst/private && rmdir ../inst/private || true test -e ../inst/$(ARCHDIR) && rm -f $(TST_SOURCES) || true test -e ../inst/$(ARCHDIR) && rmdir ../inst/$(ARCHDIR) || true distclean: clean $(RM) -f config.h Makefile config.log config.status oct-alt-includes.h miscellaneous-1.3.1/src/aclocal.m40000644000000000000000000000127314650254633013747 0ustar00# generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_include([m4/octave-forge.m4]) miscellaneous-1.3.1/src/bootstrap0000755000000000000000000000036214650254633014050 0ustar00#!/bin/bash ## Octave-Forge: miscellaneous package bootstrap script ## Run this to generate the configure script set -e # halt if unhandled error aclocal -I m4 autoconf # generate configure script autoheader -f rm -rf autom4te.cache miscellaneous-1.3.1/src/cell2cell.cc0000644000000000000000000000657014650254633014264 0ustar00// Copyright (C) 2010-2019 Olaf Till // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see . #include #include "./config.h" DEFUN_DLD (cell2cell, args, , "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} cell2cell (@var{c}, @var{dim})\n\ Return a one-dimensional cell array, extending along dimension @var{dim},\n\ which contains the slices of cell array @var{c} vertical to dimension\n\ @var{dim}.\n\ @end deftypefn") { std::string fname ("cell2cell"); if (args.length () != 2) { print_usage (); return octave_value_list (); } if (!args(0).OV_ISCELL()) { error ("%s: first argument must be a cell array", fname.c_str ()); return octave_value_list (); } if (!args(1).OV_ISNUMERIC()) { error ("%s: second argument must be an integer", fname.c_str ()); return octave_value_list (); } Cell c = args(0).cell_value (); octave_idx_type dim = args(1).int_value (); if (dim < 1) { error ("%s: second argument must be a positive integer", fname.c_str ()); return octave_value_list (); } octave_idx_type i, j; dim_vector cdims (c.dims ()); octave_idx_type n_cdims = cdims.length (); dim_vector rdims, tdims (cdims); octave_idx_type nr = 1; if (n_cdims >= dim && cdims(dim - 1) > 1) { if (dim == 1) { rdims.resize (2); rdims(1) = 1; } else rdims.resize (dim); for (i = 0; i < dim - 1; i++) rdims(i) = 1; rdims(dim - 1) = (nr = cdims(dim - 1)); tdims(dim - 1) = 1; tdims.chop_trailing_singletons (); } else { rdims.resize (2); rdims(0) = 1; rdims(1) = 1; } Cell retval (rdims); octave_idx_type nt = tdims.numel (); octave_idx_type base = 0, origin, cursor; octave_idx_type skip_count = 1; // when to skip octave_idx_type min_tp = n_cdims < dim - 1 ? n_cdims : dim - 1; for (i = 0; i < min_tp; i++) skip_count *= cdims(i); octave_idx_type skip = skip_count; // how much to skip if (n_cdims >= dim) skip *= cdims(dim - 1); for (i = 0; i < nr; i++) { Cell t (tdims); origin = base; cursor = 0; for (j = 0; j < nt; j++) { t(j) = c(origin + cursor++); if (cursor == skip_count) { cursor = 0; origin += skip; } } retval(i) = t; base += skip_count; } return octave_value (retval); } #if 0 %!test %! c = { 0, 1, 2, 3 }; %! assert (cell2cell (c, 1), { c }); %! assert (cell2cell (c, 2), { {0}, {1}, {2}, {3} }); %!fail ("cell2cell()", "cell2cell"); %!fail ("cell2cell({1})", "cell2cell"); %!fail ("cell2cell([], 1)", "cell2cell"); %!fail ("cell2cell([], 0)", "cell2cell"); #endif miscellaneous-1.3.1/src/config.h.in0000644000000000000000000000333214650254633014130 0ustar00/* config.h.in. Generated from configure.ac by autoheader. */ #include "undef-ah-octave.h" /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* macro for alternative Octave symbols */ #undef OCTAVE__RAND_UNIFORM /* macro for alternative Octave symbols */ #undef OV_ISCELL /* macro for alternative Octave symbols */ #undef OV_ISNUMERIC /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS #include "oct-alt-includes.h" miscellaneous-1.3.1/src/configure0000755000000000000000000046464514650254633014036 0ustar00#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for Octave-Forge miscellaneous package 1.3.1. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="as_nop=: if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Octave-Forge miscellaneous package' PACKAGE_TARNAME='octave-forge-miscellaneous-package' PACKAGE_VERSION='1.3.1' PACKAGE_STRING='Octave-Forge miscellaneous package 1.3.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='LTLIBOBJS LIBOBJS OCTAVE_CONFIG MKOCTFILE UNITS_AVAILABLE ac_ct_CXX CXXFLAGS CXX OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC SED GREP target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures Octave-Forge miscellaneous package 1.3.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/octave-forge-miscellaneous-package] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of Octave-Forge miscellaneous package 1.3.1:";; esac cat <<\_ACEOF Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF Octave-Forge miscellaneous package configure 1.3.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Octave-Forge miscellaneous package $as_me 1.3.1, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' // Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' // Does the compiler advertise C11 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Test code for whether the C++ compiler supports C++98 (global declarations) ac_cxx_conftest_cxx98_globals=' // Does the compiler advertise C++98 conformance? #if !defined __cplusplus || __cplusplus < 199711L # error "Compiler does not advertise C++98 conformance" #endif // These inclusions are to reject old compilers that // lack the unsuffixed header files. #include #include // and are *not* freestanding headers in C++98. extern void assert (int); namespace std { extern int strcmp (const char *, const char *); } // Namespaces, exceptions, and templates were all added after "C++ 2.0". using std::exception; using std::strcmp; namespace { void test_exception_syntax() { try { throw "test"; } catch (const char *s) { // Extra parentheses suppress a warning when building autoconf itself, // due to lint rules shared with more typical C programs. assert (!(strcmp) (s, "test")); } } template struct test_template { T const val; explicit test_template(T t) : val(t) {} template T add(U u) { return static_cast(u) + val; } }; } // anonymous namespace ' # Test code for whether the C++ compiler supports C++98 (body of main) ac_cxx_conftest_cxx98_main=' assert (argc); assert (! argv[0]); { test_exception_syntax (); test_template tt (2.0); assert (tt.add (4) == 6.0); assert (true && !false); } ' # Test code for whether the C++ compiler supports C++11 (global declarations) ac_cxx_conftest_cxx11_globals=' // Does the compiler advertise C++ 2011 conformance? #if !defined __cplusplus || __cplusplus < 201103L # error "Compiler does not advertise C++11 conformance" #endif namespace cxx11test { constexpr int get_val() { return 20; } struct testinit { int i; double d; }; class delegate { public: delegate(int n) : n(n) {} delegate(): delegate(2354) {} virtual int getval() { return this->n; }; protected: int n; }; class overridden : public delegate { public: overridden(int n): delegate(n) {} virtual int getval() override final { return this->n * 2; } }; class nocopy { public: nocopy(int i): i(i) {} nocopy() = default; nocopy(const nocopy&) = delete; nocopy & operator=(const nocopy&) = delete; private: int i; }; // for testing lambda expressions template Ret eval(Fn f, Ret v) { return f(v); } // for testing variadic templates and trailing return types template auto sum(V first) -> V { return first; } template auto sum(V first, Args... rest) -> V { return first + sum(rest...); } } ' # Test code for whether the C++ compiler supports C++11 (body of main) ac_cxx_conftest_cxx11_main=' { // Test auto and decltype auto a1 = 6538; auto a2 = 48573953.4; auto a3 = "String literal"; int total = 0; for (auto i = a3; *i; ++i) { total += *i; } decltype(a2) a4 = 34895.034; } { // Test constexpr short sa[cxx11test::get_val()] = { 0 }; } { // Test initializer lists cxx11test::testinit il = { 4323, 435234.23544 }; } { // Test range-based for int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; for (auto &x : array) { x += 23; } } { // Test lambda expressions using cxx11test::eval; assert (eval ([](int x) { return x*2; }, 21) == 42); double d = 2.0; assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); assert (d == 5.0); assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); assert (d == 5.0); } { // Test use of variadic templates using cxx11test::sum; auto a = sum(1); auto b = sum(1, 2); auto c = sum(1.0, 2.0, 3.0); } { // Test constructor delegation cxx11test::delegate d1; cxx11test::delegate d2(); cxx11test::delegate d3(45); } { // Test override and final cxx11test::overridden o1(55464); } { // Test nullptr char *c = nullptr; } { // Test template brackets test_template<::test_template> v(test_template(12)); } { // Unicode literals char const *utf8 = u8"UTF-8 string \u2500"; char16_t const *utf16 = u"UTF-8 string \u2500"; char32_t const *utf32 = U"UTF-32 string \u2500"; } ' # Test code for whether the C compiler supports C++11 (complete). ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} ${ac_cxx_conftest_cxx11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} ${ac_cxx_conftest_cxx11_main} return ok; } " # Test code for whether the C compiler supports C++98 (complete). ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} return ok; } " # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" # Avoid warnings for redefining AH-generated preprocessor symbols of # Octave. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed ## these are C headers required for text_waitbar ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "term.h" "ac_cv_header_term_h" "$ac_includes_default" if test "x$ac_cv_header_term_h" = xyes then : else $as_nop ac_fn_c_check_header_compile "$LINENO" "termcap.h" "ac_cv_header_termcap_h" "$ac_includes_default" if test "x$ac_cv_header_termcap_h" = xyes then : else $as_nop ac_fn_c_check_header_compile "$LINENO" "ncurses/termcap.h" "ac_cv_header_ncurses_termcap_h" "$ac_includes_default" if test "x$ac_cv_header_ncurses_termcap_h" = xyes then : else $as_nop as_fn_error $? "Unable to find ncurses library headers." "$LINENO" 5 fi fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CXX+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 printf "%s\n" "$CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CXX+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 printf "%s\n" "$ac_ct_CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 printf %s "checking whether the compiler supports GNU C++... " >&6; } if test ${ac_cv_cxx_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 printf %s "checking whether $CXX accepts -g... " >&6; } if test ${ac_cv_prog_cxx_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes else $as_nop CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : else $as_nop ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_prog_cxx_stdcxx=no if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } if test ${ac_cv_prog_cxx_cxx11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cxx_cxx11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx11_program _ACEOF for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX fi if test "x$ac_cv_prog_cxx_cxx11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cxx_cxx11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx11" fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 ac_prog_cxx_stdcxx=cxx11 fi fi if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } if test ${ac_cv_prog_cxx_cxx98+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cxx_cxx98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx98_program _ACEOF for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx98=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx98" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX fi if test "x$ac_cv_prog_cxx_cxx98" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cxx_cxx98" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx98" fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 ac_prog_cxx_stdcxx=cxx98 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ## this is required for the units.m function # Extract the first word of "units", so it can be a program name with args. set dummy units; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_UNITS_AVAILABLE+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$UNITS_AVAILABLE"; then ac_cv_prog_UNITS_AVAILABLE="$UNITS_AVAILABLE" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_UNITS_AVAILABLE="yes" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi UNITS_AVAILABLE=$ac_cv_prog_UNITS_AVAILABLE if test -n "$UNITS_AVAILABLE"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $UNITS_AVAILABLE" >&5 printf "%s\n" "$UNITS_AVAILABLE" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x"$UNITS_AVAILABLE" != x"yes" ; then as_fn_error $? "The program GNU Units is required to install $PACKAGE_NAME." "$LINENO" 5 fi # Extract the first word of "mkoctfile", so it can be a program name with args. set dummy mkoctfile; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MKOCTFILE+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$MKOCTFILE"; then ac_cv_prog_MKOCTFILE="$MKOCTFILE" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MKOCTFILE="mkoctfile" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MKOCTFILE=$ac_cv_prog_MKOCTFILE if test -n "$MKOCTFILE"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKOCTFILE" >&5 printf "%s\n" "$MKOCTFILE" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$MKOCTFILE" && as_fn_error $? "no mkoctfile found on path" "$LINENO" 5 # Extract the first word of "octave-config", so it can be a program name with args. set dummy octave-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCTAVE_CONFIG+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OCTAVE_CONFIG"; then ac_cv_prog_OCTAVE_CONFIG="$OCTAVE_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCTAVE_CONFIG="octave-config" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OCTAVE_CONFIG=$ac_cv_prog_OCTAVE_CONFIG if test -n "$OCTAVE_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCTAVE_CONFIG" >&5 printf "%s\n" "$OCTAVE_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "OCTAVE_CONFIG" && OCTAVE_CONFIG=$MKOCTFILE # try get around possible spaces in the path if test "X${IGNORE_MINGW_PATH_MODIFICATION}" == "X"; then MSYSTEM="${MSYSTEM}" else MSYSTEM="none" fi if test "X${IGNORE_MINGW_PATH_MODIFICATION}" == "X"; then case X$MSYSTEM in XMINGW*) # try demangle spaces in escaped input strings MKOCTFILE=`echo $MKOCTFILE | $SED "s,\\\\\ ,?,g"` OCTAVE_CONFIG=`echo $OCTAVE_CONFIG | $SED "s,\\\\\ ,?,g"` ;; *) ;; esac fi # check for some octave functionality save_altsyms_CXX="$CXX" save_altsyms_CXXFLAGS="$CXXFLAGS" save_altsyms_LDFLAGS="$LDFLAGS" save_altsyms_LIBS="$LIBS" OCTINCLUDEDIR="${OCTINCLUDEDIR:-`$MKOCTFILE -p OCTINCLUDEDIR`}/.." OCTLIBDIR=${OCTLIBDIR:-`$MKOCTFILE -p OCTLIBDIR`} case X$MSYSTEM in XMINGW64*) OCTAVE_HOME=`${MKOCTFILE} -p OCTAVE_HOME | $SED 's,\\\\,/,g'` # change \ to / and replace octave home part with mingw part OCTINCLUDEDIR=`echo $OCTINCLUDEDIR | $SED -e 's,\\\\,/,g' -e "s,${OCTAVE_HOME},/mingw64,g"` OCTLIBDIR=`echo $OCTLIBDIR | $SED -e 's,\\\\,/,g' -e "s,${OCTAVE_HOME},/mingw64,g"` ;; XMINGW32*) OCTAVE_HOME=`${MKOCTFILE} -p OCTAVE_HOME | $SED 's,\\\\,/,g'` # change \ to / and replace octave home part with mingw part OCTINCLUDEDIR=`echo $OCTINCLUDEDIR | $SED -e 's,\\\\,/,g' -e "s,${OCTAVE_HOME},/mingw32,g"` OCTLIBDIR=`echo $OCTLIBDIR | $SED -e 's,\\\\,/,g -e "s,${OCTAVE_HOME},/mingw32,g"'` ;; *) ;; esac CXX=`${MKOCTFILE} -p CXX` CXXFLAGS="-I$OCTINCLUDEDIR $CXXFLAGS" LDFLAGS="-L$OCTLIBDIR $LDFLAGS" LIBS="-loctinterp $LIBS" echo '/* generated by configure */' > oct-alt-includes.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking oct_randu or octave::rand_uniform" >&5 printf %s "checking oct_randu or octave::rand_uniform... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { octave::rand_uniform (); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : printf "%s\n" "#define OCTAVE__RAND_UNIFORM octave::rand_uniform" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: octave::rand_uniform" >&5 printf "%s\n" "octave::rand_uniform" >&6; } echo '#include ' >> oct-alt-includes.h else $as_nop printf "%s\n" "#define OCTAVE__RAND_UNIFORM oct_randu" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: oct_randu" >&5 printf "%s\n" " oct_randu" >&6; } echo '#include ' >> oct-alt-includes.h fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking is_cell or iscell" >&5 printf %s "checking is_cell or iscell... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { octave_value ().iscell (); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : printf "%s\n" "#define OV_ISCELL iscell" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: iscell" >&5 printf "%s\n" "iscell" >&6; } echo ' ' >> oct-alt-includes.h else $as_nop printf "%s\n" "#define OV_ISCELL is_cell" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: is_cell" >&5 printf "%s\n" " is_cell" >&6; } echo '' >> oct-alt-includes.h fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking is_numeric_type or isnumeric" >&5 printf %s "checking is_numeric_type or isnumeric... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { octave_value ().isnumeric (); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : printf "%s\n" "#define OV_ISNUMERIC isnumeric" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: isnumeric" >&5 printf "%s\n" "isnumeric" >&6; } echo ' ' >> oct-alt-includes.h else $as_nop printf "%s\n" "#define OV_ISNUMERIC is_numeric_type" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: is_numeric_type" >&5 printf "%s\n" " is_numeric_type" >&6; } echo '' >> oct-alt-includes.h fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXX=$save_altsyms_CXX CXXFLAGS=$save_altsyms_CXXFLAGS LDFLAGS=$save_altsyms_LDFLAGS LIBS=$save_altsyms_LIBS ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by Octave-Forge miscellaneous package $as_me 1.3.1, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to the package provider." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ Octave-Forge miscellaneous package config.status 1.3.1 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi miscellaneous-1.3.1/src/configure.ac0000644000000000000000000000615114650254633014375 0ustar00AC_PREREQ([2.67]) AC_INIT([Octave-Forge miscellaneous package],[1.3.1]) AC_CONFIG_HEADERS([config.h]) # Avoid warnings for redefining AH-generated preprocessor symbols of # Octave. AH_TOP([#include "undef-ah-octave.h"]) AC_CONFIG_MACRO_DIRS([m4]) AC_PROG_GREP AC_PROG_SED ## these are C headers required for text_waitbar AC_CHECK_HEADER([term.h], [], [AC_CHECK_HEADER([termcap.h], [], [AC_CHECK_HEADER([ncurses/termcap.h], [], [AC_MSG_ERROR([Unable to find ncurses library headers.])] ]) ]) ) AC_PROG_CXX AC_LANG(C++) ## this is required for the units.m function AC_CHECK_PROG(UNITS_AVAILABLE, units, yes) if test x"$UNITS_AVAILABLE" != x"yes" ; then AC_MSG_ERROR([The program GNU Units is required to install $PACKAGE_NAME.]) fi dnl Check for mkoctfile AC_CHECK_PROG(MKOCTFILE,mkoctfile,mkoctfile) test -z "$MKOCTFILE" && AC_MSG_ERROR([no mkoctfile found on path]) dnl Check for octave-config AC_CHECK_PROG(OCTAVE_CONFIG,octave-config,octave-config) test -z "OCTAVE_CONFIG" && OCTAVE_CONFIG=$MKOCTFILE # try get around possible spaces in the path if test "X${IGNORE_MINGW_PATH_MODIFICATION}" == "X"; then MSYSTEM="${MSYSTEM}" else MSYSTEM="none" fi if test "X${IGNORE_MINGW_PATH_MODIFICATION}" == "X"; then case X$MSYSTEM in XMINGW*) # try demangle spaces in escaped input strings MKOCTFILE=`echo $MKOCTFILE | $SED "s,\\\\\ ,?,g"` OCTAVE_CONFIG=`echo $OCTAVE_CONFIG | $SED "s,\\\\\ ,?,g"` ;; *) ;; esac fi # check for some octave functionality save_altsyms_CXX="$CXX" save_altsyms_CXXFLAGS="$CXXFLAGS" save_altsyms_LDFLAGS="$LDFLAGS" save_altsyms_LIBS="$LIBS" OCTINCLUDEDIR="${OCTINCLUDEDIR:-`$MKOCTFILE -p OCTINCLUDEDIR`}/.." OCTLIBDIR=${OCTLIBDIR:-`$MKOCTFILE -p OCTLIBDIR`} case X$MSYSTEM in XMINGW64*) OCTAVE_HOME=`${MKOCTFILE} -p OCTAVE_HOME | $SED 's,\\\\,/,g'` # change \ to / and replace octave home part with mingw part OCTINCLUDEDIR=`echo $OCTINCLUDEDIR | $SED -e 's,\\\\,/,g' -e "s,${OCTAVE_HOME},/mingw64,g"` OCTLIBDIR=`echo $OCTLIBDIR | $SED -e 's,\\\\,/,g' -e "s,${OCTAVE_HOME},/mingw64,g"` ;; XMINGW32*) OCTAVE_HOME=`${MKOCTFILE} -p OCTAVE_HOME | $SED 's,\\\\,/,g'` # change \ to / and replace octave home part with mingw part OCTINCLUDEDIR=`echo $OCTINCLUDEDIR | $SED -e 's,\\\\,/,g' -e "s,${OCTAVE_HOME},/mingw32,g"` OCTLIBDIR=`echo $OCTLIBDIR | $SED -e 's,\\\\,/,g -e "s,${OCTAVE_HOME},/mingw32,g"'` ;; *) ;; esac CXX=`${MKOCTFILE} -p CXX` CXXFLAGS="-I$OCTINCLUDEDIR $CXXFLAGS" LDFLAGS="-L$OCTLIBDIR $LDFLAGS" LIBS="-loctinterp $LIBS" OF_OCTAVE_LIST_ALT_SYMS([ [dnl [oct_randu], [octave::rand_uniform], [[octave::rand_uniform ();]], [OCTAVE__RAND_UNIFORM], [[#include ]], [[#include ]] ], [dnl [is_cell], [iscell], [[octave_value ().iscell ();]], [OV_ISCELL], [], [] ], [dnl [is_numeric_type], [isnumeric], [[octave_value ().isnumeric ();]], [OV_ISNUMERIC], [], [] ] ],[oct-alt-includes.h]) CXX=$save_altsyms_CXX CXXFLAGS=$save_altsyms_CXXFLAGS LDFLAGS=$save_altsyms_LDFLAGS LIBS=$save_altsyms_LIBS AC_CONFIG_FILES([Makefile]) AC_OUTPUT miscellaneous-1.3.1/src/m4/0000755000000000000000000000000014650254633012424 5ustar00miscellaneous-1.3.1/src/m4/octave-forge.m40000644000000000000000000000575314650254633015261 0ustar00# Copyright (C) 2017 Olaf Till # Modifications to print what is searching for by JohnD # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # arguments of OF_OCTAVE_ALT_SYMS (see also description of # OF_OCTAVE_LIST_ALT_SYMS below): # # $1: symbol version 1 # $2: symbol version 2 # $3: test for symbol version 2 # $4: macro name to access alternative symbols # $5: include directives for symbol version 1 # $6: include directives for symbol version 2 # (a list of lists of args 1--6 is $1 of OF_OCTAVE_LIST_ALT_SYMS) # $7: name of generated include file with alternatives of Octave headers # (arg7 is $2 of OF_OCTAVE_LIST_ALT_SYMS) AC_DEFUN([OF_OCTAVE_ALT_SYMS], [ AC_MSG_CHECKING([$1 or $2]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ] $6], [$3])], [AC_DEFINE($4, [[$2]], [macro for alternative Octave symbols]) AC_MSG_RESULT([$2]) echo '$6' >> $7], [AC_DEFINE($4, [[$1]], [macro for alternative Octave symbols]) AC_MSG_RESULT([$1]) echo '$5' >> $7] ) ]) # OF_OCTAVE_LIST_ALT_SYMS is called in the following way: # # OF_OCTAVE_LIST_ALT_SYMS([ # [dnl # [old_octave_symbol], # [new_octave_symbol], # [[compilation test] # [for new_octave_symbol]], # [NAME_OF_GENERATED_MACRO____WILL_EXPAND_TO_OLD_OR_NEW_SYMBOL], # [[include directives] # [except #include ] # [necessary to compile with old_octave_symbol]], # [[include directives] # [except #include ] # [nessary to compile with new_octave_symbol] # [and to compile the test]] # ], # # ... further such lists as the above # # ], # # [name-of-header-file-for-alternative-octave-iclude-directives.h]) # # # This file should be put into src/m4/, and the line # # AC_CONFIG_MACRO_DIRS([m4]) # # should be put into src/configure.ac. The package should use # autoheader to generate config.h.in (src/bootstrap should contain the # lines 'aclocal', 'autoconf', and 'autoheader -f'). Package code # should include config.h and use the generated macros to access the # alternative symbols of Octave. An example of a call to # OF_OCTAVE_LIST_ALT_SYMS in src/configure.ac is available together # with this file. AC_DEFUN([OF_OCTAVE_LIST_ALT_SYMS], [ echo '/* generated by configure */' > $2 m4_foreach([it], [$1], [m4_apply([OF_OCTAVE_ALT_SYMS], [it, $2])]) AH_BOTTOM([#include "$2"]) ]) miscellaneous-1.3.1/src/partint.cc0000644000000000000000000001307014650254633014075 0ustar00// Copyright (C) 2006-2019 Torsten Finke // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see . #include #include #include "./config.h" #include "partint.h" unsigned long * pcnt(unsigned long n) { unsigned long *s = new unsigned long[n]; unsigned long *x = new unsigned long[n*n]; unsigned long **p = new unsigned long*[n]; for (unsigned long k=0; k // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see . class int_partition // Integer partitions // Reference: // Joerg Arndt: Algorithms for programmers // (http://www.jjj.de), 2006. { private: unsigned long *c_; // partition: c[1]* 1 + c[2]* 2 + ... + c[n]* n == n unsigned long *s_; // cumulative sums: s[j+1] = c[1]* 1 + c[2]* 2 + ... + c[j]* j unsigned long n_; // partitions of n public: int_partition(unsigned long n) { n_ = n; c_ = new unsigned long[n+1]; s_ = new unsigned long[n+1]; s_[0] = 0; // unused c_[0] = 0; // unused first(); } ~int_partition() { delete [] c_; delete [] s_; } void first() { c_[1] = n_; for (unsigned long i=2; i<=n_; i++) { c_[i] = 0; } s_[1] = 0; for (unsigned long i=2; i<=n_; i++) { s_[i] = n_; } } const unsigned long *data() const { return c_; } // one-based! bool next() { // This algorithm was given by Torsten Finke if ( c_[n_]!=0 ) return false; // last == 1* n (c[n]==1) // Find first coefficient c[i], i>=2 that can be increased: unsigned long i = 2; while ( s_[i] 1 ) { s_[i] = z; c_[i] = 0; } c_[1] = z; // z* 1 == z // s_[1] unused return true; } }; miscellaneous-1.3.1/src/sample.cc0000644000000000000000000000773214650254633013705 0ustar00// Copyright (C) 2011-2019 Piotr Krzyzanowski // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see . #include #include #include "./config.h" /* IntSetBins2 class and its usage from 'Programming Pearls' by Jon Bentley, 2nd edition, available at http://netlib.bell-labs.com/cm/cs/pearls/sets.cpp. The notice on http://netlib.bell-labs.com/cm/cs/pearls/code.html says "You may use this code for any purpose, as long as you leave the copyright notice and book citation attached." */ /* IntSetBins2 class Copyright (C) 1999 Lucent Technologies */ /* From 'Programming Pearls', 2nd edition, by Jon Bentley */ /* sets.cpp -- exercise set implementations on random numbers */ #include class IntSetBins2 { private: unsigned int n, bins; double maxval; struct node { double val; node *next; }; node **bin, *sentinel, *freenode; node *rinsert(node *p, double t) { if (p->val < t) { p->next = rinsert(p->next, t); } else if (p->val > t) { freenode->val = t; freenode->next = p; p = freenode++; n++; } return p; } public: IntSetBins2(unsigned int maxelements, double pmaxval) { bins = maxelements; maxval = pmaxval; freenode = new node[maxelements]; bin = new node*[bins]; sentinel = new node; sentinel->val = maxval; for (unsigned int i = 0; i < bins; i++) bin[i] = sentinel; n = 0; } unsigned int size() { return n; } void insert1(double t) { unsigned int i = t / (1.0 + maxval/bins); bin[i] = rinsert(bin[i], t); } void insert(double t) { node **p; unsigned int i = t / (1.0 + maxval/bins); for (p = &bin[i]; (*p)->val < t; p = &((*p)->next)) ; if ((*p)->val == t) return; freenode->val = t; freenode->next = *p; *p = freenode++; n++; } void report(double *v) { unsigned int j = 0; for (unsigned int i = 0; i < bins; i++) for (node *p = bin[i]; p != sentinel; p = p->next) v[j++] = p->val; } }; DEFUN_DLD (sample, args, , "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{s}} = sample (@var{m}, @var{n})\n\ Return @var{m} unique random integer values from 0..@var{n}-1,\n\ sorted in ascending order.\n\ \n\ Based on a code from Jon Bentley's \"Programming Pearls\", \n\ see @url{http://netlib.bell-labs.com/cm/cs/pearls/}.\n\ @end deftypefn") { int nargin = args.length(); if (nargin < 2) { print_usage (); return octave_value (); } unsigned int m; double M = args(0).scalar_value(); // temporarily allow for // negative values of "m" double n = args(1).scalar_value(); // allow huge values of "n" if (M > n) M = n; if (M <= 0) M = 0; m = M; // set actual "m" only after making sure it is not negative RowVector s(m); /* as in the code from "Programming Pearls" */ IntSetBins2 S(m, n); while (S.size() < m) S.insert(floor(OCTAVE__RAND_UNIFORM()*n)); // use Octave's uniform RNG S.report(s.fortran_vec()); return octave_value (s); } /* %!assert (isempty(sample(0,10))); %!assert (isempty(sample(-2,10))); %!assert (sample(10,10),[0:9]); %!assert (sample(12,10),[0:9]); %!assert (length(sample(9,10)),9); %!shared a,m,n %! m = 1e4-5; %! n = 1e4; %! a = sample(m,n); %!assert (all(a=0)); %!assert (length(a),m); %! n = 1e300; %! a = sample(m,n); %!assert (all(a=0)); %!assert (length(a),m); %!demo %! s = sample(4,8) %! % s should contain an increasing sequence of 4 integers from the range 0..7 */ miscellaneous-1.3.1/src/text_waitbar.cc0000644000000000000000000001774114650254633015122 0ustar00// Copyright (C) 2002-2019 Quentin Spencer // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see . #include #include "./config.h" // Note the extern "C" is need for mingw with a version of termcap.h // without the extern "C" explicitly included. Doing it twice should be // harmless. extern "C" { #if defined (HAVE_TERM_H) # include #elif defined (HAVE_TERMCAP_H) # include #elif defined (HAVE_NCURSES_TERMCAP_H) # include #endif }; #define BUF_SIZE 256 #define MAX_LEN 240 #define DEFAULT_LEN 50 #define BAR_CHAR '#' #define SPACING 3 static bool no_terminal=false; DEFUN_DLD(text_waitbar, args, nargout, " -*- texinfo -*-\n\ @deftypefn {Loadable Function} {} text_waitbar (@var{frac})\n\ @deftypefnx {Loadable Function} {} text_waitbar (@var{frac}, @var{msg})\n\ @deftypefnx {Loadable Function} {} text_waitbar (0, @var{n})\n\ Display text-based waitbar/progress bar.\n\ \n\ This function is similar to the @code{waitbar} function but is a text, rather\n\ than graphical bar. The waitbar is filled to fraction @var{frac} which must\n\ be in the range [0, 1]. Values exactly equal to 0 or 1 clear the waitbar.\n\ \n\ The optional message @var{msg} sets the waitbar caption. If Octave is running\n\ in a smart terminal, the width is automatically detected, and @var{msg} is\n\ displayed in the waitbar (and truncated if it is too long). Otherwise,\n\ @var{msg} is not displayed and the width is initialized to a default of 50\n\ characters, or it can be set to @var{n} characters with\n\ @code{text_waitbar (0, @var{n})}. If no terminal is detected (such as when\n\ Octave is run in batch mode and output is redirected), no output is\n\ generated.\n\ \n\ Additional arguments are ignored for compatibility with the graphical\n\ counterpart of this function but there are no guarantees of perfect\n\ compatibility.\n\ \n\ @seealso{waitbar}\n\ @end deftypefn\n") { static char print_buf[BUF_SIZE]; static int n_chars_old; static int pct_int_old; static int length; #if defined(USE_TERM) static char term_buffer[1024]; static char *begin_rv, *end_rv; static int brvlen, ervlen, pct_pos; static bool smart_term; static bool newtitle = false; static charMatrix title; int j; #endif static char *term; static bool init; double pct; int i; octave_value_list retval; retval(0) = Matrix(0,0); int nargin = args.length(); if (nargin < 1) { print_usage (); return retval; } if(no_terminal) return retval; pct = args(0).double_value(); if(pct>1.0) pct = 1.0; // to prevent overflow #if defined(USE_TERM) if(nargin==2 && args(1).is_string()) { newtitle = true; title = args(1).string_value(); } if(nargin==3) { newtitle = true; title = args(2).string_value(); } #endif if(pct==0.0 || pct==1.0) { init = true; term = getenv("TERM"); if(!term) { no_terminal = true; return retval; } #if defined (USE_TERM) i = tgetnum("co"); smart_term = i ? true : false; if(nargin==1 || args(1).is_string()) length = smart_term ? i-1 : DEFAULT_LEN; #else if(nargin==1) length = DEFAULT_LEN; #endif else if(nargin==2 && !(args(1).is_string())) { length = args(1).int_value(); if(length>MAX_LEN) length = MAX_LEN; if(length<=0) length = DEFAULT_LEN; } #if defined (USE_TERM) pct_pos = length/2-2; if(smart_term) { // get terminal strings ("rv"="reverse video") char* buf_ptr = term_buffer; begin_rv = tgetstr("so", &buf_ptr); end_rv = tgetstr("se", &buf_ptr); // Display a progress bar, but only if the current terminal has a // standout mode if (begin_rv && end_rv) { brvlen = 0; buf_ptr = begin_rv; while(buf_ptr[++brvlen]); ervlen = 0; buf_ptr = end_rv; while(buf_ptr[++ervlen]); } // initialize print buffer for(i=0; i=n_chars_old+brvlen ? i+ervlen : i ] = ' '; for(i=SPACING+brvlen, j=0; j=n_chars_old ? i+ervlen : i ] = title(0,j); newtitle = false; } // Insert the percentage string for(i=pct_pos+brvlen, j=0; j<4; ++i, ++j) print_buf[ i>=n_chars_old+brvlen ? i+ervlen : i ] = pct_str[j]; // Move print_buf characters if(n_chars_old=n_chars+brvlen; --i) print_buf[i+ervlen] = print_buf[i]; // Insert end of reverse video for(i=n_chars+brvlen, j=0; j=n_chars_old) for(int i=n_chars_old+1; i<=n_chars; ++i) print_buf[i] = BAR_CHAR; else for(int i=n_chars+1; i<=n_chars_old; ++i) print_buf[i] = ' '; sprintf(&(print_buf[length+3])," %3i%%\r",pct_int); #if defined (USE_TERM) } #endif fputs(print_buf,stdout); fflush(stdout); n_chars_old = n_chars; pct_int_old = pct_int; } } return retval; } miscellaneous-1.3.1/src/undef-ah-octave.h0000644000000000000000000000070614650254633015226 0ustar00/* To be included at the top of config.h (by autoheader). Avoid warnings for redefining AH-generated preprocessor symbols of Octave. */ #ifdef PACKAGE_BUGREPORT #undef PACKAGE_BUGREPORT #endif #ifdef PACKAGE_NAME #undef PACKAGE_NAME #endif #ifdef PACKAGE_STRING #undef PACKAGE_STRING #endif #ifdef PACKAGE_TARNAME #undef PACKAGE_TARNAME #endif #ifdef PACKAGE_URL #undef PACKAGE_URL #endif #ifdef PACKAGE_VERSION #undef PACKAGE_VERSION #endif