miscellaneous/src/text_waitbar.cc0000644000175000017500000001760011730535113020517 0ustar carandraugcarandraug// 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/src/cell2cell.cc0000644000175000017500000000560411733424130017663 0ustar carandraugcarandraug// 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/src/partint.cc0000644000175000017500000001253111745334750017513 0ustar carandraugcarandraug// 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 */ miscellaneous/src/partint.h0000644000175000017500000000434011745334750017354 0ustar carandraugcarandraug// 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/src/partarray.cc0000644000175000017500000002033511733423063020031 0ustar carandraugcarandraug// Copyright (C) 2010,2011 Olaf Till // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see . #include #include template static Cell do_partarray (const NDA& a, const std::string& fname, const octave_value_list& args) { // FIXME: some type-independent code should probably go into an // extra function (no template) to avoid its repetitive instanciation int nidc = args.length () - 1; dim_vector dv = a.dims (); int ndims = dv.length (); int maxdims = ndims > nidc ? ndims : nidc; Array alldims (dim_vector (maxdims, 1)); for (int i = 0; i < maxdims; alldims(i) = i < ndims ? dv(i) : 1, i++); int nc = 1; Array nidx (dim_vector (maxdims, 1)); // Octave-3.2.4 reports "missing symbol" with Array >, // though 3.3.54+ does not Array bidc [maxdims], eidc [maxdims]; // Array step (dim_vector (maxdims, 1)); step(0) = 1; for (int i = 0; i < maxdims; i++) { int cnidx; octave_value arg; if (i >= nidc || (arg = args(i + 1)).is_empty ()) { Array bidx (dim_vector (1, 1), 1); Array eidx (dim_vector (1, 1), alldims(i)); bidc[i] = bidx; eidc[i] = eidx; cnidx = 1; } else { dim_vector argdims = arg.dims (); if (argdims.length () > 2 || argdims(1) != 2) { error ("%s: argument %i: wrong dimensions", fname.c_str (), i + 2); return Cell (); } cnidx = (bidc[i] = octave_value (arg.matrix_value ().column (0)). octave_idx_type_vector_value ()).length (); eidc[i] = octave_value (arg.matrix_value ().column (1)). octave_idx_type_vector_value (); for (int j = 0; j < cnidx; j++) { if (bidc[i](j) < 1 || eidc[i](j) > alldims(i)) error ("%s: index given by row %i of argument %i exceeds array dimensions", fname.c_str (), j, i + 2); if (bidc[i](j) > eidc[i](j)) // so later length calculations yield 0 eidc[i](j) = bidc[i](j) - 1; } } nc *= (nidx(i) = cnidx); if (i < maxdims - 1) step(i + 1) = step(i) * alldims(i); } if (error_state) return Cell (); dim_vector rdv (nc, 1); Cell retval (rdv); // preparations are done, start now; take care, indices are // one-based, since given by user // go through all combinations of indices into user indices Array cidx (dim_vector (maxdims, 1), 0); // current combination for (int i = 0; i < nc; i++) { // set cursor to start of subarray and calculate some lengths octave_idx_type n = 1, cursor = 0; Array lengths (dim_vector (maxdims, 1)); for (int j = 0; j < maxdims; j++) { octave_idx_type begin = bidc[j](cidx(j)); octave_idx_type end = eidc[j](cidx(j)); octave_idx_type length = end + 1 - begin; lengths(j) = length; n *= length; cursor += (begin - 1) * step(j); } Array starts (dim_vector (maxdims - 1, 1), cursor); Array idx_cursors (dim_vector (maxdims, 1), 0); // copy the subarray dim_vector subdv; subdv.resize (maxdims); for (octave_idx_type k = 0; k < maxdims; k++) subdv(k) = lengths(k); NDA asub (subdv); for (octave_idx_type k = 0; k < n; k++) { asub(k) = a(cursor++); idx_cursors(0)++; for (int l = 0; l < maxdims - 1; l++) { if (idx_cursors(l) == lengths(l)) { idx_cursors(l) = 0; idx_cursors(l + 1)++; cursor = starts(l) + step(l + 1); for (int m = 0; m <= l; starts(m) = cursor, m++); } } } // insert subarray into cell retval(i, 0) = octave_value (asub); // prepare next combination cidx(0)++; for (int j = 0; j < maxdims - 1; j++) if (cidx(j) >= nidx(j)) { cidx(j) = 0; cidx(j + 1)++; } } return retval; } DEFUN_DLD (partarray, args, , "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} partarray (@var{a}, @var{idx}, @dots{})\n\ Return a column cell array with subarrays of the @var{a}. Start and end indices of subarrays are given in the rows of @var{idx}. @var{idx} can be given for each dimension, empty @var{idx} means no partitioning in the respective dimension. Order of returned subarrays: rows of @var{idx} of some dimension are completely used before using the next row of @var{idx} of the higher dimension.\n\ \n\ Does not work with structure arrays at the moment.\n\ @end deftypefn") { static bool warned = false; if (!warned){ warning_with_id ("Octave:deprecated-function", "partarray has been deprecated, and will be removed in the future. Use `mat2cell' instead."); warned = true; } std::string fname ("partarray"); if (args.length () == 0) { print_usage (); return octave_value_list (); } octave_value array = args(0); octave_value retval; // The idea to use a function template was taken from Octaves // num2cell in src/DLD-FUNCTIONS/cellfun.cc. The following code, // which distinguishes the applicable types for the template, was // cut and pasted from there and adapted. if (array.is_bool_type ()) retval = do_partarray (array.bool_array_value (), fname, args); else if (array.is_char_matrix ()) retval = do_partarray (array.char_array_value (), fname, args); else if (array.is_numeric_type ()) { if (array.is_integer_type ()) { if (array.is_int8_type ()) retval = do_partarray (array.int8_array_value (), fname, args); else if (array.is_int16_type ()) retval = do_partarray (array.int16_array_value (), fname, args); else if (array.is_int32_type ()) retval = do_partarray (array.int32_array_value (), fname, args); else if (array.is_int64_type ()) retval = do_partarray (array.int64_array_value (), fname, args); else if (array.is_uint8_type ()) retval = do_partarray (array.uint8_array_value (), fname, args); else if (array.is_uint16_type ()) retval = do_partarray (array.uint16_array_value (), fname, args); else if (array.is_uint32_type ()) retval = do_partarray (array.uint32_array_value (), fname, args); else if (array.is_uint64_type ()) retval = do_partarray (array.uint64_array_value (), fname, args); } else if (array.is_complex_type ()) { if (array.is_single_type ()) retval = do_partarray (array.float_complex_array_value (), fname, args); else retval = do_partarray (array.complex_array_value (), fname, args); } else { if (array.is_single_type ()) retval = do_partarray (array.float_array_value (), fname, args); else retval = do_partarray (array.array_value (), fname, args); } } // FIXME: This seems to work in cellfun.cc, but not here ... /* else if (array.is_map ()) retval = do_partarray (array.map_value (), fname, args); */ else if (array.is_cell ()) retval = do_partarray (array.cell_value (), fname, args); else gripe_wrong_type_arg (fname, array); return octave_value (retval); } miscellaneous/src/Makefile0000644000175000017500000000024711745334750017164 0ustar carandraugcarandraugMKOCTFILE = mkoctfile -Wall PROGS = $(patsubst %.cc,%.oct,$(wildcard *.cc)) all: $(PROGS) %.oct: %.cc $(MKOCTFILE) $< clean: rm -f *.o octave-core core *.oct *~ miscellaneous/inst/match.m0000644000175000017500000000530211736035416017156 0ustar carandraugcarandraug## 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/inst/nze.m0000644000175000017500000000216211742757740016667 0ustar carandraugcarandraug## 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/inst/hilbert_curve.m0000644000175000017500000000522311726132763020723 0ustar carandraugcarandraug## 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/inst/reduce.m0000644000175000017500000000471711736035416017342 0ustar carandraugcarandraug## 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/inst/laguerrepoly.m0000644000175000017500000000336411736035416020602 0ustar carandraugcarandraug## 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/inst/map.m0000644000175000017500000000611511736035416016642 0ustar carandraugcarandraug## Copyright (C) 2003 Tomer Altman ## Copyright (C) 2007 Muthiah Annamalai ## Copyright (C) 2012 Carnë Draug ## 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 (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} =} map (@var{function}, @var{iterable}, @dots{}) ## Apply @var{function} to every item of @var{iterable} and return the results. ## ## @code{map}, like Lisp's ( & numerous other language's ) function for ## iterating the result of a function applied to each of the data ## structure's elements in turn. The results are stored in the ## corresponding input's place. For now, just will work with cells and ## matrices, but support for structs are intended for future versions. ## Also, only "prefix" functions ( like @code{min (a, b, c, ...)} ) are ## supported. FUN_HANDLE can either be a function name string or a ## function handle (recommended). ## ## Example: ## @example ## ## octave> A ## A ## @{ ## [1,1] = 0.0096243 ## [2,1] = 0.82781 ## [1,2] = 0.052571 ## [2,2] = 0.84645 ## @} ## octave> B ## B = ## @{ ## [1,1] = 0.75563 ## [2,1] = 0.84858 ## [1,2] = 0.16765 ## [2,2] = 0.85477 ## @} ## octave> map(@@min,A,B) ## ans = ## @{ ## [1,1] = 0.0096243 ## [2,1] = 0.82781 ## [1,2] = 0.052571 ## [2,2] = 0.84645 ## @} ## @end example ## @seealso{reduce, match} ## @end deftypefn function return_type = map (fun_handle, data_struct, varargin) persistent warned = false; if (! warned) warned = true; warning ("Octave:deprecated-function", "map has been deprecated, and will be removed in the future. Use `arrayfun' or `cellfun' instead."); endif if (nargin < 2) print_usage; elseif (!(isnumeric (data_struct) || iscell (data_struct))) error ("second argument must be either a matrix or a cell object"); 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 if (iscell (data_struct)) return_type = cellfun (fun_handle, data_struct,varargin{:}); else return_type = arrayfun (fun_handle, data_struct,varargin{:}); endif endfunction %!assert(map(@min,[1 2 3 4 5],[5 4 3 2 1]), [1 2 3 2 1]) %!assert(map(@min,rand(1,5),[0 0 0 0 0]), [0 0 0 0 0]) %!assert(map(@(x,y) (sin(x).^2 + cos(y).^2),-pi:0.5:+pi,-pi:0.5:+pi),ones(1,13)) miscellaneous/inst/normc.m0000644000175000017500000000346611726171113017203 0ustar carandraugcarandraug## 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/inst/asci.m0000644000175000017500000000533111726156424017005 0ustar carandraugcarandraug## 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 ASCI table. ## ## If this function is called without any input argument and without any output ## argument then print a nice ASCI-table (excluding special characters with ## hexcode 0x00 to 0x20) on screen with four columns per default. If this ## function is called with one output argument then return an ASCI-table string ## and don't print anything on screen. Finally, if this function is called with ## one input argument of type scalar then either print (no output argument) or ## return (one output argument) an ASCI-table with a number of columns given in ## @var{columns}. ## ## For example, ## @example ## A = asci (3); ## disp (A); ## @end example ## @end deftypefn function [varargout] = asci (varargin) %# Check number and types of input arguments if (nargin == 0) vcol = 4; elseif (isnumeric (varargin{1}) && \ isequal (size (varargin{1}), [1, 1])) vcol = floor (varargin{1}); else print_usage (); endif %# First char is #32 (0x20) and last char is #128 (0x80) vtab = ""; voff = floor ((128 - 32) / vcol); %# Print a first row for the and underline that row for vcnt = 1:vcol vtab = sprintf ("%s Dec Hex Chr ", vtab); endfor vtab = sprintf ("%s\n", vtab); for vcnt = 1:vcol vtab = sprintf ("%s-------------", vtab); endfor vtab = sprintf ("%s\n", vtab); %# Create the lines and columns of the asci table for vpos = 32:(32+voff) for vcnt = 1:vcol vact = (vcnt-1)*voff+vpos; vstr = {num2str(vact), dec2hex(vact), char(vact)}; for vctn = 1:length (vstr) vtab = sprintf ("%s %3s", vtab, vstr{vctn}); endfor vtab = sprintf ("%s ", vtab); endfor vtab = sprintf ("%s\n", vtab); endfor vtab = sprintf ("%s\n", vtab); %# Print table to screen or return it to output argument if (nargout == 0) printf ("%s", vtab); elseif (nargout == 1) varargout{1} = vtab; endif endfunction %!test %! A = asci (); %!test %! A = asci (2); miscellaneous/inst/rolldices.m0000644000175000017500000000471511726154371020052 0ustar carandraugcarandraug## 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/inst/solvesudoku.m0000644000175000017500000001171511726132763020454 0ustar carandraugcarandraug## 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/inst/truncate.m0000644000175000017500000000321712037121615017702 0ustar carandraugcarandraug%% 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/inst/apply.m0000644000175000017500000000743211736035416017215 0ustar carandraugcarandraug## 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 {Loadable Function} {@var{return_value} =} apply (@var{@@function_handle},@var{cell_array_of_args}) ## @deftypefnx {Loadable Function} {@var{return_value} =} apply (@var{@@function_handle}) ## Apply calls the function @var{function_handle} with the arguments of the cell ## array @var{cell_array_of_args} which contains the actual arguments arg1,arg2,..., argn ## to the function, in that order. Apply invokes the function as ## @var{function_handle}(arg1, arg2, ... ,argn), where the arguments are ## extracted from each elements of the 1-row cell array @var{cell_array_of_args}. ## ## @emph{warning}: @code{apply} has been deprecated in favor of @code{arrayfun} ## and @code{cellfun} for arrays and cells respectively. This function will be ## removed from future versions of the 'miscellaneous' package". ## ## Apply also works on array of function handles if ## @var{function_handle} is passed as a cell array of a handles; in this ## case apply, evaluates each function (using the handle) with the same ## arguments. ## ## The cell-array argument is optional second argument, in the form ## of a 1-row with multiple elements. The elements of the cell-array ## form the actual arguments supplied when invoking the function @var{function_handle}. ## ## The return value depends on the function invoked, and the validity of ## the arguments. ## ## @example ## z=apply(@@sqrt,cell([1,2; 3,4])); ## z=apply(@@apply,cell(@@sqrt,cell([1,2; 3,4]))); ## apply(@@sum,cell([1,2,3,4])) ## apply(@@max,cell([1,2,3,4])) ## apply(@@min,cell([1,2,3,4])) ## @end example ## ## ## In first case, apply computes the sqrt of the matrix [1,2; 3,4]; ## The second example is meta-apply, using apply on itself. ## The rest of the examples invoke sum, max, min respectively. ## @end deftypefn ## function rval=apply(fun_handle,cell_array) persistent warned = false; if (! warned) warned = true; warning ("Octave:deprecated-function", "apply has been deprecated, and will be removed in the future. Use `arrayfun' or `cellfun' instead."); endif if (nargin == 0) print_usage(); error("apply(): needs at least 1 argument, see usage"); elseif( nargin < 2) if iscell(fun_handle) for idx=1:length(fun_handle) rval(idx)=feval(@feval,fun_handle{idx}); end else rval=feval(@feval,fun_handle); end return elseif(!iscell(cell_array)) error("apply(): needs second argument, to be a cell-array"); end if iscell(fun_handle) for idx=1:length(fun_handle) rval(idx)=feval(@feval,fun_handle{idx},cell_array{:}); end return end rval=feval(@feval,fun_handle,cell_array{:}); end %! %!assert(apply({@min, @max, @mean},{[1:10]}),[ 1.0000 ,10.0000 ,5.5000]) %!assert(apply(@min,{[1,2,3,4]}),1) %!assert(apply(@dot,{[1,2],[3,4]}),11) %!assert(apply(@min,{[1, 3]}),1) %!assert(apply(@sum,{[1:10]}),55) %!assert(apply(@sqrt,{[1,2; 3,4]}),sqrt([1,2;3,4])) %!assert(apply(@apply,{@sqrt,{[1,2; 3,4]}}),sqrt([1,2;3,4])) %!assert(apply(@sum,{[1,2,3,4]}),10) %!assert(apply(@max,{[1,2,3,4]}),4) %!assert(apply(@min,{[1,2,3,4]}),1) %! miscellaneous/inst/colorboard.m0000644000175000017500000001127111726132763020214 0ustar carandraugcarandraug## 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/inst/read_options.m0000644000175000017500000001472211742757740020566 0ustar carandraugcarandraug## 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/inst/clip.m0000644000175000017500000000425611726132763017022 0ustar carandraugcarandraug## 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/inst/legendrepoly.m0000644000175000017500000000334311736035416020556 0ustar carandraugcarandraug## 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/inst/normr.m0000644000175000017500000000341111726154371017217 0ustar carandraugcarandraug## 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/inst/gameoflife.m0000644000175000017500000000344111726132763020164 0ustar carandraugcarandraug## 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/inst/infoskeleton.m0000644000175000017500000000701011736035416020560 0ustar carandraugcarandraug## 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/inst/hermitepoly.m0000644000175000017500000011675411736035416020441 0ustar carandraugcarandraug## 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/inst/units.m0000644000175000017500000000454611726154371017236 0ustar carandraugcarandraug## Copyright (C) 2005 Carl Osterwisch ## ## 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. Nonlinear conversions ## such as Fahrenheit to Celsius are not currently supported. 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) if 2 > nargin || 3 < nargin || !ischar(fromUnit) || !ischar(toUnit) print_usage; endif [status, rawoutput] = system(sprintf('units "%s" "%s"', fromUnit, toUnit), 1); (0 == status) || error([rawoutput, 'Verify that GNU units is installed in the current path.']); i = index(rawoutput, "*"); j = index(rawoutput, "\n") - 1; i && (i < j) || error('parsing units output "%s"', rawoutput); exist("x", "var") || (x = 1); eval(['y = x', rawoutput(i:j), ';']) 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) %!assert( units("in", "mm"), 25.4 ) miscellaneous/inst/slurp_file.m0000644000175000017500000000316711742757740020245 0ustar carandraugcarandraug## 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/inst/temp_name.m0000644000175000017500000000401511742757740020037 0ustar carandraugcarandraug## 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{n} = } temp_name ( rootname, quick ) ## @cindex ## name = temp_name(rootname, quick=1) - Return a name that is not used ## ## Returns a name, suitable for defining a new function, script or global ## variable, of the form ## ## [rootname,number] ## ## Default rootname is "temp_name_" ## ## "quick" is an optional parameter, which defaults to 1. If it is false, ## temp_name() will find the smallest acceptable number for the name. ## Otherwise, a hopefully quicker method is used. ## ## @end deftypefn function n = temp_name (rootname, quick) persistent warned = false; if (! warned) warned = true; warning ("Octave:deprecated-function", "temp_name has been deprecated, and will be removed in the future. Use `tmpnam' instead."); endif ### Keep track of previously asked names persistent cnt = struct ("dummy",0); if nargin<1 || !length(rootname), rootname = "temp_name_" ; endif if nargin<2, quick = 1; endif if quick if ! isfield (cnt, rootname) cnt.(rootname) = 0; c = 0 ; else c = cnt.(rootname) ; endif else c = 0; endif n = sprintf ([rootname,"%i"], c); while exist (n), c++ ; n = sprintf ([rootname,"%i"], c); endwhile if quick cnt.(rootname) = c ; endif endfunction miscellaneous/inst/peano_curve.m0000644000175000017500000000567711726132763020411 0ustar carandraugcarandraug## 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/inst/publish.m0000644000175000017500000002237611727415251017541 0ustar carandraugcarandraug## 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/inst/textable.m0000644000175000017500000001322612037121615017666 0ustar carandraugcarandraug## 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/inst/csv2latex.m0000644000175000017500000001327311727473530020006 0ustar carandraugcarandraug## Copyright (C) 2006 Hansgeorg Schwibbe ## ## 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 . ## 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/inst/z_curve.m0000644000175000017500000000514511726154371017545 0ustar carandraugcarandraug## 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/inst/chebyshevpoly.m0000644000175000017500000000353611736035416020755 0ustar carandraugcarandraug## 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 set to ## compute the first or second kind chebyshev polynomial. ## ## 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 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 miscellaneous/inst/physical_constant.m0000644000175000017500000026407411746070050021616 0ustar carandraugcarandraug## 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/inst/zigzag.m0000644000175000017500000000470211726154371017361 0ustar carandraugcarandraug## 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/inst/zagzig.m0000644000175000017500000000502611726154371017361 0ustar carandraugcarandraug## 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/DESCRIPTION0000644000175000017500000000070112037120747016430 0ustar carandraugcarandraugName: Miscellaneous Version: 1.2.0 Date: 2012-10-16 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/INDEX0000644000175000017500000000064411745334750015530 0ustar carandraugcarandraugmiscellaneous >> Miscellaneous functions miscellaneous apply asci cell2cell chebyshevpoly clip colorboard csv2latex gameoflife hermitepoly hilbert_curve infoskeleton laguerrepoly legendrepoly map match normc normr nze partarray partcnt partint peano_curve publish read_options reduce rolldices sample slurp_file solvesudoku temp_name text_waitbar truncate units zagzig z_curve zigzag miscellaneous/COPYING0000644000175000017500000010451311726132763015770 0ustar carandraugcarandraug 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/PKG_ADD0000644000175000017500000000012411745334750015743 0ustar carandraugcarandraugautoload ("partcnt", fullfile (fileparts (mfilename ("fullpath")), "partint.oct")); miscellaneous/NEWS0000644000175000017500000000537411753245237015442 0ustar carandraugcarandraugSummary of important user-visible changes for the miscellaneous package ------------------------------------------------------------------------ =============================================================================== miscellaneous-1.2.0 Release Date: 2012-XX-XX Release Manager: =============================================================================== ** 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: =============================================================================== ** 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/src/0000755000175000017500000000000012037121674015513 5ustar carandraugcarandraugmiscellaneous/inst/0000755000175000017500000000000012037121704015673 5ustar carandraugcarandraugmiscellaneous/0000755000175000017500000000000012037121676014726 5ustar carandraugcarandraug