44 double*,
const octave_idx_type&,
double*,
45 double*,
const octave_idx_type&,
49 F77_FUNC (dorgqr, DORGQR) (
const octave_idx_type&,
const octave_idx_type&,
50 const octave_idx_type&,
double*,
51 const octave_idx_type&,
double*,
double*,
52 const octave_idx_type&, octave_idx_type&);
57 F77_FUNC (dqr1up, DQR1UP) (
const octave_idx_type&,
const octave_idx_type&,
58 const octave_idx_type&,
double*,
59 const octave_idx_type&,
double*,
60 const octave_idx_type&,
double*,
double*,
double*);
63 F77_FUNC (dqrinc, DQRINC) (
const octave_idx_type&,
const octave_idx_type&,
64 const octave_idx_type&,
double*,
65 const octave_idx_type&,
double*,
66 const octave_idx_type&,
const octave_idx_type&,
67 const double*,
double*);
70 F77_FUNC (dqrdec, DQRDEC) (
const octave_idx_type&,
const octave_idx_type&,
71 const octave_idx_type&,
double*,
72 const octave_idx_type&,
double*,
73 const octave_idx_type&,
const octave_idx_type&,
77 F77_FUNC (dqrinr, DQRINR) (
const octave_idx_type&,
const octave_idx_type&,
78 double*,
const octave_idx_type&,
double*,
79 const octave_idx_type&,
const octave_idx_type&,
80 const double*,
double*);
83 F77_FUNC (dqrder, DQRDER) (
const octave_idx_type&,
const octave_idx_type&,
84 double*,
const octave_idx_type&,
double*,
85 const octave_idx_type&,
const octave_idx_type&,
89 F77_FUNC (dqrshc, DQRSHC) (
const octave_idx_type&,
const octave_idx_type&,
90 const octave_idx_type&,
double*,
91 const octave_idx_type&,
double*,
92 const octave_idx_type&,
const octave_idx_type&,
93 const octave_idx_type&,
double*);
129 lwork =
std::max (lwork, static_cast<octave_idx_type> (1));
135 form (n, afact, tau, qr_type);
151 afact.
elem (i, j) *= tau[j];
183 afact.
xelem (i, j) = 0;
199 lwork =
std::max (lwork, static_cast<octave_idx_type> (1));
262 else if (j < 0 || j > n)
263 (*current_liboctave_error_handler) (
"qrinsert: index out of range");
296 dups = dups && js(i) == js(i+1);
299 (*current_liboctave_error_handler) (
"qrinsert: duplicate index detected");
302 else if (nj > 0 && (js(0) < 0 || js(nj-1) > n))
303 (*current_liboctave_error_handler) (
"qrinsert: index out of range");
337 if (j < 0 || j > n-1)
338 (*current_liboctave_error_handler) (
"qrdelete: index out of range");
369 dups = dups && js(i) == js(i+1);
372 (*current_liboctave_error_handler) (
"qrinsert: duplicate index detected");
373 else if (nj > 0 && (js(0) > n-1 || js(nj-1) < 0))
381 F77_XFCN (dqrdec, DQRDEC, (m, n - ii, k == m ? k : k - ii,
408 else if (j < 0 || j > m)
409 (*current_liboctave_error_handler) (
"qrinsert: index out of range");
431 else if (j < 0 || j > m-1)
432 (*current_liboctave_error_handler) (
"qrdelete: index out of range");
452 if (i < 0 || i > n-1 || j < 0 || j > n-1)
453 (*current_liboctave_error_handler) (
"qrshift: index out of range");
471 warn_qrupdate_once ();
487 warn_qrupdate_once ();
566 warn_qrupdate_once ();
573 else if (j < 0 || j > n)
574 (*current_liboctave_error_handler) (
"qrinsert: index out of range");
584 warn_qrupdate_once ();
594 dups = dups && js(i) == js(i+1);
597 (*current_liboctave_error_handler) (
"qrinsert: duplicate index detected");
600 else if (nj > 0 && (js(0) < 0 || js(nj-1) > n))
601 (*current_liboctave_error_handler) (
"qrinsert: index out of range");
614 warn_qrupdate_once ();
618 if (j < 0 || j > n-1)
619 (*current_liboctave_error_handler) (
"qrdelete: index out of range");
629 warn_qrupdate_once ();
638 dups = dups && js(i) == js(i+1);
641 (*current_liboctave_error_handler) (
"qrinsert: duplicate index detected");
642 else if (nj > 0 && (js(0) > n-1 || js(nj-1) < 0))
656 warn_qrupdate_once ();
663 else if (j < 0 || j > m)
664 (*current_liboctave_error_handler) (
"qrinsert: index out of range");
678 else if (j < 0 || j > m-1)
679 (*current_liboctave_error_handler) (
"qrdelete: index out of range");
689 warn_qrupdate_once ();
693 if (i < 0 || i > n-1 || j < 0 || j > n-1)
694 (*current_liboctave_error_handler) (
"qrshift: index out of range");
701 void warn_qrupdate_once (
void)
703 static bool warned =
false;
706 (*current_liboctave_warning_with_id_handler)
707 (
"Octave:missing-dependency",
708 "In this version of Octave, QR & Cholesky updating routines "
709 "simply update the matrix and recalculate factorizations. "
710 "To use fast algorithms, link Octave with the qrupdate library. "
711 "See <http://sourceforge.net/projects/qrupdate>.");
void insert_col(const ColumnVector &u, octave_idx_type j)
void delete_row(octave_idx_type j)
void resize(octave_idx_type nr, octave_idx_type nc, double rfv=0)
static const idx_vector colon
F77_RET_T F77_FUNC(dgeqrf, DGEQRF)(const octave_idx_type &
void delete_elements(const idx_vector &i)
Deleting elements.
static void transpose(octave_idx_type N, const octave_idx_type *ridx, const octave_idx_type *cidx, octave_idx_type *ridx2, octave_idx_type *cidx2)
T & elem(octave_idx_type n)
void shift_cols(octave_idx_type i, octave_idx_type j)
qr_type_t get_type(void) const
#define F77_XFCN(f, F, args)
void insert_row(const RowVector &u, octave_idx_type j)
octave_idx_type rows(void) const
liboctave_error_handler current_liboctave_error_handler
static const type economy
Array< T > sort(int dim=0, sortmode mode=ASCENDING) const
std::complex< double > w(std::complex< double > z, double relerr=0)
const T * data(void) const
Matrix transpose(void) const
bool is_square(void) const
void init(const Matrix &, qr_type_t)
T & xelem(octave_idx_type n)
charNDArray max(char d, const charNDArray &m)
octave_idx_type length(void) const
Number of elements in the array.
ColumnVector column(octave_idx_type i) const
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
void assign(const idx_vector &i, const Array< T > &rhs, const T &rfv)
Indexed assignment (always with resize & fill).
const T * fortran_vec(void) const
octave_idx_type cols(void) const
void delete_col(octave_idx_type j)
void update(const ColumnVector &u, const ColumnVector &v)
octave_idx_type columns(void) const
void form(octave_idx_type n, Matrix &afact, double *tau, qr_type_t qr_type)
Array< T > index(const idx_vector &i) const
Indexing without resizing.
F77_RET_T const double * x
charNDArray min(char d, const charNDArray &m)