Mercurial > hg > octave-lojdl
changeset 12057:73ca5cee6bb6 release-3-2-x
handle null matrix assignment for diagonal and permutation matrices
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 07 Aug 2009 08:15:27 +0200 |
parents | 68a4e6a2dc31 |
children | 0cb90d7fe46a |
files | src/ChangeLog src/OPERATORS/op-cdm-m.cc src/OPERATORS/op-dm-m.cc src/OPERATORS/op-dm-template.cc src/OPERATORS/op-pm-m.cc src/OPERATORS/op-pm-template.cc |
diffstat | 6 files changed, 37 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2009-08-06 John W. Eaton <jwe@octave.org> + + * OPERATORS/op-cdm-m.cc, OPERATORS/op-dm-m.cc, OPERATORS/op-pm-m.cc: + Define LDMATRIX and DEFINENULLASSIGNCONV. + * OPERATORS/op-dm-template.cc, OPERATORS/op-pm-template.cc: + Include ov-null-mat.h and define assignment conversion for null + matrices if DEFINENULLASSIGNCONV is defined. Define OCTAVE_LDMATRIX. + 2009-08-05 John W. Eaton <jwe@octave.org> * pt-eval.cc (tree_evaluator::visit_complex_for_command):
--- a/src/OPERATORS/op-cdm-m.cc +++ b/src/OPERATORS/op-cdm-m.cc @@ -1,6 +1,6 @@ /* -Copyright (C) 2008 Jaroslav Hajek +Copyright (C) 2008, 2009 Jaroslav Hajek This file is part of Octave. @@ -24,6 +24,7 @@ #define RINCLUDE "ov-re-mat.h" #define LMATRIX complex_diag_matrix +#define LDMATRIX complex_matrix #define RMATRIX matrix #define RDMATRIX complex_matrix @@ -31,6 +32,7 @@ #define RSHORT m #define DEFINELDIV +#define DEFINENULLASSIGNCONV #include "op-dm-template.cc"
--- a/src/OPERATORS/op-dm-m.cc +++ b/src/OPERATORS/op-dm-m.cc @@ -1,6 +1,6 @@ /* -Copyright (C) 2008 Jaroslav Hajek +Copyright (C) 2008, 2009 Jaroslav Hajek This file is part of Octave. @@ -24,12 +24,14 @@ #define RINCLUDE "ov-re-mat.h" #define LMATRIX diag_matrix +#define LDMATRIX matrix #define RMATRIX matrix #define LSHORT dm #define RSHORT m #define DEFINELDIV +#define DEFINENULLASSIGNCONV #include "op-dm-template.cc"
--- a/src/OPERATORS/op-dm-template.cc +++ b/src/OPERATORS/op-dm-template.cc @@ -1,6 +1,6 @@ /* -Copyright (C) 2008 Jaroslav Hajek +Copyright (C) 2008, 2009 Jaroslav Hajek This file is part of Octave. @@ -28,6 +28,9 @@ #include "xdiv.h" #include LINCLUDE #include RINCLUDE +#ifdef DEFINENULLASSIGNCONV +#include "ov-null-mat.h" +#endif // matrix by diag matrix ops. @@ -44,6 +47,7 @@ #endif #define OCTAVE_LMATRIX CONCAT2(octave_, LMATRIX) +#define OCTAVE_LDMATRIX CONCAT2(octave_, LDMATRIX) #define OCTAVE_RMATRIX CONCAT2(octave_, RMATRIX) #define LMATRIX_VALUE CONCAT2(LMATRIX, _value) #define RMATRIX_VALUE CONCAT2(RMATRIX, _value) @@ -83,6 +87,7 @@ #ifdef DEFINELDIV INSTALL_BINOP (op_ldiv, OCTAVE_LMATRIX, OCTAVE_RMATRIX, ldiv); #endif +#ifdef DEFINENULLASSIGNCONV + INSTALL_ASSIGNCONV (OCTAVE_LMATRIX, octave_null_matrix, OCTAVE_LDMATRIX); +#endif } - -
--- a/src/OPERATORS/op-pm-m.cc +++ b/src/OPERATORS/op-pm-m.cc @@ -1,6 +1,6 @@ /* -Copyright (C) 2008 Jaroslav Hajek +Copyright (C) 2008, 2009 Jaroslav Hajek This file is part of Octave. @@ -23,11 +23,13 @@ #define MINCLUDE "ov-re-mat.h" #define LMATRIX perm_matrix +#define LDMATRIX matrix #define RMATRIX matrix #define LSHORT pm #define RSHORT m #define LEFT +#define DEFINENULLASSIGNCONV #include "op-pm-template.cc"
--- a/src/OPERATORS/op-pm-template.cc +++ b/src/OPERATORS/op-pm-template.cc @@ -1,6 +1,6 @@ /* -Copyright (C) 2008 Jaroslav Hajek +Copyright (C) 2008, 2009 Jaroslav Hajek This file is part of Octave. @@ -27,8 +27,16 @@ #include "ov-perm.h" #include MINCLUDE #include "ops.h" +#ifdef DEFINENULLASSIGNCONV +#include "ov-null-mat.h" +#endif + +#ifndef LDMATRIX +#define LDMATRIX LMATRIX +#endif #define OCTAVE_LMATRIX CONCAT2(octave_, LMATRIX) +#define OCTAVE_LDMATRIX CONCAT2(octave_, LDMATRIX) #define OCTAVE_RMATRIX CONCAT2(octave_, RMATRIX) #ifdef LEFT #define LMATRIX_VALUE perm_matrix_value @@ -74,4 +82,7 @@ #else INSTALL_BINOP (op_div, OCTAVE_LMATRIX, OCTAVE_RMATRIX, div); #endif +#ifdef DEFINENULLASSIGNCONV + INSTALL_ASSIGNCONV (OCTAVE_LMATRIX, octave_null_matrix, OCTAVE_LDMATRIX); +#endif }