Mercurial > hg > octave-lyh
comparison src/OPERATORS/op-str-str.cc @ 9931:fb6b6fcafa62
untabify files in src/OPERATORS directory
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 07 Dec 2009 14:49:48 -0500 |
parents | 95a30d00f779 |
children | ac4b97c6bf8b |
comparison
equal
deleted
inserted
replaced
9930:1ddc25c3623a | 9931:fb6b6fcafa62 |
---|---|
1 /* | 1 /* |
2 | 2 |
3 Copyright (C) 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2005, 2007, 2008 | 3 Copyright (C) 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2005, 2007, |
4 John W. Eaton | 4 2008, 2009John W. Eaton |
5 | 5 |
6 This file is part of Octave. | 6 This file is part of Octave. |
7 | 7 |
8 Octave is free software; you can redistribute it and/or modify it | 8 Octave is free software; you can redistribute it and/or modify it |
9 under the terms of the GNU General Public License as published by the | 9 under the terms of the GNU General Public License as published by the |
44 error ("transpose not defined for N-d objects"); | 44 error ("transpose not defined for N-d objects"); |
45 return octave_value (); | 45 return octave_value (); |
46 } | 46 } |
47 else | 47 else |
48 return octave_value (v.char_matrix_value().transpose (), | 48 return octave_value (v.char_matrix_value().transpose (), |
49 a.is_sq_string () ? '\'' : '"'); | 49 a.is_sq_string () ? '\'' : '"'); |
50 } | 50 } |
51 | 51 |
52 // string by string ops. | 52 // string by string ops. |
53 | 53 |
54 #define DEFCHARNDBINOP_FN(name, op, t1, t2, e1, e2, f) \ | 54 #define DEFCHARNDBINOP_FN(name, op, t1, t2, e1, e2, f) \ |
55 BINOPDECL (name, a1, a2) \ | 55 BINOPDECL (name, a1, a2) \ |
56 { \ | 56 { \ |
57 dim_vector a1_dims = a1.dims (); \ | 57 dim_vector a1_dims = a1.dims (); \ |
58 dim_vector a2_dims = a2.dims (); \ | 58 dim_vector a2_dims = a2.dims (); \ |
59 \ | 59 \ |
62 \ | 62 \ |
63 CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \ | 63 CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \ |
64 \ | 64 \ |
65 if (a1_is_scalar) \ | 65 if (a1_is_scalar) \ |
66 { \ | 66 { \ |
67 if (a2_is_scalar) \ | 67 if (a2_is_scalar) \ |
68 return octave_value ((v1.e1 ## _value ())(0) op (v2.e2 ## _value ())(0)); \ | 68 return octave_value ((v1.e1 ## _value ())(0) op (v2.e2 ## _value ())(0)); \ |
69 else \ | 69 else \ |
70 return octave_value (f ((v1.e1 ## _value ())(0), v2.e2 ## _value ())); \ | 70 return octave_value (f ((v1.e1 ## _value ())(0), v2.e2 ## _value ())); \ |
71 } \ | 71 } \ |
72 else \ | 72 else \ |
73 { \ | 73 { \ |
74 if (a2_is_scalar) \ | 74 if (a2_is_scalar) \ |
75 return octave_value (f (v1.e1 ## _value (), (v2.e2 ## _value ())(0))); \ | 75 return octave_value (f (v1.e1 ## _value (), (v2.e2 ## _value ())(0))); \ |
76 else \ | 76 else \ |
77 return octave_value (f (v1.e1 ## _value (), v2.e2 ## _value ())); \ | 77 return octave_value (f (v1.e1 ## _value (), v2.e2 ## _value ())); \ |
78 } \ | 78 } \ |
79 } | 79 } |
80 | 80 |
81 DEFCHARNDBINOP_FN (lt, <, char_matrix_str, char_matrix_str, char_array, char_array, mx_el_lt) | 81 DEFCHARNDBINOP_FN (lt, <, char_matrix_str, char_matrix_str, char_array, char_array, mx_el_lt) |
82 DEFCHARNDBINOP_FN (le, <=, char_matrix_str, char_matrix_str, char_array, char_array, mx_el_le) | 82 DEFCHARNDBINOP_FN (le, <=, char_matrix_str, char_matrix_str, char_array, char_array, mx_el_le) |