miscellaneous-1.2.1/0002755000175000017500000000000012344005556013010 5ustar olafolafmiscellaneous-1.2.1/INDEX0000644000175000017500000000063712344005534013602 0ustar olafolafmiscellaneous >> Miscellaneous functions miscellaneous asci cell2cell chebyshevpoly clip colorboard csv2latex gameoflife hermitepoly hilbert_curve infoskeleton laguerrepoly legendrepoly match normc normr nze partcnt partint peano_curve physical_constant publish read_options reduce rolldices sample slurp_file solvesudoku text_waitbar textable truncate units zagzig z_curve zigzag miscellaneous-1.2.1/devel/0002755000175000017500000000000012344005534014103 5ustar olafolafmiscellaneous-1.2.1/devel/server.txt0000644000175000017500000000746412344005534016163 0ustar olafolafYou can talk to octave directly from other environments over the tcp/ip. The protocol is not sophisticated. Here is what you can send to octave: !!!x length command evaluate command in octave. length is a 32-bit network order integer. command is a string (without zero-terminator). !!!m length name send matrix back to client. length is a 32-bit network order integer. name is a string (without zero-terminator). I don't use the !!!m command to the server because it is the same as !!!x send('name', matrix expression) The latter is much more useful because you don't have to name the data that you are sending across. !!!n length namelen name command *** Not implemented *** Evaluate the command in the namespace. This needs a lookup table Map namespace and a command evalin(symbol_table,command) The function evalin pushes the given symbol table onto curr_sym_tab, evaluates the command then pops the symbol table. Here is what you will receive from octave: !!!m length rows columns namelength name data recieve matrix from server. length,rows,columns,namelength are 32-bit network order integers. name is a string (without zero-terminator). data is an array of rows*columns server order double values. This is sent in response to a !!!m matrix request or a send('name',matrix) command. The first thing I do when I open a connection is request a matrix containing 1.0. If the result is not 1.0, I know that I need to swap the data to convert from server order to client order doubles. !!!s length strlen namelen name str receive string from server. length, strlen, namelen are 32-bit network order integers. name is a string (without zero-terminator). str is a string (without zero-terminator). This is sent in response to a send('name',string) command. !!!x length str evaluate string in client. length is a 32-bit network order integer. str is a string (without zero-terminator). This is sent in response to a send('str'). The contents of str are completely arbitrary (and may indeed contain binary data). It is up to the client to decide how they want to interpret these strings. !!!e length error receive error from octave. length is a 32-bit network order integer. error is a string (without zero-terminator). This is sent in response to a !!!x command which produced an error. Composite values can be decomposed into their constituent parts. E.g., structures: for [v,k]=x, send([name,'.',k],v); end complex arrays: send([name,'.real'],real(x)); send([name,'.imag'],imag(x)); sparse arrays: [v,i,j] = spfind(x); send([name,'.i'],i); send([name,'.j'],j); send([name,'.v'],v); cell arrays: [nr,nc]=size(x); for r=1:nr, for c=1:nc, send([name,sprintf('.%d.%d',r,c)],x{r,c}); end Note that the communication is completely asynchronous. I have a tcl client that processes server responses via fileevent. That means that responses from octave are not processed until tcl enters its event loop. To be sure that octave has processed a command I follow that command with a synchronization sequence: set sync[incr syncid] 1 octave eval "send('unset sync$syncid')" vwait sync$syncid In practice it is more complicated than that because I allow the syncronization command to time out just in case octave crashed out from underneath me, but the idea is the same. Using sockets gives you platform independence and network transparency, which is a big win. The only caveat is that winsock is slow. The best I can do with dedicated winsock code on my machine is .3 seconds to transfer a 1 Mb message. Under tcl/tk, it was closer to 1 second IIRC. A memory copy of the same size took less than 0.06 seconds IIRC. That is why I'm working on a way to embed octave into tcl. Hopefully it will be easy to embed in other environments as well. Paul Kienzle 2003 miscellaneous-1.2.1/devel/README0000644000175000017500000000106512344005534014763 0ustar olafolafOn revision 10042 the files server.cc, listencanfork.c and stringmatch.c were removed from the src/ directory of the miscellaneous package since no one on the mailing list knew what to do with these files. The packages releases were also not properly configured to handle it's code and even Debian packages of miscellaneous do not include them. Looking at the code of server.cc, it seems to implement the functions server, listen and senderror. Some of these would conflict with the functions in the package sockets. Maybe this code should be merged with sockets. miscellaneous-1.2.1/devel/stringmatch.c0000644000175000017500000001506312344005534016575 0ustar olafolaf/* Extracted from tclUtil.c Copyright (c) 1987-1993 The Regents of the University of California. Copyright (c) 1994-1998 Sun Microsystems, Inc. Copyright (c) 2001 by Kevin B. Kenny. All rights reserved. This software is copyrighted by the Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState Corporation and other parties. The following terms apply to all files associated with the software unless explicitly disclaimed in individual files. The authors hereby grant permission to use, copy, modify, distribute, and license this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. No written agreement, license, or royalty fee is required for any of the authorized uses. Modifications to this software may be copyrighted by their authors and need not follow the licensing terms described here, provided that the new terms are clearly indicated on the first page of each file where they apply. IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. GOVERNMENT USE: If you are acquiring this software on behalf of the U.S. government, the Government shall have only "Restricted Rights" in the software and related documentation as defined in the Federal Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you are acquiring the software on behalf of the Department of Defense, the software shall be classified as "Commercial Computer Software" and the Government shall have only "Restricted Rights" as defined in Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the authors grant the U.S. Government and others acting in its behalf permission to use and distribute the software in accordance with the terms specified in this license. */ /* *---------------------------------------------------------------------- * * StringCaseMatch -- * * See if a particular string matches a particular pattern. * Allows case insensitivity. * * Results: * The return value is 1 if string matches pattern, and * 0 otherwise. The matching operation permits the following * special characters in the pattern: *?\[] (see the manual * entry for details on what these mean). * * Side effects: * None. * *---------------------------------------------------------------------- */ #include /* PAK: need tolower declaration */ #define CONST const #define UCHAR (unsigned char) /* Note: restore original code from the Tcl tree if you want unicode * support. */ int StringCaseMatch(string, pattern, nocase) CONST char *string; /* String. */ CONST char *pattern; /* Pattern, which may contain special * characters. */ int nocase; /* 0 for case sensitive, 1 for insensitive */ { int p /*, charLen*/; /* PAK: unused */ /* CONST char *pstart = pattern; */ /* PAK: unused */ char ch1, ch2; while (1) { p = *pattern; /* * See if we're at the end of both the pattern and the string. If * so, we succeeded. If we're at the end of the pattern but not at * the end of the string, we failed. */ if (p == '\0') { return (*string == '\0'); } if ((*string == '\0') && (p != '*')) { return 0; } /* * Check for a "*" as the next pattern character. It matches * any substring. We handle this by calling ourselves * recursively for each postfix of string, until either we * match or we reach the end of the string. */ if (p == '*') { /* * Skip all successive *'s in the pattern */ while (*(++pattern) == '*') {} p = *pattern; if (p == '\0') { return 1; } ch2 = (nocase ? tolower(UCHAR(*pattern)) : UCHAR(*pattern)); while (1) { /* * Optimization for matching - cruise through the string * quickly if the next char in the pattern isn't a special * character */ if ((p != '[') && (p != '?') && (p != '\\')) { if (nocase) { while (*string) { ch1 = *string; if (ch2==ch1 || ch2==tolower(ch1)) break; string++; } } else { while (*string) { ch1 = *string; if (ch2==ch1) break; string++; } } } if (StringCaseMatch(string, pattern, nocase)) { return 1; } if (*string == '\0') { return 0; } string++; } } /* * Check for a "?" as the next pattern character. It matches * any single character. */ if (p == '?') { pattern++; string++; continue; } /* * Check for a "[" as the next pattern character. It is followed * by a list of characters that are acceptable, or by a range * (two characters separated by "-"). */ if (p == '[') { char startChar, endChar; pattern++; ch1 = (nocase ? tolower(UCHAR(*string)) : UCHAR(*string)); string++; while (1) { if ((*pattern == ']') || (*pattern == '\0')) { return 0; } startChar = (nocase ? tolower(UCHAR(*pattern)) : UCHAR(*pattern)); pattern++; if (*pattern == '-') { pattern++; if (*pattern == '\0') { return 0; } endChar = (nocase ? tolower(UCHAR(*pattern)) : UCHAR(*pattern)); pattern++; if (((startChar <= ch1) && (ch1 <= endChar)) || ((endChar <= ch1) && (ch1 <= startChar))) { /* * Matches ranges of form [a-z] or [z-a]. */ break; } } else if (startChar == ch1) { break; } } while (*pattern != ']') { if (*pattern == '\0') { pattern--; break; } pattern++; } pattern++; continue; } /* * If the next pattern character is '\', just strip off the '\' * so we do exact matching on the character that follows. */ if (p == '\\') { pattern++; if (*pattern == '\0') { return 0; } } /* * There's no special character. Just make sure that the next * bytes of each string match. */ ch1 = *string++; ch2 = *pattern++; if (nocase) { if (tolower(ch1) != tolower(ch2)) { return 0; } } else if (ch1 != ch2) { return 0; } } } miscellaneous-1.2.1/devel/listencanfork.c0000644000175000017500000000041212344005534017104 0ustar olafolaf#if defined(__CYGWIN__) #include int listencanfork() { OSVERSIONINFO osvi; osvi.dwOSVersionInfoSize = sizeof(osvi); GetVersionEx (&osvi); return (osvi.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS); } #else int listencanfork() { return 1; } #endif miscellaneous-1.2.1/devel/server.cc0000644000175000017500000005477512344005534015740 0ustar olafolaf#define STATUS(x) do { if (debug) std::cout << x << std::endl << std::flush; } while (0) //#define HAVE_OCTAVE_30 #include #include #include #include #include //#include //#include #include // #include #include #if (defined(_WIN32)||defined(_WIN64)) && !defined(__CYGWIN__) # define USE_WINSOCK # define CAN_FORK false # include # include typedef int socklen_t; #else # define HAVE_FORK 1 # define USE_SIGNALS # if defined(__CYGWIN__) # define CAN_FORK listencanfork() # else # define USE_DAEMONIZE # define CAN_FORK true # endif # include # include # include # include # include # define closesocket close #endif #include #include #include #if 0 #include #endif #include #include #include #include static bool debug = false; static char* context = NULL; static double timestamp = 0.0; inline void tic(void) { timestamp = octave_time().double_value(); } inline double toc(void) {return ceil(-1e6*(timestamp-octave_time().double_value()));} // XXX FIXME XXX --- surely this is part of the standard library? void lowercase (std::string& s) { for (std::string::iterator i=s.begin(); i != s.end(); i++) *i = tolower(*i); } #if 0 octave_value get_builtin_value (const std::string& nm) { octave_value retval; symbol_record *sr = fbi_sym_tab->lookup (nm); if (sr) { octave_value sr_def = sr->def (); if (sr_def.is_undefined ()) error ("get_builtin_value: undefined symbol `%s'", nm.c_str ()); else retval = sr_def; } else error ("get_builtin_value: unknown symbol `$s'", nm.c_str ()); return retval; } #endif #ifdef USE_WINSOCK bool init_sockets() { WSADATA wsaData; WORD version; int error; version = MAKEWORD( 2, 0 ); error = WSAStartup( version, &wsaData ); /* check for error */ if ( error != 0 ) { /* error occured */ return false; } /* check for correct version */ if ( LOBYTE( wsaData.wVersion ) != 2 || HIBYTE( wsaData.wVersion ) != 0 ) { /* incorrect WinSock version */ WSACleanup(); return false; } return true; } inline void end_sockets() { WSACleanup(); } inline int socket_errno() { return WSAGetLastError(); } #else // !USE_WINSOCK # include inline bool init_sockets() { return true; } inline void end_sockets() { } inline int socket_errno() { return errno; } #endif // !USE_WINSOCK inline void socket_error(const char *context) { int err = socket_errno(); char errno_str[15]; snprintf(errno_str, sizeof(errno_str), " %d: ", err); std::string msg = std::string(context) + std::string(errno_str) + std::string (strerror(err)); error(msg.c_str()); } #ifdef USE_SIGNALS static void sigchld_handler(int /* sig */) { int status; /* Reap all childrens */ STATUS("reaping all children"); while (waitpid(-1, &status, WNOHANG) > 0) ; STATUS("done reaping children"); } /* Posix signal handling, based on the example from the * Unix Programming FAQ * Copyright (C) 2000 Andrew Gierth */ static void sigchld_setup(void) { struct sigaction act; /* Assign sig_chld as our SIGCHLD handler */ act.sa_handler = sigchld_handler; /* We don't want to block any other signals in this example */ sigemptyset(&act.sa_mask); /* * We're only interested in children that have terminated, not ones * which have been stopped (eg user pressing control-Z at terminal) */ act.sa_flags = SA_NOCLDSTOP; /* * Make these values effective. If we were writing a real * application, we would probably save the old value instead of * passing NULL. */ if (sigaction(SIGCHLD, &act, NULL) < 0) error("listen could not set SIGCHLD"); } #else inline void sigchld_setup(void) { } #endif #ifdef USE_DAEMONIZE static RETSIGTYPE sigterm_handler(int /* sig */) { exit(0); } static void daemonize(void) { if (fork()) exit(0); // Stop parent // Show child PID std::cout << "Octave pid: " << octave_syscalls::getpid() << std::endl; std::cout.flush(); signal(SIGTERM,sigterm_handler); signal(SIGQUIT,sigterm_handler); #if 1 const char err[] = "/dev/null"; const char out[] = "/dev/null"; #else const char err[] = "/tmp/octserver.err"; const char out[] = "/tmp/octserver.out"; std::cout << "redirecting to " << out << " and " << err << std::endl; std::cout.flush(); #endif // Exit silently if I/O redirect fails. if (freopen("/dev/null", "r", stdin) == NULL || freopen(out, "w", stdout) == NULL || freopen(err, "w", stderr) == NULL) { // std::cerr << "ioredirect failed" << std::endl; std::cerr.flush(); exit(0); } // std::cout << "ioredirect succeeded" << std::endl; std::cout.flush(); //debug = true; } #else // Don't daemonize on cygwin just yet. inline void daemonize(void) {} #endif // !DAEMONIZE static octave_value get_octave_value(char *name) { octave_value def; // Copy variable from octave #if defined(HAVE_TOP_LEVEL_SYM_TAB) // Octave 3.0 symbol_record *sr = top_level_sym_tab->lookup (name); if (sr) def = sr->def(); #elif defined(HAVE_VARREF) // Octave 2.x def = symbol_table::varref (std::string (name), symbol_table::top_scope ()); #else // Octave 3.2 def = get_global_value(name); #endif return def; } static void channel_error (const int channel, const char *str) { STATUS("sending error !!!e (" << strlen(str) << ") " << str); uint32_t len = strlen(str); send(channel,"!!!e",4,0); uint32_t t = htonl(len); send(channel,(const char *)&t,4,0); send(channel,str,len,0); } static bool reads (const int channel, void * buf, int n) { // STATUS("entering reads loop with size " << n); tic(); while (1) { int chunk = recv(channel, (char *)buf, n, 0); if (chunk == 0) STATUS("read socket returned 0"); if (chunk < 0) STATUS("read socket error " << socket_errno()); if (chunk <= 0) return false; n -= chunk; // if (n == 0) STATUS("done reads loop after " << toc() << "us"); if (n == 0) return true; // STATUS("reading remaining " << n << " characters"); buf = (void *)((char *)buf + chunk); } } static bool writes (const int channel, const void * buf, int n) { // STATUS("entering writes loop"); while (1) { int chunk = send(channel, (const char *)buf, n, 0); if (chunk == 0) STATUS("write socket returned 0"); if (chunk < 0) STATUS("write socket: " << strerror(errno)); if (chunk <= 0) return false; n -= chunk; // if (n == 0) STATUS("done writes loop"); if (n == 0) return true; buf = (void *)((char *)buf + chunk); } } static void process_commands(int channel) { // XXX FIXME XXX check read/write return values assert(sizeof(uint32_t) == 4); char command[5]; char def_context[16536]; bool ok; STATUS("waiting for command"); // XXX FIXME XXX do we need to specify the context size? // int bufsize=sizeof(def_context); // socklen_t ol; // ol=sizeof(bufsize); // setsockopt(channel,SOL_SOCKET,SO_SNDBUF,&bufsize,ol); // setsockopt(channel,SOL_SOCKET,SO_RCVBUF,&bufsize,ol); // XXX FIXME XXX prepare to capture long jumps, because if // we dont, then errors in octave might escape to the prompt command[4] = '\0'; if (debug) tic(); while (reads(channel, &command, 4)) { // XXX FIXME XXX do whatever is require to check if function files // have changed; do we really want to do this for _every_ command? // Maybe we need a 'reload' command. STATUS("received command " << command << " after " << toc() << "us"); // Check for magic command code if (command[0] != '!' || command[1] != '!' || command[2] != '!') { STATUS("communication error: closing connection"); break; } // Get command length if (debug) tic(); // time the read uint32_t len; if (!reads(channel, &len, 4)) break; len = ntohl(len); // STATUS("read 4 byte command length in " << toc() << "us"); // Read the command context, allocating a new one if the default // is too small. if (len > (signed)sizeof(def_context)-1) { // XXX FIXME XXX use octave allocators // XXX FIXME XXX unwind_protect context= new char[len+1]; if (context== NULL) { // Requested command is too large --- skip to the next command // XXX FIXME XXX maybe we want to kill the connection instead? channel_error(channel,"out of memory"); ok = true; STATUS("skip big command loop"); while (ok && len > (signed)sizeof(def_context)) { ok = reads(channel, def_context, sizeof(def_context)); len -= sizeof(def_context); } STATUS("done skip big command loop"); if (!ok) break; ok = reads(channel, def_context, sizeof(def_context)); if (!ok) break; continue; } } else { context = def_context; } // if (debug) tic(); ok = reads(channel, context, len); context[len] = '\0'; STATUS("read " << len << " byte command in " << toc() << "us"); // Process the command if (ok) switch (command[3]) { case 'm': // send the named matrix { // XXX FIXME XXX this can be removed: app can do send(name,value) STATUS("sending " << context); uint32_t t; // read the matrix contents octave_value def = get_octave_value(context); if(!def.is_defined() || !def.is_real_matrix()) channel_error(channel,"not a matrix"); Matrix m = def.matrix_value(); // write the matrix transfer header ok = writes(channel,"!!!m",4); // matrix message t = htonl(12 + sizeof(double)*m.rows()*m.columns()); if (ok) ok = writes(channel,&t,4); // length of message t = htonl(m.rows()); if (ok) ok = writes(channel,&t,4); // rows t = htonl(m.columns()); if (ok) ok = writes(channel,&t,4); // columns t = htonl(len); if (ok) ok = writes(channel, &t, 4); // name length if (ok) ok = writes(channel,context,len); // name // write the matrix contents const double *v = m.data(); // data if (ok) ok = writes(channel,v,sizeof(double)*m.rows()*m.columns()); if (ok) STATUS("sent " << m.rows()*m.columns()); else STATUS("failed " << m.rows()*m.columns()); } break; case 'x': // silently execute the command { if (debug) { if (len > 500) { // XXX FIXME XXX can we limit the maximum output width for a // string? The setprecision() io manipulator doesn't do it. // In the meantime, a hack ... char t = context[400]; context[400] = '\0'; STATUS("evaluating (" << len << ") " << context << std::endl << "..." << std::endl << context+len-100); context[400] = t; } else { STATUS("evaluating (" << len << ") " << context); } } if (debug) tic(); #if 1 error_state = 0; int parse_status = 0; eval_string(context, true, parse_status, 0); if (parse_status != 0 || error_state) eval_string("senderror(lasterr);", true, parse_status, 0); #elif 0 octave_value_list evalargs; evalargs(1) = "senderror(lasterr);"; evalargs(0) = context; octave_value_list fret = feval("eval",evalargs,0); #else evalargs(0) = octave_value(0.); #endif STATUS("done command"); } STATUS("free evalargs"); break; case 'c': // execute the command and capture stdin/stdout STATUS("capture command not yet implemented"); break; default: STATUS("ignoring command " << command); break; } if (context != def_context) delete[] context; STATUS("done " << command); if (!ok) break; if (debug) tic(); } } int channel = -1; DEFUN_DLD(senderror,args,,"\ Send the given error message across the socket. The error context\n\ is taken to be the last command received from the socket.") { std::string str; const int nargin = args.length(); if (nargin != 1) str="senderror not called with error"; else str = args(0).string_value(); // provide a context for the error (but not too much!) str += "when evaluating:\n"; if (strlen(context) > 100) { char t=context[100]; context[100] = '\0'; str+=context; context[100]=t; } else str += context; STATUS("error is " << str); channel_error(channel,str.c_str()); return octave_value_list(); } DEFUN_DLD(send,args,,"\ send(str)\n\ Send a command on the current connection\n\ send(name,value)\n\ Send a binary value with the given name on the current connection\n\ ") { bool ok; uint32_t t; octave_value_list ret; int nargin = args.length(); if (nargin < 1 || nargin > 2) { print_usage (); return ret; } if (channel < 0) { error("Not presently listening on a port"); return ret; } std::string cmd(args(0).string_value()); if (error_state) return ret; // XXX FIXME XXX perhaps process the panalopy of types? if (nargin > 1) { octave_value def = args(1); if (args(1).is_string()) { // Grab the string value from args(1). // Can't use args(1).string_value() because that trims trailing \0 charMatrix m(args(1).char_matrix_value()); std::string s(m.row_as_string(0,false,true)); STATUS("sending string(" << cmd.c_str() << " len " << s.length() << ")"); ok = writes(channel,"!!!s",4); // string message t = htonl(8 + cmd.length() + s.length()); if (ok) ok = writes(channel,&t,4); // length of message t = htonl(s.length()); if (ok) ok = writes(channel, &t, 4); // string length t = htonl(cmd.length()); if (ok) ok = writes(channel, &t, 4); // name length if (cmd.length() && ok) ok = writes(channel, cmd.c_str(), cmd.length()); // name if (s.length() && ok) ok = writes(channel, s.c_str(), s.length()); // string } else if (args(1).is_real_type()) { Matrix m(args(1).matrix_value()); STATUS("sending matrix(" << cmd.c_str() << " " << m.rows() << "x" << m.columns() << ")"); // write the matrix transfer header ok = writes(channel,"!!!m",4); // matrix message t = htonl(12 + cmd.length() + sizeof(double)*m.rows()*m.columns()); if (ok) ok = writes(channel,&t,4); // length of message t = htonl(m.rows()); if (ok) ok = writes(channel,&t,4); // rows t = htonl(m.columns()); if (ok) ok = writes(channel,&t,4); // columns t = htonl(cmd.length()); if (ok) ok = writes(channel, &t, 4); // name length if (ok) ok = writes(channel, cmd.c_str(), cmd.length()); // name // write the matrix contents const double *v = m.data(); // data if (m.rows()*m.columns() && ok) ok = writes(channel,v,sizeof(double)*m.rows()*m.columns()); } else { ok = false; error("send expected name and matrix or string value"); } if (!ok) error("send could not write to channel"); } else { STATUS("sending command(" << cmd.length() << ") " << cmd.c_str()); // STATUS("start writing at "<. ## 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. ## ## Usage: ## - csv2latex(csv_file, csv_sep, latex_file) ## - csv2latex(csv_file, csv_sep, latex_file, tabular_alignments) ## - csv2latex(csv_file, csv_sep, latex_file, tabular_alignments, has_hline) ## - csv2latex(csv_file, csv_sep, latex_file, ## tabular_alignments, has_hline, column_titles) ## - csv2latex(csv_file, csv_sep, latex_file, tabular_alignments, ## has_hline, column_titles, row_titles) ## ## Parameters: ## 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: ## # 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'}); 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 = {}; end if nargin < 6 column_titles = {}; end if nargin < 5 has_hline = false; end if nargin < 4 tabular_alignments = {}; end ## 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)); end end end ## 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; end 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); end 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)); end else tabular_headline = sprintf ('%s &', tabular_headline); end end end ## 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'); end fprintf (fid, ' %s \\\\\n', tabular_headline); # print the headline of the tabular end for row_index = 1:row_size if has_hline == true fprintf (fid, ' \\hline\n'); end 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 end end fprintf (fid, ' %s ', csv{row_index, col_index}); else fprintf (fid, '& %s ', csv{row_index, col_index}); end end fprintf (fid, '\\\\\n'); end if has_hline == true fprintf (fid, ' \\hline\n'); end fprintf (fid, '\\end{tabular}', alignment_preamble); # print the end of the tabular fclose(fid); # close the latex file after writing end end miscellaneous-1.2.1/inst/zigzag.m0000644000175000017500000000470212344005534015433 0ustar olafolaf## 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.2.1/inst/laguerrepoly.m0000644000175000017500000000336412344005534016655 0ustar olafolaf## 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.2.1/inst/textable.m0000644000175000017500000001322612344005534015751 0ustar olafolaf## 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 = p.addSwitch ("clines"); p = p.addSwitch ("rlines"); p = p.addParamValue ("math", "X", @ischar); p = p.addParamValue ("file", "matrix.tex", @ischar); p = p.addParamValue ("align", "r", @(x) any(strcmpi(x, {"l", "c", "r"}))); p = 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 miscellaneous-1.2.1/inst/rolldices.m0000644000175000017500000000471512344005534016124 0ustar olafolaf## 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.2.1/inst/normc.m0000644000175000017500000000346612344005534015264 0ustar olafolaf## 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.2.1/inst/hilbert_curve.m0000644000175000017500000000522312344005534016774 0ustar olafolaf## 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 check_power_of_two (n); if (n == 2) x = [0, 0, 1, 1]; y = [0, 1, 1, 0]; else [x1, y1] = hilbert_curve (n/2); x = [y1, x1, n/2 + x1, n - 1 - y1]; y = [x1, n/2 + y1, n/2 + y1, n/2 - 1 - x1]; endif endfunction function check_power_of_two (n) if (frac_part (log (n) / log (2)) != 0) error ("hilbert_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, 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.2.1/inst/physical_constant.py0000755000175000017500000001663612344005534020075 0ustar olafolaf#!/usr/bin/python ## coding: utf-8 ## 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 . ## 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) import time import sys import os.path import urllib 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 = urllib.urlopen(url).read().split('\r\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 in sorted (table.keys()): 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.2.1/inst/nze.m0000644000175000017500000000216212344005534014732 0ustar olafolaf## 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.2.1/inst/z_curve.m0000644000175000017500000000514512344005534015617 0ustar olafolaf## 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.2.1/inst/publish.m0000644000175000017500000002237612344005534015615 0ustar olafolaf## Copyright (C) 2010 Fotios Kasolis ## ## 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} {} publish (@var{filename}) ## @deftypefnx {Function File} {} publish (@var{filename}, @var{options}) ## Produces latex reports from scripts. ## ## @example ## publish (@var{my_script}) ## @end example ## ## @noindent ## where the argument is a string that contains the file name of ## the script we want to report. ## ## If two arguments are given, they are interpreted as follows. ## ## @example ## publish (@var{filename}, [@var{option}, @var{value}, ...]) ## @end example ## ## @noindent ## The following options are available: ## ## @itemize @bullet ## @item format ## ## the only available format values are the strings `latex' and ## `html'. ## ## @item ## imageFormat: ## ## string that specifies the image format, valid formats are `pdf', ## `png', and `jpg'(or `jpeg'). ## ## @item ## showCode: ## ## boolean value that specifies if the source code will be included ## in the report. ## ## @item ## evalCode: ## ## boolean value that specifies if execution results will be included ## in the report. ## ## @end itemize ## ## Default @var{options} ## ## @itemize @bullet ## @item format = latex ## ## @item imageFormat = pdf ## ## @item showCode = 1 ## ## @item evalCode = 1 ## ## @end itemize ## ## Remarks ## ## @itemize @bullet ## @item Any additional non-valid field is removed without ## notification. ## ## @item To include several figures in the resulting report you must ## use figure with a unique number for each one of them. ## ## @item You do not have to save the figures manually, publish will ## do it for you. ## ## @item The functions works only for the current path and no way ... ## to specify other path is allowed. ## ## @end itemize ## ## Assume you have the script `myscript.m' which looks like ## ## @example ## @group ## x = 0:0.1:pi; ## y = sin(x) ## figure(1) ## plot(x,y); ## figure(2) ## plot(x,y.^2); ## @end group ## @end example ## ## You can then call publish with default @var{options} ## ## @example ## publish("myscript") ## @end example ## @end deftypefn function publish (file_name, varargin) if ((nargin < 1) || (rem (numel (varargin), 2) != 0)) print_usage (); endif if (!strcmp (file_name(end-1:end), ".m")) ifile = strcat (file_name, ".m"); ofile = strcat (file_name, ".tex"); else ifile = file_name; ofile = strcat (file_name(1:end-1), "tex"); endif if (exist (ifile, "file") != 2) error ("File %s does not exist.", ifile); endif options = set_default (struct ()); options = read_options (varargin, "op1", "format imageFormat showCode evalCode", "default", options); if (strcmpi (options.format, "latex")) create_latex (ifile, ofile, options); elseif strcmpi(options.format, "html") create_html (ifile, options); endif endfunction function def_options = set_default (options); if (!isfield (options, "format")) def_options.format = "latex"; elseif (!ischar (options.format)) error("Option format must be a string."); else valid_formats={"latex", "html"}; validity_test = strcmpi (valid_formats, options.format); if (isempty (find (validity_test))) error ("The supplied format is not currently supported."); else def_options.format = options.format; endif endif if (! isfield (options, "imageFormat")) def_options.imageFormat = "pdf"; elseif (! ischar(options.imageFormat)) error("Option imageFormat must be a string."); else valid_formats = {"pdf", "png", "jpg", "jpeg"}; validity_test = strcmpi (valid_formats, options.imageFormat); if (isempty (find (validity_test))) error ("The supplied image format is not available."); else def_options.imageFormat = options.imageFormat; endif endif if (!isfield (options,"showCode")) def_options.showCode = true; elseif (!isbool (options.showCode)) error ("Option showCode must be a boolean."); else def_options.showCode = options.showCode; endif if (!isfield (options,"evalCode")) def_options.evalCode = true; elseif (!isbool (options.evalCode)) error ("Option evalCode must be a boolean."); else def_options.evalCode = options.evalCode; endif endfunction function create_html (ifile, options) ofile = strcat (ifile(1:end-1), "html"); html_start = "\n\n"; html_end = "\n\n"; if options.showCode section1_title = "

