00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
00025 #pragma implementation
00026 #endif
00027
00028 #ifdef HAVE_CONFIG_H
00029 #include <config.h>
00030 #endif
00031
00032 #include <iostream>
00033
00034 #include "Array-util.h"
00035 #include "lo-error.h"
00036 #include "str-vec.h"
00037 #include "mx-base.h"
00038 #include "mx-inlines.cc"
00039
00040
00041
00042 bool
00043 boolMatrix::operator == (const boolMatrix& a) const
00044 {
00045 if (rows () != a.rows () || cols () != a.cols ())
00046 return 0;
00047
00048 return mx_inline_equal (data (), a.data (), length ());
00049 }
00050
00051 bool
00052 boolMatrix::operator != (const boolMatrix& a) const
00053 {
00054 return !(*this == a);
00055 }
00056
00057 boolMatrix&
00058 boolMatrix::insert (const boolMatrix& a, int r, int c)
00059 {
00060 Array2<bool>::insert (a, r, c);
00061 return *this;
00062 }
00063
00064
00065
00066 boolMatrix
00067 boolMatrix::operator ! (void) const
00068 {
00069 int nr = rows ();
00070 int nc = cols ();
00071
00072 boolMatrix b (nr, nc);
00073
00074 for (int j = 0; j < nc; j++)
00075 for (int i = 0; i < nr; i++)
00076 b.elem (i, j) = ! elem (i, j);
00077
00078 return b;
00079 }
00080
00081
00082
00083
00084
00085
00086 boolMatrix
00087 boolMatrix::all (int dim) const
00088 {
00089 MX_ALL_OP (dim);
00090 }
00091
00092 boolMatrix
00093 boolMatrix::any (int dim) const
00094 {
00095 MX_ANY_OP (dim);
00096 }
00097
00098 MM_CMP_OPS (boolMatrix, , boolMatrix, )
00099
00100
00101
00102
00103
00104