4588
|
1 /* |
|
2 |
|
3 Copyright (C) 2000 John W. Eaton |
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
7016
|
9 Free Software Foundation; either version 3 of the License, or (at your |
|
10 option) any later version. |
4588
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
7016
|
18 along with Octave; see the file COPYING. If not, see |
|
19 <http://www.gnu.org/licenses/>. |
4588
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_Array_util_h) |
|
24 #define octave_Array_util_h 1 |
|
25 |
|
26 #include <cassert> |
|
27 |
|
28 #include "Array.h" |
|
29 #include "dim-vector.h" |
|
30 #include "idx-vector.h" |
|
31 #include "lo-error.h" |
|
32 |
6108
|
33 extern OCTAVE_API bool index_in_bounds (const Array<octave_idx_type>& ra_idx, |
4588
|
34 const dim_vector& dimensions); |
|
35 |
6108
|
36 extern OCTAVE_API void increment_index (Array<octave_idx_type>& ra_idx, |
4588
|
37 const dim_vector& dimensions, |
|
38 int start_dimension = 0); |
|
39 |
6108
|
40 extern OCTAVE_API octave_idx_type get_scalar_idx (Array<octave_idx_type>& idx, dim_vector& dims); |
4588
|
41 |
6108
|
42 extern OCTAVE_API octave_idx_type num_ones (const Array<octave_idx_type>& ra_idx); |
4588
|
43 |
6108
|
44 extern OCTAVE_API bool is_scalar (const dim_vector& dim); |
4588
|
45 |
6108
|
46 extern OCTAVE_API bool any_ones (const Array<octave_idx_type>& arr); |
4588
|
47 |
6108
|
48 extern OCTAVE_API octave_idx_type compute_index (const Array<octave_idx_type>& ra_idx, const dim_vector& dims); |
4588
|
49 |
6108
|
50 extern OCTAVE_API Array<octave_idx_type> conv_to_int_array (const Array<idx_vector>& a); |
4588
|
51 |
6108
|
52 extern OCTAVE_API Array<idx_vector> conv_to_array (const idx_vector *tmp, const octave_idx_type len); |
4588
|
53 |
6108
|
54 extern OCTAVE_API dim_vector freeze (Array<idx_vector>& ra_idx, |
4588
|
55 const dim_vector& dimensions, int resize_ok); |
|
56 |
6108
|
57 extern OCTAVE_API bool vector_equivalent (const dim_vector& dv); |
4588
|
58 |
6108
|
59 extern OCTAVE_API bool all_ok (const Array<idx_vector>& ra_idx); |
4588
|
60 |
6108
|
61 extern OCTAVE_API bool any_orig_empty (const Array<idx_vector>& ra_idx); |
4588
|
62 |
6108
|
63 extern OCTAVE_API bool all_colon_equiv (const Array<idx_vector>& ra_idx, |
4588
|
64 const dim_vector& frozen_lengths); |
|
65 |
6108
|
66 extern OCTAVE_API bool is_in (octave_idx_type num, const idx_vector& idx); |
4588
|
67 |
6108
|
68 extern OCTAVE_API octave_idx_type how_many_lgt (const octave_idx_type num, idx_vector& idxv); |
4588
|
69 |
6108
|
70 extern OCTAVE_API bool all_ones (const Array<octave_idx_type>& arr); |
4588
|
71 |
6108
|
72 extern OCTAVE_API Array<octave_idx_type> get_elt_idx (const Array<idx_vector>& ra_idx, |
5275
|
73 const Array<octave_idx_type>& result_idx); |
4588
|
74 |
6108
|
75 extern OCTAVE_API Array<octave_idx_type> get_ra_idx (octave_idx_type idx, const dim_vector& dims); |
4588
|
76 |
6108
|
77 extern OCTAVE_API dim_vector short_freeze (Array<idx_vector>& ra_idx, |
4588
|
78 const dim_vector& dimensions, |
|
79 int resize_ok); |
|
80 |
6108
|
81 extern void OCTAVE_API gripe_nonconformant (const char *op, int op1_len, int op2_len); |
4669
|
82 |
6108
|
83 extern void OCTAVE_API gripe_nonconformant (const char *op, int op1_nr, int op1_nc, |
4669
|
84 int op2_nr, int op2_nc); |
|
85 |
|
86 |
6108
|
87 extern void OCTAVE_API gripe_nonconformant (const char *op, dim_vector& op1_dims, |
4669
|
88 dim_vector& op2_dims); |
|
89 |
4588
|
90 #endif |
|
91 |
|
92 /* |
|
93 ;;; Local Variables: *** |
|
94 ;;; mode: C++ *** |
|
95 ;;; End: *** |
|
96 */ |