Source code

\n"; fid = fopen (ifile, "r"); source_code = fread (fid, "*char")'; fclose(fid); else section1_title = ""; source_code = ""; endif if options.evalCode section2_title = "

Execution results

\n"; oct_command = strcat ("octave> ", ifile(1:end-2), "\n"); script_result = exec_script (ifile); else section2_title = ""; oct_command = ""; script_result = ""; endif [section3_title, disp_fig] = exec_print (ifile, options); final_document = strcat (html_start, section1_title, "\n", source_code,"\n",... "\n", section2_title, oct_command, script_result,... "", section3_title, disp_fig, html_end); fid = fopen (ofile, "w"); fputs (fid, final_document); fclose (fid); endfunction function create_latex (ifile, ofile, options) latex_preamble = "\ \\documentclass[a4paper,12pt]{article}\n\ \\usepackage{listings}\n\ \\usepackage{graphicx}\n\ \\usepackage{color}\n\ \\usepackage[T1]{fontenc}\n\ \\definecolor{lightgray}{rgb}{0.9,0.9,0.9}\n"; listing_source_option = "\ \\lstset{\n\ language = Octave,\n\ basicstyle =\\footnotesize,\n\ numbers = left,\n\ numberstyle = \\footnotesize,\n\ backgroundcolor=\\color{lightgray},\n\ frame=single,\n\ tabsize=2,\n\ breaklines=true}\n"; listing_exec_option = "\ \\lstset{\n\ language = Octave,\n\ basicstyle =\\footnotesize,\n\ numbers = none,\n\ backgroundcolor=\\color{white},\n\ frame=none,\n\ tabsize=2,\n\ breaklines=true}\n"; if options.showCode section1_title = strcat ("\\section*{Source code: \\texttt{", ifile, "}}\n"); source_code = strcat ("\\lstinputlisting{", ifile, "}\n"); else section1_title = ""; source_code = ""; endif if options.evalCode section2_title = "\\section*{Execution results}\n"; oct_command = strcat ("octave> ", ifile(1:end-2), "\n"); script_result = exec_script (ifile); else section2_title = ""; oct_command = ""; script_result = ""; endif [section3_title, disp_fig] = exec_print (ifile, options); final_document = strcat (latex_preamble, listing_source_option, "\\begin{document}\n", section1_title, source_code, section2_title, listing_exec_option, "\\begin{lstlisting}\n", oct_command, script_result, "\\end{lstlisting}\n", section3_title, "\\begin{center}\n", disp_fig, "\\end{center}\n", "\\end{document}"); fid = fopen (ofile, "w"); fputs(fid, final_document); fclose(fid); endfunction function script_result = exec_script (ifile) diary publish_tmp_script.txt eval (ifile(1:end-2)) diary off fid = fopen ("publish_tmp_script.txt", 'r'); script_result = fread (fid, '*char')'; fclose(fid); delete ("publish_tmp_script.txt"); endfunction function [section3_title, disp_fig] = exec_print (ifile, options) figures = findall (0, "type", "figure"); section3_title = ""; disp_fig = ""; if (!isempty (figures)) for nfig = 1:length (figures) figure (figures(nfig)); print (sprintf ("%s%d.%s", ifile(1:end-2), nfig, options.imageFormat), sprintf ("-d%s", options.imageFormat), "-color"); if (strcmpi (options.format, "html")); section3_title = "

