[Pkg-octave-commit] [SCM] octave-symbolic branch, master, updated. a718b53403d9f164f8c2a3df521385a01d28a11b
bensapp
bensapp at 416fae20-06d0-4450-9b69-c6c34d4b5f03
Mon Jan 3 03:40:16 UTC 2011
The following commit has been merged in the master branch:
commit f4ae74f336787639ba98cda3bd2afd4e335a5d41
Author: bensapp <bensapp at 416fae20-06d0-4450-9b69-c6c34d4b5f03>
Date: Mon Mar 4 18:38:20 2002 +0000
New ex_matrix type.
git-svn-id: https://octave.svn.sourceforge.net/svnroot/octave/trunk/octave-forge/main/symbolic@145 416fae20-06d0-4450-9b69-c6c34d4b5f03
diff --git a/ov-ex-mat.cc b/ov-ex-mat.cc
new file mode 100644
index 0000000..d6df240
--- /dev/null
+++ b/ov-ex-mat.cc
@@ -0,0 +1,226 @@
+/*
+Copyright (C) 2002 Benjamin Sapp
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+This is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You can have receive a copy of the GNU General Public License. Write
+to the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#include <octave/config.h>
+
+#include <cstdlib>
+
+#include <string>
+
+class ostream;
+class octave_sym;
+
+#include <octave/lo-mappers.h>
+#include <octave/lo-utils.h>
+#include <octave/mx-base.h>
+#include <octave/str-vec.h>
+
+#include <octave/defun-dld.h>
+#include <octave/error.h>
+#include <octave/gripes.h>
+#include <octave/oct-obj.h>
+#include <octave/ops.h>
+#include <octave/ov-base.h>
+#include <octave/ov-typeinfo.h>
+#include <octave/ov.h>
+#include <octave/ov-scalar.h>
+#include <octave/ov-re-mat.h>
+#include <octave/ov-complex.h>
+#include <octave/pager.h>
+#include <octave/pr-output.h>
+#include <octave/symtab.h>
+#include <octave/variables.h>
+#include <iostream>
+#include <fstream>
+#include "ov-ex.h"
+#include "ov-ex-mat.h"
+#include "ov-sym.h"
+#include "ov-vpa.h"
+
+
+#if 0
+DEFUNOP_OP (uminus, ex, -)
+
+DEFNCUNOP_METHOD (incr, ex, increment)
+DEFNCUNOP_METHOD (decr, ex, decrement)
+
+#endif
+
+// Addition operations
+DEFBINOP_MATRIX_OP(ex_matrix_complex_matrix_add, ex_matrix, complex_matrix, add)
+DEFBINOP_MATRIX_OP(complex_matrix_ex_matrix_add, complex_matrix, ex_matrix, add)
+DEFBINOP_MATRIX_OP(ex_matrix_matrix_add, ex_matrix, matrix, add)
+DEFBINOP_MATRIX_OP(matrix_ex_matrix_add, matrix, ex_matrix, add)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_complex_add, ex_matrix, complex, +)
+DEFBINOP_SCALAR_EXMAT_OP(complex_ex_matrix_add, complex, ex_matrix, +)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_scalar_add,ex_matrix,scalar,+)
+DEFBINOP_SCALAR_EXMAT_OP(scalar_ex_matrix_add,scalar,ex_matrix,+)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_vpa_add,ex_matrix,vpa,+)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_ex_add, ex_matrix, ex, +)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_sym_add,ex_matrix,sym,+)
+DEFBINOP_MATRIX_OP(add,ex_matrix,ex_matrix,add)
+
+// Subtraction operations
+DEFBINOP_MATRIX_OP(ex_matrix_complex_matrix_sub, ex_matrix, complex_matrix, sub)
+DEFBINOP_MATRIX_OP(complex_matrix_ex_matrix_sub, complex_matrix, ex_matrix, sub)
+DEFBINOP_MATRIX_OP(ex_matrix_matrix_sub, ex_matrix, matrix, sub)
+DEFBINOP_MATRIX_OP(matrix_ex_matrix_sub, matrix, ex_matrix, sub)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_complex_sub, ex_matrix, complex, -)
+DEFBINOP_SCALAR_EXMAT_OP(complex_ex_matrix_sub, complex, ex_matrix, -)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_scalar_sub,ex_matrix,scalar, -)
+DEFBINOP_SCALAR_EXMAT_OP(scalar_ex_matrix_sub,scalar,ex_matrix, -)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_vpa_sub,ex_matrix,vpa, -)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_ex_sub, ex_matrix, ex, -)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_sym_sub,ex_matrix,sym, -)
+DEFBINOP_MATRIX_OP(sub,ex_matrix,ex_matrix,sub)
+
+// multiplication operations
+DEFBINOP_MATRIX_OP(ex_matrix_complex_matrix_mul, ex_matrix, complex_matrix, mul)
+DEFBINOP_MATRIX_OP(complex_matrix_ex_matrix_mul, complex_matrix, ex_matrix, mul)
+DEFBINOP_MATRIX_OP(ex_matrix_matrix_mul, ex_matrix, matrix, mul)
+DEFBINOP_MATRIX_OP(matrix_ex_matrix_mul, matrix, ex_matrix, mul)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_complex_mul, ex_matrix, complex, *)
+DEFBINOP_SCALAR_EXMAT_OP(complex_ex_matrix_mul, complex, ex_matrix, *)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_scalar_mul,ex_matrix,scalar, *)
+DEFBINOP_SCALAR_EXMAT_OP(scalar_ex_matrix_mul,scalar,ex_matrix, *)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_vpa_mul,ex_matrix,vpa, *)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_ex_mul, ex_matrix, ex, *)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_sym_mul,ex_matrix,sym, *)
+DEFBINOP_MATRIX_OP(mul,ex_matrix,ex_matrix,mul)
+
+// "right division" operations
+DEFBINOP_MATRIX_DIV(ex_matrix_complex_matrix_div, ex_matrix, complex_matrix)
+DEFBINOP_MATRIX_DIV(complex_matrix_ex_matrix_div, complex_matrix, ex_matrix)
+DEFBINOP_MATRIX_DIV(ex_matrix_matrix_div, ex_matrix, matrix)
+DEFBINOP_MATRIX_DIV(matrix_ex_matrix_div, matrix, ex_matrix)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_complex_div, ex_matrix, complex, /)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_scalar_div,ex_matrix,scalar, /)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_vpa_div,ex_matrix,vpa, /)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_ex_div, ex_matrix, ex, /)
+DEFBINOP_EXMAT_SCALAR_OP(ex_matrix_sym_div,ex_matrix,sym, /)
+DEFBINOP_MATRIX_DIV(div,ex_matrix,ex_matrix)
+
+// power operators
+DEFBINOP_POW(ex_matrix_complex_pow, ex_matrix, complex)
+DEFBINOP_POW(ex_matrix_scalar_pow,ex_matrix,scalar)
+DEFBINOP_POW(ex_matrix_vpa_pow,ex_matrix,vpa)
+DEFBINOP_POW(ex_matrix_ex_pow, ex_matrix, ex)
+DEFBINOP_POW(ex_matrix_sym_pow,ex_matrix,sym)
+
+void
+octave_ex_matrix::print(ostream& os,bool pr_as_read_syntax) const
+{
+ os << x;
+}
+
+octave_ex_matrix& octave_ex_matrix::operator=(const octave_ex_matrix& a)
+{
+ // GiNaC::ex *tmp;
+ // tmp = (a.x.bp->duplicate());
+ // return octave_ex(*tmp);
+ return (*(new octave_ex_matrix(a.x)));
+}
+
+void
+install_ex_matrix_type()
+{
+ octave_ex_matrix::register_type();
+
+ cerr << "installing ex matrix type at type-id = "
+ << octave_ex_matrix::static_type_id() << "\n";
+}
+
+
+void
+install_ex_matrix_ops()
+{
+ // Install addition operators
+ INSTALL_BINOP(op_add, octave_ex_matrix, octave_complex_matrix, ex_matrix_complex_matrix_add);
+ INSTALL_BINOP(op_add, octave_complex_matrix, octave_ex_matrix, complex_matrix_ex_matrix_add);
+ INSTALL_BINOP(op_add, octave_ex_matrix, octave_matrix, ex_matrix_matrix_add);
+ INSTALL_BINOP(op_add, octave_matrix, octave_ex_matrix, matrix_ex_matrix_add);
+ INSTALL_BINOP(op_add, octave_ex_matrix, octave_complex, ex_matrix_complex_add);
+ INSTALL_BINOP(op_add, octave_complex, octave_ex_matrix, complex_ex_matrix_add);
+ INSTALL_BINOP(op_add, octave_ex_matrix, octave_scalar, ex_matrix_scalar_add);
+ INSTALL_BINOP(op_add, octave_scalar, octave_ex_matrix, scalar_ex_matrix_add);
+ INSTALL_BINOP(op_add, octave_ex_matrix, octave_vpa, ex_matrix_vpa_add);
+ INSTALL_BINOP(op_add, octave_ex_matrix, octave_ex, ex_matrix_ex_add);
+ INSTALL_BINOP(op_add, octave_ex_matrix, octave_sym, ex_matrix_sym_add);
+ INSTALL_BINOP(op_add, octave_ex_matrix, octave_ex_matrix, add);
+
+ // Install subtraction operators
+ INSTALL_BINOP(op_sub, octave_ex_matrix, octave_complex_matrix, ex_matrix_complex_matrix_sub);
+ INSTALL_BINOP(op_sub, octave_complex_matrix, octave_ex_matrix, complex_matrix_ex_matrix_sub);
+ INSTALL_BINOP(op_sub, octave_ex_matrix, octave_matrix, ex_matrix_matrix_sub);
+ INSTALL_BINOP(op_sub, octave_matrix, octave_ex_matrix, matrix_ex_matrix_sub);
+ INSTALL_BINOP(op_sub, octave_ex_matrix, octave_complex, ex_matrix_complex_sub);
+ INSTALL_BINOP(op_sub, octave_complex, octave_ex_matrix, complex_ex_matrix_sub);
+ INSTALL_BINOP(op_sub, octave_ex_matrix, octave_scalar, ex_matrix_scalar_sub);
+ INSTALL_BINOP(op_sub, octave_scalar, octave_ex_matrix, scalar_ex_matrix_sub);
+ INSTALL_BINOP(op_sub, octave_ex_matrix, octave_vpa, ex_matrix_vpa_sub);
+ INSTALL_BINOP(op_sub, octave_ex_matrix, octave_ex, ex_matrix_ex_sub);
+ INSTALL_BINOP(op_sub, octave_ex_matrix, octave_sym, ex_matrix_sym_sub);
+ INSTALL_BINOP(op_sub, octave_ex_matrix, octave_ex_matrix, sub);
+
+ // Install multiplication operators
+ INSTALL_BINOP(op_mul, octave_ex_matrix, octave_complex_matrix, ex_matrix_complex_matrix_mul);
+ INSTALL_BINOP(op_mul, octave_complex_matrix, octave_ex_matrix, complex_matrix_ex_matrix_mul);
+ INSTALL_BINOP(op_mul, octave_ex_matrix, octave_matrix, ex_matrix_matrix_mul);
+ INSTALL_BINOP(op_mul, octave_matrix, octave_ex_matrix, matrix_ex_matrix_mul);
+ INSTALL_BINOP(op_mul, octave_ex_matrix, octave_complex, ex_matrix_complex_mul);
+ INSTALL_BINOP(op_mul, octave_complex, octave_ex_matrix, complex_ex_matrix_mul);
+ INSTALL_BINOP(op_mul, octave_ex_matrix, octave_scalar, ex_matrix_scalar_mul);
+ INSTALL_BINOP(op_mul, octave_scalar, octave_ex_matrix, scalar_ex_matrix_mul);
+ INSTALL_BINOP(op_mul, octave_ex_matrix, octave_vpa, ex_matrix_vpa_mul);
+ INSTALL_BINOP(op_mul, octave_ex_matrix, octave_ex, ex_matrix_ex_mul);
+ INSTALL_BINOP(op_mul, octave_ex_matrix, octave_sym, ex_matrix_sym_mul);
+ INSTALL_BINOP(op_mul, octave_ex_matrix, octave_ex_matrix, mul);
+
+ // Install "right division" operators
+ INSTALL_BINOP(op_div, octave_ex_matrix, octave_complex_matrix, ex_matrix_complex_matrix_div);
+ INSTALL_BINOP(op_div, octave_complex_matrix, octave_ex_matrix, complex_matrix_ex_matrix_div);
+ INSTALL_BINOP(op_div, octave_ex_matrix, octave_matrix, ex_matrix_matrix_div);
+ INSTALL_BINOP(op_div, octave_matrix, octave_ex_matrix, matrix_ex_matrix_div);
+ INSTALL_BINOP(op_div, octave_ex_matrix, octave_complex, ex_matrix_complex_div);
+ INSTALL_BINOP(op_div, octave_ex_matrix, octave_scalar, ex_matrix_scalar_div);
+ INSTALL_BINOP(op_div, octave_ex_matrix, octave_vpa, ex_matrix_vpa_div);
+ INSTALL_BINOP(op_div, octave_ex_matrix, octave_ex, ex_matrix_ex_div);
+ INSTALL_BINOP(op_div, octave_ex_matrix, octave_sym, ex_matrix_sym_div);
+ INSTALL_BINOP(op_div, octave_ex_matrix, octave_ex_matrix, div);
+
+ // Install power operators
+ INSTALL_BINOP(op_pow, octave_ex_matrix, octave_complex, ex_matrix_complex_pow);
+ INSTALL_BINOP(op_pow, octave_ex_matrix, octave_scalar, ex_matrix_scalar_pow);
+ INSTALL_BINOP(op_pow, octave_ex_matrix, octave_vpa, ex_matrix_vpa_pow);
+ INSTALL_BINOP(op_pow, octave_ex_matrix, octave_ex, ex_matrix_ex_pow);
+ INSTALL_BINOP(op_pow, octave_ex_matrix, octave_sym, ex_matrix_sym_pow);
+
+#if 0
+
+ INSTALL_UNOP(op_uminus, octave_ex, uminus); // -x
+
+ INSTALL_NCUNOP(op_incr, octave_ex, incr); // x++
+ INSTALL_NCUNOP(op_decr, octave_ex, decr); // x--
+
+#endif
+}
+
+DEFINE_OCTAVE_ALLOCATOR (octave_ex_matrix);
+
+DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_ex_matrix, "symbolic matrix");
diff --git a/ov-ex-mat.h b/ov-ex-mat.h
new file mode 100644
index 0000000..038bf29
--- /dev/null
+++ b/ov-ex-mat.h
@@ -0,0 +1,271 @@
+/*
+Copyright (C) 2002 Benjamin Sapp
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+This is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You can have receive a copy of the GNU General Public License. Write
+to the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#if !defined (octave_ex_matrix_h)
+#define octave_ex_matrix_h 1
+
+#include <ginac/ginac.h>
+#include <octave/ov-re-mat.h>
+#include <octave/ov-cx-mat.h>
+
+void install_ex_matrix_type();
+void install_ex_matrix_ops();
+
+#define DEFBINOP_MATRIX_OP(name, t1, t2, op) \
+ BINOPDECL (name, a1, a2) \
+ { \
+ try \
+ { \
+ CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
+ GiNaC::matrix r1 = octave_ex_matrix(v1.t1 ## _value ()).ex_matrix_value (); \
+ GiNaC::matrix r2 = octave_ex_matrix(v2.t2 ## _value ()).ex_matrix_value (); \
+ if ( (r1.rows () != r2.rows ()) || (r1.cols () != r2.cols ()) ) \
+ { \
+ error("nonconformant arguments\n"); \
+ return octave_value (); \
+ } \
+ return octave_value \
+ (new octave_ex_matrix (r1.op (r2))); \
+ } \
+ catch (exception &e) \
+ { \
+ error(e.what()); \
+ return octave_value (); \
+ } \
+ }
+
+#define DEFBINOP_MATRIX_DIV(name, t1, t2) \
+ BINOPDECL (name, a1, a2) \
+ { \
+ try \
+ { \
+ CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
+ GiNaC::matrix r1 = octave_ex_matrix(v1.t1 ## _value ()).ex_matrix_value (); \
+ GiNaC::matrix r2 = octave_ex_matrix(v2.t2 ## _value ()).ex_matrix_value (); \
+ if ( (r1.rows () != r2.rows ()) || (r1.cols () != r2.cols ()) ) \
+ { \
+ error("nonconformant arguments\n"); \
+ return octave_value (); \
+ } \
+ return octave_value \
+ (new octave_ex_matrix (r2.transpose ().inverse ().mul (r1).transpose ())); \
+ } \
+ catch (exception &e) \
+ { \
+ error(e.what()); \
+ return octave_value (); \
+ } \
+ }
+
+#define DEFBINOP_SCALAR_EXMAT_OP(name, t1, t2, op) \
+ BINOPDECL (name, a1, a2) \
+ { \
+ try \
+ { \
+ CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
+ GiNaC::matrix r1 = octave_ex_matrix(v2.t2 ## _value ()).ex_matrix_value (); \
+ GiNaC::ex r2 = octave_ex(v1.t1 ## _value ()).ex_value (); \
+ int rows = int(r1.rows ()); \
+ int cols = int(r1.cols ()); \
+ GiNaC::matrix result(rows, cols); \
+ for (int i = 0; i < rows; i++) \
+ for (int j = 0; j < cols; j++) \
+ result(i,j) = r1(i,j) op r2; \
+ return octave_value \
+ (new octave_ex_matrix (result)); \
+ } \
+ catch (exception &e) \
+ { \
+ error(e.what()); \
+ return octave_value (); \
+ } \
+ }
+
+#define DEFBINOP_EXMAT_SCALAR_OP(name, t1, t2, op) \
+ BINOPDECL (name, a1, a2) \
+ { \
+ try \
+ { \
+ CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
+ GiNaC::matrix r1 = octave_ex_matrix(v1.t1 ## _value ()).ex_matrix_value (); \
+ GiNaC::ex r2 = octave_ex(v2.t2 ## _value ()).ex_value (); \
+ int rows = int(r1.rows ()); \
+ int cols = int(r1.cols ()); \
+ GiNaC::matrix result(rows, cols); \
+ for (int i = 0; i < rows; i++) \
+ for (int j = 0; j < cols; j++) \
+ result(i,j) = r1(i,j) op r2; \
+ return octave_value \
+ (new octave_ex_matrix (result)); \
+ } \
+ catch (exception &e) \
+ { \
+ error(e.what()); \
+ return octave_value (); \
+ } \
+ }
+
+#define DEFBINOP_POW(name, t1, t2) \
+ BINOPDECL (name, a1, a2) \
+ { \
+ try \
+ { \
+ CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
+ GiNaC::matrix r1 = octave_ex_matrix(v1.t1 ## _value ()).ex_matrix_value (); \
+ GiNaC::ex r2 = octave_ex(v2.t2 ## _value ()).ex_value (); \
+ int rows = int(r1.rows ()); \
+ int cols = int(r1.cols ()); \
+ GiNaC::matrix result(rows, cols); \
+ for (int i = 0; i < rows; i++) \
+ for (int j = 0; j < cols; j++) \
+ result(i,j) = GiNaC::pow(r1(i,j), r2); \
+ return octave_value \
+ (new octave_ex_matrix (result)); \
+ } \
+ catch (exception &e) \
+ { \
+ error(e.what()); \
+ return octave_value (); \
+ } \
+ }
+
+class
+octave_ex_matrix : public octave_base_value
+{
+public:
+ octave_ex_matrix(void):octave_base_value() {}
+
+ octave_ex_matrix(octave_ex_matrix &ox)
+ {
+ x = ox.x;
+ }
+
+ octave_ex_matrix(octave_ex &ox)
+ {
+ x = GiNaC::matrix(1,1);
+ x(0,0) = ox.ex_value ();
+ }
+
+ octave_ex_matrix(GiNaC::symbol sym)
+ {
+ x = GiNaC::matrix(1,1);
+ x(0,0) = GiNaC::ex(sym);
+ }
+
+ octave_ex_matrix(GiNaC::matrix ex_mat)
+ {
+ x = ex_mat;
+ }
+
+ octave_ex_matrix(GiNaC::ex expression)
+ {
+ x = GiNaC::matrix(1,1);
+ x(0,0) = expression;
+ }
+
+ octave_ex_matrix(int rows, int columns)
+ {
+ x = GiNaC::matrix(rows,columns);
+ }
+
+ octave_ex_matrix(octave_matrix ov)
+ {
+ Matrix mat = ov.matrix_value ();
+
+ int rows = mat.rows ();
+ int cols = mat.cols ();
+
+ x = GiNaC::matrix(rows, cols);
+
+ for (int i = 0; i < rows; i++)
+ for (int j = 0; j < cols; j++)
+ x(i,j) = GiNaC::ex(mat(i,j));
+ }
+
+ octave_ex_matrix(octave_complex_matrix ov)
+ {
+ ComplexMatrix mat = ov.complex_matrix_value ();
+
+ int rows = mat.rows ();
+ int cols = mat.cols ();
+
+ x = GiNaC::matrix(rows, cols);
+
+ for (int i = 0; i < rows; i++)
+ for (int j = 0; j < cols; j++)
+ x(i,j) = GiNaC::ex(mat(i,j).real ()) + GiNaC::I*GiNaC::ex(mat(i,j).imag ());
+ }
+
+ ~octave_ex_matrix() {}
+
+ octave_ex_matrix& operator=(const octave_ex_matrix&);
+
+ GiNaC::matrix ex_matrix_value(bool = false) const
+ {
+ // GiNaC::ex tmp = *(x.bp->duplicate());
+ // return tmp;
+ return x;
+ }
+
+ GiNaC::ex ex_value(bool = false) const
+ {
+ // GiNaC::ex tmp = *(x.bp->duplicate());
+ // return tmp;
+ return GiNaC::ex(x);
+ }
+
+ octave_value *clone (void)
+ {
+ return new octave_ex_matrix (*this);
+ }
+
+ int rows (void) const { return x.rows (); }
+ int columns (void) const { return x.cols (); }
+
+ bool is_constant (void) const { return true; }
+ bool is_defined (void) const { return true; }
+
+ bool valid_as_scalar_index(void) const {return false;}
+
+ bool is_true(void) const { return true; }
+
+ octave_value uminus (void) const { return new octave_ex_matrix(-x); }
+ /*
+ void increment (void) { x = x+1;}
+
+ void decrement (void) { x = x-1;}
+ */
+ void print(ostream& os,bool pr_as_read_syntax) const;
+
+private:
+ GiNaC::matrix x;
+
+ DECLARE_OCTAVE_ALLOCATOR
+
+ DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
+
+};
+
+
+#endif
+
+/*
+;;; Local Variables: ***
+;;; mode: C++ ***
+;;; End: ***
+*/
--
octave-symbolic
More information about the Pkg-octave-commit
mailing list