GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
op-dms-template.cc
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2008-2025 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if defined (HAVE_CONFIG_H)
27# include "config.h"
28#endif
29
30#include "ops.h"
31#include "xpow.h"
32#include SINCLUDE
33#include MINCLUDE
34
35// matrix by diag matrix ops.
36
37#if ! defined (SCALARV)
38# define SCALARV SCALAR
39#endif
40
41#if ! defined (MATRIXV)
42# define MATRIXV MATRIX
43#endif
44
46
49
50#define OCTAVE_MATRIX CONCAT2(octave_, MATRIX)
51#define OCTAVE_SCALAR CONCAT2(octave_, SCALAR)
52#define MATRIX_VALUE CONCAT2(MATRIXV, _value)
53#define SCALAR_VALUE CONCAT2(SCALARV, _value)
54
55DEFBINOP (dmsdiv, MATRIX, SCALAR)
56{
59
60 return v1.MATRIX_VALUE () / v2.SCALAR_VALUE ();
61}
62
63DEFBINOP (sdmldiv, SCALAR, MATRIX)
64{
67
68 return v2.MATRIX_VALUE () / v1.SCALAR_VALUE ();
69}
70
71DEFBINOP (dmspow, MATRIX, SCALAR)
72{
75
76 return xpow (v1.MATRIX_VALUE (), v2.SCALAR_VALUE ());
77}
78
79#define SHORT_NAME CONCAT3(MSHORT, _, SSHORT)
80#define INST_NAME CONCAT3(install_, SHORT_NAME, _ops)
81
82void
91
92OCTAVE_END_NAMESPACE(octave)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define SCALAR
Definition op-cdm-cs.cc:29
#define MATRIX
Definition op-cdm-cs.cc:30
#define INST_NAME
#define OCTAVE_MATRIX
#define MATRIXV
#define OCTAVE_SCALAR
#define SCALARV
const octave_base_value & a2
const octave_char_matrix & v2
#define DEFNDBINOP_OP(name, t1, t2, e1, e2, op)
Definition ops.h:294
#define DEFBINOP(name, t1, t2)
Definition ops.h:248
#define OCTAVE_CAST_BASE_VALUE(T, T_VAL, BASE_VAL)
Definition ops.h:52
#define INSTALL_BINOP_TI(ti, op, t1, t2, f)
Definition ops.h:70
octave_value op_mul(const octave_value &a1, const octave_value &a2)
Definition ov.h:1680
octave_value op_ldiv(const octave_value &a1, const octave_value &a2)
Definition ov.h:1684
octave_value op_pow(const octave_value &a1, const octave_value &a2)
Definition ov.h:1683
octave_value op_div(const octave_value &a1, const octave_value &a2)
Definition ov.h:1681
octave_value xpow(const SparseMatrix &a, double b)