24 #if defined (HAVE_CONFIG_H) 58 : a_fact (
u), l_fact (l), ipvt (
p.
transpose ().col_perm_vec ())
60 if (l.columns () !=
u.rows ())
107 l.xelem (
i,
i) = 1.0;
110 l.xelem (
i, j) = a_fact.xelem (
i, j);
119 template <
typename T>
134 u.xelem (
i, j) = a_fact.xelem (
i, j);
143 template <
typename T>
148 (*current_liboctave_error_handler)
149 (
"lu: Y () not implemented for unpacked form");
154 template <
typename T>
185 template <
typename T>
192 template <
typename T>
203 p.xelem (
i) =
static_cast<double> (pvt.
xelem (
i) + 1);
208 template <
typename T>
228 #if ! defined (HAVE_QRUPDATE_LUU) 230 template <
typename T>
234 (*current_liboctave_error_handler)
235 (
"luupdate: support for qrupdate with LU updates " 236 "was unavailable or disabled when liboctave was built");
239 template <
typename T>
243 (*current_liboctave_error_handler)
244 (
"luupdate: support for qrupdate with LU updates " 245 "was unavailable or disabled when liboctave was built");
248 template <
typename T>
252 (*current_liboctave_error_handler)
253 (
"luupdate: support for qrupdate with LU updates " 254 "was unavailable or disabled when liboctave was built");
257 template <
typename T>
261 (*current_liboctave_error_handler)
262 (
"luupdate: support for qrupdate with LU updates " 263 "was unavailable or disabled when liboctave was built");
278 F77_INT *pipvt = ipvt.fortran_vec ();
281 double *tmp_data = a_fact.fortran_vec ();
291 #if defined (HAVE_QRUPDATE_LUU) 307 F77_INT u_nel = to_f77_int (
u.numel ());
310 if (u_nel != m || v_nel != n)
311 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
333 F77_INT u_nr = to_f77_int (
u.rows ());
334 F77_INT u_nc = to_f77_int (
u.columns ());
339 if (u_nr != m || v_nr != n || u_nc != v_nc)
340 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
366 F77_INT u_nel = to_f77_int (
u.numel ());
369 if (u_nel != m || v_nel != n)
370 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
379 utmp.data (), vtmp.
data (),
w));
397 F77_INT u_nr = to_f77_int (
u.rows ());
398 F77_INT u_nc = to_f77_int (
u.columns ());
403 if (u_nr != m || v_nr != n || u_nc != v_nc)
404 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
430 F77_INT *pipvt = ipvt.fortran_vec ();
433 float *tmp_data = a_fact.fortran_vec ();
443 #if defined (HAVE_QRUPDATE_LUU) 460 F77_INT u_nel = to_f77_int (
u.numel ());
463 if (u_nel != m || v_nel != n)
464 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
487 F77_INT u_nr = to_f77_int (
u.rows ());
488 F77_INT u_nc = to_f77_int (
u.columns ());
493 if (u_nr != m || v_nr != n || u_nc != v_nc)
494 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
521 F77_INT u_nel = to_f77_int (
u.numel ());
524 if (u_nel != m || v_nel != n)
525 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
534 utmp.data (), vtmp.
data (),
w));
552 F77_INT u_nr = to_f77_int (
u.rows ());
553 F77_INT u_nc = to_f77_int (
u.columns ());
558 if (u_nr != m || v_nr != n || u_nc != v_nc)
559 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
585 F77_INT *pipvt = ipvt.fortran_vec ();
588 Complex *tmp_data = a_fact.fortran_vec ();
599 #if defined (HAVE_QRUPDATE_LUU) 616 F77_INT u_nel = to_f77_int (
u.numel ());
619 if (u_nel != m || v_nel != n)
620 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
644 F77_INT u_nr = to_f77_int (
u.rows ());
645 F77_INT u_nc = to_f77_int (
u.columns ());
650 if (u_nr != m || v_nr != n || u_nc != v_nc)
651 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
681 F77_INT u_nel = to_f77_int (
u.numel ());
684 if (u_nel != m || v_nel != n)
685 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
715 F77_INT u_nr = to_f77_int (
u.rows ());
716 F77_INT u_nc = to_f77_int (
u.columns ());
721 if (u_nr != m || v_nr != n || u_nc != v_nc)
722 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
734 k, ipvt.fortran_vec (),
752 F77_INT *pipvt = ipvt.fortran_vec ();
766 #if defined (HAVE_QRUPDATE_LUU) 783 F77_INT u_nel = to_f77_int (
u.numel ());
786 if (u_nel != m || v_nel != n)
787 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
812 F77_INT u_nr = to_f77_int (
u.rows ());
813 F77_INT u_nc = to_f77_int (
u.columns ());
818 if (u_nr != m || v_nr != n || u_nc != v_nc)
819 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
847 F77_INT u_nel = to_f77_int (
u.numel ());
850 if (u_nel != m || v_nel != n)
851 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
881 F77_INT u_nr = to_f77_int (
u.rows ());
882 F77_INT u_nc = to_f77_int (
u.columns ());
887 if (u_nr != m || v_nr != n || u_nc != v_nc)
888 (*current_liboctave_error_handler) (
"luupdate: dimensions mismatch");
octave_idx_type rows(void) const
const T * data(void) const
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
#define F77_DBLE_CMPLX_ARG(x)
const T * fortran_vec(void) const
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)
octave_idx_type columns(void) const
#define F77_XFCN(f, F, args)
Array< octave_idx_type > getp(void) const
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
std::complex< double > w(std::complex< double > z, double relerr=0)
ColumnVector column(octave_idx_type i) const
void update_piv(const VT &u, const VT &v)
T & xelem(octave_idx_type n)
#define F77_CONST_DBLE_CMPLX_ARG(x)
octave_f77_int_type F77_INT
FloatComplexColumnVector column(octave_idx_type i) const
ColumnVector P_vec(void) const
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
void update(const VT &u, const VT &v)
#define F77_CONST_CMPLX_ARG(x)
ComplexColumnVector column(octave_idx_type i) const
std::complex< float > FloatComplex
std::complex< double > Complex
FloatColumnVector column(octave_idx_type i) const
octave_idx_type numel(void) const
Number of elements in the array.
Vector representing the dimensions (size) of an Array.
charNDArray min(char d, const charNDArray &m)