comparison src/ov-bool-sparse.cc @ 14861:f7afecdd87ef

maint: Use Octave coding conventions for cuddling parentheses in src/ directory * bitfcns.cc, comment-list.cc, data.cc, defun.cc, error.cc, gl-render.cc, graphics.cc, graphics.in.h, load-path.cc, load-path.h, load-save.cc, ls-hdf5.cc, ls-mat4.cc, ls-mat5.cc, ls-oct-ascii.cc, mappers.cc, mex.cc, oct-map.cc, oct-obj.cc, ov-base-int.cc, ov-base-mat.h, ov-base-sparse.cc, ov-bool-mat.cc, ov-bool-sparse.cc, ov-cell.cc, ov-class.cc, ov-complex.cc, ov-cx-mat.cc, ov-cx-sparse.cc, ov-fcn-handle.cc, ov-flt-cx-mat.cc, ov-flt-re-mat.cc, ov-re-mat.cc, ov-re-sparse.cc, ov-scalar.cc, ov-str-mat.cc, ov-struct.cc, ov-usr-fcn.cc, ov.cc, pr-output.cc, procstream.h, sighandlers.cc, sparse-xdiv.cc, sparse-xpow.cc, sparse.cc, symtab.cc, syscalls.cc, sysdep.cc, txt-eng-ft.cc, variables.cc, zfstream.cc, zfstream.h: Use Octave coding conventions for cuddling parentheses.
author Rik <octave@nomad.inbox5.com>
date Sat, 14 Jul 2012 06:22:56 -0700
parents 460a3c6d8bf1
children
comparison
equal deleted inserted replaced
14860:e027f98403c3 14861:f7afecdd87ef
161 } 161 }
162 162
163 NDArray 163 NDArray
164 octave_sparse_bool_matrix::array_value (bool) const 164 octave_sparse_bool_matrix::array_value (bool) const
165 { 165 {
166 return NDArray (Matrix(matrix.matrix_value ())); 166 return NDArray (Matrix (matrix.matrix_value ()));
167 } 167 }
168 168
169 charNDArray 169 charNDArray
170 octave_sparse_bool_matrix::char_array_value (bool) const 170 octave_sparse_bool_matrix::char_array_value (bool) const
171 { 171 {
172 charNDArray retval (dims (), 0); 172 charNDArray retval (dims (), 0);
173 octave_idx_type nc = matrix.cols (); 173 octave_idx_type nc = matrix.cols ();
174 octave_idx_type nr = matrix.rows (); 174 octave_idx_type nr = matrix.rows ();
175 175
176 for (octave_idx_type j = 0; j < nc; j++) 176 for (octave_idx_type j = 0; j < nc; j++)
177 for (octave_idx_type i = matrix.cidx(j); i < matrix.cidx(j+1); i++) 177 for (octave_idx_type i = matrix.cidx (j); i < matrix.cidx (j+1); i++)
178 retval(matrix.ridx(i) + nr * j) = static_cast<char>(matrix.data (i)); 178 retval(matrix.ridx (i) + nr * j) = static_cast<char>(matrix.data (i));
179 179
180 return retval; 180 return retval;
181 } 181 }
182 182
183 boolMatrix 183 boolMatrix
236 // add one to the printed indices to go from 236 // add one to the printed indices to go from
237 // zero-based to one-based arrays 237 // zero-based to one-based arrays
238 for (int i = 0; i < nc+1; i++) 238 for (int i = 0; i < nc+1; i++)
239 { 239 {
240 octave_quit (); 240 octave_quit ();
241 itmp = matrix.cidx(i); 241 itmp = matrix.cidx (i);
242 os.write (reinterpret_cast<char *> (&itmp), 4); 242 os.write (reinterpret_cast<char *> (&itmp), 4);
243 } 243 }
244 244
245 for (int i = 0; i < nz; i++) 245 for (int i = 0; i < nz; i++)
246 { 246 {
247 octave_quit (); 247 octave_quit ();
248 itmp = matrix.ridx(i); 248 itmp = matrix.ridx (i);
249 os.write (reinterpret_cast<char *> (&itmp), 4); 249 os.write (reinterpret_cast<char *> (&itmp), 4);
250 } 250 }
251 251
252 OCTAVE_LOCAL_BUFFER (char, htmp, nz); 252 OCTAVE_LOCAL_BUFFER (char, htmp, nz);
253 253
298 octave_quit (); 298 octave_quit ();
299 if (! is.read (reinterpret_cast<char *> (&tmp), 4)) 299 if (! is.read (reinterpret_cast<char *> (&tmp), 4))
300 return false; 300 return false;
301 if (swap) 301 if (swap)
302 swap_bytes<4> (&tmp); 302 swap_bytes<4> (&tmp);
303 m.cidx(i) = tmp; 303 m.cidx (i) = tmp;
304 } 304 }
305 305
306 for (int i = 0; i < nz; i++) 306 for (int i = 0; i < nz; i++)
307 { 307 {
308 octave_quit (); 308 octave_quit ();
309 if (! is.read (reinterpret_cast<char *> (&tmp), 4)) 309 if (! is.read (reinterpret_cast<char *> (&tmp), 4))
310 return false; 310 return false;
311 if (swap) 311 if (swap)
312 swap_bytes<4> (&tmp); 312 swap_bytes<4> (&tmp);
313 m.ridx(i) = tmp; 313 m.ridx (i) = tmp;
314 } 314 }
315 315
316 if (error_state || ! is) 316 if (error_state || ! is)
317 return false; 317 return false;
318 318
549 hsize_t rank; 549 hsize_t rank;
550 550
551 dim_vector dv; 551 dim_vector dv;
552 int empty = load_hdf5_empty (loc_id, name, dv); 552 int empty = load_hdf5_empty (loc_id, name, dv);
553 if (empty > 0) 553 if (empty > 0)
554 matrix.resize(dv); 554 matrix.resize (dv);
555 if (empty) 555 if (empty)
556 return (empty > 0); 556 return (empty > 0);
557 557
558 #if HAVE_HDF5_18 558 #if HAVE_HDF5_18
559 group_hid = H5Gopen (loc_id, name, H5P_DEFAULT); 559 group_hid = H5Gopen (loc_id, name, H5P_DEFAULT);
780 mwIndex *ir = retval->get_ir (); 780 mwIndex *ir = retval->get_ir ();
781 mwIndex *jc = retval->get_jc (); 781 mwIndex *jc = retval->get_jc ();
782 782
783 for (mwIndex i = 0; i < nz; i++) 783 for (mwIndex i = 0; i < nz; i++)
784 { 784 {
785 pr[i] = matrix.data(i); 785 pr[i] = matrix.data (i);
786 ir[i] = matrix.ridx(i); 786 ir[i] = matrix.ridx (i);
787 } 787 }
788 788
789 for (mwIndex i = 0; i < columns () + 1; i++) 789 for (mwIndex i = 0; i < columns () + 1; i++)
790 jc[i] = matrix.cidx(i); 790 jc[i] = matrix.cidx (i);
791 791
792 return retval; 792 return retval;
793 } 793 }