GNU Octave  3.8.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-2013 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 #include "ov-perm.h"
28 #include MINCLUDE
29 #include "ops.h"
30 #ifdef DEFINENULLASSIGNCONV
31 #include "ov-null-mat.h"
32 #endif
33 
34 #ifndef LDMATRIX
35 #define LDMATRIX LMATRIX
36 #endif
37 
38 #define OCTAVE_LMATRIX CONCAT2(octave_, LMATRIX)
39 #define OCTAVE_LDMATRIX CONCAT2(octave_, LDMATRIX)
40 #define OCTAVE_RMATRIX CONCAT2(octave_, RMATRIX)
41 #ifdef LEFT
42 #define LMATRIX_VALUE perm_matrix_value
43 #define RMATRIX_VALUE CONCAT2(RMATRIX, _value)
44 #else
45 #define LMATRIX_VALUE CONCAT2(LMATRIX, _value)
46 #define RMATRIX_VALUE perm_matrix_value
47 #endif
48 
50 {
52 
53  return v1.LMATRIX_VALUE () * v2.RMATRIX_VALUE ();
54 }
55 
56 #ifdef LEFT
57 DEFBINOP (ldiv, LMATRIX, RMATRIX)
58 {
60 
61  return v1.perm_matrix_value ().inverse () * v2.RMATRIX_VALUE ();
62 }
63 #else
65 {
67 
68  return v1.LMATRIX_VALUE () * v2.perm_matrix_value ().inverse ();
69 }
70 #endif
71 
72 
73 #define SHORT_NAME CONCAT3(LSHORT, _, RSHORT)
74 #define INST_NAME CONCAT3(install_, SHORT_NAME, _ops)
75 
76 void
77 INST_NAME (void)
78 {
80 #ifdef LEFT
82 #else
84 #endif
85 #ifdef DEFINENULLASSIGNCONV
89 #endif
90 }