23 #if defined (HAVE_CONFIG_H)
63 double tol = tmp *
s(0) * std::numeric_limits<double>::epsilon ();
74 retval = V.
extract (0, rank, A_nc-1, A_nc-1);
97 double rtol = sqrt (std::numeric_limits<double>::epsilon ());
145 catch (octave::execution_exception&
e)
147 error (e,
"qp: failed to compute eigenvalues of H");
152 double minReal = eigenvalH.
min ();
156 if (minReal == eigenvalH(
i))
211 p = eigenvecH.
column (indminR);
215 if (p.
transpose () * g > std::numeric_limits<double>::epsilon ())
222 lambda_tmp.
fill (0.0);
293 catch (octave::execution_exception& e)
295 error (e,
"qp: failed to compute eigenvalues of rH");
300 double mRrH = eigenvalrH.
min ();
304 if (mRrH == eigenvalH(
i))
316 if (p.
transpose () * g > std::numeric_limits<double>::epsilon ())
325 double max_p = abs_p.
max ();
330 if (n_act - n_eq == 0)
340 Yt = Yt.
extract_n (n_eq, 0, n_act-n_eq, n);
341 lambda_tmp = Yt * (g + H *
p);
345 double min_lambda = lambda_tmp.
min ();
356 if (lambda_tmp(
i) == min_lambda)
371 Aact(n_eq+
i,j) = Aact(n_eq+
i+1,j);
372 bact(n_eq+
i) = bact(n_eq+
i+1);
385 if (n_act - n_eq == n_in)
417 double tmp = tmp_row *
p;
418 double res = tmp_row *
x;
422 double alpha_tmp = (bin(
i) - res) / tmp;
424 if (alpha_tmp < alpha)
440 Aact = Aact.
stack (Ain.
row (is_block));
441 bact.
resize (n_act, bin(is_block));
442 Wact.
resize (n_act-n_eq, is_block);
471 lambda(
i) = lambda_tmp(
i);
477 if (Wact(j) ==
i - n_eq)
479 lambda(
i) = lambda_tmp(n_eq+j);
494 if (
args.length () != 8)
504 const int maxit (
args(7).int_value ());
514 int info =
qp (H, q, Aeq, beq, Ain, bin, maxit, x, lambda, iter);
516 return ovl (x, lambda, info, iter);
ColumnVector & fill(double val)
static int qp(const Matrix &H, const ColumnVector &q, const Matrix &Aeq, const ColumnVector &beq, const Matrix &Ain, const ColumnVector &bin, int maxit, ColumnVector &x, ColumnVector &lambda, int &iter)
bool is_empty(void) const
F77_RET_T const F77_INT const F77_INT const F77_INT const F77_DBLE const F77_DBLE F77_INT F77_DBLE * V
void resize(octave_idx_type nr, octave_idx_type nc, double rfv=0)
Matrix extract(octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).is_integer_type())
OCTINTERP_API void print_usage(void)
octave_idx_type numel(void) const
Number of elements in the array.
Matrix extract_n(octave_idx_type r1, octave_idx_type c1, octave_idx_type nr, octave_idx_type nc) const
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
RowVector row(octave_idx_type i) const
ColumnVector extract_diag(octave_idx_type k=0) const
octave_idx_type rows(void) const
RowVector transpose(void) const
ComplexColumnVector eigenvalues(void) const
OCTAVE_EXPORT octave_value_list return the value of the option it must match the dimension of the state and the relative tolerance must also be a vector of the same length tem it must match the dimension of the state and the absolute tolerance must also be a vector of the same length The local error test applied at each integration step is xample roup calculate Y_a and Y _d item Given Y
T right_singular_matrix(void) const
OCTAVE_EXPORT octave_value_list search each directory of the loadpath for element of the cell array and return the first that matches If the second optional argument return a cell array containing the list of all files that have the same name in the path If no files are found
static Matrix null(const Matrix &A, octave_idx_type &rank)
DM_T singular_values(void) const
Matrix transpose(void) const
Array< T > column(octave_idx_type k) const
Extract column: A(:,k+1).
F77_RET_T const F77_INT const F77_INT const F77_INT F77_DBLE const F77_INT F77_DBLE const F77_INT F77_DBLE const F77_INT F77_DBLE * Z
Matrix stack(const Matrix &a) const
=val(i)}if ode{val(i)}occurs in table i
OCTAVE_EXPORT octave_value_list return the value of the option it must match the dimension of the state and the relative tolerance must also be a vector of the same length tem it must match the dimension of the state and the absolute tolerance must also be a vector of the same length The local error test applied at each integration step is xample roup abs(local error in x(i))<
ComplexMatrix right_eigenvectors(void) const
ColumnVector real(const ComplexColumnVector &a)
octave_idx_type cols(void) const
Matrix pseudo_inverse(double tol=0.0) const
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE * x
void resize(octave_idx_type n, const double &rfv=0)
F77_RET_T const F77_INT F77_CMPLX * A
T chol_matrix(void) const