Mercurial > hg > octave-max
changeset 2363:74f9c8283d31
[project @ 1996-10-11 22:31:17 by jwe]
author | jwe |
---|---|
date | Fri, 11 Oct 1996 22:31:19 +0000 |
parents | 1865e40602a3 |
children | 5eb0af0730d6 |
files | src/arith-ops.h src/builtins.cc src/f-eval.cc src/f-fill.cc src/f-input.cc src/g-builtins.cc src/g-builtins.h |
diffstat | 7 files changed, 0 insertions(+), 3181 deletions(-) [+] |
line wrap: on
line diff
deleted file mode 100644 --- a/src/arith-ops.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - -Copyright (C) 1996 John W. Eaton - -This file is part of Octave. - -Octave is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -Octave is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with Octave; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - -#if !defined (octave_arith_ops_h) -#define octave_arith_ops_h 1 - -#include "oct-cmplx.h" - -#include "pt-exp.h" - -class Matrix; -class ComplexMatrix; -class octave_value; - -extern octave_value do_unary_op (double d, tree_expression::type t); - -extern octave_value do_unary_op (const Matrix& a, tree_expression::type t); - -extern octave_value do_unary_op (const Complex& c, tree_expression::type t); - -extern octave_value do_unary_op (const ComplexMatrix& a, - tree_expression::type t); - -extern octave_value do_binary_op (double a, double b, - tree_expression::type t); - -extern octave_value do_binary_op (double a, const Matrix& b, - tree_expression::type t); - -extern octave_value do_binary_op (double a, const Complex& b, - tree_expression::type t); - -extern octave_value do_binary_op (double a, const ComplexMatrix& b, - tree_expression::type t); - -extern octave_value do_binary_op (const Matrix& a, double b, - tree_expression::type t); - -extern octave_value do_binary_op (const Matrix& a, const Matrix& b, - tree_expression::type t); - -extern octave_value do_binary_op (const Matrix& a, const Complex& b, - tree_expression::type t); - -extern octave_value do_binary_op (const Matrix& a, const ComplexMatrix& b, - tree_expression::type t); - -extern octave_value do_binary_op (const Complex& a, double b, - tree_expression::type t); - -extern octave_value do_binary_op (const Complex& a, const Matrix& b, - tree_expression::type t); - -extern octave_value do_binary_op (const Complex& a, const Complex& b, - tree_expression::type t); - -extern octave_value do_binary_op (const Complex& a, const ComplexMatrix& b, - tree_expression::type t); - -extern octave_value do_binary_op (const ComplexMatrix& a, double b, - tree_expression::type t); - -extern octave_value do_binary_op (const ComplexMatrix& a, const Matrix& b, - tree_expression::type t); - -extern octave_value do_binary_op (const ComplexMatrix& a, const Complex& b, - tree_expression::type t); - -extern octave_value do_binary_op (const ComplexMatrix& a, - const ComplexMatrix& b, - tree_expression::type t); - -extern void symbols_of_arith_ops (void); - -#endif - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; End: *** -*/
deleted file mode 100644 --- a/src/builtins.cc +++ /dev/null @@ -1,265 +0,0 @@ -// DO NOT EDIT! Generated automatically by mkbuiltins. - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "mappers.h" -#include "variables.h" -#include "builtins.h" -#include "oct-obj.h" - -static void -install_builtin_functions (void) -{ - extern Octave_object Fall (const Octave_object& args, int nargout) ; static builtin_function Sall = { "all" , 2 , 1 , 0 , Fall , - "all (X): are all elements of X nonzero?" }; install_builtin_function (& Sall ); - extern Octave_object Fany (const Octave_object& args, int nargout) ; static builtin_function Sany = { "any" , 2 , 1 , 0 , Fany , - "any (X): are any elements of X nonzero?" }; install_builtin_function (& Sany ); - extern Octave_object Fcumprod (const Octave_object& args, int nargout) ; static builtin_function Scumprod = { "cumprod" , 2 , 1 , 0 , Fcumprod , - "cumprod (X): cumulative products" }; install_builtin_function (& Scumprod ); - extern Octave_object Fcumsum (const Octave_object& args, int nargout) ; static builtin_function Scumsum = { "cumsum" , 2 , 1 , 0 , Fcumsum , - "cumsum (X): cumulative sums" }; install_builtin_function (& Scumsum ); - extern Octave_object Fdiag (const Octave_object& args, int nargout) ; static builtin_function Sdiag = { "diag" , 3 , 1 , 0 , Fdiag , - "diag (X [,k]): form/extract diagonals" }; install_builtin_function (& Sdiag ); - extern Octave_object Fisstr (const Octave_object& args, int nargout) ; static builtin_function Sisstr = { "isstr" , 2 , 1 , 0 , Fisstr , - "isstr (X): return 1 if X is a string, 0 otherwise" }; install_builtin_function (& Sisstr ); - extern Octave_object Fprod (const Octave_object& args, int nargout) ; static builtin_function Sprod = { "prod" , 2 , 1 , 0 , Fprod , - "prod (X): products" }; install_builtin_function (& Sprod ); - extern Octave_object Fsetstr (const Octave_object& args, int nargout) ; static builtin_function Ssetstr = { "setstr" , 2 , 1 , 0 , Fsetstr , - "setstr (V): convert a vector to a string" }; install_builtin_function (& Ssetstr ); - extern Octave_object Fsize (const Octave_object& args, int nargout) ; static builtin_function Ssize = { "size" , 2 , 1 , 0 , Fsize , - "[m, n] = size (x): return rows and columns of X" }; install_builtin_function (& Ssize ); - extern Octave_object Fsum (const Octave_object& args, int nargout) ; static builtin_function Ssum = { "sum" , 2 , 1 , 0 , Fsum , - "sum (X): sum of elements" }; install_builtin_function (& Ssum ); - extern Octave_object Fsumsq (const Octave_object& args, int nargout) ; static builtin_function Ssumsq = { "sumsq" , 2 , 1 , 0 , Fsumsq , - "sumsq (X): sum of squares of elements" }; install_builtin_function (& Ssumsq ); - extern Octave_object Fones (const Octave_object& args, int nargout) ; static builtin_function Sones = { "ones" , 3 , 1 , 0 , Fones , - "ones (N), ones (N, M), ones (X): create a matrix of all ones" }; install_builtin_function (& Sones ); - extern Octave_object Fzeros (const Octave_object& args, int nargout) ; static builtin_function Szeros = { "zeros" , 3 , 1 , 0 , Fzeros , - "zeros (N), zeros (N, M), zeros (X): create a matrix of all zeros" }; install_builtin_function (& Szeros ); - extern Octave_object Feye (const Octave_object& args, int nargout) ; static builtin_function Seye = { "eye" , 3 , 1 , 0 , Feye , - "eye (N), eye (N, M), eye (X): create an identity matrix" }; install_builtin_function (& Seye ); - extern Octave_object Fcd (const Octave_object& args, int nargout) ; static builtin_function Scd = { "cd" , 2 , 1 , 1 , Fcd , - "cd [dir]\n\nchange current working directory\nif no arguments are given, the current directory is changed to the\nusers home directory" }; install_builtin_function (& Scd ); - extern Octave_object Fls (const Octave_object& args, int nargout) ; static builtin_function Sls = { "ls" , -1 , 1 , 1 , Fls , - "ls [options]\n\nprint a directory listing" }; install_builtin_function (& Sls ); - alias_builtin ("dir", "ls"); ; - - extern Octave_object Fpwd (const Octave_object& args, int nargout) ; static builtin_function Spwd = { "pwd" , 1 , 0 , 0 , Fpwd , - "pwd (): print current working directory" }; install_builtin_function (& Spwd ); - extern Octave_object Ferror (const Octave_object& args, int nargout) ; static builtin_function Serror = { "error" , 2 , 1 , 0 , Ferror , - "error (MESSAGE): print MESSAGE and set the error state.\nThis should eventually take us up to the top level, possibly\nprinting traceback messages as we go.\n\nIf MESSAGE ends in a newline character, traceback messages are not\nprinted." }; install_builtin_function (& Serror ); - extern Octave_object Ffclose (const Octave_object& args, int nargout) ; static builtin_function Sfclose = { "fclose" , 2 , 1 , 0 , Ffclose , - "fclose (FILENAME or FILENUM): close a file" }; install_builtin_function (& Sfclose ); - extern Octave_object Ffflush (const Octave_object& args, int nargout) ; static builtin_function Sfflush = { "fflush" , 2 , 1 , 0 , Ffflush , - "fflush (FILENAME or FILENUM): flush buffered data to output file" }; install_builtin_function (& Sfflush ); - extern Octave_object Ffgets (const Octave_object& args, int nargout) ; static builtin_function Sfgets = { "fgets" , 3 , 2 , 0 , Ffgets , - "[STRING, LENGTH] = fgets (FILENAME or FILENUM, LENGTH)\n\nread a string from a file" }; install_builtin_function (& Sfgets ); - extern Octave_object Ffopen (const Octave_object& args, int nargout) ; static builtin_function Sfopen = { "fopen" , 3 , 1 , 0 , Ffopen , - "FILENUM = fopen (FILENAME, MODE): open a file\n\n Valid values for mode include:\n\n r : open text file for reading\n w : open text file for writing; discard previous contents if any\n a : append; open or create text file for writing at end of file\n r+ : open text file for update (i.e., reading and writing)\n w+ : create text file for update; discard previous contents if any\n a+ : append; open or create text file for update, writing at end\n\n Update mode permits reading from and writing to the same file." }; install_builtin_function (& Sfopen ); - extern Octave_object Ffreport (const Octave_object& args, int nargout) ; static builtin_function Sfreport = { "freport" , 1 , 1 , 0 , Ffreport , - "freport (): list open files and their status" }; install_builtin_function (& Sfreport ); - extern Octave_object Ffrewind (const Octave_object& args, int nargout) ; static builtin_function Sfrewind = { "frewind" , 2 , 1 , 0 , Ffrewind , - "frewind (FILENAME or FILENUM): set file position at beginning of file" }; install_builtin_function (& Sfrewind ); - extern Octave_object Ffseek (const Octave_object& args, int nargout) ; static builtin_function Sfseek = { "fseek" , 4 , 1 , 0 , Ffseek , - "fseek (FILENAME or FILENUM, OFFSET [, ORIGIN])\n\nset file position for reading or writing" }; install_builtin_function (& Sfseek ); - extern Octave_object Fftell (const Octave_object& args, int nargout) ; static builtin_function Sftell = { "ftell" , 2 , 1 , 0 , Fftell , - "POSITION = ftell (FILENAME or FILENUM): returns the current file position" }; install_builtin_function (& Sftell ); - extern Octave_object Ffprintf (const Octave_object& args, int nargout) ; static builtin_function Sfprintf = { "fprintf" , -1 , 1 , 0 , Ffprintf , - "fprintf (FILENAME or FILENUM, FORMAT, ...)" }; install_builtin_function (& Sfprintf ); - extern Octave_object Fprintf (const Octave_object& args, int nargout) ; static builtin_function Sprintf = { "printf" , -1 , 1 , 0 , Fprintf , - "printf (FORMAT, ...)" }; install_builtin_function (& Sprintf ); - extern Octave_object Fsprintf (const Octave_object& args, int nargout) ; static builtin_function Ssprintf = { "sprintf" , -1 , 1 , 0 , Fsprintf , - "s = sprintf (FORMAT, ...)" }; install_builtin_function (& Ssprintf ); - extern Octave_object Ffscanf (const Octave_object& args, int nargout) ; static builtin_function Sfscanf = { "fscanf" , 3 , -1 , 0 , Ffscanf , - "[A, B, C, ...] = fscanf (FILENAME or FILENUM, FORMAT)" }; install_builtin_function (& Sfscanf ); - extern Octave_object Fscanf (const Octave_object& args, int nargout) ; static builtin_function Sscanf = { "scanf" , 2 , -1 , 0 , Fscanf , - "[A, B, C, ...] = scanf (FORMAT)" }; install_builtin_function (& Sscanf ); - extern Octave_object Fsscanf (const Octave_object& args, int nargout) ; static builtin_function Ssscanf = { "sscanf" , 3 , -1 , 0 , Fsscanf , - "[A, B, C, ...] = sscanf (STRING, FORMAT)" }; install_builtin_function (& Ssscanf ); - extern Octave_object Ffread (const Octave_object& args, int nargout) ; static builtin_function Sfread = { "fread" , 4 , 2 , 0 , Ffread , - "[DATA, COUNT] = fread (FILENUM, SIZE, PRECISION)\n\n Reads data in binary form of type PRECISION from a file.\n\n FILENUM : file number from fopen\n SIZE : size specification for the Data matrix\n PRECISION : type of data to read, valid types are\n\n 'char', 'schar', 'short', 'int', 'long', 'float'\n 'double', 'uchar', 'ushort', 'uint', 'ulong'\n\n DATA : matrix in which the data is stored\n COUNT : number of elements read" }; install_builtin_function (& Sfread ); - extern Octave_object Ffwrite (const Octave_object& args, int nargout) ; static builtin_function Sfwrite = { "fwrite" , 4 , 1 , 0 , Ffwrite , - "COUNT = fwrite (FILENUM, DATA, PRECISION)\n\n Writes data to a file in binary form of size PRECISION\n\n FILENUM : file number from fopen\n DATA : matrix of elements to be written\n PRECISION : type of data to read, valid types are\n\n 'char', 'schar', 'short', 'int', 'long', 'float'\n 'double', 'uchar', 'ushort', 'uint', 'ulong'\n\n COUNT : number of elements written" }; install_builtin_function (& Sfwrite ); - extern Octave_object Ffeof (const Octave_object& args, int nargout) ; static builtin_function Sfeof = { "feof" , 2 , 1 , 0 , Ffeof , - "ERROR = feof (FILENAME or FILENUM)\n\n Returns a non zero value for an end of file condition for the\n file specified by FILENAME or FILENUM from fopen" }; install_builtin_function (& Sfeof ); - extern Octave_object Fferror (const Octave_object& args, int nargout) ; static builtin_function Sferror = { "ferror" , 2 , 1 , 0 , Fferror , - "ERROR = ferror (FILENAME or FILENUM)\n\n Returns a non zero value for an error condition on the\n file specified by FILENAME or FILENUM from fopen" }; install_builtin_function (& Sferror ); - extern Octave_object Fhelp (const Octave_object& args, int nargout) ; static builtin_function Shelp = { "help" , -1 , 1 , 1 , Fhelp , - "help [-i] [topic ...]\n\nprint cryptic yet witty messages" }; install_builtin_function (& Shelp ); - extern Octave_object Ftype (const Octave_object& args, int nargout) ; static builtin_function Stype = { "type" , -1 , 1 , 1 , Ftype , - "type NAME ...]\n\ndisplay the definition of each NAME that refers to a function" }; install_builtin_function (& Stype ); - extern Octave_object Fwhich (const Octave_object& args, int nargout) ; static builtin_function Swhich = { "which" , -1 , 1 , 1 , Fwhich , - "which NAME ...]\n\ndisplay the type of each NAME. If NAME is defined from an function\nfile, print the full name of the file." }; install_builtin_function (& Swhich ); - extern Octave_object Finput (const Octave_object& args, int nargout) ; static builtin_function Sinput = { "input" , 3 , 1 , 0 , Finput , - "input (PROMPT [, S])\n\nPrompt user for input. If the second argument is present, return -value as a string." }; install_builtin_function (& Sinput ); - extern Octave_object Fkeyboard (const Octave_object& args, int nargout) ; static builtin_function Skeyboard = { "keyboard" , 2 , 1 , 0 , Fkeyboard , - "keyboard (PROMPT)\n\nmaybe help in debugging function files" }; install_builtin_function (& Skeyboard ); - extern Octave_object Fload (const Octave_object& args, int nargout) ; static builtin_function Sload = { "load" , -1 , 1 , 1 , Fload , - "load [-force] [-ascii] [-binary] [-mat-binary] file [pattern ...]\n -\nload variables from a file" }; install_builtin_function (& Sload ); - extern Octave_object Fsave (const Octave_object& args, int nargout) ; static builtin_function Ssave = { "save" , -1 , 1 , 1 , Fsave , - "save [-ascii] [-binary] [-save-builtins] file [pattern ...]\n\nsave variables in a file" }; install_builtin_function (& Ssave ); - extern Octave_object Fcasesen (const Octave_object& args, int nargout) ; static builtin_function Scasesen = { "casesen" , 2 , 1 , 1 , Fcasesen , - "casesen [on|off]" }; install_builtin_function (& Scasesen ); - extern Octave_object Fflops (const Octave_object& args, int nargout) ; static builtin_function Sflops = { "flops" , 2 , 1 , 0 , Fflops , - "flops (): count floating point operations" }; install_builtin_function (& Sflops ); - extern Octave_object Fquit (const Octave_object& args, int nargout) ; static builtin_function Squit = { "quit" , 1 , 0 , 0 , Fquit , - "quit (): exit Octave gracefully" }; install_builtin_function (& Squit ); - alias_builtin ("exit", "quit"); ; - - extern Octave_object Fwarranty (const Octave_object& args, int nargout) ; static builtin_function Swarranty = { "warranty" , 1 , 0 , 0 , Fwarranty , - "warranty (): describe copying conditions" }; install_builtin_function (& Swarranty ); - extern Octave_object Ffeval (const Octave_object& args, int nargout) ; static builtin_function Sfeval = { "feval" , -1 , 1 , 0 , Ffeval , - "feval (NAME, ARGS, ...)\n\nevaluate NAME as a function, passing ARGS as its arguments" }; install_builtin_function (& Sfeval ); - extern Octave_object Feval (const Octave_object& args, int nargout) ; static builtin_function Seval = { "eval" , 2 , 1 , 0 , Feval , - "eval (STRING): evaluate STRING as octave code" }; install_builtin_function (& Seval ); - extern Octave_object Fshell_cmd (const Octave_object& args, int nargout) ; static builtin_function Sshell_cmd = { "shell_cmd" , 2 , 1 , 0 , Fshell_cmd , - "shell_cmd (string [, return_output]): execute shell commands" }; install_builtin_function (& Sshell_cmd ); - extern Octave_object Fedit_history (const Octave_object& args, int nargout) ; static builtin_function Sedit_history = { "edit_history" , -1 , 1 , 1 , Fedit_history , - "edit_history [first] [last]\n\nedit commands from the history list" }; install_builtin_function (& Sedit_history ); - extern Octave_object Fhistory (const Octave_object& args, int nargout) ; static builtin_function Shistory = { "history" , -1 , 1 , 1 , Fhistory , - "history [N] [-w file] [-r file] [-q]\n\ndisplay, save, or load command history" }; install_builtin_function (& Shistory ); - extern Octave_object Frun_history (const Octave_object& args, int nargout) ; static builtin_function Srun_history = { "run_history" , -1 , 1 , 1 , Frun_history , - "run_history [first] [last]\n\nrun commands from the history list" }; install_builtin_function (& Srun_history ); - extern Octave_object Fdiary (const Octave_object& args, int nargout) ; static builtin_function Sdiary = { "diary" , -1 , 1 , 1 , Fdiary , - "diary [on|off]\ndiary [file]\n\nredirect all input and screen output to a file." }; install_builtin_function (& Sdiary ); - extern Octave_object Fdisp (const Octave_object& args, int nargout) ; static builtin_function Sdisp = { "disp" , 3 , 1 , 0 , Fdisp , - "disp (X): display value without name tag" }; install_builtin_function (& Sdisp ); - extern Octave_object Fformat (const Octave_object& args, int nargout) ; static builtin_function Sformat = { "format" , -1 , 1 , 1 , Fformat , - "format [style]\n\nset output formatting style" }; install_builtin_function (& Sformat ); - extern Octave_object Fclc (const Octave_object& args, int nargout) ; static builtin_function Sclc = { "clc" , 1 , 0 , 0 , Fclc , - "clc (): clear screen" }; install_builtin_function (& Sclc ); - alias_builtin ("home", "clc"); ; - - extern Octave_object Fgetenv (const Octave_object& args, int nargout) ; static builtin_function Sgetenv = { "getenv" , 2 , 1 , 0 , Fgetenv , - "getenv (STRING): get environment variable values" }; install_builtin_function (& Sgetenv ); - extern Octave_object Fkbhit (const Octave_object& args, int nargout) ; static builtin_function Skbhit = { "kbhit" , 1 , 1 , 0 , Fkbhit , - "kbhit: get a single character from the terminal" }; install_builtin_function (& Skbhit ); - extern Octave_object Fpause (const Octave_object& args, int nargout) ; static builtin_function Spause = { "pause" , 1 , 1 , 0 , Fpause , - "pause (seconds): suspend program execution" }; install_builtin_function (& Spause ); - extern Octave_object Fclock (const Octave_object& args, int nargout) ; static builtin_function Sclock = { "clock" , 1 , 0 , 0 , Fclock , - "clock (): return current date and time in vector with elements\n\n [ year, month, day-of-month, hour, minute, second ]" }; install_builtin_function (& Sclock ); - extern Octave_object Fdate (const Octave_object& args, int nargout) ; static builtin_function Sdate = { "date" , 1 , 0 , 0 , Fdate , - "date (): return current date in a string, in the form `18-Jul-94'" }; install_builtin_function (& Sdate ); - extern Octave_object Fva_arg (const Octave_object& args, int nargout) ; static builtin_function Sva_arg = { "va_arg" , 1 , 1 , 0 , Fva_arg , - "va_arg (): return next argument in a function that takes a\nvariable number of parameters" }; install_builtin_function (& Sva_arg ); - extern Octave_object Fva_start (const Octave_object& args, int nargout) ; static builtin_function Sva_start = { "va_start" , 1 , 0 , 0 , Fva_start , - "va_start (): reset the pointer to the list of optional arguments\nto the beginning" }; install_builtin_function (& Sva_start ); - extern Octave_object Fcloseplot (const Octave_object& args, int nargout) ; static builtin_function Scloseplot = { "closeplot" , 1 , 0 , 0 , Fcloseplot , - "closeplot (): close the stream to plotter" }; install_builtin_function (& Scloseplot ); - extern Octave_object Fhold (const Octave_object& args, int nargout) ; static builtin_function Shold = { "hold" , -1 , 1 , 1 , Fhold , - "hold [on|off]\n\ndetermine whether the plot window is cleared before the next line is\ndrawn. With no argument, toggle the current state." }; install_builtin_function (& Shold ); - extern Octave_object Fpurge_tmp_files (const Octave_object& args, int nargout) ; static builtin_function Spurge_tmp_files = { "purge_tmp_files" , 5 , 1 , 0 , Fpurge_tmp_files , - "delete temporary data files used for plotting" }; install_builtin_function (& Spurge_tmp_files ); - extern Octave_object Fset (const Octave_object& args, int nargout) ; static builtin_function Sset = { "set" , -1 , 1 , 1 , Fset , - "set [options]\n\nset plotting options" }; install_builtin_function (& Sset ); - extern Octave_object Fshow (const Octave_object& args, int nargout) ; static builtin_function Sshow = { "show" , -1 , 1 , 1 , Fshow , - "show [options]\n\nshow plotting options" }; install_builtin_function (& Sshow ); - extern Octave_object Fis_global (const Octave_object& args, int nargout) ; static builtin_function Sis_global = { "is_global" , 2 , 1 , 0 , Fis_global , - "is_global (X): return 1 if the string X names a global variable\notherwise, return 0." }; install_builtin_function (& Sis_global ); - extern Octave_object Fexist (const Octave_object& args, int nargout) ; static builtin_function Sexist = { "exist" , 2 , 1 , 0 , Fexist , - "exist (NAME): check if variable or file exists\n\nreturn 0 if NAME is undefined, 1 if it is a variable, or 2 if it is\na function." }; install_builtin_function (& Sexist ); - extern Octave_object Fdocument (const Octave_object& args, int nargout) ; static builtin_function Sdocument = { "document" , -1 , 1 , 1 , Fdocument , - "document symbol string ...\n\nAssociate a cryptic message with a variable name." }; install_builtin_function (& Sdocument ); - extern Octave_object Fwho (const Octave_object& args, int nargout) ; static builtin_function Swho = { "who" , -1 , 1 , 1 , Fwho , - "who [-all] [-builtins] [-functions] [-long] [-variables]\n\nList currently defined symbol(s). Options may be shortened to one\ncharacter, but may not be combined." }; install_builtin_function (& Swho ); - extern Octave_object Fwhos (const Octave_object& args, int nargout) ; static builtin_function Swhos = { "whos" , -1 , 1 , 1 , Fwhos , - "whos [-all] [-builtins] [-functions] [-long] [-variables]\n\nList currently defined symbol(s). Options may be shortened to one\ncharacter, but may not be combined." }; install_builtin_function (& Swhos ); - extern Octave_object Fclear (const Octave_object& args, int nargout) ; static builtin_function Sclear = { "clear" , -1 , 1 , 1 , Fclear , - "clear [name ...]\n\nclear symbol(s) matching a list of globbing patterns\nif no arguments are given, clear all user-defined variables and functions" }; install_builtin_function (& Sclear ); - extern Octave_object Fbalance (const Octave_object& args, int nargout) ; static builtin_function Sbalance = { "balance" , 4 , 4 , 0 , Fbalance , - "AA = balance (A [, OPT]) or [[DD,] AA] = balance (A [, OPT])\n\ngeneralized eigenvalue problem:\n\n [cc, dd, aa, bb] = balance (a, b [, opt])\n\nwhere OPT is an optional single character argument as follows: \n\n N: no balancing; arguments copied, transformation(s) set to identity\n P: permute argument(s) to isolate eigenvalues where possible\n S: scale to improve accuracy of computed eigenvalues\n B: (default) permute and scale, in that order. Rows/columns\n of a (and b) that are isolated by permutation are not scaled\n\n[DD, AA] = balance (A, OPT) returns aa = dd\a*dd,\n\n[CC, DD, AA, BB] = balance (A, B, OPT) returns AA (BB) = CC*A*DD (CC*B*DD)" }; install_builtin_function (& Sbalance ); - extern Octave_object Fchol (const Octave_object& args, int nargout) ; static builtin_function Schol = { "chol" , 2 , 1 , 0 , Fchol , - "R = chol (X): cholesky factorization" }; install_builtin_function (& Schol ); - extern Octave_object Fcolloc (const Octave_object& args, int nargout) ; static builtin_function Scolloc = { "colloc" , 7 , 4 , 0 , Fcolloc , - "[R, A, B, Q] = colloc (N [, \"left\"] [, \"right\"]): collocation weights" }; install_builtin_function (& Scolloc ); - extern Octave_object Fdassl (const Octave_object& args, int nargout) ; static builtin_function Sdassl = { "dassl" , 5 , 1 , 0 , Fdassl , - "dassl (\"function_name\", x_0, xdot_0, t_out)\ndassl (F, X_0, XDOT_0, T_OUT, T_CRIT)\n\nThe first argument is the name of the function to call to\ncompute the vector of residuals. It must have the form\n\n res = f (x, xdot, t)\n\nwhere x, xdot, and res are vectors, and t is a scalar." }; install_builtin_function (& Sdassl ); - extern Octave_object Fdassl_options (const Octave_object& args, int nargout) ; static builtin_function Sdassl_options = { "dassl_options" , -1 , 1 , 0 , Fdassl_options , - "dassl_options (KEYWORD, VALUE)\n\nSet or show options for dassl. Keywords may be abbreviated\nto the shortest match." }; install_builtin_function (& Sdassl_options ); - extern Octave_object Fdet (const Octave_object& args, int nargout) ; static builtin_function Sdet = { "det" , 2 , 1 , 0 , Fdet , - "det (X): determinant of a square matrix" }; install_builtin_function (& Sdet ); - extern Octave_object Feig (const Octave_object& args, int nargout) ; static builtin_function Seig = { "eig" , 2 , 1 , 0 , Feig , - "eig (X) or [V, D] = eig (X): compute eigenvalues and eigenvectors of X" }; install_builtin_function (& Seig ); - extern Octave_object Fexpm (const Octave_object& args, int nargout) ; static builtin_function Sexpm = { "expm" , 2 , 1 , 0 , Fexpm , - "expm (X): matrix exponential, e^A" }; install_builtin_function (& Sexpm ); - extern Octave_object Ffft (const Octave_object& args, int nargout) ; static builtin_function Sfft = { "fft" , 2 , 1 , 0 , Ffft , - "fft (X): fast fourier transform of a vector" }; install_builtin_function (& Sfft ); - extern Octave_object Ffind (const Octave_object& args, int nargout) ; static builtin_function Sfind = { "find" , 2 , 3 , 0 , Ffind , - "find (X) or [I, J, V] = find (X): Return indices of nonzero elements" }; install_builtin_function (& Sfind ); - extern Octave_object Ffsolve (const Octave_object& args, int nargout) ; static builtin_function Sfsolve = { "fsolve" , 5 , 1 , 0 , Ffsolve , - "Solve nonlinear equations using Minpack. Usage:\n\n [X, INFO] = fsolve (F, X0)\n\nWhere the first argument is the name of the function to call to\ncompute the vector of function values. It must have the form\n\n y = f (x) -\nwhere y and x are vectors." }; install_builtin_function (& Sfsolve ); - extern Octave_object Ffsolve_options (const Octave_object& args, int nargout) ; static builtin_function Sfsolve_options = { "fsolve_options" , -1 , 1 , 0 , Ffsolve_options , - "fsolve_options (KEYWORD, VALUE)\n\nSet or show options for fsolve. Keywords may be abbreviated\nto the shortest match." }; install_builtin_function (& Sfsolve_options ); - extern Octave_object Ffsqp (const Octave_object& args, int nargout) ; static builtin_function Sfsqp = { "fsqp" , 11 , 3 , 0 , Ffsqp , - "[X, PHI] = fsqp (X, PHI [, LB, UB] [, LB, A, UB] [, LB, G, UB])\n\nGroups of arguments surrounded in `[]' are optional, but\nmust appear in the same relative order shown above." }; install_builtin_function (& Sfsqp ); - extern Octave_object Ffsqp_options (const Octave_object& args, int nargout) ; static builtin_function Sfsqp_options = { "fsqp_options" , -1 , 1 , 0 , Ffsqp_options , - "fsqp_options (KEYWORD, VALUE)\n\nSet or show options for fsqp. Keywords may be abbreviated\nto the shortest match." }; install_builtin_function (& Sfsqp_options ); - extern Octave_object Fgivens (const Octave_object& args, int nargout) ; static builtin_function Sgivens = { "givens" , 3 , 2 , 0 , Fgivens , - "G = givens (X, Y)\n\ncompute orthogonal matrix G = [c s; -conj (s) c]\nsuch that G [x; y] = [*; 0] (x, y scalars)\n\n[c, s] = givens (x, y) returns the (c, s) values themselves." }; install_builtin_function (& Sgivens ); - extern Octave_object Fhess (const Octave_object& args, int nargout) ; static builtin_function Shess = { "hess" , 2 , 2 , 0 , Fhess , - "[P, H] = hess (A) or H = hess (A): Hessenberg decomposition" }; install_builtin_function (& Shess ); - extern Octave_object Fifft (const Octave_object& args, int nargout) ; static builtin_function Sifft = { "ifft" , 2 , 1 , 0 , Fifft , - "ifft (X): inverse fast fourier transform of a vector" }; install_builtin_function (& Sifft ); - extern Octave_object Finv (const Octave_object& args, int nargout) ; static builtin_function Sinv = { "inv" , 2 , 1 , 0 , Finv , - "inv (X): inverse of a square matrix" }; install_builtin_function (& Sinv ); - extern Octave_object Flogm (const Octave_object& args, int nargout) ; static builtin_function Slogm = { "logm" , 2 , 1 , 0 , Flogm , - "logm (X): matrix logarithm" }; install_builtin_function (& Slogm ); - extern Octave_object Fsqrtm (const Octave_object& args, int nargout) ; static builtin_function Ssqrtm = { "sqrtm" , 2 , 1 , 0 , Fsqrtm , - "sqrtm (X): matrix sqrt" }; install_builtin_function (& Ssqrtm ); - extern Octave_object Flpsolve (const Octave_object& args, int nargout) ; static builtin_function Slpsolve = { "lpsolve" , 11 , 3 , 0 , Flpsolve , - "lp_solve (): solve linear programs using lp_solve." }; install_builtin_function (& Slpsolve ); - extern Octave_object Flpsolve_options (const Octave_object& args, int nargout) ; static builtin_function Slpsolve_options = { "lpsolve_options" , -1 , 1 , 0 , Flpsolve_options , - "lp_solve_options (KEYWORD, VALUE)\n\nSet or show options for lp_solve. Keywords may be abbreviated\nto the shortest match." }; install_builtin_function (& Slpsolve_options ); - extern Octave_object Flsode (const Octave_object& args, int nargout) ; static builtin_function Slsode = { "lsode" , 6 , 1 , 0 , Flsode , - "lsode (F, X0, T_OUT, T_CRIT)\n\nThe first argument is the name of the function to call to\ncompute the vector of right hand sides. It must have the form\n\n xdot = f (x, t)\n\nwhere xdot and x are vectors and t is a scalar.\n" }; install_builtin_function (& Slsode ); - extern Octave_object Flsode_options (const Octave_object& args, int nargout) ; static builtin_function Slsode_options = { "lsode_options" , -1 , 1 , 0 , Flsode_options , - "lsode_options (KEYWORD, VALUE)\n\nSet or show options for lsode. Keywords may be abbreviated\nto the shortest match." }; install_builtin_function (& Slsode_options ); - extern Octave_object Flu (const Octave_object& args, int nargout) ; static builtin_function Slu = { "lu" , 2 , 3 , 0 , Flu , - "[L, U, P] = lu (A): LU factorization" }; install_builtin_function (& Slu ); - extern Octave_object Fmin (const Octave_object& args, int nargout) ; static builtin_function Smin = { "min" , 3 , 2 , 0 , Fmin , - "min (X): minimum value(s) of a vector (matrix)" }; install_builtin_function (& Smin ); - extern Octave_object Fmax (const Octave_object& args, int nargout) ; static builtin_function Smax = { "max" , 3 , 2 , 0 , Fmax , - "max (X): maximum value(s) of a vector (matrix)" }; install_builtin_function (& Smax ); - extern Octave_object Fnpsol (const Octave_object& args, int nargout) ; static builtin_function Snpsol = { "npsol" , 11 , 3 , 0 , Fnpsol , - "[X, OBJ, INFO, LAMBDA] = npsol (X, PHI [, LB, UB] [, LB, A, UB] [, LB, G, UB])\n\nGroups of arguments surrounded in `[]' are optional, but\nmust appear in the same relative order shown above.\n\nThe second argument is a string containing the name of the objective\nfunction to call. The objective function must be of the form\n\n y = phi (x)\n\nwhere x is a vector and y is a scalar.\n\nThe argument G is a string containing the name of the function that -defines the nonlinear constraints. It must be of the form\n\n y = g (x)\n\nwhere x is a vector and y is a vector." }; install_builtin_function (& Snpsol ); - extern Octave_object Fnpsol_options (const Octave_object& args, int nargout) ; static builtin_function Snpsol_options = { "npsol_options" , -1 , 1 , 0 , Fnpsol_options , - "npsol_options (KEYWORD, VALUE)\n\nSet or show options for npsol. Keywords may be abbreviated\nto the shortest match." }; install_builtin_function (& Snpsol_options ); - extern Octave_object Fqpsol (const Octave_object& args, int nargout) ; static builtin_function Sqpsol = { "qpsol" , 9 , 3 , 0 , Fqpsol , - "[X, OBJ, INFO, LAMBDA] = qpsol (X, H, C [, LB, UB] [, LB, A, UB])\n\nGroups of arguments surrounded in `[]' are optional, but\nmust appear in the same relative order shown above." }; install_builtin_function (& Sqpsol ); - extern Octave_object Fqpsol_options (const Octave_object& args, int nargout) ; static builtin_function Sqpsol_options = { "qpsol_options" , -1 , 1 , 0 , Fqpsol_options , - "qpsol_options (KEYWORD, VALUE)\n -\nSet or show options for qpsol. Keywords may be abbreviated\nto the shortest match." }; install_builtin_function (& Sqpsol_options ); - extern Octave_object Fqr (const Octave_object& args, int nargout) ; static builtin_function Sqr = { "qr" , 2 , 2 , 0 , Fqr , - "[Q, R] = qr (X): form Q unitary and R upper triangular such\n that Q * R = X\n\n[Q, R] = qr (X, 0): form the economy decomposition such that if X is\n if X is m by n then only the first n columns of Q\n are computed.\n\n[Q, R, P] = qr (X): form QRP factorization of X where\n P is a permutation matrix such that\n A * P = Q * R\n\n[Q, R, P] = qr (X, 0): form the economy decomposition with \n permutation vector P such that Q * R = X (:, P)\n\nqr (X) alone returns the output of the LAPACK routine dgeqrf, such\nthat R = triu (qr (X))" }; install_builtin_function (& Sqr ); - extern Octave_object Fquad (const Octave_object& args, int nargout) ; static builtin_function Squad = { "quad" , 6 , 3 , 0 , Fquad , - "[V, IER, NFUN] = quad (F, A, B [, TOL] [, SING])\n\nWhere the first argument is the name of the function to call to\ncompute the value of the integrand. It must have the form\n\n y = f (x) -\nwhere y and x are scalars.\n\nThe second and third arguments are limits of integration. Either or\nboth may be infinite. The optional argument TOL specifies the desired\naccuracy of the result. The optional argument SING is a vector of\nat which the integrand is singular." }; install_builtin_function (& Squad ); - extern Octave_object Fquad_options (const Octave_object& args, int nargout) ; static builtin_function Squad_options = { "quad_options" , -1 , 1 , 0 , Fquad_options , - "quad_options (KEYWORD, VALUE)\n\nSet or show options for quad. Keywords may be abbreviated\nto the shortest match." }; install_builtin_function (& Squad_options ); - extern Octave_object Fqzvalue (const Octave_object& args, int nargout) ; static builtin_function Sqzvalue = { "qzvalue" , 3 , 1 , 0 , Fqzvalue , - "X = qzval (A, B)\n\ncompute generalized eigenvalues of the matrix pencil (A - lambda B).\nA and B must be real matrices." }; install_builtin_function (& Sqzvalue ); - extern Octave_object Frand (const Octave_object& args, int nargout) ; static builtin_function Srand = { "rand" , 2 , 1 , 0 , Frand , - "rand -- generate a random value\n\nrand (N) -- generate N x N matrix\nrand (A) -- generate matrix the size of A\nrand (N, M) -- generate N x M matrix\nrand (\"dist\") -- get current distribution\nrand (DISTRIBUTION) -- set distribution type (\"normal\" or \"uniform\"\nrand (SEED) -- get current seed\nrand (SEED, N) -- set seed" }; install_builtin_function (& Srand ); - extern Octave_object Fschur (const Octave_object& args, int nargout) ; static builtin_function Sschur = { "schur" , 3 , 2 , 0 , Fschur , - "[U, S] = schur (A) or S = schur (A)\n\nor, for ordered Schur:\n\n [U, S] = schur (A, TYPE) or S = schur (A, TYPE)\nwhere TYPE is a string that begins with one of the following\ncharacters:\n\n A = continuous time poles\n D = discrete time poles\n U = unordered schur (default)" }; install_builtin_function (& Sschur ); - extern Octave_object Fsort (const Octave_object& args, int nargout) ; static builtin_function Ssort = { "sort" , 2 , 2 , 0 , Fsort , - "[S, I] = sort (X)\n\nsort the columns of X, optionally return sort index" }; install_builtin_function (& Ssort ); - extern Octave_object Fsvd (const Octave_object& args, int nargout) ; static builtin_function Ssvd = { "svd" , 2 , 3 , 0 , Fsvd , - "S = svd (X) or [U, S, V] = svd (X [, 0])\n\nCompute the singular value decomposition of X. Given a second input\nargument, an `economy' sized factorization is computed that omits\nunnecessary rows and columns of U and V" }; install_builtin_function (& Ssvd ); - extern Octave_object Fsyl (const Octave_object& args, int nargout) ; static builtin_function Ssyl = { "syl" , 4 , 1 , 0 , Fsyl , - "X = syl (A, B, C): solve the Sylvester equation A X + X B + C = 0" }; install_builtin_function (& Ssyl ); -} - -void -install_builtins (void) -{ - install_builtin_variables (); - install_mapper_functions (); - install_builtin_functions (); -}
deleted file mode 100644 --- a/src/f-eval.cc +++ /dev/null @@ -1,124 +0,0 @@ -// f-eval.cc -*- C++ -*- -/* - -Copyright (C) 1994 John W. Eaton - -This file is part of Octave. - -Octave is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -Octave is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with Octave; see the file COPYING. If not, write to the Free -Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "unwind-prot.h" -#include "tree-const.h" -#include "variables.h" -#include "octave.h" -#include "input.h" -#include "parse.h" -#include "lex.h" -#include "f-eval.h" - -Octave_object -feval (const Octave_object& args, int nargout) -{ -// Assumes that we have been given the correct number of arguments. - - Octave_object retval; - - tree_fvc *fcn = is_valid_function (args(1), "feval", 1); - if (fcn != (tree_fvc *) NULL) - { - int nargin = args.length () - 1; - Octave_object tmp_args (nargin); - for (int i = 0; i < nargin; i++) - tmp_args(i) = args(i+1); - retval = fcn->eval (0, nargout, tmp_args); - } - - return retval; -} - -tree_constant -eval_string (const char *string, int print, int ans_assign, - int& parse_status) -{ - begin_unwind_frame ("eval_string"); - - unwind_protect_int (get_input_from_eval_string); - unwind_protect_ptr (global_command); - unwind_protect_ptr (current_eval_string); - - get_input_from_eval_string = 1; - current_eval_string = string; - - YY_BUFFER_STATE old_buf = current_buffer (); - YY_BUFFER_STATE new_buf = create_buffer ((FILE *) NULL); - - add_unwind_protect (restore_input_buffer, (void *) old_buf); - add_unwind_protect (delete_input_buffer, (void *) new_buf); - - switch_to_buffer (new_buf); - - unwind_protect_ptr (curr_sym_tab); - - reset_parser (); - - parse_status = yyparse (); - -// Important to reset the idea of where input is coming from before -// trying to eval the command we just parsed -- it might contain the -// name of an function file that still needs to be parsed! - - tree *command = global_command; - - run_unwind_frame ("eval_string"); - - tree_constant retval; - - if (parse_status == 0 && command != NULL_TREE) - { - retval = command->eval (print); - delete command; - } - - return retval; -} - -tree_constant -eval_string (const tree_constant& arg, int& parse_status) -{ - if (! arg.is_string_type ()) - { - error ("eval: expecting string argument"); - return -1; - } - - char *string = arg.string_value (); - -// Yes Virginia, we always print here... - - return eval_string (string, 1, 1, parse_status); -} - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; page-delimiter: "^/\\*" *** -;;; End: *** -*/
deleted file mode 100644 --- a/src/f-fill.cc +++ /dev/null @@ -1,175 +0,0 @@ -// f-fill.cc -*- C++ -*- -/* - -Copyright (C) 1994 John W. Eaton - -This file is part of Octave. - -Octave is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -Octave is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with Octave; see the file COPYING. If not, write to the Free -Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "tree-const.h" -#include "user-prefs.h" -#include "utils.h" -#include "error.h" -#include "f-fill.h" - -#ifndef MIN -#define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -static void -check_dimensions (int& nr, int& nc, const char *warnfor) -{ - if (nr < 0 || nc < 0) - { - if (user_pref.treat_neg_dim_as_zero) - nr = nc = 0; - else - error ("%s: can't create a matrix with negative dimensions", - warnfor); - } -} - -static void -get_dimensions (const tree_constant& a, const char *warn_for, - int& nr, int& nc) -{ - tree_constant tmpa = a.make_numeric (); - - if (tmpa.is_scalar_type ()) - { - double tmp = tmpa.double_value (); - nr = nc = NINT (tmp); - } - else - { - nr = tmpa.rows (); - nc = tmpa.columns (); - - if ((nr == 1 && nc == 2) || (nr == 2 && nc == 1)) - { - ColumnVector v = tmpa.to_vector (); - - nr = NINT (v.elem (0)); - nc = NINT (v.elem (1)); - } - else - warning ("%s (A): use %s (size (A)) instead", warn_for, warn_for); - } - - check_dimensions (nr, nc, warn_for); // May set error_state. -} - -static void -get_dimensions (const tree_constant& a, const tree_constant& b, - const char *warn_for, int& nr, int& nc) -{ - tree_constant tmpa = a.make_numeric (); - tree_constant tmpb = b.make_numeric (); - - if (tmpa.is_scalar_type () && tmpb.is_scalar_type ()) - { - nr = NINT (tmpa.double_value ()); - nc = NINT (tmpb.double_value ()); - - check_dimensions (nr, nc, warn_for); // May set error_state. - } - else - error ("%s: expecting two scalar arguments", warn_for); -} - -tree_constant -fill_matrix (const tree_constant& a, double val, const char *warn_for) -{ - int nr, nc; - get_dimensions (a, warn_for, nr, nc); - - if (error_state) - return tree_constant (); - - Matrix m (nr, nc, val); - - return m; -} - -tree_constant -fill_matrix (const tree_constant& a, const tree_constant& b, - double val, const char *warn_for) -{ - int nr, nc; - get_dimensions (a, b, warn_for, nr, nc); // May set error_state. - - if (error_state) - return tree_constant (); - - Matrix m (nr, nc, val); - - return m; -} - -tree_constant -identity_matrix (const tree_constant& a) -{ - int nr, nc; - get_dimensions (a, "eye", nr, nc); // May set error_state. - - if (error_state) - return tree_constant (); - - Matrix m (nr, nc, 0.0); - - if (nr > 0 && nc > 0) - { - int n = MIN (nr, nc); - for (int i = 0; i < n; i++) - m.elem (i, i) = 1.0; - } - - return m; -} - -tree_constant -identity_matrix (const tree_constant& a, const tree_constant& b) -{ - int nr, nc; - get_dimensions (a, b, "eye", nr, nc); // May set error_state. - - if (error_state) - return tree_constant (); - - Matrix m (nr, nc, 0.0); - - if (nr > 0 && nc > 0) - { - int n = MIN (nr, nc); - for (int i = 0; i < n; i++) - m.elem (i, i) = 1.0; - } - - return m; -} - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; page-delimiter: "^/\\*" *** -;;; End: *** -*/
deleted file mode 100644 --- a/src/f-input.cc +++ /dev/null @@ -1,135 +0,0 @@ -// f-input.cc -*- C++ -*- -/* - -Copyright (C) 1994 John W. Eaton - -This file is part of Octave. - -Octave is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -Octave is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with Octave; see the file COPYING. If not, write to the Free -Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <string.h> - -#include "tree-const.h" -#include "octave-hist.h" -#include "pager.h" -#include "input.h" -#include "f-eval.h" -#include "f-input.h" - -static int -match_sans_spaces (const char *standard, const char *test) -{ - const char *tp = test; - while (*tp == ' ' || *tp == '\t') - tp++; - - const char *ep = test + strlen (test) - 1; - while (*ep == ' ' || *ep == '\t') - ep--; - - int len = ep - tp + 1; - - return (strncmp (standard, tp, len) == 0); -} - -tree_constant -get_user_input (const Octave_object& args, int nargout, int debug = 0) -{ - tree_constant retval; - - int nargin = args.length (); - - int read_as_string = 0; - - if (nargin == 3) - { - if (args(2).is_string_type () - && strcmp ("s", args(2).string_value ()) == 0) - read_as_string++; - else - { - error ("input: unrecognized second argument"); - return retval; - } - } - - char *prompt = "debug> "; - if (nargin > 1) - { - if (args(1).is_string_type ()) - prompt = args(1).string_value (); - else - { - error ("input: unrecognized argument"); - return retval; - } - } - - again: - - flush_output_to_pager (); - - char *input_buf = gnu_readline (prompt); - - if (input_buf != (char *) NULL) - { - if (input_buf) - maybe_save_history (input_buf); - - int len = strlen (input_buf); - - if (len < 1) - { - if (debug) - goto again; - else - return retval; - } - - if (match_sans_spaces ("exit", input_buf) - || match_sans_spaces ("quit", input_buf) - || match_sans_spaces ("return", input_buf)) - return tree_constant (); - else if (read_as_string) - retval = input_buf; - else - { - int parse_status = 0; - retval = eval_string (input_buf, 0, 0, parse_status); - if (debug && retval.is_defined ()) - retval.eval (1); - } - } - else - error ("input: reading user-input failed!"); - - if (debug) - goto again; - - return retval; -} - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; page-delimiter: "^/\\*" *** -;;; End: *** -*/
deleted file mode 100644 --- a/src/g-builtins.cc +++ /dev/null @@ -1,2135 +0,0 @@ -// g-builtins.cc -*- C++ -*- -/* - -Copyright (C) 1992, 1993, 1994 John W. Eaton - -This file is part of Octave. - -Octave is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -Octave is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with Octave; see the file COPYING. If not, write to the Free -Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -/* - -The function builtin_pwd adapted from a similar function from GNU -Bash, the Bourne Again SHell, copyright (C) 1987, 1989, 1991 Free -Software Foundation, Inc. - -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <sys/types.h> -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#include <strstream.h> -#include <iostream.h> -#include <fstream.h> -#include <stdio.h> -#include <sys/wait.h> -#include <sys/param.h> -#include <signal.h> -#include <math.h> - -#include "f-balance.h" -#include "f-chol.h" -#include "f-colloc.h" -#include "f-dassl.h" -#include "f-det.h" -#include "f-eig.h" -#include "f-expm.h" -#include "f-fft.h" -#include "f-fsolve.h" -#include "f-fsqp.h" -#include "f-givens.h" -#include "f-hess.h" -#include "f-ifft.h" -#include "f-inv.h" -#include "f-lpsolve.h" -#include "f-lsode.h" -#include "f-lu.h" -#include "f-npsol.h" -#include "f-qpsol.h" -#include "f-qr.h" -#include "f-quad.h" -#include "f-qzval.h" -#include "f-rand.h" -#include "f-schur.h" -#include "f-svd.h" -#include "f-syl.h" - -#include "sighandlers.h" -#include "procstream.h" -#include "error.h" -#include "variables.h" -#include "builtins.h" -#include "g-builtins.h" -#include "user-prefs.h" -#include "utils.h" -#include "tree.h" -#include "tree-const.h" -#include "input.h" -#include "pager.h" -#include "octave.h" -#include "version.h" -#include "file-io.h" - -extern "C" -{ -#include <readline/readline.h> - -extern char *term_clrpag; -extern void _rl_output_character_function (); -} - -#ifndef MAXPATHLEN -#define MAXPATHLEN 1024 -#endif - -#ifdef WITH_DLD -#include "dynamic-ld.h" -#define Q_STR(name) #name -#define DLD_FCN(name) Q_STR (builtin_##name##_2) -#define DLD_OBJ(name) Q_STR (f-##name##.o) -#define DLD_BUILTIN(args,n_out,name,code) \ -return octave_dld_tc2_and_go (args, n_out, Q_STR (name), \ - DLD_FCN (name), DLD_OBJ (name)); - -#else -#define DLD_BUILTIN(name,args,n_out,code) code -#endif - -// Non-zero means that pwd always give verbatim directory, regardless -// of symbolic link following. -static int verbatim_pwd = 1; - -/* - * Are all elements of a constant nonzero? - */ -Octave_object -builtin_all (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("all"); - else - { - if (nargin > 0 && args(1).is_defined ()) - { - retval.resize (1); - retval(0) = args(1).all (); - } - } - - return retval; -} - -/* - * Are any elements of a constant nonzero? - */ -Octave_object -builtin_any (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("any"); - else - { - if (nargin > 0 && args(1).is_defined ()) - { - retval.resize (1); - retval(0) = args(1).any (); - } - } - - return retval; -} - -/* - * Balancing for eigenvalue problems - */ -Octave_object -builtin_balance (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin <= 1 || nargin > 4 || nargout < 0 || nargout > 4) - print_usage ("balance"); - else - { - DLD_BUILTIN (args, nargout, balance, - retval = balance (args, nargout)); - } - - return retval; -} - -/* - * Cholesky factorization. - */ -Octave_object -builtin_chol (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2 && (nargout == 0 || nargout == 1)) - DLD_BUILTIN (args, nargout, chol, - { - retval.resize (1); - retval(0) = chol (args(1)); - }) - else - usage ("R = chol(A) \n"); - - return retval; -} - -/* - * Clear the screen? - */ -Octave_object -builtin_clc (const Octave_object& args, int nargout) -{ - Octave_object retval; - - rl_beg_of_line (); - rl_kill_line (1); - -#if ! defined (_GO32_) - if (term_clrpag) - tputs (term_clrpag, 1, _rl_output_character_function); - else - crlf (); -#else - crlf (); -#endif - - fflush (rl_outstream); - - return retval; -} - -/* - * Time in a vector. - */ -Octave_object -builtin_clock (const Octave_object& args, int nargout) -{ - Octave_object retval; - - time_t now; - struct tm *tm; - - time (&now); - tm = localtime (&now); - - Matrix m (1, 6); - m.elem (0, 0) = tm->tm_year + 1900; - m.elem (0, 1) = tm->tm_mon + 1; - m.elem (0, 2) = tm->tm_mday; - m.elem (0, 3) = tm->tm_hour; - m.elem (0, 4) = tm->tm_min; - m.elem (0, 5) = tm->tm_sec; - - retval.resize (1); - retval(0) = tree_constant (m); - - return retval; -} - -/* - * Close the stream to the plotter. - */ -Octave_object -builtin_closeplot (const Octave_object& args, int nargout) -{ - Octave_object retval; - close_plot_stream (); - return retval; -} - -/* - * Collocation roots and weights. - */ -Octave_object -builtin_colloc (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin < 2 || nargin > 4) - print_usage ("colloc"); - else - DLD_BUILTIN (args, nargout, colloc, - retval = collocation_weights (args);) - - return retval; -} - -/* - * Cumulative sums and products. - */ -Octave_object -builtin_cumprod (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("cumprod"); - else - { - if (nargin > 0 && args(1).is_defined ()) - { - retval.resize (1); - retval(0) = args(1).cumprod (); - } - } - - return retval; -} - -Octave_object -builtin_cumsum (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("cumsum"); - else - { - if (nargin > 0 && args(1).is_defined ()) - { - retval.resize (1); - retval(0) = args(1).cumsum (); - } - } - - return retval; -} - -/* - * DAEs. - */ -Octave_object -builtin_dassl (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if ((nargin == 5 || nargin == 6) && nargout >= 0) - DLD_BUILTIN (args, nargout, dassl, - retval = dassl (args, nargout);) - else - print_usage ("dassl"); - - return retval; -} - -Octave_object -builtin_dassl_options (const Octave_object& args, int nargout) -{ - Octave_object retval; - - DLD_BUILTIN (args, nargout, dassl_options, - retval = dassl_options (args, nargout);) - - return retval; -} - -/* - * Time in a string. - */ -Octave_object -builtin_date (const Octave_object& args, int nargout) -{ - Octave_object retval; - - time_t now; - struct tm *tm; - - time (&now); - tm = localtime (&now); - char date[32]; - int len = strftime (date, 31, "%d-%b-%y", tm); - if (len > 0) - { - retval.resize (1); - retval(0) = tree_constant (date); - } - - return retval; -} - -/* - * Determinant of a matrix. - */ -Octave_object -builtin_det (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2) - DLD_BUILTIN (args, nargout, det, - { - retval.resize (1); - retval(0) = determinant (args(1)); - }) - else - print_usage ("det"); - - return retval; -} - -/* - * Diagonal elements of a matrix. - */ -Octave_object -builtin_diag (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2) - { - retval.resize (1); - retval(0) = args(1).diag (); - } - else if (nargin == 3) - { - retval.resize (1); - retval(0) = args(1).diag (args(2)); - } - else - print_usage ("diag"); - - return retval; -} - -/* - * Display value without trimmings. - */ -Octave_object -builtin_disp (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2) - args(1).eval (1); - else - print_usage ("disp"); - - return retval; -} - -/* - * Compute eigenvalues and eigenvectors. - */ -Octave_object -builtin_eig (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2 && (nargout == 0 || nargout == 1 || nargout == 2)) - DLD_BUILTIN (args, nargout, eig, - retval = eig (args, nargout);) - else - print_usage ("eig"); - - return retval; -} - -/* - * Print error message and set the error state. This should - * eventually take us up to the top level, possibly printing traceback - * messages as we go. - */ -Octave_object -builtin_error (const Octave_object& args, int nargout) -{ - Octave_object retval; - - char *msg = "unspecified_error"; - - int nargin = args.length (); - - if (nargin == 2 && args(1).is_defined ()) - { - if (args(1).is_string_type ()) - { - msg = args(1).string_value (); - - if (msg == (char *) NULL || *msg == '\0') - return retval; - } - else if (args(1).is_empty ()) - { - return retval; - } - } - - error (msg); - - return retval; -} - -/* - * Evaluate text argument as octave source. - */ -Octave_object -builtin_eval (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2) - { - int parse_status = 0; - retval.resize (1); - retval(0) = eval_string (args(1), parse_status); - } - else - print_usage ("eval"); - - return retval; -} - -/* - * Check if variable or file exists. - */ -Octave_object -builtin_exist (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2 && args(1).is_string_type ()) - { - int status = identifier_exists (args(1).string_value ()); - retval.resize (1); - retval(0) = tree_constant ((double) status); - } - else - print_usage ("exist"); - - return retval; -} - -/* - * Matrix exponential. - */ -Octave_object -builtin_expm (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2) - DLD_BUILTIN (args, nargout, matrix_exp, - { - retval.resize (1); - retval(0) = matrix_exp (args(1)); - }) - else - print_usage ("expm"); - - return retval; -} - -/* - * Identity matrix. - */ -Octave_object -builtin_eye (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - switch (nargin) - { - case 2: - retval.resize (1); - retval(0) = identity_matrix (args(1)); - break; - case 3: - retval.resize (1); - retval(0) = identity_matrix (args(1), args(2)); - break; - default: - print_usage ("eye"); - break; - } - - return retval; -} - -/* - * Closing a file - */ -Octave_object -builtin_fclose (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("fclose"); - else - retval = fclose_internal (args); - - return retval; -} - -/* - * Check file for EOF condition. - */ -Octave_object -builtin_feof (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("feof"); - else - retval = feof_internal (args, nargout); - - return retval; -} - -/* - * Check file for error condition. - */ -Octave_object -builtin_ferror (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("ferror"); - else - retval = ferror_internal (args, nargout); - - return retval; -} - -/* - * Evaluate first argument as a function. - */ -Octave_object -builtin_feval (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin > 1) - retval = feval (args, nargout); - else - print_usage ("feval"); - - return retval; -} - -/* - * Flushing output to a file. - */ -Octave_object -builtin_fflush (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("fflush"); - else - retval = fflush_internal (args); - - return retval; -} - -/* - * Fast Fourier Transform. - */ -Octave_object -builtin_fft (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2) - DLD_BUILTIN (args, nargout, fft, - { - retval.resize (1); - retval(0) = fft (args(1)); - }) - else - print_usage ("fft"); - - return retval; -} - -/* - * Get a string from a file. - */ -Octave_object -builtin_fgets (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 3) - print_usage ("fgets"); - else - retval = fgets_internal (args, nargout); - - return retval; -} - -/* - * Find nonzero elements. This should probably only work if - * do_fortran_indexing is true... - */ -Octave_object -builtin_find (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2 && nargout < 4) - retval = find_nonzero_elem_idx (args(1), nargout); - else - print_usage ("find"); - - return retval; -} - -/* - * Don\'t really count floating point operations. - */ -Octave_object -builtin_flops (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin > 2) - print_usage ("flops"); - - warning ("flops always returns zero"); - - retval.resize (1); - retval(0) = tree_constant (0.0); - - return retval; -} - -/* - * Opening a file. - */ -Octave_object -builtin_fopen (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 3) - print_usage ("fopen"); - else - retval = fopen_internal (args); - - return retval; -} - -/* - * Formatted printing to a file. - */ -Octave_object -builtin_fprintf (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin < 3) - print_usage ("fprintf"); - else - retval = do_printf ("fprintf", args, nargout); - - return retval; -} - -/* - * Read binary data from a file. - */ -Octave_object -builtin_fread (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin < 2 || nargin > 4) - print_usage ("fread"); - else - retval = fread_internal (args, nargout); - - return retval; -} - -/* - * Rewind a file. - */ -Octave_object -builtin_frewind (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("frewind"); - else - retval = frewind_internal (args); - - return retval; -} - -/* - * Report on open files. - */ -Octave_object -builtin_freport (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin > 1) - warning ("freport: ignoring extra arguments"); - - retval = freport_internal (); - - return retval; -} - -/* - * Formatted reading from a file. - */ -Octave_object -builtin_fscanf (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2 && nargin != 3) - print_usage ("fscanf"); - else - retval = do_scanf ("fscanf", args, nargout); - - return retval; -} - -/* - * Seek a point in a file for reading and/or writing. - */ -Octave_object -builtin_fseek (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 3 && nargin != 4) - print_usage ("fseek"); - else - retval = fseek_internal (args); - - return retval; -} - -/* - * Nonlinear algebraic equations. - */ -Octave_object -builtin_fsolve (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin >= 3 && nargin <= 7 && nargout >= 0 && nargout <= 3) - DLD_BUILTIN (args, nargout, fsolve, - retval = fsolve (args, nargout);) - else - print_usage ("fsolve"); - - return retval; -} - -Octave_object -builtin_fsolve_options (const Octave_object& args, int nargout) -{ - Octave_object retval; - - DLD_BUILTIN (args, nargout, fsolve_options, - retval = fsolve_options (args, nargout);) - - return retval; -} - -/* - * NLPs. - */ -Octave_object -builtin_fsqp (const Octave_object& args, int nargout) -{ - Octave_object retval; - -#if defined (FSQP_MISSING) - print_usage ("fsqp"); -#else - int nargin = args.length (); - - if ((nargin == 3 || nargin == 5 || nargin == 6 || nargin == 8 - || nargin == 9 || nargin == 11) - && (nargout >= 0 && nargout <= 3)) - DLD_BUILTIN (args, nargout, fsqp, - retval = fsqp (args, nargout);) - else - print_usage ("fsolve"); -#endif - - return retval; -} - -Octave_object -builtin_fsqp_options (const Octave_object& args, int nargout) -{ - Octave_object retval; - -#if defined (FSQP_MISSING) - print_usage ("fsqp_options"); -#else - DLD_BUILTIN (args, nargout, fsqp_options, - retval = fsqp_options (args, nargout);) -#endif - - return retval; -} - -/* - * Tell current position of file. - */ -Octave_object -builtin_ftell (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("ftell"); - else - retval = ftell_internal (args); - - return retval; -} - -/* - * Write binary data to a file. - */ -Octave_object -builtin_fwrite (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin < 3 || nargin > 4) - print_usage ("fwrite"); - else - retval = fwrite_internal (args, nargout); - - return retval; -} - -/* - * Get the value of an environment variable. - */ -Octave_object -builtin_getenv (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2 && args(1).is_string_type ()) - { - retval.resize (1); - char *value = getenv (args(1).string_value ()); - if (value != (char *) NULL) - retval(0) = tree_constant (value); - else - retval(0) = tree_constant (""); - } - else - print_usage ("getenv"); - - return retval; -} - -/* - * Inverse Fast Fourier Transform. - */ -Octave_object -builtin_ifft (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2) - DLD_BUILTIN (args, nargout, ifft, - { - retval.resize (1); - retval(0) = ifft (args(1)); - }) - else - print_usage ("ifft"); - - return retval; -} - -/* - * Inverse of a square matrix. - */ -Octave_object -builtin_inv (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2) - DLD_BUILTIN (args, nargout, inv, - { - retval.resize (1); - retval(0) = inverse (args(1)); - }) - else - print_usage ("inv"); - - return retval; -} - -/* - * Prompt user for input. - */ -Octave_object -builtin_input (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2 || nargin == 3) - { - retval.resize (1); - retval(0) = get_user_input (args, nargout); - } - else - print_usage ("input"); - - return retval; -} - -/* - * Does the given string name a global variable? - */ -Octave_object -builtin_is_global (const Octave_object& args, int nargout) -{ - Octave_object retval(1); - retval(0) = tree_constant (0.0); - - int nargin = args.length (); - - if (nargin == 2 && args(1).is_string_type ()) - { - char *name = args(1).string_value (); - if (is_globally_visible (name)) - retval(0) = tree_constant (1.0); - } - else - print_usage ("is_global"); - - return retval; -} - -/* - * Is the argument a string? - */ -Octave_object -builtin_isstr (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("isstr"); - else - { - if (nargin > 0 && args(1).is_defined ()) - { - retval.resize (1); - retval(0) = args(1).isstr (); - } - } - - return retval; -} - -Octave_object -builtin_kbhit (const Octave_object& args, int nargout) -{ - Octave_object retval; - -// XXX FIXME XXX -- add timeout and default value args? - - if (interactive) - { - int c = kbhit (); - char *s = new char [2]; - s[0] = c; - s[1] = '\0'; - retval.resize (1); - retval(0) = tree_constant (s); - } - - return retval; -} - -/* - * Maybe help in debugging. - */ -Octave_object -builtin_keyboard (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 1 || nargin == 2) - { - retval.resize (1); - retval(0) = get_user_input (args, nargout, 1); - } - else - print_usage ("keyboard"); - - return retval; -} - -/* - * Matrix logarithm. - */ -Octave_object -builtin_logm (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2) - retval = matrix_log (args(1)); - else - print_usage ("logm"); - - return retval; -} - -/* - * LPs. - */ -Octave_object -builtin_lpsolve (const Octave_object& args, int nargout) -{ - Octave_object retval; - -// Force a bad value of inform, and empty matrices for x and phi. - retval.resize (3); - Matrix m; - retval(0) = tree_constant (m); - retval(1) = tree_constant (m); - retval(2) = tree_constant (-1.0); - - int nargin = args.length (); - - if (nargin == 0) - DLD_BUILTIN (args, nargout, lpsolve, - retval = lpsolve (args, nargout);) - else - print_usage ("lp_solve"); - - return retval; -} - -Octave_object -builtin_lpsolve_options (const Octave_object& args, int nargout) -{ - Octave_object retval; - - DLD_BUILTIN (args, nargout, lpsolve_options, - retval = lpsolve_options (args, nargout);) - - return retval; -} - -/* - * ODEs. - */ -Octave_object -builtin_lsode (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if ((nargin == 4 || nargin == 5) && (nargout == 0 || nargout == 1)) - DLD_BUILTIN (args, nargout, lsode, - retval = lsode (args, nargout);) - else - print_usage ("lsode"); - - return retval; -} - -Octave_object -builtin_lsode_options (const Octave_object& args, int nargout) -{ - Octave_object retval; - - DLD_BUILTIN (args, nargout, lsode_options, - retval = lsode_options (args, nargout);) - - return retval; -} - -/* - * LU factorization. - */ -Octave_object -builtin_lu (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2 && nargout < 4) - DLD_BUILTIN (args, nargout, lu, - retval = lu (args(1), nargout);) - else - print_usage ("lu"); - - return retval; -} - -/* - * Max values. - */ -Octave_object -builtin_max (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if ((nargin == 2 && (nargout == 0 || nargout == 1 || nargout == 2)) - || (nargin == 3 && (nargout == 0 || nargout == 1))) - retval = column_max (args, nargout); - else - print_usage ("max"); - - return retval; -} - -/* - * Min values. - */ -Octave_object -builtin_min (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if ((nargin == 2 && (nargout == 0 || nargout == 1 || nargout == 2)) - || (nargin == 3 && (nargout == 0 || nargout == 1))) - retval = column_min (args, nargout); - else - print_usage ("min"); - - return retval; -} - -/* - * NLPs. - */ -Octave_object -builtin_npsol (const Octave_object& args, int nargout) -{ - Octave_object retval; - -#if defined (NPSOL_MISSING) -// Force a bad value of inform, and empty matrices for x, phi, and lambda. - retval.resize (3); - Matrix m; - retval(0) = tree_constant (m); - retval(1) = tree_constant (m); - retval(2) = tree_constant (-1.0); - retval(3) = tree_constant (m); - print_usage ("npsol"); -#else - int nargin = args.length (); - - if ((nargin == 3 || nargin == 5 || nargin == 6 || nargin == 8 - || nargin == 9 || nargin == 11) - && (nargout >= 0 && nargout <= 4)) - DLD_BUILTIN (args, nargout, npsol, - retval = npsol (args, nargout);) - else - print_usage ("npsol"); -#endif - - return retval; -} - -Octave_object -builtin_npsol_options (const Octave_object& args, int nargout) -{ - Octave_object retval; - -#if defined (NPSOL_MISSING) - print_usage ("npsol_options"); -#else - DLD_BUILTIN (args, nargout, npsol_options, - retval = npsol_options (args, nargout);) -#endif - - return retval; -} - -/* - * A matrix of ones. - */ -Octave_object -builtin_ones (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - switch (nargin) - { - case 2: - retval.resize (1); - retval(0) = fill_matrix (args(1), 1.0, "ones"); - break; - case 3: - retval.resize (1); - retval(0) = fill_matrix (args(1), args(2), 1.0, "ones"); - break; - default: - print_usage ("ones"); - break; - } - - return retval; -} - -/* - * You guessed it. - */ -Octave_object -builtin_pause (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (! (nargin == 1 || nargin == 2)) - { - print_usage ("pause"); - return retval; - } - - if (interactive) - { - switch (nargin) - { - case 2: - { - int delay = NINT (args(1).double_value ()); - if (delay > 0) - { - sleep (delay); - break; - } - } - default: - if (kbhit () == EOF) - clean_up_and_exit (0); - break; - } - } - - return retval; -} - -/* - * Delete turds from /tmp. - */ -Octave_object -builtin_purge_tmp_files (const Octave_object& args, int nargout) -{ - Octave_object retval; - cleanup_tmp_files (); - return retval; -} - -/* - * Formatted printing. - */ -Octave_object -builtin_printf (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin < 2) - print_usage ("printf"); - else - retval = do_printf ("printf", args, nargout); - - return retval; -} - -/* - * Product. - */ -Octave_object -builtin_prod (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("prod"); - else - { - if (nargin > 0 && args(1).is_defined ()) - { - retval.resize (1); - retval(0) = args(1).prod (); - } - } - - return retval; -} - -/* - * Print name of current working directory. - */ -Octave_object -builtin_pwd (const Octave_object& args, int nargout) -{ - Octave_object retval; - char *directory; - - if (verbatim_pwd) - { - char *buffer = new char [MAXPATHLEN]; - directory = getcwd (buffer, MAXPATHLEN); - - if (!directory) - { - warning ("pwd: can't find working directory!"); - delete buffer; - } - } - else - { - directory = get_working_directory ("pwd"); - } - - if (directory) - { - char *s = strconcat (directory, "\n"); - retval.resize (1); - retval(0) = tree_constant (s); - delete [] s; - } - return retval; -} - -/* - * QPs. - */ -Octave_object -builtin_qpsol (const Octave_object& args, int nargout) -{ - Octave_object retval; - -#if defined (QPSOL_MISSING) -// Force a bad value of inform, and empty matrices for x, phi, and lambda. - retval.resize (4); - Matrix m; - retval(0) = tree_constant (m); - retval(1) = tree_constant (m); - retval(2) = tree_constant (-1.0); - retval(3) = tree_constant (m); - print_usage ("qpsol"); -#else - int nargin = args.length (); - - if ((nargin == 4 || nargin == 6 || nargin == 7 || nargin == 9) - && (nargout >= 0 && nargout <= 4)) - DLD_BUILTIN (args, nargout, qpsol, - retval = qpsol (args, nargout);) - else - print_usage ("qpsol"); -#endif - - return retval; -} - -Octave_object -builtin_qpsol_options (const Octave_object& args, int nargout) -{ - Octave_object retval; - -#if defined (QPSOL_MISSING) - print_usage ("qpsol"); -#else - DLD_BUILTIN (args, nargout, qpsol_options, - retval = qpsol_options (args, nargout);) -#endif - - return retval; -} - -/* - * QR factorization. - */ -Octave_object -builtin_qr (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2 && nargout < 3) - DLD_BUILTIN (args, nargout, qr, - retval = qr (args(1), nargout);) - else - print_usage ("qr"); - - return retval; -} - -/* - * generalized eigenvalues via qz - */ -Octave_object -builtin_qzval (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 3 && nargout < 2) - DLD_BUILTIN (args, nargout, qzvalue, - retval = qzvalue (args, nargout);) - else - print_usage ("qzval"); - - return retval; -} - -/* - * Random numbers. - */ -Octave_object -builtin_quad (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if ((nargin > 3 && nargin < 7) && (nargout >= 0 && nargout < 5)) - DLD_BUILTIN (args, nargout, quad, - retval = do_quad (args, nargout);) - else - print_usage ("quad"); - - return retval; -} - -Octave_object -builtin_quad_options (const Octave_object& args, int nargout) -{ - Octave_object retval; - - DLD_BUILTIN (args, nargout, quad_options, - retval = quad_options (args, nargout);) - - return retval; -} - -/* - * I'm outta here. - */ -Octave_object -builtin_quit (const Octave_object& args, int nargout) -{ - Octave_object retval; - quitting_gracefully = 1; - clean_up_and_exit (0); - return retval; -} - -/* - * Random numbers. - */ -Octave_object -builtin_rand (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if ((nargin > 0 && nargin < 4) && (nargout == 0 || nargout == 1)) - DLD_BUILTIN (args, nargout, rand, - retval = rand_internal (args, nargout);) - else - print_usage ("rand"); - - return retval; -} - -/* - * Formatted reading. - */ -Octave_object -builtin_scanf (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("scanf"); - else - retval = do_scanf ("scanf", args, nargout); - - return retval; -} - -/* - * Convert a vector to a string. - */ -Octave_object -builtin_setstr (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2) - { - retval.resize (1); - retval(0) = args(1).convert_to_str (); - } - else - print_usage ("setstr"); - - return retval; -} - -/* - * Execute a shell command. - */ -Octave_object -builtin_shell_command (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2 && args(1).is_string_type ()) - { - iprocstream cmd (args(1).string_value ()); - char ch; - ostrstream output_buf; - while (cmd.get (ch)) - output_buf.put (ch); - output_buf << ends; - int status = cmd.close (); - switch (nargout) - { - case 1: - maybe_page_output (output_buf); - retval.resize (1); - retval(0) = tree_constant ((double) status); - break; - case 2: - retval.resize (2); - retval(0) = tree_constant ((double) status); - retval(1) = tree_constant (output_buf.str ()); - break; - break; - } - } - else - print_usage ("shell_cmd"); - - return retval; -} - -/* - * Report rows and columns. - */ -Octave_object -builtin_size (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("size"); - else - { - if (nargin > 0 && args(1).is_defined ()) - { - int nr = args(1).rows (); - int nc = args(1).columns (); - if (nargout == 0 || nargout == 1) - { - Matrix m (1, 2); - m.elem (0, 0) = nr; - m.elem (0, 1) = nc; - retval.resize (1); - retval(0) = tree_constant (m); - } - else if (nargout == 2) - { - retval.resize (2); - retval(0) = tree_constant ((double) nr); - retval(1) = tree_constant ((double) nc); - } - else - print_usage ("size"); - } - } - - return retval; -} - -/* - * Sort columns. - */ -Octave_object -builtin_sort (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2) - retval = sort (args, nargout); - else - print_usage ("sort"); - - return retval; -} - -/* - * Formatted printing to a string. - */ -Octave_object -builtin_sprintf (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin < 2) - print_usage ("sprintf"); - else - retval = do_printf ("sprintf", args, nargout); - - return retval; -} - -/* - * Matrix sqrt. - */ -Octave_object -builtin_sqrtm (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2) - retval = matrix_sqrt (args(1)); - else - print_usage ("sqrtm"); - - return retval; -} - -/* - * Formatted reading from a string. - */ -Octave_object -builtin_sscanf (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 3) - print_usage ("sscanf"); - else - retval = do_scanf ("sscanf", args, nargout); - - return retval; -} - -/* - * Sum. - */ -Octave_object -builtin_sum (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("sum"); - else - { - if (nargin > 0 && args(1).is_defined ()) - { - retval.resize (1); - retval(0) = args(1).sum (); - } - } - - return retval; -} - -/* - * Sum of squares. - */ -Octave_object -builtin_sumsq (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 2) - print_usage ("sumsq"); - else - { - if (nargin > 0 && args(1).is_defined ()) - { - retval.resize (1); - retval(0) = args(1).sumsq (); - } - } - - return retval; -} - -/* - * Singluar value decomposition. - */ -Octave_object -builtin_svd (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2 && (nargout == 0 || nargout == 1 || nargout == 3)) - DLD_BUILTIN (args, nargout, svd, - retval = svd (args, nargout);) - else - print_usage ("svd"); - - return retval; -} - -/* - * Sylvester equation solver. - */ -Octave_object -builtin_syl (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if ((nargin == 4) && (nargout == 0 || nargout == 1)) - DLD_BUILTIN (args, nargout, syl, - retval = syl (args, nargout);) - else - print_usage ("syl"); - - return retval; -} - -/* - * Schur Decomposition. - */ -Octave_object -builtin_schur (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if ((nargin == 3 || nargin == 2) - && (nargout == 0 || nargout == 1 || nargout == 2)) - DLD_BUILTIN (args, nargout, schur, - retval = schur (args, nargout);) - else - print_usage ("schur"); - - return retval; -} - -/* - * Givens rotation. - */ -Octave_object -builtin_givens (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 3 && (nargout == 0 || nargout == 1 || nargout == 2 )) - retval = givens (args, nargout); - else - print_usage ("givens"); - - return retval; -} - -/* - * Hessenberg Decomposition. - */ -Octave_object -builtin_hess (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 2 && (nargout == 0 || nargout == 1 || nargout == 2)) - DLD_BUILTIN (args, nargout, hess, - retval = hess (args, nargout);) - else - print_usage ("hess"); - - return retval; -} - -/* - * Variable argument lists. - */ -Octave_object -builtin_va_arg (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 1) - { - if (curr_function != (tree_function *) NULL) - { - if (curr_function->takes_varargs ()) - { - retval.resize (1); - retval(0) = curr_function->octave_va_arg (); - } - else - { - error ("va_arg only valid within function taking variable"); - error ("number of arguments"); - } - } - else - error ("va_arg only valid within function body"); - } - else - print_usage ("va_arg"); - - return retval; -} - -Octave_object -builtin_va_start (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 1) - { - if (curr_function != (tree_function *) NULL) - { - if (curr_function->takes_varargs ()) - curr_function->octave_va_start (); - else - { - error ("va_start only valid within function taking variable"); - error ("number of arguments"); - } - } - else - error ("va_start only valid within function body"); - } - else - print_usage ("va_start"); - - return retval; -} - -/* - * Copying information. - */ -Octave_object -builtin_warranty (const Octave_object& args, int nargout) -{ - Octave_object retval; - - ostrstream output_buf; - output_buf << "\n Octave, version " << version_string - << ". Copyright (C) 1992, 1993, 1994 John W. Eaton\n" - << "\n\ - This program is free software; you can redistribute it and/or modify\n\ - it under the terms of the GNU General Public License as published by\n\ - the Free Software Foundation; either version 2 of the License, or\n\ - (at your option) any later version.\n\n\ - This program is distributed in the hope that it will be useful,\n\ - but WITHOUT ANY WARRANTY; without even the implied warranty of\n\ - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\ - GNU General Public License for more details.\n\n\ - You should have received a copy of the GNU General Public License\n\ - along with this program. If not, write to the Free Software\n\ - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.\n\n"; - - output_buf << ends; - maybe_page_output (output_buf); - - return retval; -} - -/* - * A matrix of zeros. - */ -Octave_object -builtin_zeros (const Octave_object& args, int nargout) -{ - Octave_object retval; - - int nargin = args.length (); - - switch (nargin) - { - case 2: - retval.resize (1); - retval(0) = fill_matrix (args(1), 0.0, "zeros"); - break; - case 3: - retval.resize (1); - retval(0) = fill_matrix (args(1), args(2), 0.0, "zeros"); - break; - default: - print_usage ("zeros"); - break; - } - - return retval; -} - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; page-delimiter: "^/\\*" *** -;;; End: *** -*/
deleted file mode 100644 --- a/src/g-builtins.h +++ /dev/null @@ -1,247 +0,0 @@ -// Builtin general function support. -*- C++ -*- -/* - -Copyright (C) 1992, 1993, 1994 John W. Eaton - -This file is part of Octave. - -Octave is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -Octave is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with Octave; see the file COPYING. If not, write to the Free -Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#if !defined (octave_g_builtins_h) -#define octave_g_builtins_h 1 - -#include "tree-const.h" - -struct builtin_general_functions -{ - char *name; - int nargin_max; - int nargout_max; - General_fcn general_fcn; - char *help_string; -}; - -extern Octave_object builtin_all (const Octave_object& args, int nargout); - -extern Octave_object builtin_any (const Octave_object& args, int nargout); - -extern Octave_object builtin_balance (const Octave_object& args, int nargout); - -extern Octave_object builtin_chol (const Octave_object& args, int nargout); - -extern Octave_object builtin_clc (const Octave_object& args, int nargout); - -extern Octave_object builtin_clock (const Octave_object& args, int nargout); - -extern Octave_object builtin_closeplot (const Octave_object& args, - int nargout); - -extern Octave_object builtin_colloc (const Octave_object& args, int nargout); - -extern Octave_object builtin_cumprod (const Octave_object& args, int nargout); - -extern Octave_object builtin_cumsum (const Octave_object& args, int nargout); - -extern Octave_object builtin_dassl (const Octave_object& args, int nargout); - -extern Octave_object builtin_dassl_options (const Octave_object& args, - int nargout); - -extern Octave_object builtin_date (const Octave_object& args, int nargout); - -extern Octave_object builtin_det (const Octave_object& args, int nargout); - -extern Octave_object builtin_diag (const Octave_object& args, int nargout); - -extern Octave_object builtin_disp (const Octave_object& args, int nargout); - -extern Octave_object builtin_eig (const Octave_object& args, int nargout); - -extern Octave_object builtin_error (const Octave_object& args, int nargout); - -extern Octave_object builtin_eval (const Octave_object& args, int nargout); - -extern Octave_object builtin_exist (const Octave_object& args, int nargout); - -extern Octave_object builtin_expm (const Octave_object& args, int nargout); - -extern Octave_object builtin_eye (const Octave_object& args, int nargout); - -extern Octave_object builtin_fclose (const Octave_object& args, int nargout); - -extern Octave_object builtin_feof (const Octave_object& args, int nargout); - -extern Octave_object builtin_ferror (const Octave_object& args, int nargout); - -extern Octave_object builtin_feval (const Octave_object& args, int nargout); - -extern Octave_object builtin_fflush (const Octave_object& args, int nargout); - -extern Octave_object builtin_fft (const Octave_object& args, int nargout); - -extern Octave_object builtin_fgets (const Octave_object& args, int nargout); - -extern Octave_object builtin_find (const Octave_object& args, int nargout); - -extern Octave_object builtin_flops (const Octave_object& args, int nargout); - -extern Octave_object builtin_fopen (const Octave_object& args, int nargout); - -extern Octave_object builtin_fprintf (const Octave_object& args, int nargout); - -extern Octave_object builtin_fread (const Octave_object& args, int nargout); - -extern Octave_object builtin_frewind (const Octave_object& args, int nargout); - -extern Octave_object builtin_freport (const Octave_object& args, int nargout); - -extern Octave_object builtin_fscanf (const Octave_object& args, int nargout); - -extern Octave_object builtin_fseek (const Octave_object& args, int nargout); - -extern Octave_object builtin_fsolve (const Octave_object& args, int nargout); - -extern Octave_object builtin_fsolve_options (const Octave_object& args, - int nargout); - -extern Octave_object builtin_fsqp (const Octave_object& args, int nargout); - -extern Octave_object builtin_fsqp_options (const Octave_object& args, - int nargout); - -extern Octave_object builtin_ftell (const Octave_object& args, int nargout); - -extern Octave_object builtin_fwrite (const Octave_object& args, int nargout); - -extern Octave_object builtin_getenv (const Octave_object& args, int nargout); - -extern Octave_object builtin_givens (const Octave_object& args, int nargout); - -extern Octave_object builtin_hess (const Octave_object& args, int nargout); - -extern Octave_object builtin_input (const Octave_object& args, int nargout); - -extern Octave_object builtin_ifft (const Octave_object& args, int nargout); - -extern Octave_object builtin_inv (const Octave_object& args, int nargout); - -extern Octave_object builtin_is_global (const Octave_object& args, - int nargout); - -extern Octave_object builtin_isstr (const Octave_object& args, int nargout); - -extern Octave_object builtin_kbhit (const Octave_object& args, int nargout); - -extern Octave_object builtin_keyboard (const Octave_object& args, int nargout); - -extern Octave_object builtin_logm (const Octave_object& args, int nargout); - -extern Octave_object builtin_lpsolve (const Octave_object& args, int nargout); - -extern Octave_object builtin_lpsolve_options (const Octave_object& args, - int nargout); - -extern Octave_object builtin_lsode (const Octave_object& args, int nargout); - -extern Octave_object builtin_lsode_options (const Octave_object& args, - int nargout); - -extern Octave_object builtin_lu (const Octave_object& args, int nargout); - -extern Octave_object builtin_max (const Octave_object& args, int nargout); - -extern Octave_object builtin_min (const Octave_object& args, int nargout); - -extern Octave_object builtin_npsol (const Octave_object& args, int nargout); - -extern Octave_object builtin_npsol_options (const Octave_object& args, - int nargout); - -extern Octave_object builtin_ones (const Octave_object& args, int nargout); - -extern Octave_object builtin_pause (const Octave_object& args, int nargout); - -extern Octave_object builtin_purge_tmp_files (const Octave_object& args, - int nargout); - -extern Octave_object builtin_printf (const Octave_object& args, int nargout); - -extern Octave_object builtin_prod (const Octave_object& args, int nargout); - -extern Octave_object builtin_pwd (const Octave_object& args, int nargout); - -extern Octave_object builtin_qpsol (const Octave_object& args, int nargout); - -extern Octave_object builtin_qpsol_options (const Octave_object& args, - int nargout); - -extern Octave_object builtin_qr (const Octave_object& args, int nargout); - -extern Octave_object builtin_quad (const Octave_object& args, int nargout); - -extern Octave_object builtin_quad_options (const Octave_object& args, - int nargout); - -extern Octave_object builtin_quit (const Octave_object& args, int nargout); - -extern Octave_object builtin_qzval (const Octave_object& args, int nargout); - -extern Octave_object builtin_rand (const Octave_object& args, int nargout); - -extern Octave_object builtin_setstr (const Octave_object& args, int nargout); - -extern Octave_object builtin_scanf (const Octave_object& args, int nargout); - -extern Octave_object builtin_schur (const Octave_object& args, int nargout); - -extern Octave_object builtin_shell_command (const Octave_object& args, - int nargout); - -extern Octave_object builtin_size (const Octave_object& args, int nargout); - -extern Octave_object builtin_sort (const Octave_object& args, int nargout); - -extern Octave_object builtin_sprintf (const Octave_object& args, int nargout); - -extern Octave_object builtin_sqrtm (const Octave_object& args, int nargout); - -extern Octave_object builtin_sscanf (const Octave_object& args, int nargout); - -extern Octave_object builtin_sum (const Octave_object& args, int nargout); - -extern Octave_object builtin_sumsq (const Octave_object& args, int nargout); - -extern Octave_object builtin_svd (const Octave_object& args, int nargout); - -extern Octave_object builtin_syl (const Octave_object& args, int nargout); - -extern Octave_object builtin_va_arg (const Octave_object& args, int nargout); - -extern Octave_object builtin_va_start (const Octave_object& args, int nargout); - -extern Octave_object builtin_warranty (const Octave_object& args, int nargout); - -extern Octave_object builtin_zeros (const Octave_object& args, int nargout); - -#endif - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; page-delimiter: "^/\\*" *** -;;; End: *** -*/