GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
xdiv.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1993-2018 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
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Octave is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License 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 <https://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 void
53 {
55 }
56 
57 template <typename T1, typename T2>
58 bool
60 {
61  octave_idx_type a_nr = (blas_trans == blas_no_trans ? a.rows () : a.cols ());
62  octave_idx_type b_nr = b.rows ();
63 
64  if (a_nr != b_nr)
65  {
67  : a.rows ());
68  octave_idx_type b_nc = b.cols ();
69 
70  octave::err_nonconformant (R"(operator \)", a_nr, a_nc, b_nr, b_nc);
71  }
72 
73  return true;
74 }
75 
76 #define INSTANTIATE_MX_LEFTDIV_CONFORM(T1, T2) \
77  template bool mx_leftdiv_conform (const T1&, const T2&, blas_trans_type)
78 
83 
84 template <typename T1, typename T2>
85 bool
86 mx_div_conform (const T1& a, const T2& b)
87 {
88  octave_idx_type a_nc = a.cols ();
89  octave_idx_type b_nc = b.cols ();
90 
91  if (a_nc != b_nc)
92  {
93  octave_idx_type a_nr = a.rows ();
94  octave_idx_type b_nr = b.rows ();
95 
96  octave::err_nonconformant ("operator /", a_nr, a_nc, b_nr, b_nc);
97  }
98 
99  return true;
100 }
101 
102 #define INSTANTIATE_MX_DIV_CONFORM(T1, T2) \
103  template bool mx_div_conform (const T1&, const T2&)
104 
109 
110 // Right division functions.
111 //
112 // op2 / op1: m cm
113 // +-- +---+----+
114 // matrix | 1 | 3 |
115 // +---+----+
116 // complex_matrix | 2 | 4 |
117 // +---+----+
118 
119 // -*- 1 -*-
120 Matrix
121 xdiv (const Matrix& a, const Matrix& b, MatrixType& typ)
122 {
123  if (! mx_div_conform (a, b))
124  return Matrix ();
125 
126  octave_idx_type info;
127  double rcond = 0.0;
128 
129  Matrix result
130  = b.solve (typ, a.transpose (), info, rcond,
132 
133  return result.transpose ();
134 }
135 
136 // -*- 2 -*-
138 xdiv (const Matrix& a, const ComplexMatrix& b, MatrixType& typ)
139 {
140  if (! mx_div_conform (a, b))
141  return ComplexMatrix ();
142 
143  octave_idx_type info;
144  double rcond = 0.0;
145 
147  = b.solve (typ, a.transpose (), info, rcond,
149 
150  return result.transpose ();
151 }
152 
153 // -*- 3 -*-
155 xdiv (const ComplexMatrix& a, const Matrix& b, MatrixType& typ)
156 {
157  if (! mx_div_conform (a, b))
158  return ComplexMatrix ();
159 
160  octave_idx_type info;
161  double rcond = 0.0;
162 
164  = b.solve (typ, a.transpose (), info, rcond,
166 
167  return result.transpose ();
168 }
169 
170 // -*- 4 -*-
173 {
174  if (! mx_div_conform (a, b))
175  return ComplexMatrix ();
176 
177  octave_idx_type info;
178  double rcond = 0.0;
179 
181  = b.solve (typ, a.transpose (), info, rcond,
183 
184  return result.transpose ();
185 }
186 
187 // Funny element by element division operations.
188 //
189 // op2 \ op1: s cs
190 // +-- +---+----+
191 // matrix | 1 | 3 |
192 // +---+----+
193 // complex_matrix | 2 | 4 |
194 // +---+----+
195 
196 Matrix
197 x_el_div (double a, const Matrix& b)
198 {
199  octave_idx_type nr = b.rows ();
200  octave_idx_type nc = b.columns ();
201 
202  Matrix result (nr, nc);
203 
204  for (octave_idx_type j = 0; j < nc; j++)
205  for (octave_idx_type i = 0; i < nr; i++)
206  {
207  octave_quit ();
208  result (i, j) = a / b (i, j);
209  }
210 
211  return result;
212 }
213 
215 x_el_div (double a, const ComplexMatrix& b)
216 {
217  octave_idx_type nr = b.rows ();
218  octave_idx_type nc = b.columns ();
219 
220  ComplexMatrix result (nr, nc);
221 
222  for (octave_idx_type j = 0; j < nc; j++)
223  for (octave_idx_type i = 0; i < nr; i++)
224  {
225  octave_quit ();
226  result (i, j) = a / b (i, j);
227  }
228 
229  return result;
230 }
231 
233 x_el_div (const Complex a, const Matrix& b)
234 {
235  octave_idx_type nr = b.rows ();
236  octave_idx_type nc = b.columns ();
237 
238  ComplexMatrix result (nr, nc);
239 
240  for (octave_idx_type j = 0; j < nc; j++)
241  for (octave_idx_type i = 0; i < nr; i++)
242  {
243  octave_quit ();
244  result (i, j) = a / b (i, j);
245  }
246 
247  return result;
248 }
249 
252 {
253  octave_idx_type nr = b.rows ();
254  octave_idx_type nc = b.columns ();
255 
256  ComplexMatrix result (nr, nc);
257 
258  for (octave_idx_type j = 0; j < nc; j++)
259  for (octave_idx_type i = 0; i < nr; i++)
260  {
261  octave_quit ();
262  result (i, j) = a / b (i, j);
263  }
264 
265  return result;
266 }
267 
268 // Funny element by element division operations.
269 //
270 // op2 \ op1: s cs
271 // +-- +---+----+
272 // N-D array | 1 | 3 |
273 // +---+----+
274 // complex N-D array | 2 | 4 |
275 // +---+----+
276 
277 NDArray
278 x_el_div (double a, const NDArray& b)
279 {
280  NDArray result (b.dims ());
281 
282  for (octave_idx_type i = 0; i < b.numel (); i++)
283  {
284  octave_quit ();
285  result (i) = a / b (i);
286  }
287 
288  return result;
289 }
290 
292 x_el_div (double a, const ComplexNDArray& b)
293 {
294  ComplexNDArray result (b.dims ());
295 
296  for (octave_idx_type i = 0; i < b.numel (); i++)
297  {
298  octave_quit ();
299  result (i) = a / b (i);
300  }
301 
302  return result;
303 }
304 
306 x_el_div (const Complex a, const NDArray& b)
307 {
308  ComplexNDArray result (b.dims ());
309 
310  for (octave_idx_type i = 0; i < b.numel (); i++)
311  {
312  octave_quit ();
313  result (i) = a / b (i);
314  }
315 
316  return result;
317 }
318 
321 {
322  ComplexNDArray result (b.dims ());
323 
324  for (octave_idx_type i = 0; i < b.numel (); i++)
325  {
326  octave_quit ();
327  result (i) = a / b (i);
328  }
329 
330  return result;
331 }
332 
333 // Left division functions.
334 //
335 // op2 \ op1: m cm
336 // +-- +---+----+
337 // matrix | 1 | 3 |
338 // +---+----+
339 // complex_matrix | 2 | 4 |
340 // +---+----+
341 
342 // -*- 1 -*-
343 Matrix
344 xleftdiv (const Matrix& a, const Matrix& b, MatrixType& typ,
345  blas_trans_type transt)
346 {
347  if (! mx_leftdiv_conform (a, b, transt))
348  return Matrix ();
349 
350  octave_idx_type info;
351  double rcond = 0.0;
352  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
353 }
354 
355 // -*- 2 -*-
357 xleftdiv (const Matrix& a, const ComplexMatrix& b, MatrixType& typ,
358  blas_trans_type transt)
359 {
360  if (! mx_leftdiv_conform (a, b, transt))
361  return ComplexMatrix ();
362 
363  octave_idx_type info;
364  double rcond = 0.0;
365 
366  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
367 }
368 
369 // -*- 3 -*-
371 xleftdiv (const ComplexMatrix& a, const Matrix& b, MatrixType& typ,
372  blas_trans_type transt)
373 {
374  if (! mx_leftdiv_conform (a, b, transt))
375  return ComplexMatrix ();
376 
377  octave_idx_type info;
378  double rcond = 0.0;
379  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
380 }
381 
382 // -*- 4 -*-
385  blas_trans_type transt)
386 {
387  if (! mx_leftdiv_conform (a, b, transt))
388  return ComplexMatrix ();
389 
390  octave_idx_type info;
391  double rcond = 0.0;
392  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
393 }
394 
395 static void
397 {
399 }
400 
405 
410 
411 // Right division functions.
412 //
413 // op2 / op1: m cm
414 // +-- +---+----+
415 // matrix | 1 | 3 |
416 // +---+----+
417 // complex_matrix | 2 | 4 |
418 // +---+----+
419 
420 // -*- 1 -*-
422 xdiv (const FloatMatrix& a, const FloatMatrix& b, MatrixType& typ)
423 {
424  if (! mx_div_conform (a, b))
425  return FloatMatrix ();
426 
427  octave_idx_type info;
428  float rcond = 0.0;
429 
431  = b.solve (typ, a.transpose (), info, rcond,
433 
434  return result.transpose ();
435 }
436 
437 // -*- 2 -*-
440 {
441  if (! mx_div_conform (a, b))
442  return FloatComplexMatrix ();
443 
444  octave_idx_type info;
445  float rcond = 0.0;
446 
448  = b.solve (typ, a.transpose (), info, rcond,
450 
451  return result.transpose ();
452 }
453 
454 // -*- 3 -*-
457 {
458  if (! mx_div_conform (a, b))
459  return FloatComplexMatrix ();
460 
461  octave_idx_type info;
462  float rcond = 0.0;
463 
465  = b.solve (typ, a.transpose (), info, rcond,
467 
468  return result.transpose ();
469 }
470 
471 // -*- 4 -*-
474 {
475  if (! mx_div_conform (a, b))
476  return FloatComplexMatrix ();
477 
478  octave_idx_type info;
479  float rcond = 0.0;
480 
482  = b.solve (typ, a.transpose (), info, rcond,
484 
485  return result.transpose ();
486 }
487 
488 // Funny element by element division operations.
489 //
490 // op2 \ op1: s cs
491 // +-- +---+----+
492 // matrix | 1 | 3 |
493 // +---+----+
494 // complex_matrix | 2 | 4 |
495 // +---+----+
496 
498 x_el_div (float a, const FloatMatrix& b)
499 {
500  octave_idx_type nr = b.rows ();
501  octave_idx_type nc = b.columns ();
502 
503  FloatMatrix result (nr, nc);
504 
505  for (octave_idx_type j = 0; j < nc; j++)
506  for (octave_idx_type i = 0; i < nr; i++)
507  {
508  octave_quit ();
509  result (i, j) = a / b (i, j);
510  }
511 
512  return result;
513 }
514 
517 {
518  octave_idx_type nr = b.rows ();
519  octave_idx_type nc = b.columns ();
520 
521  FloatComplexMatrix result (nr, nc);
522 
523  for (octave_idx_type j = 0; j < nc; j++)
524  for (octave_idx_type i = 0; i < nr; i++)
525  {
526  octave_quit ();
527  result (i, j) = a / b (i, j);
528  }
529 
530  return result;
531 }
532 
535 {
536  octave_idx_type nr = b.rows ();
537  octave_idx_type nc = b.columns ();
538 
539  FloatComplexMatrix result (nr, nc);
540 
541  for (octave_idx_type j = 0; j < nc; j++)
542  for (octave_idx_type i = 0; i < nr; i++)
543  {
544  octave_quit ();
545  result (i, j) = a / b (i, j);
546  }
547 
548  return result;
549 }
550 
553 {
554  octave_idx_type nr = b.rows ();
555  octave_idx_type nc = b.columns ();
556 
557  FloatComplexMatrix result (nr, nc);
558 
559  for (octave_idx_type j = 0; j < nc; j++)
560  for (octave_idx_type i = 0; i < nr; i++)
561  {
562  octave_quit ();
563  result (i, j) = a / b (i, j);
564  }
565 
566  return result;
567 }
568 
569 // Funny element by element division operations.
570 //
571 // op2 \ op1: s cs
572 // +-- +---+----+
573 // N-D array | 1 | 3 |
574 // +---+----+
575 // complex N-D array | 2 | 4 |
576 // +---+----+
577 
579 x_el_div (float a, const FloatNDArray& b)
580 {
581  FloatNDArray result (b.dims ());
582 
583  for (octave_idx_type i = 0; i < b.numel (); i++)
584  {
585  octave_quit ();
586  result (i) = a / b (i);
587  }
588 
589  return result;
590 }
591 
594 {
595  FloatComplexNDArray result (b.dims ());
596 
597  for (octave_idx_type i = 0; i < b.numel (); i++)
598  {
599  octave_quit ();
600  result (i) = a / b (i);
601  }
602 
603  return result;
604 }
605 
608 {
609  FloatComplexNDArray result (b.dims ());
610 
611  for (octave_idx_type i = 0; i < b.numel (); i++)
612  {
613  octave_quit ();
614  result (i) = a / b (i);
615  }
616 
617  return result;
618 }
619 
622 {
623  FloatComplexNDArray result (b.dims ());
624 
625  for (octave_idx_type i = 0; i < b.numel (); i++)
626  {
627  octave_quit ();
628  result (i) = a / b (i);
629  }
630 
631  return result;
632 }
633 
634 // Left division functions.
635 //
636 // op2 \ op1: m cm
637 // +-- +---+----+
638 // matrix | 1 | 3 |
639 // +---+----+
640 // complex_matrix | 2 | 4 |
641 // +---+----+
642 
643 // -*- 1 -*-
646  blas_trans_type transt)
647 {
648  if (! mx_leftdiv_conform (a, b, transt))
649  return FloatMatrix ();
650 
651  octave_idx_type info;
652  float rcond = 0.0;
653  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
654 }
655 
656 // -*- 2 -*-
659  blas_trans_type transt)
660 {
661  if (! mx_leftdiv_conform (a, b, transt))
662  return FloatComplexMatrix ();
663 
664  octave_idx_type info;
665  float rcond = 0.0;
666 
667  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
668 }
669 
670 // -*- 3 -*-
673  blas_trans_type transt)
674 {
675  if (! mx_leftdiv_conform (a, b, transt))
676  return FloatComplexMatrix ();
677 
678  octave_idx_type info;
679  float rcond = 0.0;
680  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
681 }
682 
683 // -*- 4 -*-
686  MatrixType& typ, blas_trans_type transt)
687 {
688  if (! mx_leftdiv_conform (a, b, transt))
689  return FloatComplexMatrix ();
690 
691  octave_idx_type info;
692  float rcond = 0.0;
693  return a.solve (typ, b, info, rcond, solve_singularity_warning, true, transt);
694 }
695 
696 // Diagonal matrix division.
697 
698 template <typename MT, typename DMT>
699 MT
700 mdm_div_impl (const MT& a, const DMT& d)
701 {
702  if (! mx_div_conform (a, d))
703  return MT ();
704 
705  octave_idx_type m = a.rows ();
706  octave_idx_type n = d.rows ();
707  octave_idx_type l = d.length ();
708  MT x (m, n);
709  typedef typename DMT::element_type S;
710  typedef typename MT::element_type T;
711  const T *aa = a.data ();
712  const S *dd = d.data ();
713  T *xx = x.fortran_vec ();
714 
715  for (octave_idx_type j = 0; j < l; j++)
716  {
717  const S del = dd[j];
718  if (del != S ())
719  for (octave_idx_type i = 0; i < m; i++)
720  xx[i] = aa[i] / del;
721  else
722  for (octave_idx_type i = 0; i < m; i++)
723  xx[i] = T ();
724  aa += m; xx += m;
725  }
726 
727  for (octave_idx_type i = l*m; i < n*m; i++)
728  xx[i] = T ();
729 
730  return x;
731 }
732 
733 // Right division functions.
734 //
735 // op2 / op1: dm cdm
736 // +-- +---+----+
737 // matrix | 1 | |
738 // +---+----+
739 // complex_matrix | 2 | 3 |
740 // +---+----+
741 
742 // -*- 1 -*-
743 Matrix
744 xdiv (const Matrix& a, const DiagMatrix& b)
745 { return mdm_div_impl (a, b); }
746 
747 // -*- 2 -*-
749 xdiv (const ComplexMatrix& a, const DiagMatrix& b)
750 { return mdm_div_impl (a, b); }
751 
752 // -*- 3 -*-
755 { return mdm_div_impl (a, b); }
756 
757 // Right division functions, float type.
758 //
759 // op2 / op1: dm cdm
760 // +-- +---+----+
761 // matrix | 1 | |
762 // +---+----+
763 // complex_matrix | 2 | 3 |
764 // +---+----+
765 
766 // -*- 1 -*-
769 { return mdm_div_impl (a, b); }
770 
771 // -*- 2 -*-
774 { return mdm_div_impl (a, b); }
775 
776 // -*- 3 -*-
779 { return mdm_div_impl (a, b); }
780 
781 template <typename MT, typename DMT>
782 MT
783 dmm_leftdiv_impl (const DMT& d, const MT& a)
784 {
786  return MT ();
787 
788  octave_idx_type m = d.cols ();
789  octave_idx_type n = a.cols ();
790  octave_idx_type k = a.rows ();
791  octave_idx_type l = d.length ();
792  MT x (m, n);
793  typedef typename DMT::element_type S;
794  typedef typename MT::element_type T;
795  const T *aa = a.data ();
796  const S *dd = d.data ();
797  T *xx = x.fortran_vec ();
798 
799  for (octave_idx_type j = 0; j < n; j++)
800  {
801  for (octave_idx_type i = 0; i < l; i++)
802  xx[i] = (dd[i] != S () ? aa[i] / dd[i] : T ());
803  for (octave_idx_type i = l; i < m; i++)
804  xx[i] = T ();
805  aa += k; xx += m;
806  }
807 
808  return x;
809 }
810 
811 // Left division functions.
812 //
813 // op2 \ op1: m cm
814 // +---+----+
815 // diag_matrix | 1 | 2 |
816 // +---+----+
817 // complex_diag_matrix | | 3 |
818 // +---+----+
819 
820 // -*- 1 -*-
821 Matrix
822 xleftdiv (const DiagMatrix& a, const Matrix& b)
823 { return dmm_leftdiv_impl (a, b); }
824 
825 // -*- 2 -*-
828 { return dmm_leftdiv_impl (a, b); }
829 
830 // -*- 3 -*-
833 { return dmm_leftdiv_impl (a, b); }
834 
835 // Left division functions, float type.
836 //
837 // op2 \ op1: m cm
838 // +---+----+
839 // diag_matrix | 1 | 2 |
840 // +---+----+
841 // complex_diag_matrix | | 3 |
842 // +---+----+
843 
844 // -*- 1 -*-
847 { return dmm_leftdiv_impl (a, b); }
848 
849 // -*- 2 -*-
852 { return dmm_leftdiv_impl (a, b); }
853 
854 // -*- 3 -*-
857 { return dmm_leftdiv_impl (a, b); }
858 
859 // Diagonal by diagonal matrix division.
860 
861 template <typename MT, typename DMT>
862 MT
863 dmdm_div_impl (const MT& a, const DMT& d)
864 {
865  if (! mx_div_conform (a, d))
866  return MT ();
867 
868  octave_idx_type m = a.rows ();
869  octave_idx_type n = d.rows ();
870  octave_idx_type k = d.cols ();
871  octave_idx_type l = std::min (m, n);
872  octave_idx_type lk = std::min (l, k);
873  MT x (m, n);
874  typedef typename DMT::element_type S;
875  typedef typename MT::element_type T;
876  const T *aa = a.data ();
877  const S *dd = d.data ();
878  T *xx = x.fortran_vec ();
879 
880  for (octave_idx_type i = 0; i < lk; i++)
881  xx[i] = (dd[i] != S () ? aa[i] / dd[i] : T ());
882  for (octave_idx_type i = lk; i < l; i++)
883  xx[i] = T ();
884 
885  return x;
886 }
887 
888 // Right division functions.
889 //
890 // op2 / op1: dm cdm
891 // +-- +---+----+
892 // diag_matrix | 1 | |
893 // +---+----+
894 // complex_diag_matrix | 2 | 3 |
895 // +---+----+
896 
897 // -*- 1 -*-
899 xdiv (const DiagMatrix& a, const DiagMatrix& b)
900 { return dmdm_div_impl (a, b); }
901 
902 // -*- 2 -*-
905 { return dmdm_div_impl (a, b); }
906 
907 // -*- 3 -*-
910 { return dmdm_div_impl (a, b); }
911 
912 // Right division functions, float type.
913 //
914 // op2 / op1: dm cdm
915 // +-- +---+----+
916 // diag_matrix | 1 | |
917 // +---+----+
918 // complex_diag_matrix | 2 | 3 |
919 // +---+----+
920 
921 // -*- 1 -*-
924 { return dmdm_div_impl (a, b); }
925 
926 // -*- 2 -*-
929 { return dmdm_div_impl (a, b); }
930 
931 // -*- 3 -*-
934 { return dmdm_div_impl (a, b); }
935 
936 template <typename MT, typename DMT>
937 MT
938 dmdm_leftdiv_impl (const DMT& d, const MT& a)
939 {
941  return MT ();
942 
943  octave_idx_type m = d.cols ();
944  octave_idx_type n = a.cols ();
945  octave_idx_type k = d.rows ();
946  octave_idx_type l = std::min (m, n);
947  octave_idx_type lk = std::min (l, k);
948  MT x (m, n);
949  typedef typename DMT::element_type S;
950  typedef typename MT::element_type T;
951  const T *aa = a.data ();
952  const S *dd = d.data ();
953  T *xx = x.fortran_vec ();
954 
955  for (octave_idx_type i = 0; i < lk; i++)
956  xx[i] = (dd[i] != S () ? aa[i] / dd[i] : T ());
957  for (octave_idx_type i = lk; i < l; i++)
958  xx[i] = T ();
959 
960  return x;
961 }
962 
963 // Left division functions.
964 //
965 // op2 \ op1: dm cdm
966 // +---+----+
967 // diag_matrix | 1 | 2 |
968 // +---+----+
969 // complex_diag_matrix | | 3 |
970 // +---+----+
971 
972 // -*- 1 -*-
974 xleftdiv (const DiagMatrix& a, const DiagMatrix& b)
975 { return dmdm_leftdiv_impl (a, b); }
976 
977 // -*- 2 -*-
980 { return dmdm_leftdiv_impl (a, b); }
981 
982 // -*- 3 -*-
985 { return dmdm_leftdiv_impl (a, b); }
986 
987 // Left division functions, float type.
988 //
989 // op2 \ op1: dm cdm
990 // +---+----+
991 // diag_matrix | 1 | 2 |
992 // +---+----+
993 // complex_diag_matrix | | 3 |
994 // +---+----+
995 
996 // -*- 1 -*-
999 { return dmdm_leftdiv_impl (a, b); }
1000 
1001 // -*- 2 -*-
1004 { return dmdm_leftdiv_impl (a, b); }
1005 
1006 // -*- 3 -*-
1009 { return dmdm_leftdiv_impl (a, b); }
MT dmm_leftdiv_impl(const DMT &d, const MT &a)
Definition: xdiv.cc:783
Matrix xleftdiv(const Matrix &a, const Matrix &b, MatrixType &typ, blas_trans_type transt)
Definition: xdiv.cc:344
for large enough k
Definition: lu.cc:617
MT mdm_div_impl(const MT &a, const DMT &d)
Definition: xdiv.cc:700
octave_idx_type b_nr
Definition: sylvester.cc:76
octave_idx_type a_nc
Definition: sylvester.cc:74
Matrix xdiv(const Matrix &a, const Matrix &b, MatrixType &typ)
Definition: xdiv.cc:121
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 const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &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:400
MT dmdm_div_impl(const MT &a, const DMT &d)
Definition: xdiv.cc:863
static void solve_singularity_warning(double rcond)
Definition: xdiv.cc:52
octave_idx_type a_nr
Definition: sylvester.cc:73
void err_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
#define INSTANTIATE_MX_LEFTDIV_CONFORM(T1, T2)
Definition: xdiv.cc:76
bool mx_div_conform(const T1 &a, const T2 &b)
Definition: xdiv.cc:86
Definition: dMatrix.h:36
bool mx_leftdiv_conform(const T1 &a, const T2 &b, blas_trans_type blas_trans)
Definition: xdiv.cc:59
#define INSTANTIATE_MX_DIV_CONFORM(T1, T2)
Definition: xdiv.cc:102
With real return the complex result
Definition: data.cc:3260
MT dmdm_leftdiv_impl(const DMT &d, const MT &a)
Definition: xdiv.cc:938
octave_idx_type b_nc
Definition: sylvester.cc:77
b
Definition: cellfun.cc:400
Matrix x_el_div(double a, const Matrix &b)
Definition: xdiv.cc:197
for i
Definition: data.cc:5264
std::complex< float > FloatComplex
Definition: oct-cmplx.h:32
blas_trans_type
Definition: mx-defs.h:105
std::complex< double > Complex
Definition: oct-cmplx.h:31
void warn_singular_matrix(double rcond)
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 const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE * x
charNDArray min(char d, const charNDArray &m)
Definition: chNDArray.cc:204