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-pm-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 "ov-perm.h"
32 #include MINCLUDE
33 #include "ops.h"
34 #ifdef DEFINENULLASSIGNCONV
35 #include "ov-null-mat.h"
36 #endif
37 
38 #ifndef LDMATRIX
39 #define LDMATRIX LMATRIX
40 #endif
41 
42 #define OCTAVE_LMATRIX CONCAT2(octave_, LMATRIX)
43 #define OCTAVE_LDMATRIX CONCAT2(octave_, LDMATRIX)
44 #define OCTAVE_RMATRIX CONCAT2(octave_, RMATRIX)
45 #ifdef LEFT
46 #define LMATRIX_VALUE perm_matrix_value
47 #define RMATRIX_VALUE CONCAT2(RMATRIX, _value)
48 #else
49 #define LMATRIX_VALUE CONCAT2(LMATRIX, _value)
50 #define RMATRIX_VALUE perm_matrix_value
51 #endif
52 
54 {
56 
57  return v1.LMATRIX_VALUE () * v2.RMATRIX_VALUE ();
58 }
59 
60 #ifdef LEFT
61 DEFBINOP (ldiv, LMATRIX, RMATRIX)
62 {
64 
65  return v1.perm_matrix_value ().inverse () * v2.RMATRIX_VALUE ();
66 }
67 #else
69 {
71 
72  return v1.LMATRIX_VALUE () * v2.perm_matrix_value ().inverse ();
73 }
74 #endif
75 
76 
77 #define SHORT_NAME CONCAT3(LSHORT, _, RSHORT)
78 #define INST_NAME CONCAT3(install_, SHORT_NAME, _ops)
79 
80 void
81 INST_NAME (void)
82 {
84 #ifdef LEFT
86 #else
88 #endif
89 #ifdef DEFINENULLASSIGNCONV
93 #endif
94 }
#define DEFBINOP(name, t1, t2)
Definition: ops.h:279
#define RMATRIX
Definition: op-cdm-cm.cc:27
#define OCTAVE_LDMATRIX
#define LMATRIX
Definition: op-cdm-cm.cc:26
#define OCTAVE_RMATRIX
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
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
PermMatrix inverse(void) const
Definition: PermMatrix.cc:132
#define INST_NAME
#define OCTAVE_LMATRIX
const octave_char_matrix & v2
octave_value op_ldiv(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1329
#define INSTALL_ASSIGNCONV(t1, t2, tr)
Definition: ops.h:64
virtual PermMatrix perm_matrix_value(void) const
Definition: ov-base.cc:739
octave_value op_mul(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1325