GNU Octave  4.0.0
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
op-dm-template.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2008-2015 Jaroslav Hajek
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26 
27 // FIXME: it might be nice to only include the declarations of the
28 // operators that are actually needed instead of including all of them.
29 #include "mx-ops.h"
30 
31 #include "ops.h"
32 #include "xdiv.h"
33 #include LINCLUDE
34 #include RINCLUDE
35 #ifdef DEFINENULLASSIGNCONV
36 #include "ov-null-mat.h"
37 #endif
38 
39 // matrix by diag matrix ops.
40 
43 DEFBINOP_OP (mul, LMATRIX, RMATRIX, *)
44 
45 #ifndef LDMATRIX
46 #define LDMATRIX LMATRIX
47 #endif
48 
49 #ifndef RDMATRIX
50 #define RDMATRIX RMATRIX
51 #endif
52 
53 #define OCTAVE_LMATRIX CONCAT2(octave_, LMATRIX)
54 #define OCTAVE_LDMATRIX CONCAT2(octave_, LDMATRIX)
55 #define OCTAVE_RMATRIX CONCAT2(octave_, RMATRIX)
56 #define LMATRIX_VALUE CONCAT2(LMATRIX, _value)
57 #define RMATRIX_VALUE CONCAT2(RMATRIX, _value)
58 #define LDMATRIX_VALUE CONCAT2(LDMATRIX, _value)
59 #define RDMATRIX_VALUE CONCAT2(RDMATRIX, _value)
60 
61 #ifdef DEFINEDIV
62 DEFBINOP (div, LMATRIX, RMATRIX)
63 {
65 
66  return xdiv (v1.LDMATRIX_VALUE (), v2.RMATRIX_VALUE ());
67 }
68 #endif
69 
70 #ifdef DEFINELDIV
71 DEFBINOP (ldiv, LMATRIX, RMATRIX)
72 {
74 
75  return xleftdiv (v1.LMATRIX_VALUE (), v2.RDMATRIX_VALUE ());
76 }
77 #endif
78 
79 #define SHORT_NAME CONCAT3(LSHORT, _, RSHORT)
80 #define INST_NAME CONCAT3(install_, SHORT_NAME, _ops)
81 
82 void
83 INST_NAME (void)
84 {
88 #ifdef DEFINEDIV
90 #endif
91 #ifdef DEFINELDIV
93 #endif
94 #ifdef DEFINENULLASSIGNCONV
98 #endif
99 }
#define DEFBINOP(name, t1, t2)
Definition: ops.h:279
#define OCTAVE_LMATRIX
#define RMATRIX
Definition: op-cdm-cm.cc:27
#define LMATRIX
Definition: op-cdm-cm.cc:26
const octave_base_value const Array< octave_idx_type > &ra_idx octave_int16_scalar & v1
#define CAST_BINOP_ARGS(t1, t2)
Definition: ops.h:79
#define DEFBINOP_OP(name, t1, t2, op)
Definition: ops.h:282
octave_value op_div(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1326
#define INSTALL_BINOP(op, t1, t2, f)
Definition: ops.h:46
Matrix xleftdiv(const SparseMatrix &a, const Matrix &b, MatrixType &typ)
Definition: sparse-xdiv.cc:466
#define INST_NAME
#define OCTAVE_LDMATRIX
const octave_char_matrix & v2
Matrix xdiv(const Matrix &a, const SparseMatrix &b, MatrixType &typ)
Definition: sparse-xdiv.cc:135
octave_value op_add(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1323
octave_value op_ldiv(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1329
#define OCTAVE_RMATRIX
octave_value op_sub(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1324
#define INSTALL_ASSIGNCONV(t1, t2, tr)
Definition: ops.h:64
octave_value op_mul(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1325