annotate src/of-sparsersb-1-fixes.patch @ 4427:2a53600c749c

of-sparsersb: enable buildability in dev octave * src/of-sparsersb-1-fixes.patch: updated patch * src/of-sparsersb.mk: call autogen.sh before build
author John D
date Fri, 21 Jul 2017 15:06:37 -0400
parents 54b1b8a285e6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4377
54b1b8a285e6 of-sparsersb.mk: add patch for typo (Bug #50764)
John D
parents:
diff changeset
1 diff -ur sparsersb-1.0.5.orig/src/sparsersb.cc sparsersb-1.0.5/src/sparsersb.cc
54b1b8a285e6 of-sparsersb.mk: add patch for typo (Bug #50764)
John D
parents:
diff changeset
2 --- sparsersb-1.0.5.orig/src/sparsersb.cc 2017-04-08 17:49:45.120506400 -0400
54b1b8a285e6 of-sparsersb.mk: add patch for typo (Bug #50764)
John D
parents:
diff changeset
3 +++ sparsersb-1.0.5/src/sparsersb.cc 2017-04-08 17:50:04.244313729 -0400
54b1b8a285e6 of-sparsersb.mk: add patch for typo (Bug #50764)
John D
parents:
diff changeset
4 @@ -311,7 +311,7 @@
54b1b8a285e6 of-sparsersb.mk: add patch for typo (Bug #50764)
John D
parents:
diff changeset
5 // assumes tacitly that rsboi_idx_overflow(IA[i],JA[i])==false for i in 0..nnzA-1.
54b1b8a285e6 of-sparsersb.mk: add patch for typo (Bug #50764)
John D
parents:
diff changeset
6 rsb_err_t errval = RSB_ERR_NO_ERROR;
54b1b8a285e6 of-sparsersb.mk: add patch for typo (Bug #50764)
John D
parents:
diff changeset
7
54b1b8a285e6 of-sparsersb.mk: add patch for typo (Bug #50764)
John D
parents:
diff changeset
8 - errval = rsb_mtx_get_coo(mtxAp, VA, (rsb_coo_idx_t *)IA, (rsb_coo_idx_ t*)JA, flags );
54b1b8a285e6 of-sparsersb.mk: add patch for typo (Bug #50764)
John D
parents:
diff changeset
9 + errval = rsb_mtx_get_coo(mtxAp, VA, (rsb_coo_idx_t *)IA, (rsb_coo_idx_t*)JA, flags );
54b1b8a285e6 of-sparsersb.mk: add patch for typo (Bug #50764)
John D
parents:
diff changeset
10 rsb_nnz_idx_t nnzA = 0;
54b1b8a285e6 of-sparsersb.mk: add patch for typo (Bug #50764)
John D
parents:
diff changeset
11 rsb_mtx_get_info(mtxAp,RSB_MIF_MATRIX_NNZ__TO__RSB_NNZ_INDEX_T,&nnzA); // FIXME: make this a member and use nnz()
54b1b8a285e6 of-sparsersb.mk: add patch for typo (Bug #50764)
John D
parents:
diff changeset
12 rsboi_ri2oi((rsb_coo_idx_t *)IA,nnzA);
4427
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
13 diff -r e6017808f88d src/configure.ac
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
14 --- a/src/configure.ac Fri Jul 21 12:04:41 2017 -0400
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
15 +++ b/src/configure.ac Fri Jul 21 13:25:48 2017 -0400
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
16 @@ -107,11 +107,7 @@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
17 fi
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
18 fi
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
19
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
20 -if test -x `which $OCTAVE-cli` ; then
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
21 - OCTAVE_CLI="$OCTAVE-cli";
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
22 -else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
23 - OCTAVE_CLI="$OCTAVE";
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
24 -fi
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
25 +OCTAVE_CLI="$OCTAVE --no-gui --no-window-system";
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
26
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
27 SPARSERSB_USE_64BIT_IDX=`$OCTAVE_CLI --no-line-editing -qf --eval 'printf ("%i", sizemax() > intmax ("int32"))'`
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
28 if [test x"$SPARSERSB_USE_64BIT_IDX" = x"1" ]; then
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
29 diff -r 105149bc4206 src/Makeconf.in
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
30 --- a/src/Makeconf.in Fri Jul 21 13:47:46 2017 -0400
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
31 +++ b/src/Makeconf.in Fri Jul 21 14:52:25 2017 -0400
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
32 @@ -4,3 +4,4 @@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
33 SPARSERSB_CXXFLAGS = @SPARSERSB_CXXFLAGS@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
34 SPARSERSB_LDFLAGS = @SPARSERSB_LDFLAGS@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
35 SPARSERSB_CXX11= @SPARSERSB_CXX11@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
36 +OCTAVE_FUNC_DEFINES = @HAVE_OCTAVE_VALUE_ISCOMPLEX@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
37 diff -r 105149bc4206 src/Makefile
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
38 --- a/src/Makefile Fri Jul 21 13:47:46 2017 -0400
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
39 +++ b/src/Makefile Fri Jul 21 14:52:25 2017 -0400
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
40 @@ -1,7 +1,7 @@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
41 sinclude Makeconf
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
42 # Makeconf is created by the configure script.
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
43 # You can also not use it but set explicitly the following:
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
44 -CXXFLAGS=$(SPARSERSB_CXXFLAGS)
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
45 +CXXFLAGS=$(SPARSERSB_CXXFLAGS) $(OCTAVE_FUNC_DEFINES)
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
46 LFLAGS=$(shell $(MKOCTFILE) -p LFLAGS) $(SPARSERSB_LDFLAGS)
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
47 CXXFLAGS_CXX11=$(SPARSERSB_CXX11)
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
48
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
49 diff -r 105149bc4206 src/configure.ac
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
50 --- a/src/configure.ac Fri Jul 21 13:47:46 2017 -0400
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
51 +++ b/src/configure.ac Fri Jul 21 14:52:25 2017 -0400
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
52 @@ -154,6 +154,40 @@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
53 AC_MSG_ERROR([$PACKAGE_NAME requires librsb library])
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
54 fi
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
55
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
56 +# check for octave functions
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
57 +save_CXX="$CXX"
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
58 +save_CXXFLAGS="$CXXFLAGS"
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
59 +CXX=`${MKOCTFILE} -p CXX`
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
60 +CXXFLAGS="$CXXFLAGS -I`$MKOCTFILE -p OCTINCLUDEDIR`"
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
61 +
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
62 +# need to use interpreter->get_load_path in dev version of octave,
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
63 +# prior to that methods of load_path were static
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
64 +AC_CACHE_CHECK(
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
65 + [for octave_value function iscomplex],
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
66 + [octave_value_cv_iscomplex],
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
67 + [AC_COMPILE_IFELSE(
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
68 + [AC_LANG_PROGRAM([
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
69 + #include <oct.h>
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
70 + #include <octave.h>
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
71 + ],
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
72 + [
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
73 + octave_value().iscomplex();
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
74 + ])],
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
75 + [octave_value_cv_iscomplex=yes],
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
76 + [octave_value_cv_iscomplex=no])
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
77 + ])
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
78 +if test "$octave_value_cv_iscomplex" = "yes" ; then
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
79 + HAVE_OCTAVE_VALUE_ISCOMPLEX=-DHAVE_OCTAVE_VALUE_ISCOMPLEX
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
80 +else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
81 + HAVE_OCTAVE_VALUE_ISCOMPLEX=
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
82 +fi
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
83 +AC_SUBST(HAVE_OCTAVE_VALUE_ISCOMPLEX)
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
84 +
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
85 +CC=$save_CXX
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
86 +CXXFLAGS=$save_CXXFLAGS
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
87 +
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
88 +
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
89 +
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
90 AC_SUBST(OCTAVE)
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
91 AC_SUBST(TARGETS)
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
92 AC_SUBST(SPARSERSB_CXXFLAGS)
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
93 @@ -163,6 +197,7 @@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
94 AC_CONFIG_FILES([Makeconf])
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
95 AC_OUTPUT
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
96
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
97 +
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
98 AC_MSG_NOTICE([
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
99
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
100 $PACKAGE_NAME is configured with:
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
101 diff -r 105149bc4206 src/sparsersb.cc
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
102 --- a/src/sparsersb.cc Fri Jul 21 13:47:46 2017 -0400
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
103 +++ b/src/sparsersb.cc Fri Jul 21 14:52:25 2017 -0400
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
104 @@ -177,7 +177,11 @@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
105
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
106 #ifdef RSB_NUMERICAL_TYPE_DOUBLE_COMPLEX
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
107 #define RSBOI_WANT_DOUBLE_COMPLEX 1
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
108 +#ifdef HAVE_OCTAVE_VALUE_ISCOMPLEX
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
109 +#define ORSB_RSB_TYPE_FLAG(OBJ) (((OBJ).iscomplex())?RSB_NUMERICAL_TYPE_DOUBLE:RSB_NUMERICAL_TYPE_DOUBLE_COMPLEX)
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
110 +#else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
111 #define ORSB_RSB_TYPE_FLAG(OBJ) (((OBJ).is_complex_type())?RSB_NUMERICAL_TYPE_DOUBLE:RSB_NUMERICAL_TYPE_DOUBLE_COMPLEX)
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
112 +#endif
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
113 #else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
114 #define RSBOI_WANT_DOUBLE_COMPLEX 0
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
115 #define ORSB_RSB_TYPE_FLAG(OBJ) RSB_NUMERICAL_TYPE_DOUBLE
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
116 @@ -228,7 +232,11 @@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
117 }
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
118 #endif
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
119 #if RSBOI_WANT_DOUBLE_COMPLEX
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
120 +#ifdef HAVE_OCTAVE_VALUE_ISCOMPLEX
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
121 +#define RSBOI_BINOP_PREVAILING_TYPE(V1,V2) (((V1).iscomplex()||(V2).iscomplex())?RSB_NUMERICAL_TYPE_DOUBLE_COMPLEX:RSB_NUMERICAL_TYPE_DOUBLE)
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
122 +#else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
123 #define RSBOI_BINOP_PREVAILING_TYPE(V1,V2) (((V1).is_complex_type()||(V2).is_complex_type())?RSB_NUMERICAL_TYPE_DOUBLE_COMPLEX:RSB_NUMERICAL_TYPE_DOUBLE)
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
124 +#endif
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
125 #else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
126 #define RSBOI_BINOP_PREVAILING_TYPE(V1,V2) RSBOI_TYPECODE
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
127 #endif
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
128 @@ -863,7 +871,11 @@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
129 bool is_diagonal (void) const { RSBOI_0_EMCHECK(this->mtxAp); RSBOI_DEBUG_NOTICE(RSBOI_D_EMPTY_MSG);return RSB_DO_FLAG_HAS(this->rsbflags(),RSB_FLAG_DIAGONAL)?true:false; }/* FIXME: new: not sure whether this is ever called */
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
130 bool is_lower_triangular (void) const { RSBOI_0_EMCHECK(this->mtxAp); RSBOI_DEBUG_NOTICE(RSBOI_D_EMPTY_MSG);return RSB_DO_FLAG_HAS(this->rsbflags(),RSB_FLAG_LOWER_TRIANGULAR)?true:false; }/* FIXME: new: not sure whether this is ever called */
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
131 bool is_upper_triangular (void) const { RSBOI_0_EMCHECK(this->mtxAp); RSBOI_DEBUG_NOTICE(RSBOI_D_EMPTY_MSG);return RSB_DO_FLAG_HAS(this->rsbflags(),RSB_FLAG_UPPER_TRIANGULAR)?true:false; }/* FIXME: new: not sure whether this is ever called */
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
132 +#ifdef HAVE_OCTAVE_VALUE_ISCOMPLEX
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
133 + bool iscomplex (void) const { RSBOI_DEBUG_NOTICE(RSBOI_D_EMPTY_MSG); return !is_real_type(); }
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
134 +#else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
135 bool is_complex_type (void) const { RSBOI_DEBUG_NOTICE(RSBOI_D_EMPTY_MSG); return !is_real_type(); }
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
136 +#endif
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
137 bool is_bool_type (void) const { return false; }
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
138 bool is_integer_type (void) const { return false; }
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
139 bool is_square (void) const { return this->rows()==this->cols(); }
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
140 @@ -1534,7 +1546,11 @@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
141 rsb_err_t errval = RSB_ERR_NO_ERROR;
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
142 RSBOI_DEBUG_NOTICE(RSBOI_D_EMPTY_MSG);
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
143
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
144 +#ifdef HAVE_OCTAVE_VALUE_ISCOMPLEX
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
145 + if(v1.iscomplex())
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
146 +#else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
147 if(v1.is_complex_type())
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
148 +#endif
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
149 {
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
150 ComplexMatrix retval = v2.complex_matrix_value();
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
151 octave_idx_type b_nc = retval.cols ();
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
152 @@ -1640,7 +1656,11 @@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
153 if(v1.is__triangular())
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
154 return rsboi_spsm(v1,v2,RSB_TRANSPOSITION_N);
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
155
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
156 +#ifdef HAVE_OCTAVE_VALUE_ISCOMPLEX
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
157 + if(v1.iscomplex() || v2.iscomplex())
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
158 +#else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
159 if(v1.is_complex_type() || v2.is_complex_type())
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
160 +#endif
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
161 return (v1.sparse_complex_matrix_value()).solve(v2.sparse_complex_matrix_value());
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
162 else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
163 return (v1.sparse_matrix_value()).solve(v2.matrix_value());
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
164 @@ -1655,7 +1675,11 @@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
165 if(v1.is__triangular())
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
166 return rsboi_spsm(v1,v2,RSB_TRANSPOSITION_T);
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
167
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
168 +#ifdef HAVE_OCTAVE_VALUE_ISCOMPLEX
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
169 + if(v1.iscomplex() || v2.iscomplex())
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
170 +#else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
171 if(v1.is_complex_type() || v2.is_complex_type())
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
172 +#endif
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
173 return (v1.sparse_complex_matrix_value().transpose()).solve(v2.sparse_complex_matrix_value());
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
174 else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
175 return (v1.sparse_matrix_value().transpose()).solve(v2.matrix_value());
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
176 @@ -1671,7 +1695,11 @@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
177 if(v1.is__triangular())
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
178 return rsboi_spsm(v1,v2,RSB_TRANSPOSITION_N);
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
179
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
180 +#ifdef HAVE_OCTAVE_VALUE_ISCOMPLEX
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
181 + if(v1.iscomplex() || v2.iscomplex())
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
182 +#else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
183 if(v1.is_complex_type() || v2.is_complex_type())
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
184 +#endif
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
185 return (v1.sparse_complex_matrix_value()).solve(v2.sparse_complex_matrix_value());
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
186 else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
187 return (v1.sparse_matrix_value()).solve(v2.matrix_value());
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
188 @@ -1685,7 +1713,11 @@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
189 if(v1.is__triangular())
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
190 return rsboi_spsm(v1,v2,RSB_TRANSPOSITION_T);
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
191
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
192 +#ifdef HAVE_OCTAVE_VALUE_ISCOMPLEX
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
193 + if(v1.iscomplex() || v2.iscomplex())
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
194 +#else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
195 if(v1.is_complex_type() || v2.is_complex_type())
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
196 +#endif
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
197 return (v1.sparse_complex_matrix_value().transpose()).solve(v2.sparse_complex_matrix_value());
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
198 else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
199 return (v1.sparse_matrix_value().transpose()).solve(v2.matrix_value());
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
200 @@ -2199,8 +2231,13 @@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
201 int nargin = args.length ();
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
202 octave_value_list retval;
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
203 octave_sparsersb_mtx*osmp = RSBOI_NULL;
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
204 +#ifdef HAVE_OCTAVE_VALUE_ISCOMPLEX
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
205 + bool ic0 = nargin>0?(args(0).iscomplex()):false;
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
206 + bool ic3 = nargin>2?(args(2).iscomplex()):false;
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
207 +#else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
208 bool ic0 = nargin>0?(args(0).is_complex_type()):false;
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
209 bool ic3 = nargin>2?(args(2).is_complex_type()):false;
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
210 +#endif
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
211 bool isr = (nargin>0 && args(0).type_name()==RSB_OI_TYPEINFO_STRING);
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
212
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
213 RSBOI_DEBUG_NOTICE("in sparsersb()\n");
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
214 @@ -2522,7 +2559,11 @@
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
215 if(nargout) retval.append(osmp->cols()),--nargout;
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
216 if(nargout) retval.append(osmp->nnz()),--nargout;
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
217 if(nargout) retval.append(osmp->get_info_string()),--nargout;
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
218 +#ifdef HAVE_OCTAVE_VALUE_ISCOMPLEX
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
219 + if(nargout) retval.append((!osmp->iscomplex())?"real":"complex"),--nargout;
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
220 +#else
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
221 if(nargout) retval.append((!osmp->is_complex_type())?"real":"complex"),--nargout;
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
222 +#endif
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
223 if(nargout) retval.append(osmp->get_symmetry()),--nargout;
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
224 }
2a53600c749c of-sparsersb: enable buildability in dev octave
John D
parents: 4377
diff changeset
225 }