Generated graphics

\n"; disp_fig = strcat (disp_fig, ""); elseif (strcmpi (options.format, "latex")) section3_title = "\\section*{Generated graphics}\n"; disp_fig = strcat (disp_fig, "\\includegraphics[scale=0.6]{", ifile(1:end-2), sprintf("%d",nfig), "}\n"); endif endfor endif endfunction # TODO # * ADD VARARGIN FOR ADDITIONAL FILES SOURCES TO BE INLCUDED AS # APPENDICES (THIS SOLVES THE PROBLEM OF FUNCTIONS SINCE YOU CAN # PUT THE FUNCTION CALL IN SCRIPT CALL PUBLISH(SCRIPT) AND ADD # THE FUNCTIONS CODE AS APPENDIX) # # * KNOWN PROBLEM: THE COMMENTING LINES IN HTML miscellaneous-1.2.1/inst/physical_constant.m0000644000175000017500000026407412344005534017677 0ustar olafolaf## 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 Wed Apr 25 22:17:07 2012 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.02214129e23; unit_data(2).uncertainty = 0.00000027e23; unit_data(2).units = "mol^-1"; unit_data(3).name = "Bohr magneton"; unit_data(3).value = 927.400968e-26; unit_data(3).uncertainty = 0.000020e-26; unit_data(3).units = "J T^-1"; unit_data(4).name = "Bohr magneton in Hz/T"; unit_data(4).value = 13.99624555e9; unit_data(4).uncertainty = 0.00000031e9; unit_data(4).units = "Hz T^-1"; unit_data(5).name = "Bohr magneton in K/T"; unit_data(5).value = 0.67171388; unit_data(5).uncertainty = 0.00000061; unit_data(5).units = "K T^-1"; unit_data(6).name = "Bohr magneton in eV/T"; unit_data(6).value = 5.7883818066e-5; unit_data(6).uncertainty = 0.0000000038e-5; unit_data(6).units = "eV T^-1"; unit_data(7).name = "Bohr magneton in inverse meters per tesla"; unit_data(7).value = 46.6864498; unit_data(7).uncertainty = 0.0000010; unit_data(7).units = "m^-1 T^-1"; unit_data(8).name = "Bohr radius"; unit_data(8).value = 0.52917721092e-10; unit_data(8).uncertainty = 0.00000000017e-10; unit_data(8).units = "m"; unit_data(9).name = "Boltzmann constant"; unit_data(9).value = 1.3806488e-23; unit_data(9).uncertainty = 0.0000013e-23; unit_data(9).units = "J K^-1"; unit_data(10).name = "Boltzmann constant in Hz/K"; unit_data(10).value = 2.0836618e10; unit_data(10).uncertainty = 0.0000019e10; unit_data(10).units = "Hz K^-1"; unit_data(11).name = "Boltzmann constant in eV/K"; unit_data(11).value = 8.6173324e-5; unit_data(11).uncertainty = 0.0000078e-5; unit_data(11).units = "eV K^-1"; unit_data(12).name = "Boltzmann constant in inverse meters per kelvin"; unit_data(12).value = 69.503476; unit_data(12).uncertainty = 0.000063; unit_data(12).units = "m^-1 K^-1"; unit_data(13).name = "Compton wavelength"; unit_data(13).value = 2.4263102389e-12; unit_data(13).uncertainty = 0.0000000016e-12; unit_data(13).units = "m"; unit_data(14).name = "Compton wavelength over 2 pi"; unit_data(14).value = 386.15926800e-15; unit_data(14).uncertainty = 0.00000025e-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.3365; unit_data(16).uncertainty = 0.0021; unit_data(16).units = "C mol^-1"; unit_data(17).name = "Faraday constant for conventional electric current"; unit_data(17).value = 96485.3321; unit_data(17).uncertainty = 0.0043; unit_data(17).units = "C_90 mol^-1"; unit_data(18).name = "Fermi coupling constant"; unit_data(18).value = 1.166364e-5; unit_data(18).uncertainty = 0.000005e-5; unit_data(18).units = "GeV^-2"; unit_data(19).name = "Hartree energy"; unit_data(19).value = 4.35974434e-18; unit_data(19).uncertainty = 0.00000019e-18; unit_data(19).units = "J"; unit_data(20).name = "Hartree energy in eV"; unit_data(20).value = 27.21138505; unit_data(20).uncertainty = 0.00000060; unit_data(20).units = "eV"; unit_data(21).name = "Josephson constant"; unit_data(21).value = 483597.870e9; unit_data(21).uncertainty = 0.011e9; unit_data(21).units = "Hz V^-1"; unit_data(22).name = "Loschmidt constant (273.15 K, 100 kPa)"; unit_data(22).value = 2.6516462e25; unit_data(22).uncertainty = 0.0000024e25; unit_data(22).units = "m^-3"; unit_data(23).name = "Loschmidt constant (273.15 K, 101.325 kPa)"; unit_data(23).value = 2.6867805e25; unit_data(23).uncertainty = 0.0000024e25; 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.67384e-11; unit_data(25).uncertainty = 0.00080e-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.70837e-39; unit_data(26).uncertainty = 0.00080e-39; unit_data(26).units = "(GeV/c^2)^-2"; unit_data(27).name = "Planck constant"; unit_data(27).value = 6.62606957e-34; unit_data(27).uncertainty = 0.00000029e-34; unit_data(27).units = "J s"; unit_data(28).name = "Planck constant in eV s"; unit_data(28).value = 4.135667516e-15; unit_data(28).uncertainty = 0.000000091e-15; unit_data(28).units = "eV s"; unit_data(29).name = "Planck constant over 2 pi"; unit_data(29).value = 1.054571726e-34; unit_data(29).uncertainty = 0.000000047e-34; unit_data(29).units = "J s"; unit_data(30).name = "Planck constant over 2 pi in eV s"; unit_data(30).value = 6.58211928e-16; unit_data(30).uncertainty = 0.00000015e-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.3269718; unit_data(31).uncertainty = 0.0000044; unit_data(31).units = "MeV fm"; unit_data(32).name = "Planck length"; unit_data(32).value = 1.616199e-35; unit_data(32).uncertainty = 0.000097e-35; unit_data(32).units = "m"; unit_data(33).name = "Planck mass"; unit_data(33).value = 2.17651e-8; unit_data(33).uncertainty = 0.00013e-8; unit_data(33).units = "kg"; unit_data(34).name = "Planck mass energy equivalent in GeV"; unit_data(34).value = 1.220932e19; unit_data(34).uncertainty = 0.000073e19; unit_data(34).units = "GeV"; unit_data(35).name = "Planck temperature"; unit_data(35).value = 1.416833e32; unit_data(35).uncertainty = 0.000085e32; unit_data(35).units = "K"; unit_data(36).name = "Planck time"; unit_data(36).value = 5.39106e-44; unit_data(36).uncertainty = 0.00032e-44; unit_data(36).units = "s"; unit_data(37).name = "Rydberg constant"; unit_data(37).value = 10973731.568539; unit_data(37).uncertainty = 0.000055; unit_data(37).units = "m^-1"; unit_data(38).name = "Rydberg constant times c in Hz"; unit_data(38).value = 3.289841960364e15; unit_data(38).uncertainty = 0.000000000017e15; unit_data(38).units = "Hz"; unit_data(39).name = "Rydberg constant times hc in J"; unit_data(39).value = 2.179872171e-18; unit_data(39).uncertainty = 0.000000096e-18; unit_data(39).units = "J"; unit_data(40).name = "Rydberg constant times hc in eV"; unit_data(40).value = 13.60569253; unit_data(40).uncertainty = 0.00000030; unit_data(40).units = "eV"; unit_data(41).name = "Sackur-Tetrode constant (1 K, 100 kPa)"; unit_data(41).value = -1.1517078; unit_data(41).uncertainty = 0.0000023; unit_data(41).units = ""; unit_data(42).name = "Sackur-Tetrode constant (1 K, 101.325 kPa)"; unit_data(42).value = -1.1648708; unit_data(42).uncertainty = 0.0000023; unit_data(42).units = ""; unit_data(43).name = "Stefan-Boltzmann constant"; unit_data(43).value = 5.670373e-8; unit_data(43).uncertainty = 0.000021e-8; unit_data(43).units = "W m^-2 K^-4"; unit_data(44).name = "Thomson cross section"; unit_data(44).value = 0.6652458734e-28; unit_data(44).uncertainty = 0.0000000013e-28; unit_data(44).units = "m^2"; unit_data(45).name = "Wien frequency displacement law constant"; unit_data(45).value = 5.8789254e10; unit_data(45).uncertainty = 0.0000053e10; unit_data(45).units = "Hz K^-1"; unit_data(46).name = "Wien wavelength displacement law constant"; unit_data(46).value = 2.8977721e-3; unit_data(46).uncertainty = 0.0000026e-3; unit_data(46).units = "m K"; unit_data(47).name = "alpha particle mass"; unit_data(47).value = 6.64465675e-27; unit_data(47).uncertainty = 0.00000029e-27; unit_data(47).units = "kg"; unit_data(48).name = "alpha particle mass energy equivalent"; unit_data(48).value = 5.97191967e-10; unit_data(48).uncertainty = 0.00000026e-10; unit_data(48).units = "J"; unit_data(49).name = "alpha particle mass energy equivalent in MeV"; unit_data(49).value = 3727.379240; unit_data(49).uncertainty = 0.000082; unit_data(49).units = "MeV"; unit_data(50).name = "alpha particle mass in u"; unit_data(50).value = 4.001506179125; unit_data(50).uncertainty = 0.000000000062; unit_data(50).units = "u"; unit_data(51).name = "alpha particle molar mass"; unit_data(51).value = 4.001506179125e-3; unit_data(51).uncertainty = 0.000000000062e-3; unit_data(51).units = "kg mol^-1"; unit_data(52).name = "alpha particle-electron mass ratio"; unit_data(52).value = 7294.2995361; unit_data(52).uncertainty = 0.0000029; unit_data(52).units = ""; unit_data(53).name = "alpha particle-proton mass ratio"; unit_data(53).value = 3.97259968933; unit_data(53).uncertainty = 0.00000000036; unit_data(53).units = ""; unit_data(54).name = "atomic mass constant"; unit_data(54).value = 1.660538921e-27; unit_data(54).uncertainty = 0.000000073e-27; unit_data(54).units = "kg"; unit_data(55).name = "atomic mass constant energy equivalent"; unit_data(55).value = 1.492417954e-10; unit_data(55).uncertainty = 0.000000066e-10; unit_data(55).units = "J"; unit_data(56).name = "atomic mass constant energy equivalent in MeV"; unit_data(56).value = 931.494061; unit_data(56).uncertainty = 0.000021; unit_data(56).units = "MeV"; unit_data(57).name = "atomic mass unit-electron volt relationship"; unit_data(57).value = 931.494061e6; unit_data(57).uncertainty = 0.000021e6; unit_data(57).units = "eV"; unit_data(58).name = "atomic mass unit-hartree relationship"; unit_data(58).value = 3.4231776845e7; unit_data(58).uncertainty = 0.0000000024e7; unit_data(58).units = "E_h"; unit_data(59).name = "atomic mass unit-hertz relationship"; unit_data(59).value = 2.2523427168e23; unit_data(59).uncertainty = 0.0000000016e23; unit_data(59).units = "Hz"; unit_data(60).name = "atomic mass unit-inverse meter relationship"; unit_data(60).value = 7.5130066042e14; unit_data(60).uncertainty = 0.0000000053e14; unit_data(60).units = "m^-1"; unit_data(61).name = "atomic mass unit-joule relationship"; unit_data(61).value = 1.492417954e-10; unit_data(61).uncertainty = 0.000000066e-10; unit_data(61).units = "J"; unit_data(62).name = "atomic mass unit-kelvin relationship"; unit_data(62).value = 1.08095408e13; unit_data(62).uncertainty = 0.00000098e13; unit_data(62).units = "K"; unit_data(63).name = "atomic mass unit-kilogram relationship"; unit_data(63).value = 1.660538921e-27; unit_data(63).uncertainty = 0.000000073e-27; unit_data(63).units = "kg"; unit_data(64).name = "atomic unit of 1st hyperpolarizability"; unit_data(64).value = 3.206361449e-53; unit_data(64).uncertainty = 0.000000071e-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.23538054e-65; unit_data(65).uncertainty = 0.00000028e-65; unit_data(65).units = "C^4 m^4 J^-3"; unit_data(66).name = "atomic unit of action"; unit_data(66).value = 1.054571726e-34; unit_data(66).uncertainty = 0.000000047e-34; unit_data(66).units = "J s"; unit_data(67).name = "atomic unit of charge"; unit_data(67).value = 1.602176565e-19; unit_data(67).uncertainty = 0.000000035e-19; unit_data(67).units = "C"; unit_data(68).name = "atomic unit of charge density"; unit_data(68).value = 1.081202338e12; unit_data(68).uncertainty = 0.000000024e12; unit_data(68).units = "C m^-3"; unit_data(69).name = "atomic unit of current"; unit_data(69).value = 6.62361795e-3; unit_data(69).uncertainty = 0.00000015e-3; unit_data(69).units = "A"; unit_data(70).name = "atomic unit of electric dipole mom."; unit_data(70).value = 8.47835326e-30; unit_data(70).uncertainty = 0.00000019e-30; unit_data(70).units = "C m"; unit_data(71).name = "atomic unit of electric field"; unit_data(71).value = 5.14220652e11; unit_data(71).uncertainty = 0.00000011e11; unit_data(71).units = "V m^-1"; unit_data(72).name = "atomic unit of electric field gradient"; unit_data(72).value = 9.71736200e21; unit_data(72).uncertainty = 0.00000021e21; unit_data(72).units = "V m^-2"; unit_data(73).name = "atomic unit of electric polarizability"; unit_data(73).value = 1.6487772754e-41; unit_data(73).uncertainty = 0.0000000016e-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.21138505; unit_data(74).uncertainty = 0.00000060; unit_data(74).units = "V"; unit_data(75).name = "atomic unit of electric quadrupole mom."; unit_data(75).value = 4.486551331e-40; unit_data(75).uncertainty = 0.000000099e-40; unit_data(75).units = "C m^2"; unit_data(76).name = "atomic unit of energy"; unit_data(76).value = 4.35974434e-18; unit_data(76).uncertainty = 0.00000019e-18; unit_data(76).units = "J"; unit_data(77).name = "atomic unit of force"; unit_data(77).value = 8.23872278e-8; unit_data(77).uncertainty = 0.00000036e-8; unit_data(77).units = "N"; unit_data(78).name = "atomic unit of length"; unit_data(78).value = 0.52917721092e-10; unit_data(78).uncertainty = 0.00000000017e-10; unit_data(78).units = "m"; unit_data(79).name = "atomic unit of mag. dipole mom."; unit_data(79).value = 1.854801936e-23; unit_data(79).uncertainty = 0.000000041e-23; unit_data(79).units = "J T^-1"; unit_data(80).name = "atomic unit of mag. flux density"; unit_data(80).value = 2.350517464e5; unit_data(80).uncertainty = 0.000000052e5; unit_data(80).units = "T"; unit_data(81).name = "atomic unit of magnetizability"; unit_data(81).value = 7.891036607e-29; unit_data(81).uncertainty = 0.000000013e-29; unit_data(81).units = "J T^-2"; unit_data(82).name = "atomic unit of mass"; unit_data(82).value = 9.10938291e-31; unit_data(82).uncertainty = 0.00000040e-31; unit_data(82).units = "kg"; unit_data(83).name = "atomic unit of mom.um"; unit_data(83).value = 1.992851740e-24; unit_data(83).uncertainty = 0.000000088e-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.418884326502e-17; unit_data(85).uncertainty = 0.000000000012e-17; unit_data(85).units = "s"; unit_data(86).name = "atomic unit of velocity"; unit_data(86).value = 2.18769126379e6; unit_data(86).uncertainty = 0.00000000071e6; 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.8179403267e-15; unit_data(88).uncertainty = 0.0000000027e-15; unit_data(88).units = "m"; unit_data(89).name = "conductance quantum"; unit_data(89).value = 7.7480917346e-5; unit_data(89).uncertainty = 0.0000000025e-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.8574382308; unit_data(92).uncertainty = 0.0000000072; unit_data(92).units = ""; unit_data(93).name = "deuteron mag. mom."; unit_data(93).value = 0.433073489e-26; unit_data(93).uncertainty = 0.000000010e-26; unit_data(93).units = "J T^-1"; unit_data(94).name = "deuteron mag. mom. to Bohr magneton ratio"; unit_data(94).value = 0.4669754556e-3; unit_data(94).uncertainty = 0.0000000039e-3; unit_data(94).units = ""; unit_data(95).name = "deuteron mag. mom. to nuclear magneton ratio"; unit_data(95).value = 0.8574382308; unit_data(95).uncertainty = 0.0000000072; unit_data(95).units = ""; unit_data(96).name = "deuteron mass"; unit_data(96).value = 3.34358348e-27; unit_data(96).uncertainty = 0.00000015e-27; unit_data(96).units = "kg"; unit_data(97).name = "deuteron mass energy equivalent"; unit_data(97).value = 3.00506297e-10; unit_data(97).uncertainty = 0.00000013e-10; unit_data(97).units = "J"; unit_data(98).name = "deuteron mass energy equivalent in MeV"; unit_data(98).value = 1875.612859; unit_data(98).uncertainty = 0.000041; unit_data(98).units = "MeV"; unit_data(99).name = "deuteron mass in u"; unit_data(99).value = 2.013553212712; unit_data(99).uncertainty = 0.000000000077; unit_data(99).units = "u"; unit_data(100).name = "deuteron molar mass"; unit_data(100).value = 2.013553212712e-3; unit_data(100).uncertainty = 0.000000000077e-3; unit_data(100).units = "kg mol^-1"; unit_data(101).name = "deuteron rms charge radius"; unit_data(101).value = 2.1424e-15; unit_data(101).uncertainty = 0.0021e-15; unit_data(101).units = "m"; unit_data(102).name = "deuteron-electron mag. mom. ratio"; unit_data(102).value = -4.664345537e-4; unit_data(102).uncertainty = 0.000000039e-4; unit_data(102).units = ""; unit_data(103).name = "deuteron-electron mass ratio"; unit_data(103).value = 3670.4829652; unit_data(103).uncertainty = 0.0000015; 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.3070122070; unit_data(105).uncertainty = 0.0000000024; unit_data(105).units = ""; unit_data(106).name = "deuteron-proton mass ratio"; unit_data(106).value = 1.99900750097; unit_data(106).uncertainty = 0.00000000018; 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.758820088e11; unit_data(108).uncertainty = 0.000000039e11; unit_data(108).units = "C kg^-1"; unit_data(109).name = "electron g factor"; unit_data(109).value = -2.00231930436153; unit_data(109).uncertainty = 0.00000000000053; unit_data(109).units = ""; unit_data(110).name = "electron gyromag. ratio"; unit_data(110).value = 1.760859708e11; unit_data(110).uncertainty = 0.000000039e11; unit_data(110).units = "s^-1 T^-1"; unit_data(111).name = "electron gyromag. ratio over 2 pi"; unit_data(111).value = 28024.95266; unit_data(111).uncertainty = 0.00062; unit_data(111).units = "MHz T^-1"; unit_data(112).name = "electron mag. mom."; unit_data(112).value = -928.476430e-26; unit_data(112).uncertainty = 0.000021e-26; unit_data(112).units = "J T^-1"; unit_data(113).name = "electron mag. mom. anomaly"; unit_data(113).value = 1.15965218076e-3; unit_data(113).uncertainty = 0.00000000027e-3; unit_data(113).units = ""; unit_data(114).name = "electron mag. mom. to Bohr magneton ratio"; unit_data(114).value = -1.00115965218076; unit_data(114).uncertainty = 0.00000000000027; unit_data(114).units = ""; unit_data(115).name = "electron mag. mom. to nuclear magneton ratio"; unit_data(115).value = -1838.28197090; unit_data(115).uncertainty = 0.00000075; unit_data(115).units = ""; unit_data(116).name = "electron mass"; unit_data(116).value = 9.10938291e-31; unit_data(116).uncertainty = 0.00000040e-31; unit_data(116).units = "kg"; unit_data(117).name = "electron mass energy equivalent"; unit_data(117).value = 8.18710506e-14; unit_data(117).uncertainty = 0.00000036e-14; unit_data(117).units = "J"; unit_data(118).name = "electron mass energy equivalent in MeV"; unit_data(118).value = 0.510998928; unit_data(118).uncertainty = 0.000000011; unit_data(118).units = "MeV"; unit_data(119).name = "electron mass in u"; unit_data(119).value = 5.4857990946e-4; unit_data(119).uncertainty = 0.0000000022e-4; unit_data(119).units = "u"; unit_data(120).name = "electron molar mass"; unit_data(120).value = 5.4857990946e-7; unit_data(120).uncertainty = 0.0000000022e-7; unit_data(120).units = "kg mol^-1"; unit_data(121).name = "electron to alpha particle mass ratio"; unit_data(121).value = 1.37093355578e-4; unit_data(121).uncertainty = 0.00000000055e-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.602176565e-19; unit_data(124).uncertainty = 0.000000035e-19; unit_data(124).units = "J"; unit_data(125).name = "electron volt-atomic mass unit relationship"; unit_data(125).value = 1.073544150e-9; unit_data(125).uncertainty = 0.000000024e-9; unit_data(125).units = "u"; unit_data(126).name = "electron volt-hartree relationship"; unit_data(126).value = 3.674932379e-2; unit_data(126).uncertainty = 0.000000081e-2; unit_data(126).units = "E_h"; unit_data(127).name = "electron volt-hertz relationship"; unit_data(127).value = 2.417989348e14; unit_data(127).uncertainty = 0.000000053e14; unit_data(127).units = "Hz"; unit_data(128).name = "electron volt-inverse meter relationship"; unit_data(128).value = 8.06554429e5; unit_data(128).uncertainty = 0.00000018e5; unit_data(128).units = "m^-1"; unit_data(129).name = "electron volt-joule relationship"; unit_data(129).value = 1.602176565e-19; unit_data(129).uncertainty = 0.000000035e-19; unit_data(129).units = "J"; unit_data(130).name = "electron volt-kelvin relationship"; unit_data(130).value = 1.1604519e4; unit_data(130).uncertainty = 0.0000011e4; unit_data(130).units = "K"; unit_data(131).name = "electron volt-kilogram relationship"; unit_data(131).value = 1.782661845e-36; unit_data(131).uncertainty = 0.000000039e-36; unit_data(131).units = "kg"; unit_data(132).name = "electron-deuteron mag. mom. ratio"; unit_data(132).value = -2143.923498; unit_data(132).uncertainty = 0.000018; unit_data(132).units = ""; unit_data(133).name = "electron-deuteron mass ratio"; unit_data(133).value = 2.7244371095e-4; unit_data(133).uncertainty = 0.0000000011e-4; unit_data(133).units = ""; unit_data(134).name = "electron-helion mass ratio"; unit_data(134).value = 1.8195430761e-4; unit_data(134).uncertainty = 0.0000000017e-4; unit_data(134).units = ""; unit_data(135).name = "electron-muon mag. mom. ratio"; unit_data(135).value = 206.7669896; unit_data(135).uncertainty = 0.0000052; unit_data(135).units = ""; unit_data(136).name = "electron-muon mass ratio"; unit_data(136).value = 4.83633166e-3; unit_data(136).uncertainty = 0.00000012e-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.4386734461e-4; unit_data(138).uncertainty = 0.0000000032e-4; unit_data(138).units = ""; unit_data(139).name = "electron-proton mag. mom. ratio"; unit_data(139).value = -658.2106848; unit_data(139).uncertainty = 0.0000054; unit_data(139).units = ""; unit_data(140).name = "electron-proton mass ratio"; unit_data(140).value = 5.4461702178e-4; unit_data(140).uncertainty = 0.0000000022e-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.8192000653e-4; unit_data(142).uncertainty = 0.0000000017e-4; unit_data(142).units = ""; unit_data(143).name = "elementary charge"; unit_data(143).value = 1.602176565e-19; unit_data(143).uncertainty = 0.000000035e-19; unit_data(143).units = "C"; unit_data(144).name = "elementary charge over h"; unit_data(144).value = 2.417989348e14; unit_data(144).uncertainty = 0.000000053e14; unit_data(144).units = "A J^-1"; unit_data(145).name = "fine-structure constant"; unit_data(145).value = 7.2973525698e-3; unit_data(145).uncertainty = 0.0000000024e-3; unit_data(145).units = ""; unit_data(146).name = "first radiation constant"; unit_data(146).value = 3.74177153e-16; unit_data(146).uncertainty = 0.00000017e-16; unit_data(146).units = "W m^2"; unit_data(147).name = "first radiation constant for spectral radiance"; unit_data(147).value = 1.191042869e-16; unit_data(147).uncertainty = 0.000000053e-16; unit_data(147).units = "W m^2 sr^-1"; unit_data(148).name = "hartree-atomic mass unit relationship"; unit_data(148).value = 2.9212623246e-8; unit_data(148).uncertainty = 0.0000000021e-8; unit_data(148).units = "u"; unit_data(149).name = "hartree-electron volt relationship"; unit_data(149).value = 27.21138505; unit_data(149).uncertainty = 0.00000060; unit_data(149).units = "eV"; unit_data(150).name = "hartree-hertz relationship"; unit_data(150).value = 6.579683920729e15; unit_data(150).uncertainty = 0.000000000033e15; unit_data(150).units = "Hz"; unit_data(151).name = "hartree-inverse meter relationship"; unit_data(151).value = 2.194746313708e7; unit_data(151).uncertainty = 0.000000000011e7; unit_data(151).units = "m^-1"; unit_data(152).name = "hartree-joule relationship"; unit_data(152).value = 4.35974434e-18; unit_data(152).uncertainty = 0.00000019e-18; unit_data(152).units = "J"; unit_data(153).name = "hartree-kelvin relationship"; unit_data(153).value = 3.1577504e5; unit_data(153).uncertainty = 0.0000029e5; unit_data(153).units = "K"; unit_data(154).name = "hartree-kilogram relationship"; unit_data(154).value = 4.85086979e-35; unit_data(154).uncertainty = 0.00000021e-35; unit_data(154).units = "kg"; unit_data(155).name = "helion g factor"; unit_data(155).value = -4.255250613; unit_data(155).uncertainty = 0.000000050; unit_data(155).units = ""; unit_data(156).name = "helion mag. mom."; unit_data(156).value = -1.074617486e-26; unit_data(156).uncertainty = 0.000000027e-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.127625306; unit_data(158).uncertainty = 0.000000025; unit_data(158).units = ""; unit_data(159).name = "helion mass"; unit_data(159).value = 5.00641234e-27; unit_data(159).uncertainty = 0.00000022e-27; unit_data(159).units = "kg"; unit_data(160).name = "helion mass energy equivalent"; unit_data(160).value = 4.49953902e-10; unit_data(160).uncertainty = 0.00000020e-10; unit_data(160).units = "J"; unit_data(161).name = "helion mass energy equivalent in MeV"; unit_data(161).value = 2808.391482; unit_data(161).uncertainty = 0.000062; unit_data(161).units = "MeV"; unit_data(162).name = "helion mass in u"; unit_data(162).value = 3.0149322468; unit_data(162).uncertainty = 0.0000000025; unit_data(162).units = "u"; unit_data(163).name = "helion molar mass"; unit_data(163).value = 3.0149322468e-3; unit_data(163).uncertainty = 0.0000000025e-3; unit_data(163).units = "kg mol^-1"; unit_data(164).name = "helion-electron mass ratio"; unit_data(164).value = 5495.8852754; unit_data(164).uncertainty = 0.0000050; unit_data(164).units = ""; unit_data(165).name = "helion-proton mass ratio"; unit_data(165).value = 2.9931526707; unit_data(165).uncertainty = 0.0000000025; unit_data(165).units = ""; unit_data(166).name = "hertz-atomic mass unit relationship"; unit_data(166).value = 4.4398216689e-24; unit_data(166).uncertainty = 0.0000000031e-24; unit_data(166).units = "u"; unit_data(167).name = "hertz-electron volt relationship"; unit_data(167).value = 4.135667516e-15; unit_data(167).uncertainty = 0.000000091e-15; unit_data(167).units = "eV"; unit_data(168).name = "hertz-hartree relationship"; unit_data(168).value = 1.5198298460045e-16; unit_data(168).uncertainty = 0.0000000000076e-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.62606957e-34; unit_data(170).uncertainty = 0.00000029e-34; unit_data(170).units = "J"; unit_data(171).name = "hertz-kelvin relationship"; unit_data(171).value = 4.7992434e-11; unit_data(171).uncertainty = 0.0000044e-11; unit_data(171).units = "K"; unit_data(172).name = "hertz-kilogram relationship"; unit_data(172).value = 7.37249668e-51; unit_data(172).uncertainty = 0.00000033e-51; unit_data(172).units = "kg"; unit_data(173).name = "inverse fine-structure constant"; unit_data(173).value = 137.035999074; unit_data(173).uncertainty = 0.000000044; unit_data(173).units = ""; unit_data(174).name = "inverse meter-atomic mass unit relationship"; unit_data(174).value = 1.33102505120e-15; unit_data(174).uncertainty = 0.00000000094e-15; unit_data(174).units = "u"; unit_data(175).name = "inverse meter-electron volt relationship"; unit_data(175).value = 1.239841930e-6; unit_data(175).uncertainty = 0.000000027e-6; unit_data(175).units = "eV"; unit_data(176).name = "inverse meter-hartree relationship"; unit_data(176).value = 4.556335252755e-8; unit_data(176).uncertainty = 0.000000000023e-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.986445684e-25; unit_data(178).uncertainty = 0.000000088e-25; unit_data(178).units = "J"; unit_data(179).name = "inverse meter-kelvin relationship"; unit_data(179).value = 1.4387770e-2; unit_data(179).uncertainty = 0.0000013e-2; unit_data(179).units = "K"; unit_data(180).name = "inverse meter-kilogram relationship"; unit_data(180).value = 2.210218902e-42; unit_data(180).uncertainty = 0.000000098e-42; unit_data(180).units = "kg"; unit_data(181).name = "inverse of conductance quantum"; unit_data(181).value = 12906.4037217; unit_data(181).uncertainty = 0.0000042; unit_data(181).units = "ohm"; unit_data(182).name = "joule-atomic mass unit relationship"; unit_data(182).value = 6.70053585e9; unit_data(182).uncertainty = 0.00000030e9; unit_data(182).units = "u"; unit_data(183).name = "joule-electron volt relationship"; unit_data(183).value = 6.24150934e18; unit_data(183).uncertainty = 0.00000014e18; unit_data(183).units = "eV"; unit_data(184).name = "joule-hartree relationship"; unit_data(184).value = 2.29371248e17; unit_data(184).uncertainty = 0.00000010e17; unit_data(184).units = "E_h"; unit_data(185).name = "joule-hertz relationship"; unit_data(185).value = 1.509190311e33; unit_data(185).uncertainty = 0.000000067e33; unit_data(185).units = "Hz"; unit_data(186).name = "joule-inverse meter relationship"; unit_data(186).value = 5.03411701e24; unit_data(186).uncertainty = 0.00000022e24; unit_data(186).units = "m^-1"; unit_data(187).name = "joule-kelvin relationship"; unit_data(187).value = 7.2429716e22; unit_data(187).uncertainty = 0.0000066e22; 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.2510868e-14; unit_data(189).uncertainty = 0.0000084e-14; unit_data(189).units = "u"; unit_data(190).name = "kelvin-electron volt relationship"; unit_data(190).value = 8.6173324e-5; unit_data(190).uncertainty = 0.0000078e-5; unit_data(190).units = "eV"; unit_data(191).name = "kelvin-hartree relationship"; unit_data(191).value = 3.1668114e-6; unit_data(191).uncertainty = 0.0000029e-6; unit_data(191).units = "E_h"; unit_data(192).name = "kelvin-hertz relationship"; unit_data(192).value = 2.0836618e10; unit_data(192).uncertainty = 0.0000019e10; unit_data(192).units = "Hz"; unit_data(193).name = "kelvin-inverse meter relationship"; unit_data(193).value = 69.503476; unit_data(193).uncertainty = 0.000063; unit_data(193).units = "m^-1"; unit_data(194).name = "kelvin-joule relationship"; unit_data(194).value = 1.3806488e-23; unit_data(194).uncertainty = 0.0000013e-23; unit_data(194).units = "J"; unit_data(195).name = "kelvin-kilogram relationship"; unit_data(195).value = 1.5361790e-40; unit_data(195).uncertainty = 0.0000014e-40; unit_data(195).units = "kg"; unit_data(196).name = "kilogram-atomic mass unit relationship"; unit_data(196).value = 6.02214129e26; unit_data(196).uncertainty = 0.00000027e26; unit_data(196).units = "u"; unit_data(197).name = "kilogram-electron volt relationship"; unit_data(197).value = 5.60958885e35; unit_data(197).uncertainty = 0.00000012e35; unit_data(197).units = "eV"; unit_data(198).name = "kilogram-hartree relationship"; unit_data(198).value = 2.061485968e34; unit_data(198).uncertainty = 0.000000091e34; unit_data(198).units = "E_h"; unit_data(199).name = "kilogram-hertz relationship"; unit_data(199).value = 1.356392608e50; unit_data(199).uncertainty = 0.000000060e50; unit_data(199).units = "Hz"; unit_data(200).name = "kilogram-inverse meter relationship"; unit_data(200).value = 4.52443873e41; unit_data(200).uncertainty = 0.00000020e41; 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.5096582e39; unit_data(202).uncertainty = 0.0000059e39; 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.067833758e-15; unit_data(205).uncertainty = 0.000000046e-15; unit_data(205).units = "Wb"; unit_data(206).name = "molar Planck constant"; unit_data(206).value = 3.9903127176e-10; unit_data(206).uncertainty = 0.0000000028e-10; unit_data(206).units = "J s mol^-1"; unit_data(207).name = "molar Planck constant times c"; unit_data(207).value = 0.119626565779; unit_data(207).uncertainty = 0.000000000084; unit_data(207).units = "J m mol^-1"; unit_data(208).name = "molar gas constant"; unit_data(208).value = 8.3144621; unit_data(208).uncertainty = 0.0000075; 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.710953e-3; unit_data(211).uncertainty = 0.000021e-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.413968e-3; unit_data(212).uncertainty = 0.000020e-3; unit_data(212).units = "m^3 mol^-1"; unit_data(213).name = "molar volume of silicon"; unit_data(213).value = 12.05883301e-6; unit_data(213).uncertainty = 0.00000080e-6; unit_data(213).units = "m^3 mol^-1"; unit_data(214).name = "muon Compton wavelength"; unit_data(214).value = 11.73444103e-15; unit_data(214).uncertainty = 0.00000030e-15; unit_data(214).units = "m"; unit_data(215).name = "muon Compton wavelength over 2 pi"; unit_data(215).value = 1.867594294e-15; unit_data(215).uncertainty = 0.000000047e-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.49044807e-26; unit_data(217).uncertainty = 0.00000015e-26; unit_data(217).units = "J T^-1"; unit_data(218).name = "muon mag. mom. anomaly"; unit_data(218).value = 1.16592091e-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.84197044e-3; unit_data(219).uncertainty = 0.00000012e-3; unit_data(219).units = ""; unit_data(220).name = "muon mag. mom. to nuclear magneton ratio"; unit_data(220).value = -8.89059697; unit_data(220).uncertainty = 0.00000022; unit_data(220).units = ""; unit_data(221).name = "muon mass"; unit_data(221).value = 1.883531475e-28; unit_data(221).uncertainty = 0.000000096e-28; unit_data(221).units = "kg"; unit_data(222).name = "muon mass energy equivalent"; unit_data(222).value = 1.692833667e-11; unit_data(222).uncertainty = 0.000000086e-11; unit_data(222).units = "J"; unit_data(223).name = "muon mass energy equivalent in MeV"; unit_data(223).value = 105.6583715; unit_data(223).uncertainty = 0.0000035; unit_data(223).units = "MeV"; unit_data(224).name = "muon mass in u"; unit_data(224).value = 0.1134289267; unit_data(224).uncertainty = 0.0000000029; unit_data(224).units = "u"; unit_data(225).name = "muon molar mass"; unit_data(225).value = 0.1134289267e-3; unit_data(225).uncertainty = 0.0000000029e-3; unit_data(225).units = "kg mol^-1"; unit_data(226).name = "muon-electron mass ratio"; unit_data(226).value = 206.7682843; unit_data(226).uncertainty = 0.0000052; unit_data(226).units = ""; unit_data(227).name = "muon-neutron mass ratio"; unit_data(227).value = 0.1124545177; unit_data(227).uncertainty = 0.0000000028; unit_data(227).units = ""; unit_data(228).name = "muon-proton mag. mom. ratio"; unit_data(228).value = -3.183345107; unit_data(228).uncertainty = 0.000000084; unit_data(228).units = ""; unit_data(229).name = "muon-proton mass ratio"; unit_data(229).value = 0.1126095272; unit_data(229).uncertainty = 0.0000000028; 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.054571726e-34; unit_data(231).uncertainty = 0.000000047e-34; unit_data(231).units = "J s"; unit_data(232).name = "natural unit of action in eV s"; unit_data(232).value = 6.58211928e-16; unit_data(232).uncertainty = 0.00000015e-16; unit_data(232).units = "eV s"; unit_data(233).name = "natural unit of energy"; unit_data(233).value = 8.18710506e-14; unit_data(233).uncertainty = 0.00000036e-14; unit_data(233).units = "J"; unit_data(234).name = "natural unit of energy in MeV"; unit_data(234).value = 0.510998928; unit_data(234).uncertainty = 0.000000011; unit_data(234).units = "MeV"; unit_data(235).name = "natural unit of length"; unit_data(235).value = 386.15926800e-15; unit_data(235).uncertainty = 0.00000025e-15; unit_data(235).units = "m"; unit_data(236).name = "natural unit of mass"; unit_data(236).value = 9.10938291e-31; unit_data(236).uncertainty = 0.00000040e-31; unit_data(236).units = "kg"; unit_data(237).name = "natural unit of mom.um"; unit_data(237).value = 2.73092429e-22; unit_data(237).uncertainty = 0.00000012e-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.510998928; unit_data(238).uncertainty = 0.000000011; unit_data(238).units = "MeV/c"; unit_data(239).name = "natural unit of time"; unit_data(239).value = 1.28808866833e-21; unit_data(239).uncertainty = 0.00000000083e-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.3195909068e-15; unit_data(241).uncertainty = 0.0000000011e-15; unit_data(241).units = "m"; unit_data(242).name = "neutron Compton wavelength over 2 pi"; unit_data(242).value = 0.21001941568e-15; unit_data(242).uncertainty = 0.00000000017e-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.83247179e8; 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.1646943; 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.96623647e-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.91304272; unit_data(248).uncertainty = 0.00000045; unit_data(248).units = ""; unit_data(249).name = "neutron mass"; unit_data(249).value = 1.674927351e-27; unit_data(249).uncertainty = 0.000000074e-27; unit_data(249).units = "kg"; unit_data(250).name = "neutron mass energy equivalent"; unit_data(250).value = 1.505349631e-10; unit_data(250).uncertainty = 0.000000066e-10; unit_data(250).units = "J"; unit_data(251).name = "neutron mass energy equivalent in MeV"; unit_data(251).value = 939.565379; unit_data(251).uncertainty = 0.000021; unit_data(251).units = "MeV"; unit_data(252).name = "neutron mass in u"; unit_data(252).value = 1.00866491600; unit_data(252).uncertainty = 0.00000000043; unit_data(252).units = "u"; unit_data(253).name = "neutron molar mass"; unit_data(253).value = 1.00866491600e-3; unit_data(253).uncertainty = 0.00000000043e-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.6836605; unit_data(256).uncertainty = 0.0000011; unit_data(256).units = ""; unit_data(257).name = "neutron-muon mass ratio"; unit_data(257).value = 8.89248400; unit_data(257).uncertainty = 0.00000022; 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.30557392e-30; unit_data(259).uncertainty = 0.00000076e-30; unit_data(259).units = ""; unit_data(260).name = "neutron-proton mass difference energy equivalent"; unit_data(260).value = 2.07214650e-13; unit_data(260).uncertainty = 0.00000068e-13; unit_data(260).units = ""; unit_data(261).name = "neutron-proton mass difference energy equivalent in MeV"; unit_data(261).value = 1.29333217; unit_data(261).uncertainty = 0.00000042; unit_data(261).units = ""; unit_data(262).name = "neutron-proton mass difference in u"; unit_data(262).value = 0.00138844919; unit_data(262).uncertainty = 0.00000000045; unit_data(262).units = ""; unit_data(263).name = "neutron-proton mass ratio"; unit_data(263).value = 1.00137841917; unit_data(263).uncertainty = 0.00000000045; 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.05078353e-27; unit_data(265).uncertainty = 0.00000011e-27; unit_data(265).units = "J T^-1"; unit_data(266).name = "nuclear magneton in K/T"; unit_data(266).value = 3.6582682e-4; unit_data(266).uncertainty = 0.0000033e-4; unit_data(266).units = "K T^-1"; unit_data(267).name = "nuclear magneton in MHz/T"; unit_data(267).value = 7.62259357; unit_data(267).uncertainty = 0.00000017; unit_data(267).units = "MHz T^-1"; unit_data(268).name = "nuclear magneton in eV/T"; unit_data(268).value = 3.1524512605e-8; unit_data(268).uncertainty = 0.0000000022e-8; unit_data(268).units = "eV T^-1"; unit_data(269).name = "nuclear magneton in inverse meters per tesla"; unit_data(269).value = 2.542623527e-2; unit_data(269).uncertainty = 0.000000056e-2; unit_data(269).units = "m^-1 T^-1"; unit_data(270).name = "proton Compton wavelength"; unit_data(270).value = 1.32140985623e-15; unit_data(270).uncertainty = 0.00000000094e-15; unit_data(270).units = "m"; unit_data(271).name = "proton Compton wavelength over 2 pi"; unit_data(271).value = 0.21030891047e-15; unit_data(271).uncertainty = 0.00000000015e-15; unit_data(271).units = "m"; unit_data(272).name = "proton charge to mass quotient"; unit_data(272).value = 9.57883358e7; unit_data(272).uncertainty = 0.00000021e7; unit_data(272).units = "C kg^-1"; unit_data(273).name = "proton g factor"; unit_data(273).value = 5.585694713; unit_data(273).uncertainty = 0.000000046; unit_data(273).units = ""; unit_data(274).name = "proton gyromag. ratio"; unit_data(274).value = 2.675222005e8; unit_data(274).uncertainty = 0.000000063e8; unit_data(274).units = "s^-1 T^-1"; unit_data(275).name = "proton gyromag. ratio over 2 pi"; unit_data(275).value = 42.5774806; unit_data(275).uncertainty = 0.0000010; unit_data(275).units = "MHz T^-1"; unit_data(276).name = "proton mag. mom."; unit_data(276).value = 1.410606743e-26; unit_data(276).uncertainty = 0.000000033e-26; unit_data(276).units = "J T^-1"; unit_data(277).name = "proton mag. mom. to Bohr magneton ratio"; unit_data(277).value = 1.521032210e-3; unit_data(277).uncertainty = 0.000000012e-3; unit_data(277).units = ""; unit_data(278).name = "proton mag. mom. to nuclear magneton ratio"; unit_data(278).value = 2.792847356; unit_data(278).uncertainty = 0.000000023; unit_data(278).units = ""; unit_data(279).name = "proton mag. shielding correction"; unit_data(279).value = 25.694e-6; unit_data(279).uncertainty = 0.014e-6; unit_data(279).units = ""; unit_data(280).name = "proton mass"; unit_data(280).value = 1.672621777e-27; unit_data(280).uncertainty = 0.000000074e-27; unit_data(280).units = "kg"; unit_data(281).name = "proton mass energy equivalent"; unit_data(281).value = 1.503277484e-10; unit_data(281).uncertainty = 0.000000066e-10; unit_data(281).units = "J"; unit_data(282).name = "proton mass energy equivalent in MeV"; unit_data(282).value = 938.272046; unit_data(282).uncertainty = 0.000021; unit_data(282).units = "MeV"; unit_data(283).name = "proton mass in u"; unit_data(283).value = 1.007276466812; unit_data(283).uncertainty = 0.000000000090; unit_data(283).units = "u"; unit_data(284).name = "proton molar mass"; unit_data(284).value = 1.007276466812e-3; unit_data(284).uncertainty = 0.000000000090e-3; unit_data(284).units = "kg mol^-1"; unit_data(285).name = "proton rms charge radius"; unit_data(285).value = 0.8775e-15; unit_data(285).uncertainty = 0.0051e-15; unit_data(285).units = "m"; unit_data(286).name = "proton-electron mass ratio"; unit_data(286).value = 1836.15267245; unit_data(286).uncertainty = 0.00000075; unit_data(286).units = ""; unit_data(287).name = "proton-muon mass ratio"; unit_data(287).value = 8.88024331; unit_data(287).uncertainty = 0.00000022; unit_data(287).units = ""; unit_data(288).name = "proton-neutron mag. mom. ratio"; unit_data(288).value = -1.45989806; unit_data(288).uncertainty = 0.00000034; unit_data(288).units = ""; unit_data(289).name = "proton-neutron mass ratio"; unit_data(289).value = 0.99862347826; unit_data(289).uncertainty = 0.00000000045; 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.6369475520e-4; unit_data(291).uncertainty = 0.0000000024e-4; unit_data(291).units = "m^2 s^-1"; unit_data(292).name = "quantum of circulation times 2"; unit_data(292).value = 7.2738951040e-4; unit_data(292).uncertainty = 0.0000000047e-4; unit_data(292).units = "m^2 s^-1"; unit_data(293).name = "second radiation constant"; unit_data(293).value = 1.4387770e-2; unit_data(293).uncertainty = 0.0000013e-2; unit_data(293).units = "m K"; unit_data(294).name = "shielded helion gyromag. ratio"; unit_data(294).value = 2.037894659e8; unit_data(294).uncertainty = 0.000000051e8; unit_data(294).units = "s^-1 T^-1"; unit_data(295).name = "shielded helion gyromag. ratio over 2 pi"; unit_data(295).value = 32.43410084; unit_data(295).uncertainty = 0.00000081; unit_data(295).units = "MHz T^-1"; unit_data(296).name = "shielded helion mag. mom."; unit_data(296).value = -1.074553044e-26; unit_data(296).uncertainty = 0.000000027e-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.127497718; 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.761766558; unit_data(299).uncertainty = 0.000000011; 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.675153268e8; unit_data(301).uncertainty = 0.000000066e8; unit_data(301).units = "s^-1 T^-1"; unit_data(302).name = "shielded proton gyromag. ratio over 2 pi"; unit_data(302).value = 42.5763866; unit_data(302).uncertainty = 0.0000010; unit_data(302).units = "MHz T^-1"; unit_data(303).name = "shielded proton mag. mom."; unit_data(303).value = 1.410570499e-26; unit_data(303).uncertainty = 0.000000035e-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.792775598; 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.957924896; unit_data(321).uncertainty = 0.000000076; unit_data(321).units = ""; unit_data(322).name = "triton mag. mom."; unit_data(322).value = 1.504609447e-26; unit_data(322).uncertainty = 0.000000038e-26; unit_data(322).units = "J T^-1"; unit_data(323).name = "triton mag. mom. to Bohr magneton ratio"; unit_data(323).value = 1.622393657e-3; unit_data(323).uncertainty = 0.000000021e-3; unit_data(323).units = ""; unit_data(324).name = "triton mag. mom. to nuclear magneton ratio"; unit_data(324).value = 2.978962448; unit_data(324).uncertainty = 0.000000038; unit_data(324).units = ""; unit_data(325).name = "triton mass"; unit_data(325).value = 5.00735630e-27; unit_data(325).uncertainty = 0.00000022e-27; unit_data(325).units = "kg"; unit_data(326).name = "triton mass energy equivalent"; unit_data(326).value = 4.50038741e-10; unit_data(326).uncertainty = 0.00000020e-10; unit_data(326).units = "J"; unit_data(327).name = "triton mass energy equivalent in MeV"; unit_data(327).value = 2808.921005; unit_data(327).uncertainty = 0.000062; unit_data(327).units = "MeV"; unit_data(328).name = "triton mass in u"; unit_data(328).value = 3.0155007134; unit_data(328).uncertainty = 0.0000000025; unit_data(328).units = "u"; unit_data(329).name = "triton molar mass"; unit_data(329).value = 3.0155007134e-3; unit_data(329).uncertainty = 0.0000000025e-3; unit_data(329).units = "kg mol^-1"; unit_data(330).name = "triton-electron mass ratio"; unit_data(330).value = 5496.9215267; unit_data(330).uncertainty = 0.0000050; unit_data(330).units = ""; unit_data(331).name = "triton-proton mass ratio"; unit_data(331).value = 2.9937170308; unit_data(331).uncertainty = 0.0000000025; unit_data(331).units = ""; unit_data(332).name = "unified atomic mass unit"; unit_data(332).value = 1.660538921e-27; unit_data(332).uncertainty = 0.000000073e-27; unit_data(332).units = "kg"; unit_data(333).name = "von Klitzing constant"; unit_data(333).value = 25812.8074434; unit_data(333).uncertainty = 0.0000084; 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.02214129e23); %!assert(physical_constant("Bohr magneton"), 927.400968e-26); %!assert(physical_constant("Bohr magneton in Hz/T"), 13.99624555e9); %!assert(physical_constant("Bohr magneton in K/T"), 0.67171388); %!assert(physical_constant("Bohr magneton in eV/T"), 5.7883818066e-5); %!assert(physical_constant("Bohr magneton in inverse meters per tesla"), 46.6864498); %!assert(physical_constant("Bohr radius"), 0.52917721092e-10); %!assert(physical_constant("Boltzmann constant"), 1.3806488e-23); %!assert(physical_constant("Boltzmann constant in Hz/K"), 2.0836618e10); %!assert(physical_constant("Boltzmann constant in eV/K"), 8.6173324e-5); %!assert(physical_constant("Boltzmann constant in inverse meters per kelvin"), 69.503476); %!assert(physical_constant("Compton wavelength"), 2.4263102389e-12); %!assert(physical_constant("Compton wavelength over 2 pi"), 386.15926800e-15); %!assert(physical_constant("Cu x unit"), 1.00207697e-13); %!assert(physical_constant("Faraday constant"), 96485.3365); %!assert(physical_constant("Faraday constant for conventional electric current"), 96485.3321); %!assert(physical_constant("Fermi coupling constant"), 1.166364e-5); %!assert(physical_constant("Hartree energy"), 4.35974434e-18); %!assert(physical_constant("Hartree energy in eV"), 27.21138505); %!assert(physical_constant("Josephson constant"), 483597.870e9); %!assert(physical_constant("Loschmidt constant (273.15 K, 100 kPa)"), 2.6516462e25); %!assert(physical_constant("Loschmidt constant (273.15 K, 101.325 kPa)"), 2.6867805e25); %!assert(physical_constant("Mo x unit"), 1.00209952e-13); %!assert(physical_constant("Newtonian constant of gravitation"), 6.67384e-11); %!assert(physical_constant("Newtonian constant of gravitation over h-bar c"), 6.70837e-39); %!assert(physical_constant("Planck constant"), 6.62606957e-34); %!assert(physical_constant("Planck constant in eV s"), 4.135667516e-15); %!assert(physical_constant("Planck constant over 2 pi"), 1.054571726e-34); %!assert(physical_constant("Planck constant over 2 pi in eV s"), 6.58211928e-16); %!assert(physical_constant("Planck constant over 2 pi times c in MeV fm"), 197.3269718); %!assert(physical_constant("Planck length"), 1.616199e-35); %!assert(physical_constant("Planck mass"), 2.17651e-8); %!assert(physical_constant("Planck mass energy equivalent in GeV"), 1.220932e19); %!assert(physical_constant("Planck temperature"), 1.416833e32); %!assert(physical_constant("Planck time"), 5.39106e-44); %!assert(physical_constant("Rydberg constant"), 10973731.568539); %!assert(physical_constant("Rydberg constant times c in Hz"), 3.289841960364e15); %!assert(physical_constant("Rydberg constant times hc in J"), 2.179872171e-18); %!assert(physical_constant("Rydberg constant times hc in eV"), 13.60569253); %!assert(physical_constant("Sackur-Tetrode constant (1 K, 100 kPa)"), -1.1517078); %!assert(physical_constant("Sackur-Tetrode constant (1 K, 101.325 kPa)"), -1.1648708); %!assert(physical_constant("Stefan-Boltzmann constant"), 5.670373e-8); %!assert(physical_constant("Thomson cross section"), 0.6652458734e-28); %!assert(physical_constant("Wien frequency displacement law constant"), 5.8789254e10); %!assert(physical_constant("Wien wavelength displacement law constant"), 2.8977721e-3); %!assert(physical_constant("alpha particle mass"), 6.64465675e-27); %!assert(physical_constant("alpha particle mass energy equivalent"), 5.97191967e-10); %!assert(physical_constant("alpha particle mass energy equivalent in MeV"), 3727.379240); %!assert(physical_constant("alpha particle mass in u"), 4.001506179125); %!assert(physical_constant("alpha particle molar mass"), 4.001506179125e-3); %!assert(physical_constant("alpha particle-electron mass ratio"), 7294.2995361); %!assert(physical_constant("alpha particle-proton mass ratio"), 3.97259968933); %!assert(physical_constant("atomic mass constant"), 1.660538921e-27); %!assert(physical_constant("atomic mass constant energy equivalent"), 1.492417954e-10); %!assert(physical_constant("atomic mass constant energy equivalent in MeV"), 931.494061); %!assert(physical_constant("atomic mass unit-electron volt relationship"), 931.494061e6); %!assert(physical_constant("atomic mass unit-hartree relationship"), 3.4231776845e7); %!assert(physical_constant("atomic mass unit-hertz relationship"), 2.2523427168e23); %!assert(physical_constant("atomic mass unit-inverse meter relationship"), 7.5130066042e14); %!assert(physical_constant("atomic mass unit-joule relationship"), 1.492417954e-10); %!assert(physical_constant("atomic mass unit-kelvin relationship"), 1.08095408e13); %!assert(physical_constant("atomic mass unit-kilogram relationship"), 1.660538921e-27); %!assert(physical_constant("atomic unit of 1st hyperpolarizability"), 3.206361449e-53); %!assert(physical_constant("atomic unit of 2nd hyperpolarizability"), 6.23538054e-65); %!assert(physical_constant("atomic unit of action"), 1.054571726e-34); %!assert(physical_constant("atomic unit of charge"), 1.602176565e-19); %!assert(physical_constant("atomic unit of charge density"), 1.081202338e12); %!assert(physical_constant("atomic unit of current"), 6.62361795e-3); %!assert(physical_constant("atomic unit of electric dipole mom."), 8.47835326e-30); %!assert(physical_constant("atomic unit of electric field"), 5.14220652e11); %!assert(physical_constant("atomic unit of electric field gradient"), 9.71736200e21); %!assert(physical_constant("atomic unit of electric polarizability"), 1.6487772754e-41); %!assert(physical_constant("atomic unit of electric potential"), 27.21138505); %!assert(physical_constant("atomic unit of electric quadrupole mom."), 4.486551331e-40); %!assert(physical_constant("atomic unit of energy"), 4.35974434e-18); %!assert(physical_constant("atomic unit of force"), 8.23872278e-8); %!assert(physical_constant("atomic unit of length"), 0.52917721092e-10); %!assert(physical_constant("atomic unit of mag. dipole mom."), 1.854801936e-23); %!assert(physical_constant("atomic unit of mag. flux density"), 2.350517464e5); %!assert(physical_constant("atomic unit of magnetizability"), 7.891036607e-29); %!assert(physical_constant("atomic unit of mass"), 9.10938291e-31); %!assert(physical_constant("atomic unit of mom.um"), 1.992851740e-24); %!assert(physical_constant("atomic unit of permittivity"), 1.112650056e-10); %!assert(physical_constant("atomic unit of time"), 2.418884326502e-17); %!assert(physical_constant("atomic unit of velocity"), 2.18769126379e6); %!assert(physical_constant("characteristic impedance of vacuum"), 376.730313461); %!assert(physical_constant("classical electron radius"), 2.8179403267e-15); %!assert(physical_constant("conductance quantum"), 7.7480917346e-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.8574382308); %!assert(physical_constant("deuteron mag. mom."), 0.433073489e-26); %!assert(physical_constant("deuteron mag. mom. to Bohr magneton ratio"), 0.4669754556e-3); %!assert(physical_constant("deuteron mag. mom. to nuclear magneton ratio"), 0.8574382308); %!assert(physical_constant("deuteron mass"), 3.34358348e-27); %!assert(physical_constant("deuteron mass energy equivalent"), 3.00506297e-10); %!assert(physical_constant("deuteron mass energy equivalent in MeV"), 1875.612859); %!assert(physical_constant("deuteron mass in u"), 2.013553212712); %!assert(physical_constant("deuteron molar mass"), 2.013553212712e-3); %!assert(physical_constant("deuteron rms charge radius"), 2.1424e-15); %!assert(physical_constant("deuteron-electron mag. mom. ratio"), -4.664345537e-4); %!assert(physical_constant("deuteron-electron mass ratio"), 3670.4829652); %!assert(physical_constant("deuteron-neutron mag. mom. ratio"), -0.44820652); %!assert(physical_constant("deuteron-proton mag. mom. ratio"), 0.3070122070); %!assert(physical_constant("deuteron-proton mass ratio"), 1.99900750097); %!assert(physical_constant("electric constant"), 8.854187817e-12); %!assert(physical_constant("electron charge to mass quotient"), -1.758820088e11); %!assert(physical_constant("electron g factor"), -2.00231930436153); %!assert(physical_constant("electron gyromag. ratio"), 1.760859708e11); %!assert(physical_constant("electron gyromag. ratio over 2 pi"), 28024.95266); %!assert(physical_constant("electron mag. mom."), -928.476430e-26); %!assert(physical_constant("electron mag. mom. anomaly"), 1.15965218076e-3); %!assert(physical_constant("electron mag. mom. to Bohr magneton ratio"), -1.00115965218076); %!assert(physical_constant("electron mag. mom. to nuclear magneton ratio"), -1838.28197090); %!assert(physical_constant("electron mass"), 9.10938291e-31); %!assert(physical_constant("electron mass energy equivalent"), 8.18710506e-14); %!assert(physical_constant("electron mass energy equivalent in MeV"), 0.510998928); %!assert(physical_constant("electron mass in u"), 5.4857990946e-4); %!assert(physical_constant("electron molar mass"), 5.4857990946e-7); %!assert(physical_constant("electron to alpha particle mass ratio"), 1.37093355578e-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.602176565e-19); %!assert(physical_constant("electron volt-atomic mass unit relationship"), 1.073544150e-9); %!assert(physical_constant("electron volt-hartree relationship"), 3.674932379e-2); %!assert(physical_constant("electron volt-hertz relationship"), 2.417989348e14); %!assert(physical_constant("electron volt-inverse meter relationship"), 8.06554429e5); %!assert(physical_constant("electron volt-joule relationship"), 1.602176565e-19); %!assert(physical_constant("electron volt-kelvin relationship"), 1.1604519e4); %!assert(physical_constant("electron volt-kilogram relationship"), 1.782661845e-36); %!assert(physical_constant("electron-deuteron mag. mom. ratio"), -2143.923498); %!assert(physical_constant("electron-deuteron mass ratio"), 2.7244371095e-4); %!assert(physical_constant("electron-helion mass ratio"), 1.8195430761e-4); %!assert(physical_constant("electron-muon mag. mom. ratio"), 206.7669896); %!assert(physical_constant("electron-muon mass ratio"), 4.83633166e-3); %!assert(physical_constant("electron-neutron mag. mom. ratio"), 960.92050); %!assert(physical_constant("electron-neutron mass ratio"), 5.4386734461e-4); %!assert(physical_constant("electron-proton mag. mom. ratio"), -658.2106848); %!assert(physical_constant("electron-proton mass ratio"), 5.4461702178e-4); %!assert(physical_constant("electron-tau mass ratio"), 2.87592e-4); %!assert(physical_constant("electron-triton mass ratio"), 1.8192000653e-4); %!assert(physical_constant("elementary charge"), 1.602176565e-19); %!assert(physical_constant("elementary charge over h"), 2.417989348e14); %!assert(physical_constant("fine-structure constant"), 7.2973525698e-3); %!assert(physical_constant("first radiation constant"), 3.74177153e-16); %!assert(physical_constant("first radiation constant for spectral radiance"), 1.191042869e-16); %!assert(physical_constant("hartree-atomic mass unit relationship"), 2.9212623246e-8); %!assert(physical_constant("hartree-electron volt relationship"), 27.21138505); %!assert(physical_constant("hartree-hertz relationship"), 6.579683920729e15); %!assert(physical_constant("hartree-inverse meter relationship"), 2.194746313708e7); %!assert(physical_constant("hartree-joule relationship"), 4.35974434e-18); %!assert(physical_constant("hartree-kelvin relationship"), 3.1577504e5); %!assert(physical_constant("hartree-kilogram relationship"), 4.85086979e-35); %!assert(physical_constant("helion g factor"), -4.255250613); %!assert(physical_constant("helion mag. mom."), -1.074617486e-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.127625306); %!assert(physical_constant("helion mass"), 5.00641234e-27); %!assert(physical_constant("helion mass energy equivalent"), 4.49953902e-10); %!assert(physical_constant("helion mass energy equivalent in MeV"), 2808.391482); %!assert(physical_constant("helion mass in u"), 3.0149322468); %!assert(physical_constant("helion molar mass"), 3.0149322468e-3); %!assert(physical_constant("helion-electron mass ratio"), 5495.8852754); %!assert(physical_constant("helion-proton mass ratio"), 2.9931526707); %!assert(physical_constant("hertz-atomic mass unit relationship"), 4.4398216689e-24); %!assert(physical_constant("hertz-electron volt relationship"), 4.135667516e-15); %!assert(physical_constant("hertz-hartree relationship"), 1.5198298460045e-16); %!assert(physical_constant("hertz-inverse meter relationship"), 3.335640951e-9); %!assert(physical_constant("hertz-joule relationship"), 6.62606957e-34); %!assert(physical_constant("hertz-kelvin relationship"), 4.7992434e-11); %!assert(physical_constant("hertz-kilogram relationship"), 7.37249668e-51); %!assert(physical_constant("inverse fine-structure constant"), 137.035999074); %!assert(physical_constant("inverse meter-atomic mass unit relationship"), 1.33102505120e-15); %!assert(physical_constant("inverse meter-electron volt relationship"), 1.239841930e-6); %!assert(physical_constant("inverse meter-hartree relationship"), 4.556335252755e-8); %!assert(physical_constant("inverse meter-hertz relationship"), 299792458); %!assert(physical_constant("inverse meter-joule relationship"), 1.986445684e-25); %!assert(physical_constant("inverse meter-kelvin relationship"), 1.4387770e-2); %!assert(physical_constant("inverse meter-kilogram relationship"), 2.210218902e-42); %!assert(physical_constant("inverse of conductance quantum"), 12906.4037217); %!assert(physical_constant("joule-atomic mass unit relationship"), 6.70053585e9); %!assert(physical_constant("joule-electron volt relationship"), 6.24150934e18); %!assert(physical_constant("joule-hartree relationship"), 2.29371248e17); %!assert(physical_constant("joule-hertz relationship"), 1.509190311e33); %!assert(physical_constant("joule-inverse meter relationship"), 5.03411701e24); %!assert(physical_constant("joule-kelvin relationship"), 7.2429716e22); %!assert(physical_constant("joule-kilogram relationship"), 1.112650056e-17); %!assert(physical_constant("kelvin-atomic mass unit relationship"), 9.2510868e-14); %!assert(physical_constant("kelvin-electron volt relationship"), 8.6173324e-5); %!assert(physical_constant("kelvin-hartree relationship"), 3.1668114e-6); %!assert(physical_constant("kelvin-hertz relationship"), 2.0836618e10); %!assert(physical_constant("kelvin-inverse meter relationship"), 69.503476); %!assert(physical_constant("kelvin-joule relationship"), 1.3806488e-23); %!assert(physical_constant("kelvin-kilogram relationship"), 1.5361790e-40); %!assert(physical_constant("kilogram-atomic mass unit relationship"), 6.02214129e26); %!assert(physical_constant("kilogram-electron volt relationship"), 5.60958885e35); %!assert(physical_constant("kilogram-hartree relationship"), 2.061485968e34); %!assert(physical_constant("kilogram-hertz relationship"), 1.356392608e50); %!assert(physical_constant("kilogram-inverse meter relationship"), 4.52443873e41); %!assert(physical_constant("kilogram-joule relationship"), 8.987551787e16); %!assert(physical_constant("kilogram-kelvin relationship"), 6.5096582e39); %!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.067833758e-15); %!assert(physical_constant("molar Planck constant"), 3.9903127176e-10); %!assert(physical_constant("molar Planck constant times c"), 0.119626565779); %!assert(physical_constant("molar gas constant"), 8.3144621); %!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.710953e-3); %!assert(physical_constant("molar volume of ideal gas (273.15 K, 101.325 kPa)"), 22.413968e-3); %!assert(physical_constant("molar volume of silicon"), 12.05883301e-6); %!assert(physical_constant("muon Compton wavelength"), 11.73444103e-15); %!assert(physical_constant("muon Compton wavelength over 2 pi"), 1.867594294e-15); %!assert(physical_constant("muon g factor"), -2.0023318418); %!assert(physical_constant("muon mag. mom."), -4.49044807e-26); %!assert(physical_constant("muon mag. mom. anomaly"), 1.16592091e-3); %!assert(physical_constant("muon mag. mom. to Bohr magneton ratio"), -4.84197044e-3); %!assert(physical_constant("muon mag. mom. to nuclear magneton ratio"), -8.89059697); %!assert(physical_constant("muon mass"), 1.883531475e-28); %!assert(physical_constant("muon mass energy equivalent"), 1.692833667e-11); %!assert(physical_constant("muon mass energy equivalent in MeV"), 105.6583715); %!assert(physical_constant("muon mass in u"), 0.1134289267); %!assert(physical_constant("muon molar mass"), 0.1134289267e-3); %!assert(physical_constant("muon-electron mass ratio"), 206.7682843); %!assert(physical_constant("muon-neutron mass ratio"), 0.1124545177); %!assert(physical_constant("muon-proton mag. mom. ratio"), -3.183345107); %!assert(physical_constant("muon-proton mass ratio"), 0.1126095272); %!assert(physical_constant("muon-tau mass ratio"), 5.94649e-2); %!assert(physical_constant("natural unit of action"), 1.054571726e-34); %!assert(physical_constant("natural unit of action in eV s"), 6.58211928e-16); %!assert(physical_constant("natural unit of energy"), 8.18710506e-14); %!assert(physical_constant("natural unit of energy in MeV"), 0.510998928); %!assert(physical_constant("natural unit of length"), 386.15926800e-15); %!assert(physical_constant("natural unit of mass"), 9.10938291e-31); %!assert(physical_constant("natural unit of mom.um"), 2.73092429e-22); %!assert(physical_constant("natural unit of mom.um in MeV/c"), 0.510998928); %!assert(physical_constant("natural unit of time"), 1.28808866833e-21); %!assert(physical_constant("natural unit of velocity"), 299792458); %!assert(physical_constant("neutron Compton wavelength"), 1.3195909068e-15); %!assert(physical_constant("neutron Compton wavelength over 2 pi"), 0.21001941568e-15); %!assert(physical_constant("neutron g factor"), -3.82608545); %!assert(physical_constant("neutron gyromag. ratio"), 1.83247179e8); %!assert(physical_constant("neutron gyromag. ratio over 2 pi"), 29.1646943); %!assert(physical_constant("neutron mag. mom."), -0.96623647e-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.91304272); %!assert(physical_constant("neutron mass"), 1.674927351e-27); %!assert(physical_constant("neutron mass energy equivalent"), 1.505349631e-10); %!assert(physical_constant("neutron mass energy equivalent in MeV"), 939.565379); %!assert(physical_constant("neutron mass in u"), 1.00866491600); %!assert(physical_constant("neutron molar mass"), 1.00866491600e-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.6836605); %!assert(physical_constant("neutron-muon mass ratio"), 8.89248400); %!assert(physical_constant("neutron-proton mag. mom. ratio"), -0.68497934); %!assert(physical_constant("neutron-proton mass difference"), 2.30557392e-30); %!assert(physical_constant("neutron-proton mass difference energy equivalent"), 2.07214650e-13); %!assert(physical_constant("neutron-proton mass difference energy equivalent in MeV"), 1.29333217); %!assert(physical_constant("neutron-proton mass difference in u"), 0.00138844919); %!assert(physical_constant("neutron-proton mass ratio"), 1.00137841917); %!assert(physical_constant("neutron-tau mass ratio"), 0.528790); %!assert(physical_constant("nuclear magneton"), 5.05078353e-27); %!assert(physical_constant("nuclear magneton in K/T"), 3.6582682e-4); %!assert(physical_constant("nuclear magneton in MHz/T"), 7.62259357); %!assert(physical_constant("nuclear magneton in eV/T"), 3.1524512605e-8); %!assert(physical_constant("nuclear magneton in inverse meters per tesla"), 2.542623527e-2); %!assert(physical_constant("proton Compton wavelength"), 1.32140985623e-15); %!assert(physical_constant("proton Compton wavelength over 2 pi"), 0.21030891047e-15); %!assert(physical_constant("proton charge to mass quotient"), 9.57883358e7); %!assert(physical_constant("proton g factor"), 5.585694713); %!assert(physical_constant("proton gyromag. ratio"), 2.675222005e8); %!assert(physical_constant("proton gyromag. ratio over 2 pi"), 42.5774806); %!assert(physical_constant("proton mag. mom."), 1.410606743e-26); %!assert(physical_constant("proton mag. mom. to Bohr magneton ratio"), 1.521032210e-3); %!assert(physical_constant("proton mag. mom. to nuclear magneton ratio"), 2.792847356); %!assert(physical_constant("proton mag. shielding correction"), 25.694e-6); %!assert(physical_constant("proton mass"), 1.672621777e-27); %!assert(physical_constant("proton mass energy equivalent"), 1.503277484e-10); %!assert(physical_constant("proton mass energy equivalent in MeV"), 938.272046); %!assert(physical_constant("proton mass in u"), 1.007276466812); %!assert(physical_constant("proton molar mass"), 1.007276466812e-3); %!assert(physical_constant("proton rms charge radius"), 0.8775e-15); %!assert(physical_constant("proton-electron mass ratio"), 1836.15267245); %!assert(physical_constant("proton-muon mass ratio"), 8.88024331); %!assert(physical_constant("proton-neutron mag. mom. ratio"), -1.45989806); %!assert(physical_constant("proton-neutron mass ratio"), 0.99862347826); %!assert(physical_constant("proton-tau mass ratio"), 0.528063); %!assert(physical_constant("quantum of circulation"), 3.6369475520e-4); %!assert(physical_constant("quantum of circulation times 2"), 7.2738951040e-4); %!assert(physical_constant("second radiation constant"), 1.4387770e-2); %!assert(physical_constant("shielded helion gyromag. ratio"), 2.037894659e8); %!assert(physical_constant("shielded helion gyromag. ratio over 2 pi"), 32.43410084); %!assert(physical_constant("shielded helion mag. mom."), -1.074553044e-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.127497718); %!assert(physical_constant("shielded helion to proton mag. mom. ratio"), -0.761766558); %!assert(physical_constant("shielded helion to shielded proton mag. mom. ratio"), -0.7617861313); %!assert(physical_constant("shielded proton gyromag. ratio"), 2.675153268e8); %!assert(physical_constant("shielded proton gyromag. ratio over 2 pi"), 42.5763866); %!assert(physical_constant("shielded proton mag. mom."), 1.410570499e-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.792775598); %!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.957924896); %!assert(physical_constant("triton mag. mom."), 1.504609447e-26); %!assert(physical_constant("triton mag. mom. to Bohr magneton ratio"), 1.622393657e-3); %!assert(physical_constant("triton mag. mom. to nuclear magneton ratio"), 2.978962448); %!assert(physical_constant("triton mass"), 5.00735630e-27); %!assert(physical_constant("triton mass energy equivalent"), 4.50038741e-10); %!assert(physical_constant("triton mass energy equivalent in MeV"), 2808.921005); %!assert(physical_constant("triton mass in u"), 3.0155007134); %!assert(physical_constant("triton molar mass"), 3.0155007134e-3); %!assert(physical_constant("triton-electron mass ratio"), 5496.9215267); %!assert(physical_constant("triton-proton mass ratio"), 2.9937170308); %!assert(physical_constant("unified atomic mass unit"), 1.660538921e-27); %!assert(physical_constant("von Klitzing constant"), 25812.8074434); %!assert(physical_constant("weak mixing angle"), 0.2223); %!assert(physical_constant("{220} lattice spacing of silicon"), 192.0155714e-12); miscellaneous-1.2.1/inst/solvesudoku.m0000644000175000017500000001171512344005534016525 0ustar olafolaf## 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.2.1/inst/ascii.m0000644000175000017500000000601412344005534015226 0ustar olafolaf## 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.2.1/inst/legendrepoly.m0000644000175000017500000000334312344005534016631 0ustar olafolaf## 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.2.1/inst/units.m0000644000175000017500000001445412344005534015307 0ustar olafolaf## Copyright (C) 2005 Carl Osterwisch ## 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} {} 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 available = check_units (); persistent compact = has_compact_option (); persistent template = template_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 fpath = check_units () ## See bug #38270 about why we're checking this way. fpath = file_in_path (getenv ("PATH"), sprintf ("units%s", octave_config_info ("EXEEXT"))); if (isempty (fpath)) error ("units: %s\nVerify that GNU units is installed in the current path.", rawoutput); endif endfunction function compact = has_compact_option () 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 [status, rawoutput] = system ('units --compact --one-line "in" "cm"'); if (status) compact = false; endif endfunction function template = template_cmd (compact) ## do we have the format option? format = true; [status, rawoutput] = system ('units --output-format "%.16g" "in" "cm"'); if (status) format = false; endif template = "units "; if (format) template = [template '--output-format "%%.16g" ']; endif if (compact) template = [template '--compact --one-line ']; endif 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.2.1/inst/zagzig.m0000644000175000017500000000502612344005534015433 0ustar olafolaf## 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.2.1/inst/slurp_file.m0000644000175000017500000000316712344005534016310 0ustar olafolaf## 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.2.1/inst/reduce.m0000644000175000017500000000471712344005534015415 0ustar olafolaf## 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(@@add,[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 || (class(func)!='function_handle') || (nargin == 2 && length(lst)<2) print_usage(); end l=length(lst); if (l<2 && nargin==3) if(l==0) rv=init; elseif (l==1) rv=func(init,lst(1)); end return; end if(nargin == 3) rv=func(init,lst(1)); start=2; else rv=func(lst(1),lst(2)); start=3; end for i=start:l rv=func(rv,lst(i)); end end %!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.2.1/inst/match.m0000644000175000017500000000530212344005534015231 0ustar olafolaf## 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.2.1/inst/private/0002755000175000017500000000000012344005534015433 5ustar olafolafmiscellaneous-1.2.1/inst/private/strsplit.m0000644000175000017500000001001012344005534017463 0ustar olafolaf## Copyright (C) 2009-2012 Jaroslav Hajek ## ## This file is part of Octave. ## ## Octave 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. ## ## Octave 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 Octave; see the file COPYING. If not, see ## . ## ## FIXME: this file is here to avoid conflicts with new Octave versions. Matlab ## has recently added strplit function (used to exist in Octave only) but ## their syntax is not compatible with ours. Rather than timing the ## release of each octave forge package that used strsplit, a copy of the ## old version was placed as private. Once the new Octave version is ## released, this file can be removed, and the calls to strsplit fixed. ## -*- texinfo -*- ## @deftypefn {Function File} {[@var{cstr}] =} strsplit (@var{s}, @var{sep}) ## @deftypefnx {Function File} {[@var{cstr}] =} strsplit (@var{s}, @var{sep}, @var{strip_empty}) ## Split the string @var{s} using one or more separators @var{sep} and return ## a cell array of strings. Consecutive separators and separators at ## boundaries result in empty strings, unless @var{strip_empty} is true. ## The default value of @var{strip_empty} is false. ## ## 2-D character arrays are split at separators and at the original column ## boundaries. ## ## Example: ## ## @example ## @group ## strsplit ("a,b,c", ",") ## @result{} ## @{ ## [1,1] = a ## [1,2] = b ## [1,3] = c ## @} ## ## strsplit (["a,b" ; "cde"], ",") ## @result{} ## @{ ## [1,1] = a ## [1,2] = b ## [1,3] = cde ## @} ## @end group ## @end example ## @seealso{strtok} ## @end deftypefn function cstr = strsplit (s, sep, strip_empty = false) if (nargin < 2 || nargin > 3) print_usage (); elseif (! ischar (s) || ! ischar (sep)) error ("strsplit: S and SEP must be string values"); elseif (! isscalar (strip_empty)) error ("strsplit: STRIP_EMPTY must be a scalar value"); endif if (isempty (s)) cstr = cell (size (s)); else if (rows (s) > 1) ## For 2-D arrays, add separator character at line boundaries ## and transform to single string s(:, end+1) = sep(1); s = reshape (s.', 1, numel (s)); s(end) = []; endif ## Split s according to delimiter if (isscalar (sep)) ## Single separator idx = find (s == sep); else ## Multiple separators idx = strchr (s, sep); endif ## Get substring lengths. if (isempty (idx)) strlens = length (s); else strlens = [idx(1)-1, diff(idx)-1, numel(s)-idx(end)]; endif ## Remove separators. s(idx) = []; if (strip_empty) ## Omit zero lengths. strlens = strlens(strlens != 0); endif ## Convert! cstr = mat2cell (s, 1, strlens); endif endfunction %!assert (strsplit ("road to hell", " "), {"road", "to", "hell"}) %!assert (strsplit ("road to^hell", " ^"), {"road", "to", "hell"}) %!assert (strsplit ("road to--hell", " -", true), {"road", "to", "hell"}) %!assert (strsplit (["a,bc";",de"], ","), {"a", "bc", char(ones(1,0)), "de "}) %!assert (strsplit (["a,bc";",de"], ",", true), {"a", "bc", "de "}) %!assert (strsplit (["a,bc";",de"], ", ", true), {"a", "bc", "de"}) %% Test input validation %!error strsplit () %!error strsplit ("abc") %!error strsplit ("abc", "b", true, 4) %!error strsplit (123, "b") %!error strsplit ("abc", 1) %!error strsplit ("abc", "def", ones (3,3)) miscellaneous-1.2.1/inst/truncate.m0000644000175000017500000000321712344005534015765 0ustar olafolaf%% 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.2.1/inst/clip.m0000644000175000017500000000425612344005534015073 0ustar olafolaf## 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.2.1/inst/peano_curve.m0000644000175000017500000000567712344005534016462 0ustar olafolaf## 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.2.1/inst/gameoflife.m0000644000175000017500000000344112344005534016235 0ustar olafolaf## 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.2.1/inst/colorboard.m0000644000175000017500000001127112344005534016265 0ustar olafolaf## 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.2.1/inst/infoskeleton.m0000644000175000017500000000701012344005534016633 0ustar olafolaf## 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.2.1/inst/asci.m0000644000175000017500000000246312344005534015061 0ustar olafolaf## 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.2.1/inst/normr.m0000644000175000017500000000341112344005534015271 0ustar olafolaf## 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.2.1/inst/read_options.m0000644000175000017500000001472212344005534016631 0ustar olafolaf## 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.2.1/inst/chebyshevpoly.m0000644000175000017500000000407312344005534017025 0ustar olafolaf## 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.2.1/inst/hermitepoly.m0000644000175000017500000011675412344005534016514 0ustar olafolaf## 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.2.1/PKG_ADD0000644000175000017500000000012412344005534014013 0ustar olafolafautoload ("partcnt", fullfile (fileparts (mfilename ("fullpath")), "partint.oct")); miscellaneous-1.2.1/DESCRIPTION0000644000175000017500000000070112344005534014506 0ustar olafolafName: Miscellaneous Version: 1.2.1 Date: 2014-06-05 Author: various authors Maintainer: Octave-Forge community Title: Miscellaneous functions Description: Miscellaneous tools that don't fit somewhere else. Categories: Miscellaneous Depends: octave (>= 3.6.0), general (>= 1.3.1) Autoload: no SystemRequirements: units BuildRequires: termcap-devel [Debian] libncurses5-dev License: GPLv3+ Url: http://octave.sf.net miscellaneous-1.2.1/COPYING0000644000175000017500000010451312344005534014041 0ustar olafolaf 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.2.1/NEWS0000644000175000017500000000654512344005534013513 0ustar olafolafSummary of important user-visible changes for the miscellaneous package ------------------------------------------------------------------------ =============================================================================== 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.2.1/src/0002755000175000017500000000000012344005675013601 5ustar olafolafmiscellaneous-1.2.1/src/configure0000755000175000017500000031432412344005660015507 0ustar olafolaf#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for Octave-Forge miscellaneous package 1.2.0+. # # # Copyright (C) 1992-1996, 1998-2012 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 if test -n "${ZSH_VERSION+set}" && (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 case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; 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 # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # 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 test -z "$as_dir" && as_dir=. 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # 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'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_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="if test -n \"\${ZSH_VERSION+set}\" && (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 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 exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || 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_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else 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 test -z "$as_dir" && as_dir=. 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_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS 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'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$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_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=`$as_echo "$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 || $as_echo 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_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_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # 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 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$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 || $as_echo 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" || { $as_echo "$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 } 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 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.2.0+' PACKAGE_STRING='Octave-Forge miscellaneous package 1.2.0+' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='UNITS_AVAILABLE ac_ct_CXX CXXFLAGS CXX EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC 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 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 CPP 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' 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 # Accept the important Cygnus configure options, so we can diagnose typos. 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=`$as_echo "$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=`$as_echo "$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 ;; -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=`$as_echo "$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=`$as_echo "$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. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$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" ;; *) $as_echo "$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 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 || $as_echo 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.2.0+ 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] --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.2.0+:";; 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 CPP C preprocessor 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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$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 guested configure. 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 $as_echo "$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.2.0+ generated by GNU Autoconf 2.69 Copyright (C) 2012 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 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\"" $as_echo "$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 $as_echo "$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_echo "$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_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" 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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 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 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$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_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else 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 eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$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 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\"" $as_echo "$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 $as_echo "$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_echo "$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 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.2.0+, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _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 test -z "$as_dir" && as_dir=. $as_echo "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=`$as_echo "$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=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## 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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$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 $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$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 $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # 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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$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=`$as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`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 ## 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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. $as_echo "$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\"" $as_echo "$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 $as_echo "$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 () { ; 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$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+set}" = set && 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 ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$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_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$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 () { 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$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 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$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_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*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 don't provoke an error unfortunately, instead are silently treated as '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's necessary to write '\x00'==0 to get something that's 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 **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _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 test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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=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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_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 test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "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_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_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_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "term.h" "ac_cv_header_term_h" "$ac_includes_default" if test "x$ac_cv_header_term_h" = xyes; then : else ac_fn_c_check_header_mongrel "$LINENO" "termcap.h" "ac_cv_header_termcap_h" "$ac_includes_default" if test "x$ac_cv_header_termcap_h" = xyes; then : else as_fn_error $? "Unable to find ncurses library headers." "$LINENO" 5 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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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. $as_echo "$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\"" $as_echo "$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 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; 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_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_UNITS_AVAILABLE+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNITS_AVAILABLE" >&5 $as_echo "$UNITS_AVAILABLE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 miscellaneous-1.2.1/src/text_waitbar.cc0000644000175000017500000001760012344005534016601 0ustar olafolaf// Copyright (C) 2002 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 // 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 #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.2.1/src/cell2cell.cc0000644000175000017500000000560412344005534015746 0ustar olafolaf// Copyright (C) 2010 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 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 (); } Cell c = args(0).cell_value (); if (error_state) { error ("%s: first argument must be a cell array", fname.c_str ()); return octave_value_list (); } octave_idx_type dim = args(1).int_value (); if (error_state) { error ("%s: second argument must be an 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); } miscellaneous-1.2.1/src/Makefile0000644000175000017500000000025012344005534015226 0ustar olafolafMKOCTFILE ?= mkoctfile -Wall PROGS = $(patsubst %.cc,%.oct,$(wildcard *.cc)) all: $(PROGS) %.oct: %.cc $(MKOCTFILE) $< clean: rm -f *.o octave-core core *.oct *~ miscellaneous-1.2.1/src/bootstrap0000755000175000017500000000030012344005534015525 0ustar olafolaf#!/bin/bash ## Octave-Forge: miscellaneous package bootstrap script ## Run this to generate the configure script set -e # halt if unhandled error autoconf # generate configure script miscellaneous-1.2.1/src/partint.h0000644000175000017500000000434012344005534015424 0ustar olafolaf// Copyright (C) 2006 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 . 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.2.1/src/configure.ac0000644000175000017500000000077212344005534016065 0ustar olafolafAC_PREREQ([2.67]) AC_INIT([Octave-Forge miscellaneous package], [1.2.0+]) ## these are C headers required for text_waitbar AC_CHECK_HEADER([term.h], [], [AC_CHECK_HEADER([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 miscellaneous-1.2.1/src/partint.cc0000644000175000017500000001253112344005534015563 0ustar olafolaf// Copyright (C) 2006 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 "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 . #include #include "randmtzig.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(oct_randu()*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 */