00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifdef HAVE_CONFIG_H
00025 #include <config.h>
00026 #endif
00027
00028 #include "gripes.h"
00029 #include "oct-obj.h"
00030 #include "ov.h"
00031 #include "ov-typeinfo.h"
00032 #include "ov-bool-mat.h"
00033 #include "ov-scalar.h"
00034 #include "ops.h"
00035
00036 #include "ov-re-sparse.h"
00037 #include "ov-bool-sparse.h"
00038
00039
00040
00041 DEFUNOP_OP (not, sparse_bool_matrix, !)
00042
00043 DEFUNOP (uplus, sparse_bool_matrix)
00044 {
00045 CAST_UNOP_ARG (const octave_sparse_bool_matrix&);
00046 return octave_value (v.sparse_matrix_value ());
00047 }
00048
00049 DEFUNOP (uminus, sparse_bool_matrix)
00050 {
00051 CAST_UNOP_ARG (const octave_sparse_bool_matrix&);
00052 return octave_value ( - v.sparse_matrix_value ());
00053 }
00054
00055 DEFUNOP (transpose, sparse_bool_matrix)
00056 {
00057 CAST_UNOP_ARG (const octave_sparse_bool_matrix&);
00058 return octave_value (v.sparse_bool_matrix_value().transpose ());
00059 }
00060
00061
00062
00063 DEFBINOP_FN (eq, sparse_bool_matrix, sparse_bool_matrix, mx_el_eq)
00064 DEFBINOP_FN (ne, sparse_bool_matrix, sparse_bool_matrix, mx_el_ne)
00065 DEFBINOP_FN (el_and, sparse_bool_matrix, sparse_bool_matrix, mx_el_and)
00066 DEFBINOP_FN (el_or, sparse_bool_matrix, sparse_bool_matrix, mx_el_or)
00067
00068 DEFNDCATOP_FN (sbm_sbm, sparse_bool_matrix, sparse_bool_matrix,
00069 sparse_bool_matrix, sparse_bool_matrix, concat)
00070 DEFNDCATOP_FN (sbm_sm, sparse_bool_matrix, sparse_matrix, sparse_matrix,
00071 sparse_matrix, concat)
00072 DEFNDCATOP_FN (sm_sbm, sparse_matrix, sparse_bool_matrix, sparse_matrix,
00073 sparse_matrix, concat)
00074
00075 DEFASSIGNOP_FN (assign, sparse_bool_matrix, sparse_bool_matrix,
00076 assign)
00077
00078 CONVDECL (bool_matrix_to_double_matrix)
00079 {
00080 CAST_CONV_ARG (const octave_sparse_bool_matrix&);
00081
00082 return new octave_sparse_matrix (SparseMatrix (v.sparse_bool_matrix_value ()));
00083 }
00084
00085 void
00086 install_sbm_sbm_ops (void)
00087 {
00088 INSTALL_UNOP (op_not, octave_sparse_bool_matrix, not);
00089 INSTALL_UNOP (op_uplus, octave_sparse_bool_matrix, uplus);
00090 INSTALL_UNOP (op_uminus, octave_sparse_bool_matrix, uminus);
00091 INSTALL_UNOP (op_transpose, octave_sparse_bool_matrix, transpose);
00092 INSTALL_UNOP (op_hermitian, octave_sparse_bool_matrix, transpose);
00093
00094 INSTALL_BINOP (op_eq, octave_sparse_bool_matrix,
00095 octave_sparse_bool_matrix, eq);
00096 INSTALL_BINOP (op_ne, octave_sparse_bool_matrix,
00097 octave_sparse_bool_matrix, ne);
00098
00099 INSTALL_BINOP (op_el_and, octave_sparse_bool_matrix,
00100 octave_sparse_bool_matrix, el_and);
00101 INSTALL_BINOP (op_el_or, octave_sparse_bool_matrix,
00102 octave_sparse_bool_matrix, el_or);
00103
00104 INSTALL_CATOP (octave_sparse_bool_matrix, octave_sparse_bool_matrix,
00105 sbm_sbm);
00106 INSTALL_CATOP (octave_sparse_bool_matrix, octave_sparse_matrix, sbm_sm);
00107 INSTALL_CATOP (octave_sparse_matrix, octave_sparse_bool_matrix, sm_sbm);
00108
00109 INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix,
00110 octave_sparse_bool_matrix, assign);
00111
00112 INSTALL_CONVOP (octave_sparse_bool_matrix, octave_sparse_matrix,
00113 bool_matrix_to_double_matrix);
00114 }