annotate liboctave/util/lo-array-gripes.h @ 20574:dd6345fd8a97

use exceptions for better invalid index error reporting (bug #45957) * lo-array-gripes.h, lo-array-gripes.cc (index_exception): New base class for indexing errors. (invalid_index, out_of_range): New classes. (gripe_index_out_of_range): New overloaded function. (gripe_invalid_index): New overloaded functions. Delete version with no arguments. (gripe_invalid_assignment_size, gripe_assignment_dimension_mismatch): Delete. Change uses of gripe functions as needed. * Cell.cc (Cell::index, Cell::assign, Cell::delete_elements): Use exceptions to collect error info about and handle indexing errors. * data.cc (Fnth_element, do_accumarray_sum, F__accumarray_sum__, do_accumarray_minmax, do_accumarray_minmax_fun, F__accumdim_sum__): Likewise. * oct-map.cc (octave_map::index, octave_map::assign, octave_map::delete_elements): Likewise. * sparse.cc (Fsparse): Likewise. * sub2ind.cc (Fsub2ind, Find2sub): Likewise. New tests. * utils.cc (dims_to_numel): Likewise. * ov-base-diag.cc (octave_base_diag<DMT, MT>::do_index_op, octave_base_diag<DMT, MT>::subsasgn): Likewise. * ov-base-mat.cc (octave_base_matrix<MT>::subsref, octave_base_matrix<MT>::assign): Likewise. * ov-base-sparse.cc (octave_base_sparse<T>::do_index_op, octave_base_sparse<T>::assign, octave_base_sparse<MT>::delete_elements): Likewise. * ov-classdef.cc (cdef_object_array::subsref, cdef_object_array::subsasgn): Likewise. * ov-java.cc (make_java_index): Likewise. * ov-perm.cc (octave_perm_matrix::do_index_op): Likewise. * ov-range.cc (octave_range::do_index_op): Likewise. * ov-re-diag.cc (octave_diag_matrix::do_index_op): Likewise. * ov-str-mat.cc (octave_char_matrix_str::do_index_op_internal): Likewise. * pt-assign.cc (tree_simple_assignment::rvalue1): Likewise. * pt-idx.cc (tree_index_expression::rvalue, tree_index_expression::lvalue): Likewise. * Array-util.cc (sub2ind): Likewise. * toplev.cc (main_loop): Also catch unhandled index_exception exceptions. * ov-base.cc (octave_base_value::index_vector): Improve error message. * ov-re-sparse.cc (octave_sparse_matrix::index_vector): Likewise. * ov-complex.cc (complex_index): New class. (gripe_complex_index): New function. (octave_complex::index_vector): Use it. * pt-id.h, pt-id.cc (tree_identifier::is_variable, tree_black_hole::is_variable): Now const. * pt-idx.cc (final_index_error): New static function. (tree_index_expression::rvalue, tree_index_expression::lvalue): Use it. * index.tst: New tests.
author Lachlan Andrew <lachlanbis@gmail.com>
date Fri, 02 Oct 2015 15:07:37 -0400
parents 4197fc428c7d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11135
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 /*
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2
19731
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 19442
diff changeset
3 Copyright (C) 2000-2015 John W. Eaton
11135
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 This file is part of Octave.
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 option) any later version.
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 for more details.
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, see
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 <http://www.gnu.org/licenses/>.
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21 */
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22
17822
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17744
diff changeset
23 #if !defined (octave_lo_array_gripes_h)
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17744
diff changeset
24 #define octave_lo_array_gripes_h 1
11135
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 #include "dim-vector.h"
20574
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
27 #include "quit.h"
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
28
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
29 // Exception thrown by gripe_invalid_index
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
30 // This is thrown when the invalid index is detected, at which point nd and dim
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
31 // are usually not known. It is caught at the place they are known, where a
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
32 // new gripe_invalid_index is called.
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
33 //
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
34 // Typically, this should be caught after any call to
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
35 // octave_value_list::index_vector()
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
36 class index_exception : public octave_execution_exception
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
37 {
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
38 public:
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
39
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
40 index_exception (const char *index_in, octave_idx_type nd_in = 0,
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
41 octave_idx_type dim_in = 0, const char *var_in = "")
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
42 : index (index_in), nd (nd_in), dim (dim_in), var (var_in)
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
43 { }
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
44
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
45 ~index_exception (void) throw () { }
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
46
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
47 // Erroneous index value. Called in what, and by external code
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
48 // (e.g., nth_element) to make a custom error message.
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
49 const char *idx (void) const { return index.c_str (); }
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
50
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
51 // details set by subclass.
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
52 virtual const char* explain (void) const = 0;
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
53
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
54 // ID of error to throw.
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
55 virtual const char* id (void) const = 0;
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
56
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
57 virtual const char* err (void) throw ();
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
58
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
59 // Position of error: dimension in error, and number of dimensions.
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
60 void set_pos (octave_idx_type nd_in, octave_idx_type dim_in)
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
61 {
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
62 nd = nd_in;
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
63 dim = dim_in;
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
64 }
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
65
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
66 void set_pos_if_unset (octave_idx_type nd_in, octave_idx_type dim_in)
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
67 {
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
68 if (nd == 0)
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
69 {
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
70 nd = nd_in;
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
71 dim = dim_in;
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
72 }
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
73 }
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
74
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
75 // Name of variable being indexed. eye(2)(1,1) gives "<unknown>".
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
76 void set_var (std::string var_in) { var = var_in; }
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
77
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
78 private:
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
79
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
80 // Value of invalid index.
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
81 std::string index;
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
82
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
83 // Formatted message returned by what(), (not on stack).
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
84 std::string msg;
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
85
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
86 protected:
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
87
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
88 // Show what's wrong, e.g., A(-1,_), A(0+1i).
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
89 std::string access (void) const;
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
90
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
91 // Number of dimensions of indexed object.
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
92 octave_idx_type nd;
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
93
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
94 // Dimension number in which invalid index occurred.
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
95 octave_idx_type dim;
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
96
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
97 // Name of variable being indexed.
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
98 std::string var;
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
99
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
100 };
11135
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
101
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
102 extern OCTAVE_API const char *error_id_nonconformant_args;
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
104 extern OCTAVE_API const char *error_id_index_out_of_bounds;
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
105
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
106 extern OCTAVE_API const char *error_id_invalid_index;
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
107
19442
a0c7001cf1a8 consistent messages and IDs for singular matrix warnings
John W. Eaton <jwe@octave.org>
parents: 17822
diff changeset
108 extern OCTAVE_API const char *warning_id_nearly_singular_matrix;
a0c7001cf1a8 consistent messages and IDs for singular matrix warnings
John W. Eaton <jwe@octave.org>
parents: 17822
diff changeset
109
a0c7001cf1a8 consistent messages and IDs for singular matrix warnings
John W. Eaton <jwe@octave.org>
parents: 17822
diff changeset
110 extern OCTAVE_API const char *warning_id_singular_matrix;
a0c7001cf1a8 consistent messages and IDs for singular matrix warnings
John W. Eaton <jwe@octave.org>
parents: 17822
diff changeset
111
11135
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
112 extern void OCTAVE_API
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
113 gripe_nan_to_logical_conversion (void);
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
114
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
115 extern void OCTAVE_API
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
116 gripe_nan_to_character_conversion (void);
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
117
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
118 extern void OCTAVE_API
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
119 gripe_nonconformant (const char *op,
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
120 octave_idx_type op1_len, octave_idx_type op2_len);
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
121
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
122 extern void OCTAVE_API
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
123 gripe_nonconformant (const char *op,
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
124 octave_idx_type op1_nr, octave_idx_type op1_nc,
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
125 octave_idx_type op2_nr, octave_idx_type op2_nc);
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
126
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
127
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
128 extern void OCTAVE_API
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
129 gripe_nonconformant (const char *op, const dim_vector& op1_dims,
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
130 const dim_vector& op2_dims);
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
131
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
132 extern void OCTAVE_API
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
133 gripe_index_out_of_range (int nd, int dim,
20574
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
134 octave_idx_type iext, octave_idx_type ext,
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
135 const dim_vector& d);
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
136
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
137 extern void OCTAVE_API
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
138 gripe_index_out_of_range (int nd, int dim,
11135
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
139 octave_idx_type iext, octave_idx_type ext);
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
140
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
141 extern void OCTAVE_API
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
142 gripe_del_index_out_of_range (bool is1d, octave_idx_type iext,
11135
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
143 octave_idx_type ext);
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
144
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
145 extern void OCTAVE_API
20574
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
146 gripe_invalid_index (double, octave_idx_type nd=0,
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
147 octave_idx_type dim=0, const char *var = NULL);
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
148
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
149 extern void OCTAVE_API
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
150 gripe_invalid_index (octave_idx_type n, octave_idx_type nd=0,
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
151 octave_idx_type dim=0, const char *var = NULL);
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
152
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
153 extern void OCTAVE_API
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
154 gripe_invalid_index (const char *idx, octave_idx_type nd=0,
dd6345fd8a97 use exceptions for better invalid index error reporting (bug #45957)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 19731
diff changeset
155 octave_idx_type dim=0, const char *var = NULL);
11135
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
156
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
157 extern void OCTAVE_API
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
158 gripe_invalid_resize (void);
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
159
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
160 extern void OCTAVE_API
19442
a0c7001cf1a8 consistent messages and IDs for singular matrix warnings
John W. Eaton <jwe@octave.org>
parents: 17822
diff changeset
161 gripe_singular_matrix (double rcond = 0.0);
a0c7001cf1a8 consistent messages and IDs for singular matrix warnings
John W. Eaton <jwe@octave.org>
parents: 17822
diff changeset
162
11135
047b0e877a14 add files for previous change
John W. Eaton <jwe@octave.org>
parents:
diff changeset
163 #endif