
\newpage
{\bf \Huge optQuad}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
Constructor for quadratic form optimization expressions.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt [quad] = optQuad(Q, xoffr, xoffc, pool)  } \\
{\tt [quad] = optQuad}
\end{quote}

{\bf Description}

\begin{quote}
{\tt [quad] = optQuad(Q, xoffr, xoffc, pool) } returns a fully specified
quadratic with kernel matrix {\tt Q} at offset ({\tt xoffr},{\tt xoffc})
from optimization variable space {\tt pool}.

{\tt [quad] = optQuad} returns an empty quadratic.
\end{quote}

%-----------------

\newpage
{\bf \Huge optQuad/char, display}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
Output functions for class \optquad.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt c = char(quad)} \\
{\tt display(quad)}
\end{quote}

{\bf Descripition}

\begin{quote}
{\tt char} converts class \optquad\: to character for output.
{\tt display} is command window display of class \optquad.

Displays the kernel, offsets into variable pool, and pool number.
\end{quote}

%---------div

\newpage
{\bf \Huge optQuad/eq}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
Quadratic equality constraint.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt [eqconstr] = eq(a,b) }
\end{quote}

{\bf Description}

\begin{quote}
Forms constraint of type {\tt a == b}, where {\tt a} is an \optquad\: and
{\tt b} is an \optquad\: or a scalar. The constraint is a
second-order-cone constraint, of type \sconstr.

{\tt [eqconstr] = eq(a, b)} is called for the syntax `{\tt a == b}'.  

\end{quote}

%-----------------

\newpage
{\bf \Huge optQuad/get\_kernel}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
Kernel matrix extraction function.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt Q = get\_kernel(quad, format)  }
\end{quote}

{\bf Description}

\begin{quote}
Extracts kernel matrix {\tt Q} from {\tt quad}. Quadratic is of the form

{\tt [1;x].'*[k c.'/2;c/2 H]*[1;x] = x.'*H*x + c.'*x + k }

{\tt format} can be: {\tt 'sparse'}, {\tt 'full'}, {\tt 'purequad'},
{\tt 'affine'}, {\tt 'linear'} or {\tt 'const'}.

\begin{tabular}{ll}
 {\tt 'sparse'} & returns nonzero portion as a sparse matrix \\
   {\tt 'full'} & returns the whole kernel as a sparse matrix \\
  {\tt 'purequad'} & returns {\tt H}, the purely quadratic kernel \\
  {\tt 'affine'} & returns {\tt [k;c]},the affine part of the quadratic \\
  {\tt 'linear'} & returns {\tt c}, the linear part of the quadratic \\
  {\tt 'const'} & returns {\tt k}, the constant part \\
\end{tabular}

\end{quote}

%-----------------

\newpage
{\bf \Huge optQuad/get\_pool}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
Pool extraction function.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt pool = get\_pool(quad)  }
\end{quote}

{\bf Description}

\begin{quote}
Returns pool number of {\tt quad}.
\end{quote}

%-----------------

\newpage
{\bf \Huge optQuad/get\_xoffc}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
{\tt xoffc} extraction function.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt xoffc = get\_xoffc(quad)  }
\end{quote}

{\bf Description}

\begin{quote}
Returns {\tt xoffc}, offset of columns of kernel into the pool
of optimizables.
\end{quote}

%-----------------

\newpage
{\bf \Huge optQuad/get\_xoffr}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
{\tt xoffr} extraction function.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt xoffr = get\_xoffr(quad)  }
\end{quote}

{\bf Description}

\begin{quote}
Returns {\tt xoffr}, offset of rows of kernel matrix into the
pool of optimizables.
\end{quote}

%-----------------

\newpage
{\bf \Huge optQuad/ispure}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
Test if variable is purely quadratic.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt [pure] = ispure(quad)  }
\end{quote}

{\bf Description}

\begin{quote}
Returns true (1) if {\tt quad} contains no constant or linear terms; that
is, if {\tt quad} is purely quadratic. Otherwise returns false (0).
\end{quote}

%-----------------

\newpage
{\bf \Huge optQuad/lt}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
Quadratic inequality constraint.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt [constr] = lt(a, b) }
\end{quote}

{\bf Description}

\begin{quote}
Forms constraint of type {\tt a < b}, where {\tt a} is an \optquad\: and
{\tt b} is an \optquad\: or a scalar. The constraint is a
second-order-cone constraint, of type \sconstr.


{\tt [constr] = lt(a, b)} is called for the syntax `{\tt a < b}'.  


\end{quote}

%-----------------

\newpage
{\bf \Huge optQuad/mrdivide}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
Scalar division.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt [c] = mrdivide(a, b)  }
\end{quote}

{\bf Description}

\begin{quote}
Divides \optquad\: {\tt a}'s kernel matrix by scalar {\tt b}. 

{\tt [c] = mrdivide(a, b)} is called for the syntax `{\tt a / b}'.  

\end{quote}

%-----------------

\newpage
{\bf \Huge optQuad/mtimes}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
Scalar multiplication.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt [c] = mtimes(a, b)  }
\end{quote}

{\bf Description}

\begin{quote}
Multiplies \optquad\: {\tt a}'s kernel matrix by scalar {\tt b}. 

{\tt [c] = mtimes(a, b)} is called for the syntax `{\tt a * b}'. 
\end{quote}

%-----------------

\newpage
{\bf \Huge optQuad/optimal}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
Optimal quadratic.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt optq = optimal(quad, soln)  }
\end{quote}

{\bf Description}

\begin{quote}
Given a solution {\tt soln} returned by the {\tt minimize} function,
return optimal sequence.
\end{quote}

%-----------------


\newpage
{\bf \Huge optQuad/plus}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
Quadratic addition.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt [c] = plus(a, b) }
\end{quote}

{\bf Description}

\begin{quote}
Adds \optquad s {\tt a} and {\tt b}.

{\tt [c] = plus(a, b)} is called for the syntax `{\tt a + b}'. 
\end{quote}

%-----------------

\newpage
{\bf \Huge optQuad/set\_kernel}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
Kernel insertion function.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt quadout = set\_kernel(quad, kernel)  }
\end{quote}

{\bf Description}

\begin{quote}
Replaces {\tt quad}'s kernel matrix with {\tt kernel}.
\end{quote}

%-----------------

\newpage
{\bf \Huge optQuad/set\_xoffc}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
{\tt xoffc} insertion function.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt quadout = set\_xoffc(quad, xoffc) }
\end{quote}

{\bf Description}

\begin{quote}
Replaces {\tt quad}'s colunm offset with {\tt xoffc}. Does not perform
error checking.
\end{quote}

%-----------------

\newpage
{\bf \Huge optQuad/set\_xoffr}
\rule{2in}{1mm}
\vspace{0.25in}

{\bf Purpose}

\begin{quote}
{\tt xoffr} insertion function.
\end{quote}

{\bf Syntax}

\begin{quote}
{\tt quadout = set\_xoffr(quad, xoffr)  }
\end{quote}

{\bf Description}

\begin{quote}
Replaces {\tt quad}'s row offset with {\tt xoffr}. Does not perform
error checking.
\end{quote}

%-----------------
