Mercurial > octave-antonio
comparison liboctave/operators/Sparse-op-defs.h @ 19861:19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Try to wrap long lines to < 80 characters.
Use GNU style and don't indent first brace of function definition.
"case" statement is aligned flush left with brace of switch stmt.
Remove trailing '\' line continuation from the end of #define macros.
Use 2 spaces for indent.
* files-dock-widget.cc, history-dock-widget.cc, main-window.cc, octave-cmd.cc,
octave-dock-widget.cc, octave-gui.cc, resource-manager.cc, settings-dialog.cc,
shortcut-manager.cc, welcome-wizard.cc, workspace-view.cc, cellfun.cc, data.cc,
debug.cc, debug.h, dirfns.cc, error.h, file-io.cc, gl-render.cc, gl-render.h,
gl2ps-renderer.h, graphics.cc, graphics.in.h, help.cc, input.cc, load-path.cc,
load-path.h, lookup.cc, lu.cc, oct-stream.cc, octave-default-image.h,
ordschur.cc, pr-output.cc, qz.cc, strfns.cc, symtab.cc, symtab.h, sysdep.cc,
variables.cc, zfstream.h, __fltk_uigetfile__.cc, __init_fltk__.cc,
__magick_read__.cc, __osmesa_print__.cc, audiodevinfo.cc, ov-classdef.cc,
ov-classdef.h, ov-fcn.h, ov-float.cc, ov-flt-complex.cc, ov-java.cc,
ov-range.cc, ov-re-mat.cc, ov-usr-fcn.h, ov.cc, op-int.h, options-usage.h,
pt-eval.cc, Array-C.cc, Array-fC.cc, Array.cc, Array.h, PermMatrix.cc,
Sparse.cc, chMatrix.h, dSparse.cc, dim-vector.h, bsxfun-decl.h, bsxfun-defs.cc,
oct-norm.cc, Sparse-op-defs.h, oct-inttypes.cc, oct-inttypes.h, main.in.cc,
mkoctfile.in.cc: Cleanup C++ code to follow Octave coding conventions.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 25 Feb 2015 11:55:49 -0800 |
parents | 4197fc428c7d |
children |
comparison
equal
deleted
inserted
replaced
19860:e8ccfc5d892b | 19861:19755f4fc851 |
---|---|
969 return r; \ | 969 return r; \ |
970 } | 970 } |
971 | 971 |
972 #define SPARSE_SMSM_BOOL_OPS2(M1, M2, LHS_ZERO, RHS_ZERO) \ | 972 #define SPARSE_SMSM_BOOL_OPS2(M1, M2, LHS_ZERO, RHS_ZERO) \ |
973 SPARSE_SMSM_BOOL_OP (mx_el_and, &&, M1, M2, LHS_ZERO, RHS_ZERO) \ | 973 SPARSE_SMSM_BOOL_OP (mx_el_and, &&, M1, M2, LHS_ZERO, RHS_ZERO) \ |
974 SPARSE_SMSM_BOOL_OP (mx_el_or, ||, M1, M2, LHS_ZERO, RHS_ZERO) \ | 974 SPARSE_SMSM_BOOL_OP (mx_el_or, ||, M1, M2, LHS_ZERO, RHS_ZERO) |
975 | 975 |
976 #define SPARSE_SMSM_BOOL_OPS(M1, M2, ZERO) \ | 976 #define SPARSE_SMSM_BOOL_OPS(M1, M2, ZERO) \ |
977 SPARSE_SMSM_BOOL_OPS2(M1, M2, ZERO, ZERO) | 977 SPARSE_SMSM_BOOL_OPS2(M1, M2, ZERO, ZERO) |
978 | 978 |
979 // matrix by sparse matrix operations. | 979 // matrix by sparse matrix operations. |
1175 return r; \ | 1175 return r; \ |
1176 } | 1176 } |
1177 | 1177 |
1178 #define SPARSE_MSM_BOOL_OPS2(M1, M2, LHS_ZERO, RHS_ZERO) \ | 1178 #define SPARSE_MSM_BOOL_OPS2(M1, M2, LHS_ZERO, RHS_ZERO) \ |
1179 SPARSE_MSM_BOOL_OP (mx_el_and, &&, M1, M2, LHS_ZERO, RHS_ZERO) \ | 1179 SPARSE_MSM_BOOL_OP (mx_el_and, &&, M1, M2, LHS_ZERO, RHS_ZERO) \ |
1180 SPARSE_MSM_BOOL_OP (mx_el_or, ||, M1, M2, LHS_ZERO, RHS_ZERO) \ | 1180 SPARSE_MSM_BOOL_OP (mx_el_or, ||, M1, M2, LHS_ZERO, RHS_ZERO) |
1181 | 1181 |
1182 #define SPARSE_MSM_BOOL_OPS(M1, M2, ZERO) \ | 1182 #define SPARSE_MSM_BOOL_OPS(M1, M2, ZERO) \ |
1183 SPARSE_MSM_BOOL_OPS2(M1, M2, ZERO, ZERO) | 1183 SPARSE_MSM_BOOL_OPS2(M1, M2, ZERO, ZERO) |
1184 | 1184 |
1185 // sparse matrix by matrix operations. | 1185 // sparse matrix by matrix operations. |
1388 return r; \ | 1388 return r; \ |
1389 } | 1389 } |
1390 | 1390 |
1391 #define SPARSE_SMM_BOOL_OPS2(M1, M2, LHS_ZERO, RHS_ZERO) \ | 1391 #define SPARSE_SMM_BOOL_OPS2(M1, M2, LHS_ZERO, RHS_ZERO) \ |
1392 SPARSE_SMM_BOOL_OP (mx_el_and, &&, M1, M2, LHS_ZERO, RHS_ZERO) \ | 1392 SPARSE_SMM_BOOL_OP (mx_el_and, &&, M1, M2, LHS_ZERO, RHS_ZERO) \ |
1393 SPARSE_SMM_BOOL_OP (mx_el_or, ||, M1, M2, LHS_ZERO, RHS_ZERO) \ | 1393 SPARSE_SMM_BOOL_OP (mx_el_or, ||, M1, M2, LHS_ZERO, RHS_ZERO) |
1394 | 1394 |
1395 #define SPARSE_SMM_BOOL_OPS(M1, M2, ZERO) \ | 1395 #define SPARSE_SMM_BOOL_OPS(M1, M2, ZERO) \ |
1396 SPARSE_SMM_BOOL_OPS2(M1, M2, ZERO, ZERO) | 1396 SPARSE_SMM_BOOL_OPS2(M1, M2, ZERO, ZERO) |
1397 | 1397 |
1398 // Avoid some code duplication. Maybe we should use templates. | 1398 // Avoid some code duplication. Maybe we should use templates. |
1663 | 1663 |
1664 // Don't break from this loop if the test succeeds because | 1664 // Don't break from this loop if the test succeeds because |
1665 // we are looping over the rows and not the columns in the inner loop. | 1665 // we are looping over the rows and not the columns in the inner loop. |
1666 #define SPARSE_ANY_ALL_OP_ROW_CODE(TEST_OP, TEST_TRUE_VAL) \ | 1666 #define SPARSE_ANY_ALL_OP_ROW_CODE(TEST_OP, TEST_TRUE_VAL) \ |
1667 if (data (i) TEST_OP 0.0) \ | 1667 if (data (i) TEST_OP 0.0) \ |
1668 tmp[ridx (i)] = TEST_TRUE_VAL; \ | 1668 tmp[ridx (i)] = TEST_TRUE_VAL; |
1669 | 1669 |
1670 #define SPARSE_ANY_ALL_OP_COL_CODE(TEST_OP, TEST_TRUE_VAL) \ | 1670 #define SPARSE_ANY_ALL_OP_COL_CODE(TEST_OP, TEST_TRUE_VAL) \ |
1671 if (data (i) TEST_OP 0.0) \ | 1671 if (data (i) TEST_OP 0.0) \ |
1672 { \ | 1672 { \ |
1673 tmp[j] = TEST_TRUE_VAL; \ | 1673 tmp[j] = TEST_TRUE_VAL; \ |