COX Library util.cox


file util

util.cox

1995/1996 Joern Sierwald

Welcome to macro heaven.
Implementations for some MATLAB compatible functions.


All

INTEGER_VECTOR prefix operator All (const MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTEGER_VECTOR  prefix operator All (const MATRIX & m) precedence 28;
description
Returns a row vector of ones and zeros.
Elements are 1 if all elements of a column are nonzeros and
0 if any single element of the column is zero.
example
    print All(All(myMatrix)); returns 1 if all Elements of myMatrix
    are nonzero.
  
location
"util.h", line 59
related topics
See section Any.

int prefix operator All (const VECTOR & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
int             prefix operator All (const VECTOR & m) precedence 28;
description
Returns one if all Elements are nonzeros, returns 0 otherwise
location
"util.h", line 70
related topics
See section Any.

INTEGER_VECTOR prefix operator All (const INTEGER_MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTEGER_VECTOR  prefix operator All (const INTEGER_MATRIX & m) precedence 28;
description
Returns a row vector of ones and zeros.
Elements are 1 if all elements of a column are nonzeros and
0 if any single element of the column is zero.
example
    print All(All(myMatrix)); returns 1 if all Elements of myMatrix
    are nonzero.
  
location
"util.h", line 75
related topics
See section Any.

int prefix operator All (const INTEGER_VECTOR & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
int             prefix operator All (const INTEGER_VECTOR & m) precedence 28;
description
Returns one if all Elements are nonzeros, returns 0 otherwise
location
"util.h", line 86
related topics
See section Any.

INTEGER_VECTOR prefix operator All (const COMPLEX_MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTEGER_VECTOR  prefix operator All (const COMPLEX_MATRIX & m) precedence 28;
description
Returns a row vector of ones and zeros.
Elements are 1 if all elements of a column are nonzeros and
0 if any single element of the column is zero.
example
    print All(All(myMatrix)); returns 1 if all Elements of myMatrix
    are nonzero.
  
location
"util.h", line 91
related topics
See section Any.

int prefix operator All (const COMPLEX_VECTOR & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
int             prefix operator All (const COMPLEX_VECTOR & m) precedence 28;
description
Returns one if all Elements are nonzeros, returns 0 otherwise
location
"util.h", line 102
related topics
See section Any.

INTEGER_VECTOR prefix operator All (const INTERVAL_MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTEGER_VECTOR  prefix operator All (const INTERVAL_MATRIX & m) precedence 28;
description
Returns a row vector of ones and zeros.
Elements are 1 if all elements of a column are nonzeros and
0 if any single element of the column is zero.
example
    print All(All(myMatrix)); returns 1 if all Elements of myMatrix
    are nonzero.
  
location
"util.h", line 107
related topics
See section Any.

int prefix operator All (const INTERVAL_VECTOR & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
int             prefix operator All (const INTERVAL_VECTOR & m) precedence 28;
description
Returns one if all Elements are nonzeros, returns 0 otherwise
location
"util.h", line 118
related topics
See section Any.


Any

INTEGER_VECTOR prefix operator Any (const MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTEGER_VECTOR  prefix operator Any (const MATRIX & m) precedence 28;
description
Returns a row vector of ones and zeros.
Elements are 1 if any elements of a column are nonzeros and
0 if all elements of the column are zero.
example
    print Any(Any(myMatrix)); returns 1 if at least one Element 
    of myMatrix is nonzero.
  
location
"util.h", line 126
related topics
See section All.

int prefix operator Any (const VECTOR & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
int             prefix operator Any (const VECTOR & m) precedence 28;
description
Returns zero if all Elements are zeros, returns 1 otherwise
location
"util.h", line 137
related topics
See section All.

INTEGER_VECTOR prefix operator Any (const INTEGER_MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTEGER_VECTOR  prefix operator Any (const INTEGER_MATRIX & m) precedence 28;
description
Returns a row vector of ones and zeros.
Elements are 1 if any elements of a column are nonzeros and
0 if all elements of the column are zero.
example
    print Any(Any(myMatrix)); returns 1 if at least one Element 
    of myMatrix is nonzero.
  
location
"util.h", line 142
related topics
See section All.

int prefix operator Any (const INTEGER_VECTOR & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
int             prefix operator Any (const INTEGER_VECTOR & m) precedence 28;
description
Returns zero if all Elements are zeros, returns 1 otherwise
location
"util.h", line 153
related topics
See section All.

INTEGER_VECTOR prefix operator Any (const COMPLEX_MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTEGER_VECTOR  prefix operator Any (const COMPLEX_MATRIX & m) precedence 28;
description
Returns a row vector of ones and zeros.
Elements are 1 if any elements of a column are nonzeros and
0 if all elements of the column are zero.
example
    print Any(Any(myMatrix)); returns 1 if at least one Element 
    of myMatrix is nonzero.
  
location
"util.h", line 158
related topics
See section All.

int prefix operator Any (const COMPLEX_VECTOR & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
int             prefix operator Any (const COMPLEX_VECTOR & m) precedence 28;
description
Returns zero if all Elements are zeros, returns 1 otherwise
location
"util.h", line 169
related topics
See section All.

INTEGER_VECTOR prefix operator Any (const INTERVAL_MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTEGER_VECTOR  prefix operator Any (const INTERVAL_MATRIX & m) precedence 28;
description
Returns a row vector of ones and zeros.
Elements are 1 if any elements of a column are nonzeros and
0 if all elements of the column are zero.
example
    print Any(Any(myMatrix)); returns 1 if at least one Element 
    of myMatrix is nonzero.
  
location
"util.h", line 174
related topics
See section All.

int prefix operator Any (const INTERVAL_VECTOR & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
int             prefix operator Any (const INTERVAL_VECTOR & m) precedence 28;
description
Returns zero if all Elements are zeros, returns 1 otherwise
location
"util.h", line 185
related topics
See section All.


CRand

COMPLEX_MATRIX prefix operator CRand (INT n, INT m) precedence 28;

symbol type
prefix operator (prototype)
declaration
COMPLEX_MATRIX prefix operator CRand (INT n, INT m) precedence 28;
description
Returns a complex n-by-m matrix of random numbers in
the rectangle (0..1) + i(0..1). The numbers are uniformly
distributed.
location
"util.h", line 762
related topics
See section CRandH. @xref{ Rand}. @xref{ RandS}. @xref{ Ones}.

COMPLEX_MATRIX prefix operator CRand (INT n);

symbol type
prefix operator (prototype)
declaration
COMPLEX_MATRIX prefix  operator CRand (INT n);
description
Returns a complex n-by-n matrix of random numbers in
the rectangle (0..1) + i(0..1). The numbers are uniformly
distributed.
location
"util.h", line 770
related topics
See section CRandH. @xref{ Rand}. @xref{ RandS}. @xref{ Ones}.


CRandH

COMPLEX_MATRIX prefix operator CRandH (INT n) precedence 28;

symbol type
prefix operator (prototype)
declaration
COMPLEX_MATRIX prefix  operator CRandH (INT n) precedence 28;
description
Returns a complex hermitian n-by-n matrix of random numbers in
the rectangle (0..1) + i(0..1). The numbers are uniformly
distributed.
location
"util.h", line 780
related topics
See section CRand. @xref{ Rand}. @xref{ RandS}. @xref{ Ones}.


Ceil

double prefix operator Ceil(const double k ) precedence 28;

symbol type
prefix operator (prototype)
declaration
double  prefix operator Ceil(const double k  )   precedence 28;
description
Rounds towards +inf
location
"util.h", line 580
related topics
See section Floor. @xref{ Fix}.

VECTOR prefix operator Ceil(const VECTOR & v) precedence 28;

symbol type
prefix operator (prototype)
declaration
VECTOR  prefix operator Ceil(const VECTOR & v)  precedence 28;
description
Rounds all elements towards +inf
location
"util.h", line 586
related topics
See section Floor. @xref{ Fix}.

MATRIX prefix operator Ceil(const MATRIX & v) precedence 28;

symbol type
prefix operator (prototype)
declaration
MATRIX  prefix operator Ceil(const MATRIX & v)  precedence 28;
description
Rounds all elements towards +inf
location
"util.h", line 592
related topics
See section Floor. @xref{ Fix}.


Diag

VECTOR prefix operator Diag(const MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
VECTOR          prefix operator Diag(const MATRIX & m) precedence 28;
description
Returns a VECTOR of the elements on the diagonal. Fails if Matrix
is not square.
location
"util.h", line 193

VECTOR prefix operator Diag(const MATRIX & m, int k);

symbol type
prefix operator (prototype)
declaration
VECTOR          prefix operator Diag(const MATRIX & m, int k);
description
Returns a VECTOR with the elements on the k-th diagonal of m. k=0 is the
main diagonal, k>0 is above the main diagonal, k<0
below the main diagonal.
Fails if Matrix is not square.
location
"util.h", line 198

MATRIX prefix operator Diag(const VECTOR & v);

symbol type
prefix operator (prototype)
declaration
MATRIX          prefix operator Diag(const VECTOR & v);
description
Returns matrix with the elements
of v on the main diagonal.
location
"util.h", line 205

MATRIX prefix operator Diag(const VECTOR & v, int k);

symbol type
prefix operator (prototype)
declaration
MATRIX          prefix operator Diag(const VECTOR & v, int k);
description
Returns a matrix of order n+abs(k) with the elements
of v on the k-th diagonal. k=0 is the
main diagonal, k>0 is above the main diagonal, k<0
below the main diagonal.
location
"util.h", line 210

INTEGER_VECTOR prefix operator Diag(const INTEGER_MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTEGER_VECTOR  prefix operator Diag(const INTEGER_MATRIX & m) precedence 28;
description
Returns a VECTOR of the elements on the diagonal. Fails if Matrix
is not square.
location
"util.h", line 217

INTEGER_VECTOR prefix operator Diag(const INTEGER_MATRIX & m, int k);

symbol type
prefix operator (prototype)
declaration
INTEGER_VECTOR  prefix operator Diag(const INTEGER_MATRIX & m, int k);
description
Returns a VECTOR with the elements on the k-th diagonal of m. k=0 is the
main diagonal, k>0 is above the main diagonal, k<0
below the main diagonal.
Fails if Matrix is not square.
location
"util.h", line 222

INTEGER_MATRIX prefix operator Diag(const INTEGER_VECTOR & v);

symbol type
prefix operator (prototype)
declaration
INTEGER_MATRIX  prefix operator Diag(const INTEGER_VECTOR & v);
description
Returns matrix with the elements
of v on the main diagonal.
location
"util.h", line 229

INTEGER_MATRIX prefix operator Diag(const INTEGER_VECTOR & v, int k);

symbol type
prefix operator (prototype)
declaration
INTEGER_MATRIX  prefix operator Diag(const INTEGER_VECTOR & v, int k);
description
Returns a matrix of order n+abs(k) with the elements
of v on the k-th diagonal. k=0 is the
main diagonal, k>0 is above the main diagonal, k<0
below the main diagonal.
location
"util.h", line 234

COMPLEX_VECTOR prefix operator Diag(const COMPLEX_MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
COMPLEX_VECTOR  prefix operator Diag(const COMPLEX_MATRIX & m) precedence 28;
description
Returns a VECTOR of the elements on the diagonal. Fails if Matrix
is not square.
location
"util.h", line 241

COMPLEX_VECTOR prefix operator Diag(const COMPLEX_MATRIX & m, int k);

symbol type
prefix operator (prototype)
declaration
COMPLEX_VECTOR  prefix operator Diag(const COMPLEX_MATRIX & m, int k);
description
Returns a VECTOR with the elements on the k-th diagonal of m. k=0 is the
main diagonal, k>0 is above the main diagonal, k<0
below the main diagonal.
Fails if Matrix is not square.
location
"util.h", line 246

COMPLEX_MATRIX prefix operator Diag(const COMPLEX_VECTOR & v);

symbol type
prefix operator (prototype)
declaration
COMPLEX_MATRIX  prefix operator Diag(const COMPLEX_VECTOR & v);
description
Returns matrix with the elements
of v on the main diagonal.
location
"util.h", line 253

COMPLEX_MATRIX prefix operator Diag(const COMPLEX_VECTOR & v, int k);

symbol type
prefix operator (prototype)
declaration
COMPLEX_MATRIX  prefix operator Diag(const COMPLEX_VECTOR & v, int k);
description
Returns a matrix of order n+abs(k) with the elements
of v on the k-th diagonal. k=0 is the
main diagonal, k>0 is above the main diagonal, k<0
below the main diagonal.
location
"util.h", line 258

INTERVAL_VECTOR prefix operator Diag(const INTERVAL_MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTERVAL_VECTOR prefix operator Diag(const INTERVAL_MATRIX & m) precedence 28;
description
Returns a VECTOR of the elements on the diagonal. Fails if Matrix
is not square.
location
"util.h", line 265

INTERVAL_VECTOR prefix operator Diag(const INTERVAL_MATRIX & m, int k);

symbol type
prefix operator (prototype)
declaration
INTERVAL_VECTOR prefix operator Diag(const INTERVAL_MATRIX & m, int k);
description
Returns a VECTOR with the elements on the k-th diagonal of m. k=0 is the
main diagonal, k>0 is above the main diagonal, k<0
below the main diagonal.
Fails if Matrix is not square.
location
"util.h", line 270

INTERVAL_MATRIX prefix operator Diag(const INTERVAL_VECTOR & v);

symbol type
prefix operator (prototype)
declaration
INTERVAL_MATRIX prefix operator Diag(const INTERVAL_VECTOR & v);
description
Returns matrix with the elements
of v on the main diagonal.
location
"util.h", line 277

INTERVAL_MATRIX prefix operator Diag(const INTERVAL_VECTOR & v, int k);

symbol type
prefix operator (prototype)
declaration
INTERVAL_MATRIX prefix operator Diag(const INTERVAL_VECTOR & v, int k);
description
Returns a matrix of order n+abs(k) with the elements
of v on the k-th diagonal. k=0 is the
main diagonal, k>0 is above the main diagonal, k<0
below the main diagonal.
location
"util.h", line 282


Eye

MATRIX prefix operator Eye (int n) precedence 28;

symbol type
prefix operator (prototype)
declaration
MATRIX  prefix  operator Eye  (int  n) precedence 28;
description
Overwrites a matrix with an identity matrix of the same
size. If the matrix is not square, Eye fills the Matrix
with ones on the diagonal and with zeros elsewhere.
example
    myMatrix[1..3,1..3] = Eye 3;
  
remarks
Id and Eye are equivalent.
location
"util.h", line 664

MATRIX prefix operator Eye (int n, int m);

symbol type
prefix operator (prototype)
declaration
MATRIX  prefix  operator Eye  (int  n, int  m);
description
Returns a n-by-m identity matrix
If the matrix is not square, Eye fills the Matrix
with ones on the diagonal and with zeros elsewhere.
location
"util.h", line 674


Fix

double prefix operator Fix (const double k ) precedence 28;

symbol type
prefix operator (prototype)
declaration
double  prefix operator Fix (const double k  )   precedence 28;
description
Rounds towards zero
location
"util.h", line 601
related topics
See section Ceil. @xref{ Floor}.

VECTOR prefix operator Fix (const VECTOR & v) precedence 28;

symbol type
prefix operator (prototype)
declaration
VECTOR  prefix operator Fix (const VECTOR & v)  precedence 28;
description
Rounds all elements towards zero
location
"util.h", line 607
related topics
See section Ceil. @xref{ Floor}.

MATRIX prefix operator Fix (const MATRIX & v) precedence 28;

symbol type
prefix operator (prototype)
declaration
MATRIX  prefix operator Fix (const MATRIX & v)  precedence 28;
description
Rounds all elements towards zero
location
"util.h", line 613
related topics
See section Ceil. @xref{ Floor}.


Floor

double prefix operator Floor(const double k ) precedence 28;

symbol type
prefix operator (prototype)
declaration
double  prefix operator Floor(const double k  )  precedence 28;
description
Rounds towards zero
location
"util.h", line 622
related topics
See section Ceil. @xref{ Fix}.

VECTOR prefix operator Floor(const VECTOR & v) precedence 28;

symbol type
prefix operator (prototype)
declaration
VECTOR  prefix operator Floor(const VECTOR & v) precedence 28;
description
Rounds all elements towards zero
location
"util.h", line 628
related topics
See section Ceil. @xref{ Fix}.

MATRIX prefix operator Floor(const MATRIX & v) precedence 28;

symbol type
prefix operator (prototype)
declaration
MATRIX  prefix operator Floor(const MATRIX & v) precedence 28;
description
Rounds all elements towards zero
location
"util.h", line 634
related topics
See section Ceil. @xref{ Fix}.


Id

MATRIX prefix operator Id (int n) precedence 28;

symbol type
prefix operator (prototype)
declaration
MATRIX  prefix  operator Id   (int  n) precedence 28;
description
Overwrites a matrix with an identity matrix of the same
size. If the matrix is not square, Eye fills the Matrix
with ones on the diagonal and with zeros elsewhere.
example
    myMatrix[1..3,1..3] = Id 3;
  
remarks
Id and Eye are equivalent.
location
"util.h", line 683


Ones

MATRIX prefix operator Ones (int n) precedence 28;

symbol type
prefix operator (prototype)
declaration
MATRIX  prefix  operator Ones (int  n) precedence 28;
description
Overwrites a matrix with ones.
example
    myMatrix[1..4,1..4] = Ones 4;
  
location
"util.h", line 696
related topics
See section Zeros.

MATRIX prefix operator Ones (int n, int m);

symbol type
prefix operator (prototype)
declaration
MATRIX  prefix  operator Ones (int  n, int  m);
description
Overwrites a matrix with ones.
example
    myMatrix[1..2,1..4] = Ones(2,4);
  
location
"util.h", line 703
related topics
See section Zeros.


Poly

INTEGER_VECTOR prefix operator Poly (const INTEGER_VECTOR &r) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTEGER_VECTOR prefix operator Poly (const INTEGER_VECTOR &r) precedence 28;
description
Computes an INTEGER_VECTOR whose elements are
the coefficients of the polynomial whose roots are the
elements of r.
remarks
Roots and Poly are inverse
location
"util.h", line 911
related topics
@xref{Roots,,,lapfront}.

VECTOR prefix operator Poly (const VECTOR &r);

symbol type
prefix operator (prototype)
declaration
VECTOR prefix operator Poly (const VECTOR &r);
description
Computes a VECTOR whose elements are
the coefficients of the polynomial whose roots are the
elements of r.
remarks
Roots and Poly are inverse
location
"util.h", line 921
related topics
@xref{Roots,,,lapfront}.

COMPLEX_VECTOR prefix operator Poly (const COMPLEX_VECTOR &r);

symbol type
prefix operator (prototype)
declaration
COMPLEX_VECTOR prefix operator Poly (const COMPLEX_VECTOR &r);
description
Computes a COMPLEX_VECTOR whose elements are
the coefficients of the polynomial whose roots are the
elements of r.
remarks
Roots and Poly are inverse.
location
"util.h", line 931
related topics
@xref{Roots,,,lapfront}.

INTERVAL_VECTOR prefix operator Poly (const INTERVAL_VECTOR &r);

symbol type
prefix operator (prototype)
declaration
INTERVAL_VECTOR prefix operator Poly (const INTERVAL_VECTOR &r);
description
Computes an INTERVAL_VECTOR whose elements are
the coefficients of the polynomial whose roots are the
elements of r.
location
"util.h", line 941
related topics
@xref{Roots,,,lapfront}.


PolyVal

int prefix operator PolyVal (const INTEGER_VECTOR &p, const int x0) precedence 28;

symbol type
prefix operator (prototype)
declaration
int prefix operator PolyVal (const INTEGER_VECTOR &p, const int x0) precedence 28;
description
Polynomial evaluation.
If p is a vector of length n+1 of polynomial coefficients,
then PolyVal(p,x0) is the value of the polynomial evaluated at x0.
y = p[1]*x0^n + p[2]*x0^(n-1) + ... + p[n]*x0 + p[n+1]
location
"util.h", line 791
related topics
See section PolyValM.

INTEGER_VECTOR prefix operator PolyVal (const INTEGER_VECTOR &p, const INTEGER_VECTOR & x0);

symbol type
prefix operator (prototype)
declaration
INTEGER_VECTOR prefix operator PolyVal (const INTEGER_VECTOR &p, const INTEGER_VECTOR & x0);
description
Polynomial evaluation.
If p is a vector of length n+1 of polynomial coefficients,
then PolyVal(p,x0) is the value of the polynomial evaluated at x0.
y = p[1]*x0^n + p[2]*x0^(n-1) + ... + p[n]*x0 + p[n+1]
location
"util.h", line 800
related topics
See section PolyValM.

INTEGER_MATRIX prefix operator PolyVal (const INTEGER_VECTOR &p, const INTEGER_MATRIX & x0);

symbol type
prefix operator (prototype)
declaration
INTEGER_MATRIX prefix operator PolyVal (const INTEGER_VECTOR &p, const INTEGER_MATRIX & x0);
description
Polynomial evaluation.
If p is a vector of length n+1 of polynomial coefficients,
then PolyVal(p,x0) is the value of the polynomial evaluated at x0.
y = p[1]*x0^n + p[2]*x0^(n-1) + ... + p[n]*x0 + p[n+1]
location
"util.h", line 809
related topics
See section PolyValM.

double prefix operator PolyVal (const VECTOR &p, const double x0);

symbol type
prefix operator (prototype)
declaration
double prefix operator PolyVal (const VECTOR &p, const double x0);
description
Polynomial evaluation.
If p is a vector of length n+1 of polynomial coefficients,
then PolyVal(p,x0) is the value of the polynomial evaluated at x0.
y = p[1]*x0^n + p[2]*x0^(n-1) + ... + p[n]*x0 + p[n+1]
example
   print PolyVal( [1,3], 2 );
   Output: 5
  
location
"util.h", line 829
related topics
See section PolyValM.

VECTOR prefix operator PolyVal (const VECTOR &p, const VECTOR & x0);

symbol type
prefix operator (prototype)
declaration
VECTOR prefix operator PolyVal (const VECTOR &p, const VECTOR & x0);
description
Polynomial evaluation.
If p is a vector of length n+1 of polynomial coefficients,
then PolyVal(p,x0) is the value of the polynomial evaluated at x0.
y = p[1]*x0^n + p[2]*x0^(n-1) + ... + p[n]*x0 + p[n+1]
location
"util.h", line 841
related topics
See section PolyValM.

MATRIX prefix operator PolyVal (const VECTOR &p, const MATRIX & x0);

symbol type
prefix operator (prototype)
declaration
MATRIX prefix operator PolyVal (const VECTOR &p, const MATRIX & x0);
description
Polynomial evaluation.
If p is a vector of length n+1 of polynomial coefficients,
then PolyVal(p,x0) is the value of the polynomial evaluated at x0.
y = p[1]*x0^n + p[2]*x0^(n-1) + ... + p[n]*x0 + p[n+1]
location
"util.h", line 850
related topics
See section PolyValM.

COMPLEX prefix operator PolyVal (const COMPLEX_VECTOR &p, const COMPLEX x0);

symbol type
prefix operator (prototype)
declaration
COMPLEX prefix operator PolyVal (const COMPLEX_VECTOR &p, const COMPLEX x0);
description
Polynomial evaluation.
If p is a vector of length n+1 of polynomial coefficients,
then PolyVal(p,x0) is the value of the polynomial evaluated at x0.
y = p[1]*x0^n + p[2]*x0^(n-1) + ... + p[n]*x0 + p[n+1]
example
   print PolyVal( [1,3,I], 1+I );
   Output: 3 + 6*I
  
location
"util.h", line 869
related topics
See section PolyValM.

COMPLEX_VECTOR prefix operator PolyVal (const COMPLEX_VECTOR &p, const COMPLEX_VECTOR & x0);

symbol type
prefix operator (prototype)
declaration
COMPLEX_VECTOR prefix operator PolyVal (const COMPLEX_VECTOR &p, const COMPLEX_VECTOR & x0);
description
Polynomial evaluation.
If p is a vector of length n+1 of polynomial coefficients,
then PolyVal(p,x0) is the value of the polynomial evaluated at x0.
y = p[1]*x0^n + p[2]*x0^(n-1) + ... + p[n]*x0 + p[n+1]
location
"util.h", line 881
related topics
See section PolyValM.

COMPLEX_MATRIX prefix operator PolyVal (const COMPLEX_VECTOR &p, const COMPLEX_MATRIX & x0);

symbol type
prefix operator (prototype)
declaration
COMPLEX_MATRIX prefix operator PolyVal (const COMPLEX_VECTOR &p, const COMPLEX_MATRIX & x0);
description
Polynomial evaluation.
If p is a vector of length n+1 of polynomial coefficients,
then PolyVal(p,x0) is the value of the polynomial evaluated at x0.
y = p[1]*x0^n + p[2]*x0^(n-1) + ... + p[n]*x0 + p[n+1]
location
"util.h", line 890
related topics
See section PolyValM.


PolyValM

INTEGER_MATRIX prefix operator PolyValM (const INTEGER_VECTOR &p, const INTEGER_MATRIX & x0) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTEGER_MATRIX prefix operator PolyValM (const INTEGER_VECTOR &p, const INTEGER_MATRIX & x0) 
  precedence 28;
description
Matrix polynomial evaluation.
If p is a vector of length n+1 of polynomial coefficients,
then PolyValM(p,x0) is the value of the polynomial evaluated at matrix x0.
y = p[1]*x0^n + p[2]*x0^(n-1) + ... + p[n]*x0 + p[n+1]
location
"util.h", line 818
related topics
See section PolyVal.

MATRIX prefix operator PolyValM (const VECTOR &p, const MATRIX & x0);

symbol type
prefix operator (prototype)
declaration
MATRIX prefix operator PolyValM (const VECTOR &p, const MATRIX & x0);
description
Matrix polynomial evaluation.
If p is a vector of length n+1 of polynomial coefficients,
then PolyValM(p,x0) is the value of the polynomial evaluated at matrix x0.
y = p[1]*x0^n + p[2]*x0^(n-1) + ... + p[n]*x0 + p[n+1]
location
"util.h", line 859
related topics
See section PolyVal.

COMPLEX_MATRIX prefix operator PolyValM (const COMPLEX_VECTOR &p, const COMPLEX_MATRIX & x0);

symbol type
prefix operator (prototype)
declaration
COMPLEX_MATRIX prefix operator PolyValM (const COMPLEX_VECTOR &p, const COMPLEX_MATRIX & x0);
description
Matrix polynomial evaluation.
If p is a vector of length n+1 of polynomial coefficients,
then PolyValM(p,x0) is the value of the polynomial evaluated at matrix x0.
y = p[1]*x0^n + p[2]*x0^(n-1) + ... + p[n]*x0 + p[n+1]
location
"util.h", line 899
related topics
See section PolyVal.


Prod

VECTOR prefix operator Prod (const MATRIX & a) precedence 28;

symbol type
prefix operator (prototype)
declaration
VECTOR          prefix operator Prod (const MATRIX & a) precedence 28;
description
Returns a row vector with the product of the columns.
example
    print Prod((MATRIX)"1,2,3;2,3,4;4,5,6");
    Output: ( 8.0, 30.0, 72.0 )
  
location
"util.h", line 503
related topics
See section Sum.

double prefix operator Prod (const VECTOR & a);

symbol type
prefix operator (prototype)
declaration
double          prefix operator Prod (const VECTOR & a);
description
Returns the product of all vector elements
example
    print Prod((VECTOR)"1,2,3");
    Output: 6.0
  
location
"util.h", line 511
related topics
See section Sum.

INTEGER_VECTOR prefix operator Prod (const INTEGER_MATRIX & a) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTEGER_VECTOR  prefix operator Prod (const INTEGER_MATRIX & a) precedence 28;
description
Returns a row vector with the product of the columns.
example
    print Prod((MATRIX)"1,2,3;2,3,4;4,5,6");
    Output: ( 8.0, 30.0, 72.0 )
  
location
"util.h", line 521
related topics
See section Sum.

int prefix operator Prod (const INTEGER_VECTOR & a);

symbol type
prefix operator (prototype)
declaration
int             prefix operator Prod (const INTEGER_VECTOR & a);
description
Returns the product of all vector elements
example
    print Prod((VECTOR)"1,2,3");
    Output: 6.0
  
location
"util.h", line 529
related topics
See section Sum.

COMPLEX_VECTOR prefix operator Prod (const COMPLEX_MATRIX & a) precedence 28;

symbol type
prefix operator (prototype)
declaration
COMPLEX_VECTOR  prefix operator Prod (const COMPLEX_MATRIX & a) precedence 28;
description
Returns a row vector with the product of the columns.
example
    print Prod((MATRIX)"1,2,3;2,3,4;4,5,6");
    Output: ( 8.0, 30.0, 72.0 )
  
location
"util.h", line 539
related topics
See section Sum.

COMPLEX prefix operator Prod (const COMPLEX_VECTOR & a);

symbol type
prefix operator (prototype)
declaration
COMPLEX         prefix operator Prod (const COMPLEX_VECTOR & a);
description
Returns the product of all vector elements
example
    print Prod((VECTOR)"1,2,3");
    Output: 6.0
  
location
"util.h", line 547
related topics
See section Sum.

INTERVAL_VECTOR prefix operator Prod (const INTERVAL_MATRIX & a) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTERVAL_VECTOR prefix operator Prod (const INTERVAL_MATRIX & a) precedence 28;
description
Returns a row vector with the product of the columns.
example
    print Prod((MATRIX)"1,2,3;2,3,4;4,5,6");
    Output: ( 8.0, 30.0, 72.0 )
  
location
"util.h", line 557
related topics
See section Sum.

INTERVAL prefix operator Prod (const INTERVAL_VECTOR & a);

symbol type
prefix operator (prototype)
declaration
INTERVAL        prefix operator Prod (const INTERVAL_VECTOR & a);
description
Returns the product of all vector elements
example
    print Prod((VECTOR)"1,2,3");
    Output: 6.0
  
location
"util.h", line 565
related topics
See section Sum.


Rand

MATRIX prefix operator Rand (int n) precedence 28;

symbol type
prefix operator (prototype)
declaration
MATRIX  prefix  operator Rand (int  n) precedence 28;
description
Returns a n-by-n matrix of random numbers in
the interval (0..1). The numbers are uniformly
distributed.
location
"util.h", line 733
related topics
See section RandS. @xref{ Ones}.

MATRIX prefix operator Rand (int n, int m);

symbol type
prefix operator (prototype)
declaration
MATRIX  prefix  operator Rand (int  n, int  m);
description
Returns a n-by-m matrix of random numbers in
the interval (0..1). The numbers are uniformly
distributed.
location
"util.h", line 741
related topics
See section RandS. @xref{ Ones}.


RandS

MATRIX prefix operator RandS (int n) precedence 28;

symbol type
prefix operator (prototype)
declaration
MATRIX  prefix  operator RandS (int  n) precedence 28;
description
Returns a symmetric n-by-n matrix of random numbers in
the interval (0..1). The numbers are uniformly
distributed.
location
"util.h", line 752
related topics
See section Rand. @xref{ CRand}. @xref{ CRandH}. @xref{ Ones}.


Round

double prefix operator Round(const double k ) precedence 28;

symbol type
prefix operator (prototype)
declaration
double  prefix operator Round(const double k  )  precedence 28;
description
Rounds to the nearest integer
location
"util.h", line 643
related topics
See section Ceil. @xref{ Floor}.

VECTOR prefix operator Round(const VECTOR & v) precedence 28;

symbol type
prefix operator (prototype)
declaration
VECTOR  prefix operator Round(const VECTOR & v) precedence 28;
description
Rounds all elements to the nearest integer
location
"util.h", line 649
related topics
See section Ceil. @xref{ Floor}.

MATRIX prefix operator Round(const MATRIX & v) precedence 28;

symbol type
prefix operator (prototype)
declaration
MATRIX  prefix operator Round(const MATRIX & v) precedence 28;
description
Rounds all elements to the nearest integer
location
"util.h", line 655
related topics
See section Ceil. @xref{ Floor}.


Sum

VECTOR prefix operator Sum (const MATRIX & a) precedence 28;

symbol type
prefix operator (prototype)
declaration
VECTOR          prefix operator Sum (const MATRIX & a) precedence 28;
description
Returns a row VECTOR with the sums of the columns.
example
    print Sum((MATRIX)"1,2,3;2,3,4;4,5,6");
    Output: ( 7.0, 10.0, 13.0 )
  
location
"util.h", line 435
related topics
See section Prod.

double prefix operator Sum (const VECTOR & a);

symbol type
prefix operator (prototype)
declaration
double          prefix operator Sum (const VECTOR & a);
description
Returns the sum of all vector elements
example
    print Sum((VECTOR)"1,2,3");
    Output: 6.0
  
location
"util.h", line 443
related topics
See section Prod.

INTEGER_VECTOR prefix operator Sum (const INTEGER_MATRIX & a) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTEGER_VECTOR  prefix operator Sum (const INTEGER_MATRIX & a) precedence 28;
description
Returns a row VECTOR with the sums of the columns.
example
    print Sum((MATRIX)"1,2,3;2,3,4;4,5,6");
    Output: ( 7.0, 10.0, 13.0 )
  
location
"util.h", line 451
related topics
See section Prod.

int prefix operator Sum (const INTEGER_VECTOR & a);

symbol type
prefix operator (prototype)
declaration
int             prefix operator Sum (const INTEGER_VECTOR & a);
description
Returns the sum of all vector elements
example
    print Sum((VECTOR)"1,2,3");
    Output: 6.0
  
location
"util.h", line 459
related topics
See section Prod.

COMPLEX_VECTOR prefix operator Sum (const COMPLEX_MATRIX & a) precedence 28;

symbol type
prefix operator (prototype)
declaration
COMPLEX_VECTOR  prefix operator Sum (const COMPLEX_MATRIX & a) precedence 28;
description
Returns a row VECTOR with the sums of the columns.
example
    print Sum((MATRIX)"1,2,3;2,3,4;4,5,6");
    Output: ( 7.0, 10.0, 13.0 )
  
location
"util.h", line 467
related topics
See section Prod.

COMPLEX prefix operator Sum (const COMPLEX_VECTOR & a);

symbol type
prefix operator (prototype)
declaration
COMPLEX         prefix operator Sum (const COMPLEX_VECTOR & a);
description
Returns the sum of all vector elements
example
    print Sum((VECTOR)"1,2,3");
    Output: 6.0
  
location
"util.h", line 475
related topics
See section Prod.

INTERVAL_VECTOR prefix operator Sum (const INTERVAL_MATRIX & a) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTERVAL_VECTOR prefix operator Sum (const INTERVAL_MATRIX & a) precedence 28;
description
Returns a row VECTOR with the sums of the columns.
example
    print Sum((MATRIX)"1,2,3;2,3,4;4,5,6");
    Output: ( 7.0, 10.0, 13.0 )
  
location
"util.h", line 483
related topics
See section Prod.

INTERVAL prefix operator Sum (const INTERVAL_VECTOR & a);

symbol type
prefix operator (prototype)
declaration
INTERVAL        prefix operator Sum (const INTERVAL_VECTOR & a);
description
Returns the sum of all vector elements
example
    print Sum((VECTOR)"1,2,3");
    Output: 6.0
  
location
"util.h", line 491
related topics
See section Prod.


Trace

double prefix operator Trace (const MATRIX& a) precedence 28;

symbol type
prefix operator (prototype)
declaration
double          prefix operator Trace (const MATRIX& a) precedence 28;
description
Computes the sum of all diagonal elements (trace) of the argument matrix.
This is also the sum of all eigenvalues.
location
"util.h", line 36

COMPLEX prefix operator Trace (const COMPLEX_MATRIX& a);

symbol type
prefix operator (prototype)
declaration
COMPLEX         prefix operator Trace (const COMPLEX_MATRIX& a);
description
Computes the sum of all diagonal elements (trace) of the argument matrix.
This is also the sum of all eigenvalues.
location
"util.h", line 41

int prefix operator Trace (const INTEGER_MATRIX& a);

symbol type
prefix operator (prototype)
declaration
int             prefix operator Trace (const INTEGER_MATRIX& a);
description
Computes the sum of all diagonal elements (trace) of the argument matrix.
This is also the sum of all eigenvalues.
location
"util.h", line 46

INTERVAL prefix operator Trace (const INTERVAL_MATRIX& a);

symbol type
prefix operator (prototype)
declaration
INTERVAL        prefix operator Trace (const INTERVAL_MATRIX& a);
description
Computes the sum of all diagonal elements (trace) of the argument matrix.
This is also the sum of all eigenvalues.
location
"util.h", line 51


Transpose

MATRIX prefix operator Transpose (const MATRIX& a);

symbol type
prefix operator (prototype)
declaration
MATRIX          prefix operator Transpose (const MATRIX& a);
description
Transposes the argument matrix
location
"util.h", line 21

COMPLEX_MATRIX prefix operator Transpose (const COMPLEX_MATRIX& a);

symbol type
prefix operator (prototype)
declaration
COMPLEX_MATRIX  prefix operator Transpose (const COMPLEX_MATRIX& a);
description
Conjugates and transposes the argument matrix
location
"util.h", line 24

INTEGER_MATRIX prefix operator Transpose (const INTEGER_MATRIX& a);

symbol type
prefix operator (prototype)
declaration
INTEGER_MATRIX  prefix operator Transpose (const INTEGER_MATRIX& a);
description
Transposes the argument matrix
location
"util.h", line 27

INTERVAL_MATRIX prefix operator Transpose (const INTERVAL_MATRIX& a);

symbol type
prefix operator (prototype)
declaration
INTERVAL_MATRIX prefix operator Transpose (const INTERVAL_MATRIX& a);
description
Transposes the argument matrix
location
"util.h", line 30


Tril

MATRIX prefix operator Tril(const MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
MATRIX          prefix operator Tril(const MATRIX & m) precedence 28;
description
Tril returns the lower triangular part of m.
example
    Tril(Id(4))==Id(4)
  
location
"util.h", line 292
related topics
See section Triu.

MATRIX prefix operator Tril(const MATRIX & m, int k);

symbol type
prefix operator (prototype)
declaration
MATRIX          prefix operator Tril(const MATRIX & m, int k);
description
Returns the elements on and below the k-th diagonal
of m. k=0 is the main diagonal, k>0 is above the main diagonal,
k<0 is below the main diagonal.
example
    Tril(Ones(4),-1)+Id(4)+Triu(Ones(4),1) == Ones(4)
  
location
"util.h", line 300
related topics
See section Triu.

INTEGER_MATRIX prefix operator Tril(const INTEGER_MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTEGER_MATRIX  prefix operator Tril(const INTEGER_MATRIX & m) precedence 28;
description
Tril returns the lower triangular part of m.
example
    Tril(Id(4))==Id(4)
  
location
"util.h", line 310
related topics
See section Triu.

INTEGER_MATRIX prefix operator Tril(const INTEGER_MATRIX & m, int k);

symbol type
prefix operator (prototype)
declaration
INTEGER_MATRIX  prefix operator Tril(const INTEGER_MATRIX & m, int k);
description
Returns the elements on and below the k-th diagonal
of m. k=0 is the main diagonal, k>0 is above the main diagonal,
k<0 is below the main diagonal.
example
    Tril(Ones(4),-1)+Id(4)+Triu(Ones(4),1) == Ones(4)
  
location
"util.h", line 318
related topics
See section Triu.

COMPLEX_MATRIX prefix operator Tril(const COMPLEX_MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
COMPLEX_MATRIX  prefix operator Tril(const COMPLEX_MATRIX & m) precedence 28;
description
Tril returns the lower triangular part of m.
example
    Tril(Id(4))==Id(4)
  
location
"util.h", line 328
related topics
See section Triu.

COMPLEX_MATRIX prefix operator Tril(const COMPLEX_MATRIX & m, int k);

symbol type
prefix operator (prototype)
declaration
COMPLEX_MATRIX  prefix operator Tril(const COMPLEX_MATRIX & m, int k);
description
Returns the elements on and below the k-th diagonal
of m. k=0 is the main diagonal, k>0 is above the main diagonal,
k<0 is below the main diagonal.
example
    Tril(Ones(4),-1)+Id(4)+Triu(Ones(4),1) == Ones(4)
  
location
"util.h", line 336
related topics
See section Triu.

INTERVAL_MATRIX prefix operator Tril(const INTERVAL_MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTERVAL_MATRIX prefix operator Tril(const INTERVAL_MATRIX & m) precedence 28;
description
Tril returns the lower triangular part of m.
example
    Tril(Id(4))==Id(4)
  
location
"util.h", line 346
related topics
See section Triu.

INTERVAL_MATRIX prefix operator Tril(const INTERVAL_MATRIX & m, int k);

symbol type
prefix operator (prototype)
declaration
INTERVAL_MATRIX prefix operator Tril(const INTERVAL_MATRIX & m, int k);
description
Returns the elements on and below the k-th diagonal
of m. k=0 is the main diagonal, k>0 is above the main diagonal,
k<0 is below the main diagonal.
example
    Tril(Ones(4),-1)+Id(4)+Triu(Ones(4),1) == Ones(4)
  
location
"util.h", line 354
related topics
See section Triu.


Triu

MATRIX prefix operator Triu(const MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
MATRIX          prefix operator Triu(const MATRIX & m) precedence 28;
description
Triu returns the upper triangular part of m.
example
    Triu(Id(4))==Id(4)
  
location
"util.h", line 367
related topics
See section Tril.

MATRIX prefix operator Triu(const MATRIX & m, int k);

symbol type
prefix operator (prototype)
declaration
MATRIX          prefix operator Triu(const MATRIX & m, int k);
description
Returns the elements on and above the k-th diagonal
of m. k=0 is the main diagonal, k>0 is above the main diagonal,
k<0 is below the main diagonal.
example
    Tril(Ones(4),-1)+Id(4)+Triu(Ones(4),1) == Ones(4)
  
location
"util.h", line 374
related topics
See section Tril.

INTEGER_MATRIX prefix operator Triu(const INTEGER_MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTEGER_MATRIX  prefix operator Triu(const INTEGER_MATRIX & m) precedence 28;
description
Triu returns the upper triangular part of m.
example
    Triu(Id(4))==Id(4)
  
location
"util.h", line 383
related topics
See section Tril.

INTEGER_MATRIX prefix operator Triu(const INTEGER_MATRIX & m, int k);

symbol type
prefix operator (prototype)
declaration
INTEGER_MATRIX  prefix operator Triu(const INTEGER_MATRIX & m, int k);
description
Returns the elements on and above the k-th diagonal
of m. k=0 is the main diagonal, k>0 is above the main diagonal,
k<0 is below the main diagonal.
example
    Tril(Ones(4),-1)+Id(4)+Triu(Ones(4),1) == Ones(4)
  
location
"util.h", line 390
related topics
See section Tril.

COMPLEX_MATRIX prefix operator Triu(const COMPLEX_MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
COMPLEX_MATRIX  prefix operator Triu(const COMPLEX_MATRIX & m) precedence 28;
description
Triu returns the upper triangular part of m.
example
    Triu(Id(4))==Id(4)
  
location
"util.h", line 399
related topics
See section Tril.

COMPLEX_MATRIX prefix operator Triu(const COMPLEX_MATRIX & m, int k);

symbol type
prefix operator (prototype)
declaration
COMPLEX_MATRIX  prefix operator Triu(const COMPLEX_MATRIX & m, int k);
description
Returns the elements on and above the k-th diagonal
of m. k=0 is the main diagonal, k>0 is above the main diagonal,
k<0 is below the main diagonal.
example
    Tril(Ones(4),-1)+Id(4)+Triu(Ones(4),1) == Ones(4)
  
location
"util.h", line 406
related topics
See section Tril.

INTERVAL_MATRIX prefix operator Triu(const INTERVAL_MATRIX & m) precedence 28;

symbol type
prefix operator (prototype)
declaration
INTERVAL_MATRIX prefix operator Triu(const INTERVAL_MATRIX & m) precedence 28;
description
Triu returns the upper triangular part of m.
example
    Triu(Id(4))==Id(4)
  
location
"util.h", line 415
related topics
See section Tril.

INTERVAL_MATRIX prefix operator Triu(const INTERVAL_MATRIX & m, int k);

symbol type
prefix operator (prototype)
declaration
INTERVAL_MATRIX prefix operator Triu(const INTERVAL_MATRIX & m, int k);
description
Returns the elements on and above the k-th diagonal
of m. k=0 is the main diagonal, k>0 is above the main diagonal,
k<0 is below the main diagonal.
example
    Tril(Ones(4),-1)+Id(4)+Triu(Ones(4),1) == Ones(4)
  
location
"util.h", line 422
related topics
See section Tril.


Zeros

MATRIX prefix operator Zeros(int n) precedence 28;

symbol type
prefix operator (prototype)
declaration
MATRIX  prefix  operator Zeros(int  n) precedence 28;
description
Overwrites a matrix with zeros.
example
    myMatrix[1..4,1..4] = Zeros 4;
  
location
"util.h", line 714
related topics
See section Ones.

MATRIX prefix operator Zeros(int n, int m);

symbol type
prefix operator (prototype)
declaration
MATRIX  prefix  operator Zeros(int  n, int  m);
description
Overwrites a matrix with zeros.
example
    myMatrix[1..2,1..4] = Zeros(2,4);
  
location
"util.h", line 722
related topics
See section Ones.


util Function Index

a

  • All, prefix operator
  • Any, prefix operator
  • c

  • Ceil, prefix operator
  • CRand, prefix operator
  • CRandH, prefix operator
  • d

  • Diag, prefix operator
  • e

  • Eye, prefix operator
  • f

  • Fix, prefix operator
  • Floor, prefix operator
  • i

  • Id, prefix operator
  • o

  • Ones, prefix operator
  • p

  • Poly, prefix operator
  • PolyVal, prefix operator
  • PolyValM, prefix operator
  • Prod, prefix operator
  • r

  • Rand, prefix operator
  • RandS, prefix operator
  • Round, prefix operator
  • s

  • Sum, prefix operator
  • t

  • Trace, prefix operator
  • Transpose, prefix operator
  • Tril, prefix operator
  • Triu, prefix operator
  • z

  • Zeros, prefix operator