Mercurial > octave
annotate libinterp/corefcn/sparse-xdiv.cc @ 31605:e88a07dec498 stable
maint: Use macros to begin/end C++ namespaces.
* oct-conf-post-public.in.h: Define two macros (OCTAVE_BEGIN_NAMESPACE,
OCTAVE_END_NAMESPACE) that can be used to start/end a namespace.
* mk-opts.pl, build-env.h, build-env.in.cc, __betainc__.cc, __contourc__.cc,
__dsearchn__.cc, __eigs__.cc, __expint__.cc, __ftp__.cc, __gammainc__.cc,
__ichol__.cc, __ilu__.cc, __isprimelarge__.cc, __lin_interpn__.cc,
__magick_read__.cc, __pchip_deriv__.cc, __qp__.cc, amd.cc, auto-shlib.cc,
auto-shlib.h, balance.cc, base-text-renderer.cc, base-text-renderer.h,
besselj.cc, bitfcns.cc, bsxfun.cc, c-file-ptr-stream.cc, c-file-ptr-stream.h,
call-stack.cc, call-stack.h, ccolamd.cc, cellfun.cc, chol.cc, colamd.cc,
colloc.cc, conv2.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc, data.h, debug.cc,
defaults.cc, defaults.h, defun-int.h, defun.cc, det.cc, dirfns.cc, display.cc,
display.h, dlmread.cc, dmperm.cc, dot.cc, dynamic-ld.cc, dynamic-ld.h, eig.cc,
ellipj.cc, environment.cc, environment.h, error.cc, error.h, errwarn.h,
event-manager.cc, event-manager.h, event-queue.cc, event-queue.h, fcn-info.cc,
fcn-info.h, fft.cc, fft2.cc, fftn.cc, file-io.cc, filter.cc, find.cc,
ft-text-renderer.cc, ft-text-renderer.h, gcd.cc, getgrent.cc, getpwent.cc,
getrusage.cc, givens.cc, gl-render.cc, gl-render.h, gl2ps-print.cc,
gl2ps-print.h, graphics-toolkit.cc, graphics-toolkit.h, graphics.cc,
graphics.in.h, gsvd.cc, gtk-manager.cc, gtk-manager.h, hash.cc, help.cc,
help.h, hess.cc, hex2num.cc, hook-fcn.cc, hook-fcn.h, input.cc, input.h,
interpreter-private.cc, interpreter-private.h, interpreter.cc, interpreter.h,
inv.cc, jsondecode.cc, jsonencode.cc, kron.cc, latex-text-renderer.cc,
latex-text-renderer.h, load-path.cc, load-path.h, load-save.cc, load-save.h,
lookup.cc, ls-ascii-helper.cc, ls-ascii-helper.h, ls-oct-text.cc, ls-utils.cc,
ls-utils.h, lsode.cc, lu.cc, mappers.cc, matrix_type.cc, max.cc, mex-private.h,
mex.cc, mgorth.cc, nproc.cc, oct-fstrm.cc, oct-fstrm.h, oct-hdf5-types.cc,
oct-hdf5-types.h, oct-hist.cc, oct-hist.h, oct-iostrm.cc, oct-iostrm.h,
oct-opengl.h, oct-prcstrm.cc, oct-prcstrm.h, oct-procbuf.cc, oct-procbuf.h,
oct-process.cc, oct-process.h, oct-stdstrm.h, oct-stream.cc, oct-stream.h,
oct-strstrm.cc, oct-strstrm.h, oct-tex-lexer.in.ll, oct-tex-parser.yy,
ordqz.cc, ordschur.cc, pager.cc, pager.h, pinv.cc, pow2.cc, pr-flt-fmt.cc,
pr-output.cc, procstream.cc, procstream.h, psi.cc, qr.cc, quad.cc, quadcc.cc,
qz.cc, rand.cc, rcond.cc, regexp.cc, schur.cc, settings.cc, settings.h,
sighandlers.cc, sighandlers.h, sparse-xdiv.cc, sparse-xdiv.h, sparse-xpow.cc,
sparse-xpow.h, sparse.cc, spparms.cc, sqrtm.cc, stack-frame.cc, stack-frame.h,
stream-euler.cc, strfind.cc, strfns.cc, sub2ind.cc, svd.cc, sylvester.cc,
symbfact.cc, syminfo.cc, syminfo.h, symrcm.cc, symrec.cc, symrec.h,
symscope.cc, symscope.h, symtab.cc, symtab.h, syscalls.cc, sysdep.cc, sysdep.h,
text-engine.cc, text-engine.h, text-renderer.cc, text-renderer.h, time.cc,
toplev.cc, tril.cc, tsearch.cc, typecast.cc, url-handle-manager.cc,
url-handle-manager.h, urlwrite.cc, utils.cc, utils.h, variables.cc,
variables.h, xdiv.cc, xdiv.h, xnorm.cc, xnorm.h, xpow.cc, xpow.h,
__delaunayn__.cc, __fltk_uigetfile__.cc, __glpk__.cc, __init_fltk__.cc,
__init_gnuplot__.cc, __ode15__.cc, __voronoi__.cc, audiodevinfo.cc,
audioread.cc, convhulln.cc, fftw.cc, gzip.cc, mk-build-env-features.sh,
mk-builtins.pl, cdef-class.cc, cdef-class.h, cdef-fwd.h, cdef-manager.cc,
cdef-manager.h, cdef-method.cc, cdef-method.h, cdef-object.cc, cdef-object.h,
cdef-package.cc, cdef-package.h, cdef-property.cc, cdef-property.h,
cdef-utils.cc, cdef-utils.h, ov-base.cc, ov-base.h, ov-bool-mat.cc,
ov-builtin.h, ov-cell.cc, ov-class.cc, ov-class.h, ov-classdef.cc,
ov-classdef.h, ov-complex.cc, ov-fcn-handle.cc, ov-fcn-handle.h, ov-fcn.h,
ov-java.cc, ov-java.h, ov-mex-fcn.h, ov-null-mat.cc, ov-oncleanup.cc,
ov-struct.cc, ov-typeinfo.cc, ov-typeinfo.h, ov-usr-fcn.cc, ov-usr-fcn.h,
ov.cc, ov.h, octave.cc, octave.h, mk-ops.sh, op-b-b.cc, op-b-bm.cc,
op-b-sbm.cc, op-bm-b.cc, op-bm-bm.cc, op-bm-sbm.cc, op-cdm-cdm.cc, op-cell.cc,
op-chm.cc, op-class.cc, op-cm-cm.cc, op-cm-cs.cc, op-cm-m.cc, op-cm-s.cc,
op-cm-scm.cc, op-cm-sm.cc, op-cs-cm.cc, op-cs-cs.cc, op-cs-m.cc, op-cs-s.cc,
op-cs-scm.cc, op-cs-sm.cc, op-dm-dm.cc, op-dm-scm.cc, op-dm-sm.cc,
op-dm-template.cc, op-dms-template.cc, op-fcdm-fcdm.cc, op-fcm-fcm.cc,
op-fcm-fcs.cc, op-fcm-fm.cc, op-fcm-fs.cc, op-fcn.cc, op-fcs-fcm.cc,
op-fcs-fcs.cc, op-fcs-fm.cc, op-fcs-fs.cc, op-fdm-fdm.cc, op-fm-fcm.cc,
op-fm-fcs.cc, op-fm-fm.cc, op-fm-fs.cc, op-fs-fcm.cc, op-fs-fcs.cc,
op-fs-fm.cc, op-fs-fs.cc, op-i16-i16.cc, op-i32-i32.cc, op-i64-i64.cc,
op-i8-i8.cc, op-int-concat.cc, op-m-cm.cc, op-m-cs.cc, op-m-m.cc, op-m-s.cc,
op-m-scm.cc, op-m-sm.cc, op-mi.cc, op-pm-pm.cc, op-pm-scm.cc, op-pm-sm.cc,
op-pm-template.cc, op-range.cc, op-s-cm.cc, op-s-cs.cc, op-s-m.cc, op-s-s.cc,
op-s-scm.cc, op-s-sm.cc, op-sbm-b.cc, op-sbm-bm.cc, op-sbm-sbm.cc,
op-scm-cm.cc, op-scm-cs.cc, op-scm-m.cc, op-scm-s.cc, op-scm-scm.cc,
op-scm-sm.cc, op-sm-cm.cc, op-sm-cs.cc, op-sm-m.cc, op-sm-s.cc, op-sm-scm.cc,
op-sm-sm.cc, op-str-m.cc, op-str-s.cc, op-str-str.cc, op-struct.cc,
op-ui16-ui16.cc, op-ui32-ui32.cc, op-ui64-ui64.cc, op-ui8-ui8.cc, ops.h,
anon-fcn-validator.cc, anon-fcn-validator.h, bp-table.cc, bp-table.h,
comment-list.cc, comment-list.h, filepos.h, lex.h, lex.ll, oct-lvalue.cc,
oct-lvalue.h, oct-parse.yy, parse.h, profiler.cc, profiler.h,
pt-anon-scopes.cc, pt-anon-scopes.h, pt-arg-list.cc, pt-arg-list.h,
pt-args-block.cc, pt-args-block.h, pt-array-list.cc, pt-array-list.h,
pt-assign.cc, pt-assign.h, pt-binop.cc, pt-binop.h, pt-bp.cc, pt-bp.h,
pt-cbinop.cc, pt-cbinop.h, pt-cell.cc, pt-cell.h, pt-check.cc, pt-check.h,
pt-classdef.cc, pt-classdef.h, pt-cmd.h, pt-colon.cc, pt-colon.h, pt-const.cc,
pt-const.h, pt-decl.cc, pt-decl.h, pt-eval.cc, pt-eval.h, pt-except.cc,
pt-except.h, pt-exp.cc, pt-exp.h, pt-fcn-handle.cc, pt-fcn-handle.h, pt-id.cc,
pt-id.h, pt-idx.cc, pt-idx.h, pt-jump.h, pt-loop.cc, pt-loop.h, pt-mat.cc,
pt-mat.h, pt-misc.cc, pt-misc.h, pt-pr-code.cc, pt-pr-code.h, pt-select.cc,
pt-select.h, pt-spmd.cc, pt-spmd.h, pt-stmt.cc, pt-stmt.h, pt-tm-const.cc,
pt-tm-const.h, pt-unop.cc, pt-unop.h, pt-vm-eval.cc, pt-walk.cc, pt-walk.h,
pt.cc, pt.h, token.cc, token.h, Range.cc, Range.h, idx-vector.cc, idx-vector.h,
range-fwd.h, CollocWt.cc, CollocWt.h, aepbalance.cc, aepbalance.h, chol.cc,
chol.h, gepbalance.cc, gepbalance.h, gsvd.cc, gsvd.h, hess.cc, hess.h,
lo-mappers.cc, lo-mappers.h, lo-specfun.cc, lo-specfun.h, lu.cc, lu.h,
oct-convn.cc, oct-convn.h, oct-fftw.cc, oct-fftw.h, oct-norm.cc, oct-norm.h,
oct-rand.cc, oct-rand.h, oct-spparms.cc, oct-spparms.h, qr.cc, qr.h, qrp.cc,
qrp.h, randgamma.cc, randgamma.h, randmtzig.cc, randmtzig.h, randpoisson.cc,
randpoisson.h, schur.cc, schur.h, sparse-chol.cc, sparse-chol.h, sparse-lu.cc,
sparse-lu.h, sparse-qr.cc, sparse-qr.h, svd.cc, svd.h, child-list.cc,
child-list.h, dir-ops.cc, dir-ops.h, file-ops.cc, file-ops.h, file-stat.cc,
file-stat.h, lo-sysdep.cc, lo-sysdep.h, lo-sysinfo.cc, lo-sysinfo.h,
mach-info.cc, mach-info.h, oct-env.cc, oct-env.h, oct-group.cc, oct-group.h,
oct-password.cc, oct-password.h, oct-syscalls.cc, oct-syscalls.h, oct-time.cc,
oct-time.h, oct-uname.cc, oct-uname.h, action-container.cc, action-container.h,
base-list.h, cmd-edit.cc, cmd-edit.h, cmd-hist.cc, cmd-hist.h, f77-fcn.h,
file-info.cc, file-info.h, lo-array-errwarn.cc, lo-array-errwarn.h, lo-hash.cc,
lo-hash.h, lo-ieee.h, lo-regexp.cc, lo-regexp.h, lo-utils.cc, lo-utils.h,
oct-base64.cc, oct-base64.h, oct-glob.cc, oct-glob.h, oct-inttypes.h,
oct-mutex.cc, oct-mutex.h, oct-refcount.h, oct-shlib.cc, oct-shlib.h,
oct-sparse.cc, oct-sparse.h, oct-string.h, octave-preserve-stream-state.h,
pathsearch.cc, pathsearch.h, quit.cc, quit.h, unwind-prot.cc, unwind-prot.h,
url-transfer.cc, url-transfer.h : Use new macros to begin/end C++ namespaces.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 01 Dec 2022 14:23:45 -0800 |
parents | 796f54d4ddbf |
children | 597f3ee61a48 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
30390
diff
changeset
|
3 // Copyright (C) 1998-2022 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
5164 | 25 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21723
diff
changeset
|
26 #if defined (HAVE_CONFIG_H) |
21301
40de9f8f23a6
Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents:
21200
diff
changeset
|
27 # include "config.h" |
5164 | 28 #endif |
29 | |
30 #include <cassert> | |
31 | |
32 #include "Array-util.h" | |
21100
e39e05d90788
Switch gripe_XXX to either err_XXX or warn_XXX naming scheme.
Rik <rik@octave.org>
parents:
21024
diff
changeset
|
33 #include "lo-array-errwarn.h" |
5164 | 34 #include "oct-cmplx.h" |
35 #include "quit.h" | |
36 #include "error.h" | |
9003
0631d397fbe0
replace lo_ieee_isnan by xisnan, add missing includes
Jaroslav Hajek <highegg@gmail.com>
parents:
8965
diff
changeset
|
37 #include "lo-ieee.h" |
5164 | 38 |
39 #include "dSparse.h" | |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
40 #include "dDiagMatrix.h" |
5164 | 41 #include "CSparse.h" |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
42 #include "CDiagMatrix.h" |
5164 | 43 #include "oct-spparms.h" |
44 #include "sparse-xdiv.h" | |
45 | |
31605
e88a07dec498
maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
46 OCTAVE_BEGIN_NAMESPACE(octave) |
29990
b839c36fd106
move sparse xdiv and xpow operator functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
47 |
5164 | 48 static void |
49 solve_singularity_warning (double rcond) | |
50 { | |
22327
d0562b3159c7
move more classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
51 octave::warn_singular_matrix (rcond); |
5164 | 52 } |
53 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21112
diff
changeset
|
54 template <typename T1, typename T2> |
5164 | 55 bool |
56 mx_leftdiv_conform (const T1& a, const T2& b) | |
57 { | |
5275 | 58 octave_idx_type a_nr = a.rows (); |
59 octave_idx_type b_nr = b.rows (); | |
5164 | 60 |
61 if (a_nr != b_nr) | |
62 { | |
5275 | 63 octave_idx_type a_nc = a.cols (); |
64 octave_idx_type b_nc = b.cols (); | |
5164 | 65 |
23804
8057d3f0673d
Use C++11 raw string literals to avoid escaping backslashes in strings.
Rik <rik@octave.org>
parents:
23433
diff
changeset
|
66 octave::err_nonconformant (R"(operator \)", a_nr, a_nc, b_nr, b_nc); |
5164 | 67 } |
68 | |
69 return true; | |
70 } | |
71 | |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
72 #define INSTANTIATE_MX_LEFTDIV_CONFORM(T1, T2) \ |
5164 | 73 template bool mx_leftdiv_conform (const T1&, const T2&) |
74 | |
75 INSTANTIATE_MX_LEFTDIV_CONFORM (SparseMatrix, SparseMatrix); | |
76 INSTANTIATE_MX_LEFTDIV_CONFORM (SparseMatrix, SparseComplexMatrix); | |
77 INSTANTIATE_MX_LEFTDIV_CONFORM (SparseComplexMatrix, SparseMatrix); | |
78 INSTANTIATE_MX_LEFTDIV_CONFORM (SparseComplexMatrix, SparseComplexMatrix); | |
79 INSTANTIATE_MX_LEFTDIV_CONFORM (SparseMatrix, Matrix); | |
80 INSTANTIATE_MX_LEFTDIV_CONFORM (SparseMatrix, ComplexMatrix); | |
81 INSTANTIATE_MX_LEFTDIV_CONFORM (SparseComplexMatrix, Matrix); | |
82 INSTANTIATE_MX_LEFTDIV_CONFORM (SparseComplexMatrix, ComplexMatrix); | |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
83 INSTANTIATE_MX_LEFTDIV_CONFORM (DiagMatrix, SparseMatrix); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
84 INSTANTIATE_MX_LEFTDIV_CONFORM (DiagMatrix, SparseComplexMatrix); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
85 INSTANTIATE_MX_LEFTDIV_CONFORM (ComplexDiagMatrix, SparseMatrix); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
86 INSTANTIATE_MX_LEFTDIV_CONFORM (ComplexDiagMatrix, SparseComplexMatrix); |
5164 | 87 |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21112
diff
changeset
|
88 template <typename T1, typename T2> |
5164 | 89 bool |
90 mx_div_conform (const T1& a, const T2& b) | |
91 { | |
5275 | 92 octave_idx_type a_nc = a.cols (); |
93 octave_idx_type b_nc = b.cols (); | |
5164 | 94 |
95 if (a_nc != b_nc) | |
96 { | |
5275 | 97 octave_idx_type a_nr = a.rows (); |
98 octave_idx_type b_nr = b.rows (); | |
5164 | 99 |
22327
d0562b3159c7
move more classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
100 octave::err_nonconformant ("operator /", a_nr, a_nc, b_nr, b_nc); |
5164 | 101 } |
102 | |
103 return true; | |
104 } | |
105 | |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
106 #define INSTANTIATE_MX_DIV_CONFORM(T1, T2) \ |
5164 | 107 template bool mx_div_conform (const T1&, const T2&) |
108 | |
109 INSTANTIATE_MX_DIV_CONFORM (SparseMatrix, SparseMatrix); | |
110 INSTANTIATE_MX_DIV_CONFORM (SparseMatrix, SparseComplexMatrix); | |
111 INSTANTIATE_MX_DIV_CONFORM (SparseComplexMatrix, SparseMatrix); | |
112 INSTANTIATE_MX_DIV_CONFORM (SparseComplexMatrix, SparseComplexMatrix); | |
113 INSTANTIATE_MX_DIV_CONFORM (Matrix, SparseMatrix); | |
114 INSTANTIATE_MX_DIV_CONFORM (Matrix, SparseComplexMatrix); | |
115 INSTANTIATE_MX_DIV_CONFORM (ComplexMatrix, SparseMatrix); | |
116 INSTANTIATE_MX_DIV_CONFORM (ComplexMatrix, SparseComplexMatrix); | |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
117 INSTANTIATE_MX_DIV_CONFORM (SparseMatrix, DiagMatrix); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
118 INSTANTIATE_MX_DIV_CONFORM (SparseMatrix, ComplexDiagMatrix); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
119 INSTANTIATE_MX_DIV_CONFORM (SparseComplexMatrix, DiagMatrix); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
120 INSTANTIATE_MX_DIV_CONFORM (SparseComplexMatrix, ComplexDiagMatrix); |
5164 | 121 |
14861
f7afecdd87ef
maint: Use Octave coding conventions for cuddling parentheses in src/ directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
122 // Right division functions. X / Y = X * inv (Y) = (inv (Y') * X')' |
5164 | 123 // |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
124 // Y / X: m cm sm scm |
5164 | 125 // +-- +---+----+----+----+ |
126 // sparse matrix | 1 | 3 | 5 | 7 | | |
127 // +---+----+----+----+ | |
128 // sparse complex_matrix | 2 | 4 | 6 | 8 | | |
129 // +---+----+----+----+ | |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
130 // diagonal matrix | 9 | 11 | |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
131 // +----+----+ |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
132 // complex diag. matrix | 10 | 12 | |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
133 // +----+----+ |
5164 | 134 |
135 // -*- 1 -*- | |
136 Matrix | |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
137 xdiv (const Matrix& a, const SparseMatrix& b, MatrixType& typ) |
5164 | 138 { |
139 if (! mx_div_conform (a, b)) | |
140 return Matrix (); | |
141 | |
142 Matrix atmp = a.transpose (); | |
143 SparseMatrix btmp = b.transpose (); | |
5785 | 144 MatrixType btyp = typ.transpose (); |
5164 | 145 |
5275 | 146 octave_idx_type info; |
5681 | 147 double rcond = 0.0; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
148 Matrix result = btmp.solve (btyp, atmp, info, rcond, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
149 solve_singularity_warning); |
5164 | 150 |
5322 | 151 typ = btyp.transpose (); |
5164 | 152 return result.transpose (); |
153 } | |
154 | |
155 // -*- 2 -*- | |
156 ComplexMatrix | |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
157 xdiv (const Matrix& a, const SparseComplexMatrix& b, MatrixType& typ) |
5164 | 158 { |
159 if (! mx_div_conform (a, b)) | |
160 return ComplexMatrix (); | |
161 | |
162 Matrix atmp = a.transpose (); | |
163 SparseComplexMatrix btmp = b.hermitian (); | |
5785 | 164 MatrixType btyp = typ.transpose (); |
5164 | 165 |
5275 | 166 octave_idx_type info; |
5681 | 167 double rcond = 0.0; |
168 ComplexMatrix result | |
169 = btmp.solve (btyp, atmp, info, rcond, solve_singularity_warning); | |
5164 | 170 |
5322 | 171 typ = btyp.transpose (); |
5164 | 172 return result.hermitian (); |
173 } | |
174 | |
175 // -*- 3 -*- | |
176 ComplexMatrix | |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
177 xdiv (const ComplexMatrix& a, const SparseMatrix& b, MatrixType& typ) |
5164 | 178 { |
179 if (! mx_div_conform (a, b)) | |
180 return ComplexMatrix (); | |
181 | |
182 ComplexMatrix atmp = a.hermitian (); | |
183 SparseMatrix btmp = b.transpose (); | |
5785 | 184 MatrixType btyp = typ.transpose (); |
5164 | 185 |
5275 | 186 octave_idx_type info; |
5681 | 187 double rcond = 0.0; |
188 ComplexMatrix result | |
189 = btmp.solve (btyp, atmp, info, rcond, solve_singularity_warning); | |
5164 | 190 |
5322 | 191 typ = btyp.transpose (); |
5164 | 192 return result.hermitian (); |
193 } | |
194 | |
195 // -*- 4 -*- | |
196 ComplexMatrix | |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
197 xdiv (const ComplexMatrix& a, const SparseComplexMatrix& b, MatrixType& typ) |
5164 | 198 { |
199 if (! mx_div_conform (a, b)) | |
200 return ComplexMatrix (); | |
201 | |
202 ComplexMatrix atmp = a.hermitian (); | |
203 SparseComplexMatrix btmp = b.hermitian (); | |
5785 | 204 MatrixType btyp = typ.transpose (); |
5164 | 205 |
5275 | 206 octave_idx_type info; |
5681 | 207 double rcond = 0.0; |
208 ComplexMatrix result | |
209 = btmp.solve (btyp, atmp, info, rcond, solve_singularity_warning); | |
5164 | 210 |
5322 | 211 typ = btyp.transpose (); |
5164 | 212 return result.hermitian (); |
213 } | |
214 | |
215 // -*- 5 -*- | |
216 SparseMatrix | |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
217 xdiv (const SparseMatrix& a, const SparseMatrix& b, MatrixType& typ) |
5164 | 218 { |
219 if (! mx_div_conform (a, b)) | |
220 return SparseMatrix (); | |
221 | |
222 SparseMatrix atmp = a.transpose (); | |
223 SparseMatrix btmp = b.transpose (); | |
5785 | 224 MatrixType btyp = typ.transpose (); |
5164 | 225 |
5275 | 226 octave_idx_type info; |
5681 | 227 double rcond = 0.0; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
228 SparseMatrix result = btmp.solve (btyp, atmp, info, rcond, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
229 solve_singularity_warning); |
5164 | 230 |
5322 | 231 typ = btyp.transpose (); |
5164 | 232 return result.transpose (); |
233 } | |
234 | |
235 // -*- 6 -*- | |
236 SparseComplexMatrix | |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
237 xdiv (const SparseMatrix& a, const SparseComplexMatrix& b, MatrixType& typ) |
5164 | 238 { |
239 if (! mx_div_conform (a, b)) | |
240 return SparseComplexMatrix (); | |
241 | |
242 SparseMatrix atmp = a.transpose (); | |
243 SparseComplexMatrix btmp = b.hermitian (); | |
5785 | 244 MatrixType btyp = typ.transpose (); |
5164 | 245 |
5275 | 246 octave_idx_type info; |
5681 | 247 double rcond = 0.0; |
248 SparseComplexMatrix result | |
249 = btmp.solve (btyp, atmp, info, rcond, solve_singularity_warning); | |
5164 | 250 |
5322 | 251 typ = btyp.transpose (); |
5164 | 252 return result.hermitian (); |
253 } | |
254 | |
255 // -*- 7 -*- | |
256 SparseComplexMatrix | |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
257 xdiv (const SparseComplexMatrix& a, const SparseMatrix& b, MatrixType& typ) |
5164 | 258 { |
259 if (! mx_div_conform (a, b)) | |
260 return SparseComplexMatrix (); | |
261 | |
262 SparseComplexMatrix atmp = a.hermitian (); | |
263 SparseMatrix btmp = b.transpose (); | |
5785 | 264 MatrixType btyp = typ.transpose (); |
5164 | 265 |
5275 | 266 octave_idx_type info; |
5681 | 267 double rcond = 0.0; |
268 SparseComplexMatrix result | |
269 = btmp.solve (btyp, atmp, info, rcond, solve_singularity_warning); | |
5164 | 270 |
5322 | 271 typ = btyp.transpose (); |
5164 | 272 return result.hermitian (); |
273 } | |
274 | |
275 // -*- 8 -*- | |
276 SparseComplexMatrix | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
277 xdiv (const SparseComplexMatrix& a, const SparseComplexMatrix& b, |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
278 MatrixType& typ) |
5164 | 279 { |
280 if (! mx_div_conform (a, b)) | |
281 return SparseComplexMatrix (); | |
282 | |
283 SparseComplexMatrix atmp = a.hermitian (); | |
284 SparseComplexMatrix btmp = b.hermitian (); | |
5785 | 285 MatrixType btyp = typ.transpose (); |
5164 | 286 |
5275 | 287 octave_idx_type info; |
5681 | 288 double rcond = 0.0; |
289 SparseComplexMatrix result | |
290 = btmp.solve (btyp, atmp, info, rcond, solve_singularity_warning); | |
5164 | 291 |
5322 | 292 typ = btyp.transpose (); |
5164 | 293 return result.hermitian (); |
294 } | |
295 | |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
296 template <typename RT, typename SM, typename DM> |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
297 RT do_rightdiv_sm_dm (const SM& a, const DM& d) |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
298 { |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
299 const octave_idx_type d_nr = d.rows (); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
300 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
301 const octave_idx_type a_nr = a.rows (); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
302 const octave_idx_type a_nc = a.cols (); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
303 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
304 using std::min; |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
305 const octave_idx_type nc = min (d_nr, a_nc); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
306 |
18678
6113e0c6920b
maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
307 if (! mx_div_conform (a, d)) |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
308 return RT (); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
309 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
310 const octave_idx_type nz = a.nnz (); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
311 RT r (a_nr, nc, nz); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
312 |
9196
c229bfb14d8d
avoid apparent MSVC bug with typedef
John W. Eaton <jwe@octave.org>
parents:
9003
diff
changeset
|
313 typedef typename DM::element_type DM_elt_type; |
c229bfb14d8d
avoid apparent MSVC bug with typedef
John W. Eaton <jwe@octave.org>
parents:
9003
diff
changeset
|
314 const DM_elt_type zero = DM_elt_type (); |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
315 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
316 octave_idx_type k_result = 0; |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
317 for (octave_idx_type j = 0; j < nc; ++j) |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
318 { |
10142
829e69ec3110
make OCTAVE_QUIT a function
Jaroslav Hajek <highegg@gmail.com>
parents:
9245
diff
changeset
|
319 octave_quit (); |
9196
c229bfb14d8d
avoid apparent MSVC bug with typedef
John W. Eaton <jwe@octave.org>
parents:
9003
diff
changeset
|
320 const DM_elt_type s = d.dgelem (j); |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
321 const octave_idx_type colend = a.cidx (j+1); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
322 r.xcidx (j) = k_result; |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
323 if (s != zero) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
324 for (octave_idx_type k = a.cidx (j); k < colend; ++k) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
325 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
326 r.xdata (k_result) = a.data (k) / s; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
327 r.xridx (k_result) = a.ridx (k); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
328 ++k_result; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
329 } |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
330 } |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
331 r.xcidx (nc) = k_result; |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
332 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
333 r.maybe_compress (true); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
334 return r; |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
335 } |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
336 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
337 // -*- 9 -*- |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
338 SparseMatrix |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
29990
diff
changeset
|
339 xdiv (const SparseMatrix& a, const DiagMatrix& b, MatrixType&) |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
340 { |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
341 return do_rightdiv_sm_dm<SparseMatrix> (a, b); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
342 } |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
343 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
344 // -*- 10 -*- |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
345 SparseComplexMatrix |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
29990
diff
changeset
|
346 xdiv (const SparseMatrix& a, const ComplexDiagMatrix& b, MatrixType&) |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
347 { |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
348 return do_rightdiv_sm_dm<SparseComplexMatrix> (a, b); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
349 } |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
350 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
351 // -*- 11 -*- |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
352 SparseComplexMatrix |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
29990
diff
changeset
|
353 xdiv (const SparseComplexMatrix& a, const DiagMatrix& b, MatrixType&) |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
354 { |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
355 return do_rightdiv_sm_dm<SparseComplexMatrix> (a, b); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
356 } |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
357 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
358 // -*- 12 -*- |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
359 SparseComplexMatrix |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
29990
diff
changeset
|
360 xdiv (const SparseComplexMatrix& a, const ComplexDiagMatrix& b, MatrixType&) |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
361 { |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
362 return do_rightdiv_sm_dm<SparseComplexMatrix> (a, b); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
363 } |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
364 |
5164 | 365 // Funny element by element division operations. |
366 // | |
367 // op2 \ op1: s cs | |
368 // +-- +---+----+ | |
369 // matrix | 1 | 3 | | |
370 // +---+----+ | |
371 // complex_matrix | 2 | 4 | | |
372 // +---+----+ | |
373 | |
374 Matrix | |
29990
b839c36fd106
move sparse xdiv and xpow operator functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
375 elem_xdiv (double a, const SparseMatrix& b) |
5164 | 376 { |
5275 | 377 octave_idx_type nr = b.rows (); |
378 octave_idx_type nc = b.cols (); | |
5164 | 379 |
380 Matrix result; | |
381 if (a == 0.) | |
21723
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
382 result = Matrix (nr, nc, octave::numeric_limits<double>::NaN ()); |
5164 | 383 else if (a > 0.) |
21723
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
384 result = Matrix (nr, nc, octave::numeric_limits<double>::Inf ()); |
5164 | 385 else |
21723
bae585228161
use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents:
21721
diff
changeset
|
386 result = Matrix (nr, nc, -octave::numeric_limits<double>::Inf ()); |
5164 | 387 |
5275 | 388 for (octave_idx_type j = 0; j < nc; j++) |
14861
f7afecdd87ef
maint: Use Octave coding conventions for cuddling parentheses in src/ directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
389 for (octave_idx_type i = b.cidx (j); i < b.cidx (j+1); i++) |
5164 | 390 { |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
391 octave_quit (); |
14861
f7afecdd87ef
maint: Use Octave coding conventions for cuddling parentheses in src/ directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
392 result.elem (b.ridx (i), j) = a / b.data (i); |
5164 | 393 } |
394 | |
395 return result; | |
396 } | |
397 | |
398 ComplexMatrix | |
29990
b839c36fd106
move sparse xdiv and xpow operator functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
399 elem_xdiv (double a, const SparseComplexMatrix& b) |
5164 | 400 { |
5275 | 401 octave_idx_type nr = b.rows (); |
402 octave_idx_type nc = b.cols (); | |
5164 | 403 |
22407
34ce5be04942
maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents:
22327
diff
changeset
|
404 ComplexMatrix result (nr, nc, Complex (octave::numeric_limits<double>::NaN (), |
34ce5be04942
maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents:
22327
diff
changeset
|
405 octave::numeric_limits<double>::NaN ())); |
5164 | 406 |
5275 | 407 for (octave_idx_type j = 0; j < nc; j++) |
14861
f7afecdd87ef
maint: Use Octave coding conventions for cuddling parentheses in src/ directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
408 for (octave_idx_type i = b.cidx (j); i < b.cidx (j+1); i++) |
5164 | 409 { |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
410 octave_quit (); |
14861
f7afecdd87ef
maint: Use Octave coding conventions for cuddling parentheses in src/ directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
411 result.elem (b.ridx (i), j) = a / b.data (i); |
5164 | 412 } |
413 | |
414 return result; | |
415 } | |
416 | |
417 ComplexMatrix | |
29990
b839c36fd106
move sparse xdiv and xpow operator functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
418 elem_xdiv (const Complex& a, const SparseMatrix& b) |
5164 | 419 { |
5275 | 420 octave_idx_type nr = b.rows (); |
421 octave_idx_type nc = b.cols (); | |
5164 | 422 |
423 ComplexMatrix result (nr, nc, (a / 0.0)); | |
424 | |
5275 | 425 for (octave_idx_type j = 0; j < nc; j++) |
14861
f7afecdd87ef
maint: Use Octave coding conventions for cuddling parentheses in src/ directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
426 for (octave_idx_type i = b.cidx (j); i < b.cidx (j+1); i++) |
5164 | 427 { |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
428 octave_quit (); |
14861
f7afecdd87ef
maint: Use Octave coding conventions for cuddling parentheses in src/ directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
429 result.elem (b.ridx (i), j) = a / b.data (i); |
5164 | 430 } |
431 | |
432 return result; | |
433 } | |
434 | |
435 ComplexMatrix | |
29990
b839c36fd106
move sparse xdiv and xpow operator functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
436 elem_xdiv (const Complex& a, const SparseComplexMatrix& b) |
5164 | 437 { |
5275 | 438 octave_idx_type nr = b.rows (); |
439 octave_idx_type nc = b.cols (); | |
5164 | 440 |
441 ComplexMatrix result (nr, nc, (a / 0.0)); | |
442 | |
5275 | 443 for (octave_idx_type j = 0; j < nc; j++) |
14861
f7afecdd87ef
maint: Use Octave coding conventions for cuddling parentheses in src/ directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
444 for (octave_idx_type i = b.cidx (j); i < b.cidx (j+1); i++) |
5164 | 445 { |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
446 octave_quit (); |
14861
f7afecdd87ef
maint: Use Octave coding conventions for cuddling parentheses in src/ directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
447 result.elem (b.ridx (i), j) = a / b.data (i); |
5164 | 448 } |
449 | |
450 return result; | |
451 } | |
452 | |
14861
f7afecdd87ef
maint: Use Octave coding conventions for cuddling parentheses in src/ directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
453 // Left division functions. X \ Y = inv (X) * Y |
5164 | 454 // |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
455 // Y \ X : sm scm dm dcm |
5164 | 456 // +-- +---+----+ |
457 // matrix | 1 | 5 | | |
458 // +---+----+ | |
459 // complex_matrix | 2 | 6 | | |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
460 // +---+----+----+----+ |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
461 // sparse matrix | 3 | 7 | 9 | 11 | |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
462 // +---+----+----+----+ |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
463 // sparse complex_matrix | 4 | 8 | 10 | 12 | |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
464 // +---+----+----+----+ |
5164 | 465 |
466 // -*- 1 -*- | |
467 Matrix | |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
468 xleftdiv (const SparseMatrix& a, const Matrix& b, MatrixType& typ) |
5164 | 469 { |
470 if (! mx_leftdiv_conform (a, b)) | |
471 return Matrix (); | |
472 | |
5275 | 473 octave_idx_type info; |
5681 | 474 double rcond = 0.0; |
475 return a.solve (typ, b, info, rcond, solve_singularity_warning); | |
5164 | 476 } |
477 | |
478 // -*- 2 -*- | |
479 ComplexMatrix | |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
480 xleftdiv (const SparseMatrix& a, const ComplexMatrix& b, MatrixType& typ) |
5164 | 481 { |
482 if (! mx_leftdiv_conform (a, b)) | |
483 return ComplexMatrix (); | |
484 | |
5275 | 485 octave_idx_type info; |
5681 | 486 double rcond = 0.0; |
487 return a.solve (typ, b, info, rcond, solve_singularity_warning); | |
5164 | 488 } |
489 | |
490 // -*- 3 -*- | |
491 SparseMatrix | |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
492 xleftdiv (const SparseMatrix& a, const SparseMatrix& b, MatrixType& typ) |
5164 | 493 { |
494 if (! mx_leftdiv_conform (a, b)) | |
495 return SparseMatrix (); | |
496 | |
5275 | 497 octave_idx_type info; |
5681 | 498 double rcond = 0.0; |
499 return a.solve (typ, b, info, rcond, solve_singularity_warning); | |
5164 | 500 } |
501 | |
502 // -*- 4 -*- | |
503 SparseComplexMatrix | |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
504 xleftdiv (const SparseMatrix& a, const SparseComplexMatrix& b, MatrixType& typ) |
5164 | 505 { |
506 if (! mx_leftdiv_conform (a, b)) | |
507 return SparseComplexMatrix (); | |
508 | |
5275 | 509 octave_idx_type info; |
5681 | 510 double rcond = 0.0; |
511 return a.solve (typ, b, info, rcond, solve_singularity_warning); | |
5164 | 512 } |
513 | |
514 // -*- 5 -*- | |
515 ComplexMatrix | |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
516 xleftdiv (const SparseComplexMatrix& a, const Matrix& b, MatrixType& typ) |
5164 | 517 { |
518 if (! mx_leftdiv_conform (a, b)) | |
519 return ComplexMatrix (); | |
520 | |
5275 | 521 octave_idx_type info; |
5681 | 522 double rcond = 0.0; |
523 return a.solve (typ, b, info, rcond, solve_singularity_warning); | |
5164 | 524 } |
525 | |
526 // -*- 6 -*- | |
527 ComplexMatrix | |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
528 xleftdiv (const SparseComplexMatrix& a, const ComplexMatrix& b, MatrixType& typ) |
5164 | 529 { |
530 if (! mx_leftdiv_conform (a, b)) | |
531 return ComplexMatrix (); | |
532 | |
5275 | 533 octave_idx_type info; |
5681 | 534 double rcond = 0.0; |
535 return a.solve (typ, b, info, rcond, solve_singularity_warning); | |
5164 | 536 } |
537 | |
538 // -*- 7 -*- | |
539 SparseComplexMatrix | |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
540 xleftdiv (const SparseComplexMatrix& a, const SparseMatrix& b, MatrixType& typ) |
5164 | 541 { |
542 if (! mx_leftdiv_conform (a, b)) | |
543 return SparseComplexMatrix (); | |
544 | |
5275 | 545 octave_idx_type info; |
5681 | 546 double rcond = 0.0; |
547 return a.solve (typ, b, info, rcond, solve_singularity_warning); | |
5164 | 548 } |
549 | |
550 // -*- 8 -*- | |
551 SparseComplexMatrix | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
552 xleftdiv (const SparseComplexMatrix& a, const SparseComplexMatrix& b, |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
553 MatrixType& typ) |
5164 | 554 { |
555 if (! mx_leftdiv_conform (a, b)) | |
556 return SparseComplexMatrix (); | |
557 | |
5275 | 558 octave_idx_type info; |
5681 | 559 double rcond = 0.0; |
560 return a.solve (typ, b, info, rcond, solve_singularity_warning); | |
5164 | 561 } |
562 | |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
563 template <typename RT, typename DM, typename SM> |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
564 RT do_leftdiv_dm_sm (const DM& d, const SM& a) |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
565 { |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
566 const octave_idx_type a_nr = a.rows (); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
567 const octave_idx_type a_nc = a.cols (); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
568 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
569 const octave_idx_type d_nc = d.cols (); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
570 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
571 using std::min; |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
572 const octave_idx_type nr = min (d_nc, a_nr); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
573 |
18678
6113e0c6920b
maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
574 if (! mx_leftdiv_conform (d, a)) |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
575 return RT (); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
576 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
577 const octave_idx_type nz = a.nnz (); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
578 RT r (nr, a_nc, nz); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
579 |
9196
c229bfb14d8d
avoid apparent MSVC bug with typedef
John W. Eaton <jwe@octave.org>
parents:
9003
diff
changeset
|
580 typedef typename DM::element_type DM_elt_type; |
c229bfb14d8d
avoid apparent MSVC bug with typedef
John W. Eaton <jwe@octave.org>
parents:
9003
diff
changeset
|
581 const DM_elt_type zero = DM_elt_type (); |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
582 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
583 octave_idx_type k_result = 0; |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
584 for (octave_idx_type j = 0; j < a_nc; ++j) |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
585 { |
10142
829e69ec3110
make OCTAVE_QUIT a function
Jaroslav Hajek <highegg@gmail.com>
parents:
9245
diff
changeset
|
586 octave_quit (); |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
587 const octave_idx_type colend = a.cidx (j+1); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
588 r.xcidx (j) = k_result; |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
589 for (octave_idx_type k = a.cidx (j); k < colend; ++k) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
590 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
591 const octave_idx_type i = a.ridx (k); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
592 if (i < nr) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
593 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
594 const DM_elt_type s = d.dgelem (i); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
595 if (s != zero) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
596 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
597 r.xdata (k_result) = a.data (k) / s; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
598 r.xridx (k_result) = i; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
599 ++k_result; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
600 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
601 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
602 } |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
603 } |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
604 r.xcidx (a_nc) = k_result; |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
605 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
606 r.maybe_compress (true); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
607 return r; |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
608 } |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
609 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
610 // -*- 9 -*- |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
611 SparseMatrix |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
612 xleftdiv (const DiagMatrix& d, const SparseMatrix& a, MatrixType&) |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
613 { |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
614 return do_leftdiv_dm_sm<SparseMatrix> (d, a); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
615 } |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
616 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
617 // -*- 10 -*- |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
618 SparseComplexMatrix |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
619 xleftdiv (const DiagMatrix& d, const SparseComplexMatrix& a, MatrixType&) |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
620 { |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
621 return do_leftdiv_dm_sm<SparseComplexMatrix> (d, a); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
622 } |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
623 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
624 // -*- 11 -*- |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
625 SparseComplexMatrix |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
626 xleftdiv (const ComplexDiagMatrix& d, const SparseMatrix& a, MatrixType&) |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
627 { |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
628 return do_leftdiv_dm_sm<SparseComplexMatrix> (d, a); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
629 } |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
630 |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
631 // -*- 12 -*- |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
632 SparseComplexMatrix |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
633 xleftdiv (const ComplexDiagMatrix& d, const SparseComplexMatrix& a, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
634 MatrixType&) |
8965
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
635 { |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
636 return do_leftdiv_dm_sm<SparseComplexMatrix> (d, a); |
42aff15e059b
Implement diag \ sparse and sparse / diag.
Jason Riedy <jason@acm.org>
parents:
7017
diff
changeset
|
637 } |
29990
b839c36fd106
move sparse xdiv and xpow operator functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
638 |
31605
e88a07dec498
maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
639 OCTAVE_END_NAMESPACE(octave) |