GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
xdiv.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1993-2017 John W. Eaton
4 Copyright (C) 2008 Jaroslav Hajek
5 Copyright (C) 2009-2010 VZLU Prague
6 
7 This file is part of Octave.
8 
9 Octave is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License as published by the
11 Free Software Foundation; either version 3 of the License, or (at your
12 option) any later version.
13 
14 Octave is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Octave; see the file COPYING. If not, see
21 <http://www.gnu.org/licenses/>.
22 
23 */
24 
25 #if defined (HAVE_CONFIG_H)
26 # include "config.h"
27 #endif
28 
29 #include <cassert>
30 
31 #include "Array-util.h"
32 #include "CMatrix.h"
33 #include "dMatrix.h"
34 #include "CNDArray.h"
35 #include "dNDArray.h"
36 #include "fCMatrix.h"
37 #include "fMatrix.h"
38 #include "fCNDArray.h"
39 #include "fNDArray.h"
40 #include "oct-cmplx.h"
41 #include "dDiagMatrix.h"
42 #include "fDiagMatrix.h"
43 #include "CDiagMatrix.h"
44 #include "fCDiagMatrix.h"
45 #include "lo-array-errwarn.h"
46 #include "quit.h"
47 
48 #include "error.h"
49 #include "xdiv.h"
50 
51 static inline bool
53 {
54  assert (info != -1);
55 
56  return (info != -2);
57 }
58 
59 static void
61 {
63 }
64 
65 template <typename T1, typename T2>
66 bool
68 {
69  octave_idx_type a_nr = blas_trans == blas_no_trans ? a.rows () : a.cols ();
70  octave_idx_type b_nr = b.rows ();
71 
72  if (a_nr != b_nr)
73  {
74  octave_idx_type a_nc = blas_trans == blas_no_trans ? a.cols ()
75  : a.rows ();
76  octave_idx_type b_nc = b.cols ();
77 
78  octave::err_nonconformant ("operator \\", a_nr, a_nc, b_nr, b_nc);
79  }
80 
81  return true;
82 }
83 
84 #define INSTANTIATE_MX_LEFTDIV_CONFORM(T1, T2) \
85  template bool mx_leftdiv_conform (const T1&, const T2&, blas_trans_type)
86 
91 
92 template <typename T1, typename T2>
93 bool
94 mx_div_conform (const T1& a, const T2& b)
95 {
96  octave_idx_type a_nc = a.cols ();
97  octave_idx_type b_nc = b.cols ();
98 
99  if (a_nc != b_nc)
100  {
101  octave_idx_type a_nr = a.rows ();
102  octave_idx_type b_nr = b.rows ();
103 
104  octave::err_nonconformant ("operator /", a_nr, a_nc, b_nr, b_nc);
105  }
106 
107  return true;
108 }
109 
110 #define INSTANTIATE_MX_DIV_CONFORM(T1, T2) \
111  template bool mx_div_conform (const T1&, const T2&)
112 
117 
118 // Right division functions.
119 //
120 // op2 / op1: m cm
121 // +-- +---+----+
122 // matrix | 1 | 3 |
123 // +---+----+
124 // complex_matrix | 2 | 4 |
125 // +---+----+
126 
127 // -*- 1 -*-
128 Matrix
129 xdiv (const Matrix& a, const Matrix& b, MatrixType &typ)
130 {
131  if (! mx_div_conform (a, b))
132  return Matrix ();
133 
134  octave_idx_type info;
135  double rcond = 0.0;
136 
137  Matrix result
138  = b.solve (typ, a.transpose (), info, rcond,
140 
141  return result.transpose ();
142 }
143 
144 // -*- 2 -*-
146 xdiv (const Matrix& a, const ComplexMatrix& b, MatrixType &typ)
147 {
148  if (! mx_div_conform (a, b))
149  return ComplexMatrix ();
150 
151  octave_idx_type info;
152  double rcond = 0.0;
153 
155  = b.solve (typ, a.transpose (), info, rcond,
157 
158  return result.transpose ();
159 }
160 
161 // -*- 3 -*-
163 xdiv (const ComplexMatrix& a, const Matrix& b, MatrixType &typ)
164 {
165  if (! mx_div_conform (a, b))
166  return ComplexMatrix ();
167 
168  octave_idx_type info;
169  double rcond = 0.0;
170 
172  = b.solve (typ, a.transpose (), info, rcond,
174 
175  return result.transpose ();
176 }
177 
178 // -*- 4 -*-
181 {
182  if (! mx_div_conform (a, b))
183  return ComplexMatrix ();
184 
185  octave_idx_type info;
186  double rcond = 0.0;
187 
189  = b.solve (typ, a.transpose (), info, rcond,
191 
192  return result.transpose ();
193 }
194 
195 // Funny element by element division operations.
196 //
197 // op2 \ op1: s cs
198 // +-- +---+----+
199 // matrix | 1 | 3 |
200 // +---+----+
201 // complex_matrix | 2 | 4 |
202 // +---+----+
203 
204 Matrix
205 x_el_div (double a, const Matrix& b)
206 {
207  octave_idx_type nr = b.rows ();
208  octave_idx_type nc = b.columns ();
209 
210  Matrix result (nr, nc);
211 
212  for (octave_idx_type j = 0; j < nc; j++)
213  for (octave_idx_type i = 0; i < nr; i++)
214  {
215  octave_quit ();
216  result (i, j) = a / b (i, j);
217  }
218 
219  return result;
220 }
221 
223 x_el_div (double a, const ComplexMatrix& b)
224 {
225  octave_idx_type nr = b.rows ();
226  octave_idx_type nc = b.columns ();
227 
228  ComplexMatrix result (nr, nc);
229 
230  for (octave_idx_type j = 0; j < nc; j++)
231  for (octave_idx_type i = 0; i < nr; i++)
232  {
233  octave_quit ();
234  result (i, j) = a / b (i, j);
235  }
236 
237  return result;
238 }
239 
241 x_el_div (const Complex a, const Matrix& b)
242 {
243  octave_idx_type nr = b.rows ();
244  octave_idx_type nc = b.columns ();
245 
246  ComplexMatrix result (nr, nc);
247 
248  for (octave_idx_type j = 0; j < nc; j++)
249  for (octave_idx_type i = 0; i < nr; i++)
250  {
251  octave_quit ();
252  result (i, j) = a / b (i, j);
253  }
254 
255  return result;
256 }
257 
260 {
261  octave_idx_type nr = b.rows ();
262  octave_idx_type nc = b.columns ();
263 
264  ComplexMatrix result (nr, nc);
265 
266  for (octave_idx_type j = 0; j < nc; j++)
267  for (octave_idx_type i = 0; i < nr; i++)
268  {
269  octave_quit ();
270  result (i, j) = a / b (i, j);
271  }
272 
273  return result;
274 }
275 
276 // Funny element by element division operations.
277 //
278 // op2 \ op1: s cs
279 // +-- +---+----+
280 // N-D array | 1 | 3 |
281 // +---+----+
282 // complex N-D array | 2 | 4 |
283 // +---+----+
284 
285 NDArray
286 x_el_div (double a, const NDArray& b)
287 {
288  NDArray result (b.dims ());
289 
290  for (octave_idx_type i = 0; i < b.numel (); i++)
291  {
292  octave_quit ();
293  result (i) = a / b (i);
294  }
295 
296  return result;
297 }
298 
300 x_el_div (double a, const ComplexNDArray& b)
301 {
302  ComplexNDArray result (b.dims ());
303 
304  for (octave_idx_type i = 0; i < b.numel (); i++)
305  {
306  octave_quit ();
307  result (i) = a / b (i);
308  }
309 
310  return result;
311 }
312 
314 x_el_div (const Complex a, const NDArray& b)
315 {
316  ComplexNDArray result (b.dims ());
317 
318  for (octave_idx_type i = 0; i < b.numel (); i++)
319  {
320  octave_quit ();
321  result (i) = a / b (i);
322  }
323 
324  return result;
325 }
326 
329 {
330  ComplexNDArray result (b.dims ());
331 
332  for (octave_idx_type i = 0; i < b.numel (); i++)
333  {
334  octave_quit ();
335  result (i) = a / b (i);
336  }
337 
338  return result;
339 }
340 
341 // Left division functions.
342 //
343 // op2 \ op1: m cm
344 // +-- +---+----+
345 // matrix | 1 | 3 |
346 // +---+----+
347 // complex_matrix | 2 | 4 |
348 // +---+----+
349 
350 // -*- 1 -*-
351 Matrix
352 xleftdiv (const Matrix& a, const Matrix& b, MatrixType &typ,
353  blas_trans_type transt)
354 {
355  if (! mx_leftdiv_conform (a, b, transt))
356  return Matrix ();
357 
358  octave_idx_type info;
359  double rcond = 0.0;
360  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
361 }
362 
363 // -*- 2 -*-
365 xleftdiv (const Matrix& a, const ComplexMatrix& b, MatrixType &typ,
366  blas_trans_type transt)
367 {
368  if (! mx_leftdiv_conform (a, b, transt))
369  return ComplexMatrix ();
370 
371  octave_idx_type info;
372  double rcond = 0.0;
373 
374  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
375 }
376 
377 // -*- 3 -*-
379 xleftdiv (const ComplexMatrix& a, const Matrix& b, MatrixType &typ,
380  blas_trans_type transt)
381 {
382  if (! mx_leftdiv_conform (a, b, transt))
383  return ComplexMatrix ();
384 
385  octave_idx_type info;
386  double rcond = 0.0;
387  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
388 }
389 
390 // -*- 4 -*-
393  blas_trans_type transt)
394 {
395  if (! mx_leftdiv_conform (a, b, transt))
396  return ComplexMatrix ();
397 
398  octave_idx_type info;
399  double rcond = 0.0;
400  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
401 }
402 
403 static void
405 {
407 }
408 
413 
418 
419 // Right division functions.
420 //
421 // op2 / op1: m cm
422 // +-- +---+----+
423 // matrix | 1 | 3 |
424 // +---+----+
425 // complex_matrix | 2 | 4 |
426 // +---+----+
427 
428 // -*- 1 -*-
430 xdiv (const FloatMatrix& a, const FloatMatrix& b, MatrixType &typ)
431 {
432  if (! mx_div_conform (a, b))
433  return FloatMatrix ();
434 
435  octave_idx_type info;
436  float rcond = 0.0;
437 
439  = b.solve (typ, a.transpose (), info, rcond,
441 
442  return result.transpose ();
443 }
444 
445 // -*- 2 -*-
448 {
449  if (! mx_div_conform (a, b))
450  return FloatComplexMatrix ();
451 
452  octave_idx_type info;
453  float rcond = 0.0;
454 
456  = b.solve (typ, a.transpose (), info, rcond,
458 
459  return result.transpose ();
460 }
461 
462 // -*- 3 -*-
465 {
466  if (! mx_div_conform (a, b))
467  return FloatComplexMatrix ();
468 
469  octave_idx_type info;
470  float rcond = 0.0;
471 
473  = b.solve (typ, a.transpose (), info, rcond,
475 
476  return result.transpose ();
477 }
478 
479 // -*- 4 -*-
482 {
483  if (! mx_div_conform (a, b))
484  return FloatComplexMatrix ();
485 
486  octave_idx_type info;
487  float rcond = 0.0;
488 
490  = b.solve (typ, a.transpose (), info, rcond,
492 
493  return result.transpose ();
494 }
495 
496 // Funny element by element division operations.
497 //
498 // op2 \ op1: s cs
499 // +-- +---+----+
500 // matrix | 1 | 3 |
501 // +---+----+
502 // complex_matrix | 2 | 4 |
503 // +---+----+
504 
506 x_el_div (float a, const FloatMatrix& b)
507 {
508  octave_idx_type nr = b.rows ();
509  octave_idx_type nc = b.columns ();
510 
511  FloatMatrix result (nr, nc);
512 
513  for (octave_idx_type j = 0; j < nc; j++)
514  for (octave_idx_type i = 0; i < nr; i++)
515  {
516  octave_quit ();
517  result (i, j) = a / b (i, j);
518  }
519 
520  return result;
521 }
522 
525 {
526  octave_idx_type nr = b.rows ();
527  octave_idx_type nc = b.columns ();
528 
529  FloatComplexMatrix result (nr, nc);
530 
531  for (octave_idx_type j = 0; j < nc; j++)
532  for (octave_idx_type i = 0; i < nr; i++)
533  {
534  octave_quit ();
535  result (i, j) = a / b (i, j);
536  }
537 
538  return result;
539 }
540 
543 {
544  octave_idx_type nr = b.rows ();
545  octave_idx_type nc = b.columns ();
546 
547  FloatComplexMatrix result (nr, nc);
548 
549  for (octave_idx_type j = 0; j < nc; j++)
550  for (octave_idx_type i = 0; i < nr; i++)
551  {
552  octave_quit ();
553  result (i, j) = a / b (i, j);
554  }
555 
556  return result;
557 }
558 
561 {
562  octave_idx_type nr = b.rows ();
563  octave_idx_type nc = b.columns ();
564 
565  FloatComplexMatrix result (nr, nc);
566 
567  for (octave_idx_type j = 0; j < nc; j++)
568  for (octave_idx_type i = 0; i < nr; i++)
569  {
570  octave_quit ();
571  result (i, j) = a / b (i, j);
572  }
573 
574  return result;
575 }
576 
577 // Funny element by element division operations.
578 //
579 // op2 \ op1: s cs
580 // +-- +---+----+
581 // N-D array | 1 | 3 |
582 // +---+----+
583 // complex N-D array | 2 | 4 |
584 // +---+----+
585 
587 x_el_div (float a, const FloatNDArray& b)
588 {
589  FloatNDArray result (b.dims ());
590 
591  for (octave_idx_type i = 0; i < b.numel (); i++)
592  {
593  octave_quit ();
594  result (i) = a / b (i);
595  }
596 
597  return result;
598 }
599 
602 {
604 
605  for (octave_idx_type i = 0; i < b.numel (); i++)
606  {
607  octave_quit ();
608  result (i) = a / b (i);
609  }
610 
611  return result;
612 }
613 
616 {
618 
619  for (octave_idx_type i = 0; i < b.numel (); i++)
620  {
621  octave_quit ();
622  result (i) = a / b (i);
623  }
624 
625  return result;
626 }
627 
630 {
632 
633  for (octave_idx_type i = 0; i < b.numel (); i++)
634  {
635  octave_quit ();
636  result (i) = a / b (i);
637  }
638 
639  return result;
640 }
641 
642 // Left division functions.
643 //
644 // op2 \ op1: m cm
645 // +-- +---+----+
646 // matrix | 1 | 3 |
647 // +---+----+
648 // complex_matrix | 2 | 4 |
649 // +---+----+
650 
651 // -*- 1 -*-
654  blas_trans_type transt)
655 {
656  if (! mx_leftdiv_conform (a, b, transt))
657  return FloatMatrix ();
658 
659  octave_idx_type info;
660  float rcond = 0.0;
661  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
662 }
663 
664 // -*- 2 -*-
667  blas_trans_type transt)
668 {
669  if (! mx_leftdiv_conform (a, b, transt))
670  return FloatComplexMatrix ();
671 
672  octave_idx_type info;
673  float rcond = 0.0;
674 
675  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
676 }
677 
678 // -*- 3 -*-
681  blas_trans_type transt)
682 {
683  if (! mx_leftdiv_conform (a, b, transt))
684  return FloatComplexMatrix ();
685 
686  octave_idx_type info;
687  float rcond = 0.0;
688  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
689 }
690 
691 // -*- 4 -*-
694  MatrixType &typ, blas_trans_type transt)
695 {
696  if (! mx_leftdiv_conform (a, b, transt))
697  return FloatComplexMatrix ();
698 
699  octave_idx_type info;
700  float rcond = 0.0;
701  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
702 }
703 
704 // Diagonal matrix division.
705 
706 template <typename MT, typename DMT>
707 MT
708 mdm_div_impl (const MT& a, const DMT& d)
709 {
710  if (! mx_div_conform (a, d))
711  return MT ();
712 
713  octave_idx_type m = a.rows ();
714  octave_idx_type n = d.rows ();
715  octave_idx_type l = d.length ();
716  MT x (m, n);
717  typedef typename DMT::element_type S;
718  typedef typename MT::element_type T;
719  const T *aa = a.data ();
720  const S *dd = d.data ();
721  T *xx = x.fortran_vec ();
722 
723  for (octave_idx_type j = 0; j < l; j++)
724  {
725  const S del = dd[j];
726  if (del != S ())
727  for (octave_idx_type i = 0; i < m; i++)
728  xx[i] = aa[i] / del;
729  else
730  for (octave_idx_type i = 0; i < m; i++)
731  xx[i] = T ();
732  aa += m; xx += m;
733  }
734 
735  for (octave_idx_type i = l*m; i < n*m; i++)
736  xx[i] = T ();
737 
738  return x;
739 }
740 
741 // Right division functions.
742 //
743 // op2 / op1: dm cdm
744 // +-- +---+----+
745 // matrix | 1 | |
746 // +---+----+
747 // complex_matrix | 2 | 3 |
748 // +---+----+
749 
750 // -*- 1 -*-
751 Matrix
752 xdiv (const Matrix& a, const DiagMatrix& b)
753 { return mdm_div_impl (a, b); }
754 
755 // -*- 2 -*-
757 xdiv (const ComplexMatrix& a, const DiagMatrix& b)
758 { return mdm_div_impl (a, b); }
759 
760 // -*- 3 -*-
763 { return mdm_div_impl (a, b); }
764 
765 // Right division functions, float type.
766 //
767 // op2 / op1: dm cdm
768 // +-- +---+----+
769 // matrix | 1 | |
770 // +---+----+
771 // complex_matrix | 2 | 3 |
772 // +---+----+
773 
774 // -*- 1 -*-
777 { return mdm_div_impl (a, b); }
778 
779 // -*- 2 -*-
782 { return mdm_div_impl (a, b); }
783 
784 // -*- 3 -*-
787 { return mdm_div_impl (a, b); }
788 
789 template <typename MT, typename DMT>
790 MT
791 dmm_leftdiv_impl (const DMT& d, const MT& a)
792 {
793  if (! mx_leftdiv_conform (d, a, blas_no_trans))
794  return MT ();
795 
796  octave_idx_type m = d.cols ();
797  octave_idx_type n = a.cols ();
798  octave_idx_type k = a.rows ();
799  octave_idx_type l = d.length ();
800  MT x (m, n);
801  typedef typename DMT::element_type S;
802  typedef typename MT::element_type T;
803  const T *aa = a.data ();
804  const S *dd = d.data ();
805  T *xx = x.fortran_vec ();
806 
807  for (octave_idx_type j = 0; j < n; j++)
808  {
809  for (octave_idx_type i = 0; i < l; i++)
810  xx[i] = dd[i] != S () ? aa[i] / dd[i] : T ();
811  for (octave_idx_type i = l; i < m; i++)
812  xx[i] = T ();
813  aa += k; xx += m;
814  }
815 
816  return x;
817 }
818 
819 // Left division functions.
820 //
821 // op2 \ op1: m cm
822 // +---+----+
823 // diag_matrix | 1 | 2 |
824 // +---+----+
825 // complex_diag_matrix | | 3 |
826 // +---+----+
827 
828 // -*- 1 -*-
829 Matrix
830 xleftdiv (const DiagMatrix& a, const Matrix& b)
831 { return dmm_leftdiv_impl (a, b); }
832 
833 // -*- 2 -*-
836 { return dmm_leftdiv_impl (a, b); }
837 
838 // -*- 3 -*-
841 { return dmm_leftdiv_impl (a, b); }
842 
843 // Left division functions, float type.
844 //
845 // op2 \ op1: m cm
846 // +---+----+
847 // diag_matrix | 1 | 2 |
848 // +---+----+
849 // complex_diag_matrix | | 3 |
850 // +---+----+
851 
852 // -*- 1 -*-
855 { return dmm_leftdiv_impl (a, b); }
856 
857 // -*- 2 -*-
860 { return dmm_leftdiv_impl (a, b); }
861 
862 // -*- 3 -*-
865 { return dmm_leftdiv_impl (a, b); }
866 
867 // Diagonal by diagonal matrix division.
868 
869 template <typename MT, typename DMT>
870 MT
871 dmdm_div_impl (const MT& a, const DMT& d)
872 {
873  if (! mx_div_conform (a, d))
874  return MT ();
875 
876  octave_idx_type m = a.rows ();
877  octave_idx_type n = d.rows ();
878  octave_idx_type k = d.cols ();
879  octave_idx_type l = std::min (m, n);
880  octave_idx_type lk = std::min (l, k);
881  MT x (m, n);
882  typedef typename DMT::element_type S;
883  typedef typename MT::element_type T;
884  const T *aa = a.data ();
885  const S *dd = d.data ();
886  T *xx = x.fortran_vec ();
887 
888  for (octave_idx_type i = 0; i < lk; i++)
889  xx[i] = dd[i] != S () ? aa[i] / dd[i] : T ();
890  for (octave_idx_type i = lk; i < l; i++)
891  xx[i] = T ();
892 
893  return x;
894 }
895 
896 // Right division functions.
897 //
898 // op2 / op1: dm cdm
899 // +-- +---+----+
900 // diag_matrix | 1 | |
901 // +---+----+
902 // complex_diag_matrix | 2 | 3 |
903 // +---+----+
904 
905 // -*- 1 -*-
907 xdiv (const DiagMatrix& a, const DiagMatrix& b)
908 { return dmdm_div_impl (a, b); }
909 
910 // -*- 2 -*-
913 { return dmdm_div_impl (a, b); }
914 
915 // -*- 3 -*-
918 { return dmdm_div_impl (a, b); }
919 
920 // Right division functions, float type.
921 //
922 // op2 / op1: dm cdm
923 // +-- +---+----+
924 // diag_matrix | 1 | |
925 // +---+----+
926 // complex_diag_matrix | 2 | 3 |
927 // +---+----+
928 
929 // -*- 1 -*-
932 { return dmdm_div_impl (a, b); }
933 
934 // -*- 2 -*-
937 { return dmdm_div_impl (a, b); }
938 
939 // -*- 3 -*-
942 { return dmdm_div_impl (a, b); }
943 
944 template <typename MT, typename DMT>
945 MT
946 dmdm_leftdiv_impl (const DMT& d, const MT& a)
947 {
948  if (! mx_leftdiv_conform (d, a, blas_no_trans))
949  return MT ();
950 
951  octave_idx_type m = d.cols ();
952  octave_idx_type n = a.cols ();
953  octave_idx_type k = d.rows ();
954  octave_idx_type l = std::min (m, n);
955  octave_idx_type lk = std::min (l, k);
956  MT x (m, n);
957  typedef typename DMT::element_type S;
958  typedef typename MT::element_type T;
959  const T *aa = a.data ();
960  const S *dd = d.data ();
961  T *xx = x.fortran_vec ();
962 
963  for (octave_idx_type i = 0; i < lk; i++)
964  xx[i] = dd[i] != S () ? aa[i] / dd[i] : T ();
965  for (octave_idx_type i = lk; i < l; i++)
966  xx[i] = T ();
967 
968  return x;
969 }
970 
971 // Left division functions.
972 //
973 // op2 \ op1: dm cdm
974 // +---+----+
975 // diag_matrix | 1 | 2 |
976 // +---+----+
977 // complex_diag_matrix | | 3 |
978 // +---+----+
979 
980 // -*- 1 -*-
982 xleftdiv (const DiagMatrix& a, const DiagMatrix& b)
983 { return dmdm_leftdiv_impl (a, b); }
984 
985 // -*- 2 -*-
988 { return dmdm_leftdiv_impl (a, b); }
989 
990 // -*- 3 -*-
993 { return dmdm_leftdiv_impl (a, b); }
994 
995 // Left division functions, float type.
996 //
997 // op2 \ op1: dm cdm
998 // +---+----+
999 // diag_matrix | 1 | 2 |
1000 // +---+----+
1001 // complex_diag_matrix | | 3 |
1002 // +---+----+
1003 
1004 // -*- 1 -*-
1007 { return dmdm_leftdiv_impl (a, b); }
1008 
1009 // -*- 2 -*-
1012 { return dmdm_leftdiv_impl (a, b); }
1013 
1014 // -*- 3 -*-
1017 { return dmdm_leftdiv_impl (a, b); }
FloatComplexMatrix transpose(void) const
Definition: fCMatrix.h:170
FloatComplexMatrix solve(MatrixType &typ, const FloatMatrix &b) const
Definition: fCMatrix.cc:2016
MT dmm_leftdiv_impl(const DMT &d, const MT &a)
Definition: xdiv.cc:791
octave_idx_type numel(void) const
Number of elements in the array.
Definition: Array.h:363
Matrix xleftdiv(const Matrix &a, const Matrix &b, MatrixType &typ, blas_trans_type transt)
Definition: xdiv.cc:352
FloatMatrix transpose(void) const
Definition: fMatrix.h:133
for large enough k
Definition: lu.cc:606
octave_idx_type cols(void) const
Definition: oct-map.h:376
MT mdm_div_impl(const MT &a, const DMT &d)
Definition: xdiv.cc:708
octave_idx_type b_nr
Definition: sylvester.cc:74
FloatMatrix solve(MatrixType &typ, const FloatMatrix &b) const
Definition: fMatrix.cc:1702
octave_idx_type a_nc
Definition: sylvester.cc:72
Matrix xdiv(const Matrix &a, const Matrix &b, MatrixType &typ)
Definition: xdiv.cc:129
static bool result_ok(octave_idx_type info)
Definition: xdiv.cc:52
octave_idx_type rows(void) const
Definition: Array.h:401
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 const F77_DBLE F77_DBLE * d
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
Definition: cellfun.cc:398
MT dmdm_div_impl(const MT &a, const DMT &d)
Definition: xdiv.cc:871
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
Definition: Array.h:439
static void solve_singularity_warning(double rcond)
Definition: xdiv.cc:60
octave_idx_type a_nr
Definition: sylvester.cc:71
nd deftypefn *octave_map m
Definition: ov-struct.cc:2058
void err_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
Matrix transpose(void) const
Definition: dMatrix.h:129
#define INSTANTIATE_MX_LEFTDIV_CONFORM(T1, T2)
Definition: xdiv.cc:84
ComplexMatrix solve(MatrixType &typ, const Matrix &b) const
Definition: CMatrix.cc:2010
bool mx_div_conform(const T1 &a, const T2 &b)
Definition: xdiv.cc:94
Definition: dMatrix.h:37
ComplexMatrix transpose(void) const
Definition: CMatrix.h:165
bool mx_leftdiv_conform(const T1 &a, const T2 &b, blas_trans_type blas_trans)
Definition: xdiv.cc:67
#define INSTANTIATE_MX_DIV_CONFORM(T1, T2)
Definition: xdiv.cc:110
With real return the complex result
Definition: data.cc:3375
Matrix solve(MatrixType &typ, const Matrix &b) const
Definition: dMatrix.cc:1684
MT dmdm_leftdiv_impl(const DMT &d, const MT &a)
Definition: xdiv.cc:946
octave_idx_type rows(void) const
Definition: oct-map.h:375
=val(i)}if ode{val(i)}occurs in table i
Definition: lookup.cc:239
octave_idx_type b_nc
Definition: sylvester.cc:75
b
Definition: cellfun.cc:398
Matrix x_el_div(double a, const Matrix &b)
Definition: xdiv.cc:205
std::complex< float > FloatComplex
Definition: oct-cmplx.h:32
blas_trans_type
Definition: mx-defs.h:103
std::complex< double > Complex
Definition: oct-cmplx.h:31
void warn_singular_matrix(double rcond)
octave_idx_type columns(void) const
Definition: Array.h:410
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
charNDArray min(char d, const charNDArray &m)
Definition: chNDArray.cc:205