Navigation

Operators and Keywords

Function List:

C++ API

max.cc File Reference

#include "lo-ieee.h"
#include "lo-mappers.h"
#include "lo-math.h"
#include "dNDArray.h"
#include "CNDArray.h"
#include "quit.h"
#include "defun-dld.h"
#include "error.h"
#include "gripes.h"
#include "oct-obj.h"
#include "ov-cx-mat.h"
#include "ov-re-sparse.h"
#include "ov-cx-sparse.h"

Include dependency graph for max.cc:


Defines

#define MINMAX_DOUBLE_SBODY(FCN)
#define MINMAX_DOUBLE_BODY(FCN)
#define MINMAX_SINGLE_SBODY(FCN)
#define MINMAX_SINGLE_BODY(FCN)
#define MINMAX_INT_SBODY(FCN, TYP)
#define MINMAX_INT_BODY(FCN, TYP)
#define MINMAX_SPARSE_BODY(FCN)
#define MINMAX_BODY(FCN)
#define CUMMINMAX_BODY(FCN)

Functions

 DEFUN_DLD (min, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} min (@var{x})\n\ @deftypefnx {Loadable Function} {} min (@var{x}, @var{y})\n\ @deftypefnx {Loadable Function} {} min (@var{x}, @var{y}, @var{dim})\n\ @deftypefnx {Loadable Function} {[@var{w}, @var{iw}] =} min (@var{x})\n\ For a vector argument, return the minimum value. For a matrix\n\ argument, return the minimum value from each column, as a row\n\ vector, or over the dimension @var{dim} if defined. For two matrices\n\ (or a matrix and scalar), return the pair-wise minimum.\n\ Thus,\n\ \n\ @example\n\ min (min (@var{x}))\n\ @end example\n\ \n\ @noindent\n\ returns the smallest element of @var{x}, and\n\ \n\ @example\n\ @group\n\ min (2:5, pi)\n\ @result{} 2.0000 3.0000 3.1416 3.1416\n\ @end group\n\ @end example\n\ @noindent\n\ compares each element of the range @code{2:5} with @code{pi}, and\n\ returns a row vector of the minimum values.\n\ \n\ For complex arguments, the magnitude of the elements are used for\n\ comparison.\n\ \n\ If called with one input and two output arguments,\n\ @code{min} also returns the first index of the\n\ minimum value(s). Thus,\n\ \n\ @example\n\ @group\n\ [x, ix] = min ([1, 3, 0, 2, 0])\n\ @result{} x = 0\n\ ix = 3\n\ @end group\n\ @end example\n\ @seealso{max, cummin, cummax}\n\ @end deftypefn")
 DEFUN_DLD (max, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} max (@var{x})\n\ @deftypefnx {Loadable Function} {} max (@var{x}, @var{y})\n\ @deftypefnx {Loadable Function} {} max (@var{x}, @var{y}, @var{dim})\n\ @deftypefnx {Loadable Function} {[@var{w}, @var{iw}] =} max (@var{x})\n\ For a vector argument, return the maximum value. For a matrix\n\ argument, return the maximum value from each column, as a row\n\ vector, or over the dimension @var{dim} if defined. For two matrices\n\ (or a matrix and scalar), return the pair-wise maximum.\n\ Thus,\n\ \n\ @example\n\ max (max (@var{x}))\n\ @end example\n\ \n\ @noindent\n\ returns the largest element of the matrix @var{x}, and\n\ \n\ @example\n\ @group\n\ max (2:5, pi)\n\ @result{} 3.1416 3.1416 4.0000 5.0000\n\ @end group\n\ @end example\n\ @noindent\n\ compares each element of the range @code{2:5} with @code{pi}, and\n\ returns a row vector of the maximum values.\n\ \n\ For complex arguments, the magnitude of the elements are used for\n\ comparison.\n\ \n\ If called with one input and two output arguments,\n\ @code{max} also returns the first index of the\n\ maximum value(s). Thus,\n\ \n\ @example\n\ @group\n\ [x, ix] = max ([1, 3, 5, 2, 5])\n\ @result{} x = 5\n\ ix = 3\n\ @end group\n\ @end example\n\ @seealso{min, cummax, cummin}\n\ @end deftypefn")
 DEFUN_DLD (cummin, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} cummin (@var{x})\n\ @deftypefnx {Loadable Function} {} cummin (@var{x}, @var{dim})\n\ @deftypefnx {Loadable Function} {[@var{w}, @var{iw}] =} cummin (@var{x})\n\ Return the cumulative minimum values along dimension @var{dim}. If @var{dim}\n\ is unspecified it defaults to column-wise operation. For example,\n\ \n\ @example\n\ @group\n\ cummin ([5 4 6 2 3 1])\n\ @result{} 5 4 4 2 2 1\n\ @end group\n\ @end example\n\ \n\ \n\ The call\n\ @example\n\ [w, iw] = cummin (x, dim)\n\ @end example\n\ \n\ @noindent\n\ is equivalent to the following code:\n\ @example\n\ @group\n\ w = iw = zeros (size (x));\n\ idxw = idxx = repmat (@{':'@}, 1, ndims (x));\n\ for i = 1:size (x, dim)\n\ idxw@{dim@} = i; idxx@{dim@} = 1:i;\n\ [w(idxw@{:@}), iw(idxw@{:@})] = min(x(idxx@{:@}), [], dim);\n\ endfor\n\ @end group\n\ @end example\n\ \n\ @noindent\n\ but computed in a much faster manner.\n\ @seealso{cummax, min, max}\n\ @end deftypefn")
 DEFUN_DLD (cummax, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} cummax (@var{x})\n\ @deftypefnx {Loadable Function} {} cummax (@var{x}, @var{dim})\n\ @deftypefnx {Loadable Function} {[@var{w}, @var{iw}] =} cummax (@var{x})\n\ Return the cumulative maximum values along dimension @var{dim}. If @var{dim}\n\ is unspecified it defaults to column-wise operation. For example,\n\ \n\ @example\n\ @group\n\ cummax ([1 3 2 6 4 5])\n\ @result{} 1 3 3 6 6 6\n\ @end group\n\ @end example\n\ \n\ The call\n\ @example\n\ [w, iw] = cummax (x, dim)\n\ @end example\n\ \n\ @noindent\n\ is equivalent to the following code:\n\ @example\n\ @group\n\ w = iw = zeros (size (x));\n\ idxw = idxx = repmat (@{':'@}, 1, ndims (x));\n\ for i = 1:size (x, dim)\n\ idxw@{dim@} = i; idxx@{dim@} = 1:i;\n\ [w(idxw@{:@}), iw(idxw@{:@})] = max(x(idxx@{:@}), [], dim);\n\ endfor\n\ @end group\n\ @end example\n\ \n\ @noindent\n\ but computed in a much faster manner.\n\ @seealso{cummin, max, min}\n\ @end deftypefn")

Define Documentation

#define CUMMINMAX_BODY ( FCN   ) 

#define MINMAX_BODY ( FCN   ) 

#define MINMAX_DOUBLE_BODY ( FCN   ) 

#define MINMAX_DOUBLE_SBODY ( FCN   ) 

#define MINMAX_INT_BODY ( FCN,
TYP   ) 

#define MINMAX_INT_SBODY ( FCN,
TYP   ) 

#define MINMAX_SINGLE_BODY ( FCN   ) 

#define MINMAX_SINGLE_SBODY ( FCN   ) 

#define MINMAX_SPARSE_BODY ( FCN   ) 


Function Documentation

DEFUN_DLD ( cummax  ,
args  ,
nargout   
)

DEFUN_DLD ( cummin  ,
args  ,
nargout   
)

DEFUN_DLD ( max  ,
args  ,
nargout   
)

DEFUN_DLD ( min  ,
args  ,
nargout   
)