GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include <istream>
#include <iostream>
#include <sstream>
#include <vector>
#include "oct-locbuf.h"
#include "defun.h"
#include "error.h"
#include "gripes.h"
#include "oct-map.h"
#include "ov-base.h"
#include "ov-fcn-inline.h"
#include "ov-usr-fcn.h"
#include "pr-output.h"
#include "variables.h"
#include "parse.h"
#include "toplev.h"
#include "byte-swap.h"
#include "ls-ascii-helper.h"
#include "ls-oct-ascii.h"
#include "ls-hdf5.h"
#include "ls-utils.h"
Go to the source code of this file.
Functions | |
DEFINE_OCTAVE_ALLOCATOR (octave_fcn_inline) | |
DEFUN (formula, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} formula (@var{fun})\n\ Return a character string representing the inline function @var{fun}.\n\ Note that @code{char (@var{fun})} is equivalent to\n\ @code{formula (@var{fun})}.\n\ @seealso{argnames, inline, vectorize}\n\ @end deftypefn") | |
DEFUN (argnames, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} argnames (@var{fun})\n\ Return a cell array of character strings containing the names of\n\ the arguments of the inline function @var{fun}.\n\ @seealso{inline, formula, vectorize}\n\ @end deftypefn") | |
DEFUN (vectorize, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} vectorize (@var{fun})\n\ Create a vectorized version of the inline function @var{fun}\n\ by replacing all occurrences of @code{*}, @code{/}, etc., with\n\ @code{.*}, @code{./}, etc.\n\ \n\ This may be useful, for example, when using inline functions with\n\ numerical integration or optimization where a vector-valued function\n\ is expected.\n\ \n\ @example\n\ @group\n\ fcn = vectorize (inline (\"x^2 - 1\"))\n\ @result{} fcn = f(x) = x.^2 - 1\n\ quadv (fcn, 0, 3)\n\ @result{} 6\n\ @end group\n\ @end example\n\ @seealso{inline, formula, argnames}\n\ @end deftypefn") | |
DEFUNX ("inline", Finline, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} inline (@var{str})\n\ @deftypefnx {Built-in Function} {} inline (@var{str}, @var{arg1}, @dots{})\n\ @deftypefnx {Built-in Function} {} inline (@var{str}, @var{n})\n\ Create an inline function from the character string @var{str}.\n\ If called with a single argument, the arguments of the generated\n\ function are extracted from the function itself. The generated\n\ function arguments will then be in alphabetical order. It should\n\ be noted that i, and j are ignored as arguments due to the\n\ ambiguity between their use as a variable or their use as an inbuilt\n\ constant. All arguments followed by a parenthesis are considered\n\ to be functions. If no arguments are found, a function taking a single\n\ argument named @code{x} will be created.\n\ \n\ If the second and subsequent arguments are character strings,\n\ they are the names of the arguments of the function.\n\ \n\ If the second argument is an integer @var{n}, the arguments are\n\ @qcode{\"x\"}, @qcode{\"P1\"}, @dots{}, @qcode{\"P@var{N}\"}.\n\ @seealso{argnames, formula, vectorize}\n\ @end deftypefn") |
DEFINE_OCTAVE_ALLOCATOR | ( | octave_fcn_inline | ) |
DEFUN | ( | formula | , |
args | |||
) |
Definition at line 845 of file ov-fcn-inline.cc.
References error(), octave_fcn_inline::fcn_inline_value(), octave_fcn_inline::fcn_text(), octave_value::length(), octave_value(), and print_usage().
DEFUN | ( | argnames | , |
args | |||
) |
Definition at line 883 of file ov-fcn-inline.cc.
References error(), octave_fcn_inline::fcn_arg_names(), octave_fcn_inline::fcn_inline_value(), Array< T >::length(), octave_value::length(), and print_usage().
DEFUN | ( | vectorize | , |
args | |||
) |
Definition at line 930 of file ov-fcn-inline.cc.
References error(), error_state, octave_fcn_inline::fcn_arg_names(), octave_fcn_inline::fcn_inline_value(), octave_fcn_inline::fcn_text(), octave_value::length(), octave_value(), print_usage(), and octave_base_value::string_value().
DEFUNX | ( | "inline" | , |
Finline | , | ||
args | |||
) |
Definition at line 636 of file ov-fcn-inline.cc.
References string_vector::append(), error(), error_state, octave_value::int_value(), Array< T >::length(), octave_value::length(), octave_value(), print_usage(), string_vector::resize(), and string_vector::sort().