Mercurial > hg > octave-nkf
annotate liboctave/Array-util.h @ 10410:b3ec24dc305a
chol.cc: Increase tolerance for single precision test.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Fri, 12 Mar 2010 19:15:39 -0500 |
parents | 9c4daf174387 |
children | 0677c5d80b77 |
rev | line source |
---|---|
4588 | 1 /* |
2 | |
8920 | 3 Copyright (C) 2000, 2003, 2004, 2005, 2006, 2007, 2008 John W. Eaton |
4588 | 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, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
34 const dim_vector& dimensions); |
4588 | 35 |
6108 | 36 extern OCTAVE_API void increment_index (Array<octave_idx_type>& ra_idx, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
37 const dim_vector& dimensions, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
38 int start_dimension = 0); |
4588 | 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 |
7642
9a4541c622b5
refactor Array::assignN dimensioning code for empty initial matrices
David Bateman <dbateman@free.fr>
parents:
7246
diff
changeset
|
46 extern OCTAVE_API bool is_vector (const dim_vector& dim); |
9a4541c622b5
refactor Array::assignN dimensioning code for empty initial matrices
David Bateman <dbateman@free.fr>
parents:
7246
diff
changeset
|
47 |
6108 | 48 extern OCTAVE_API bool any_ones (const Array<octave_idx_type>& arr); |
4588 | 49 |
6108 | 50 extern OCTAVE_API octave_idx_type compute_index (const Array<octave_idx_type>& ra_idx, const dim_vector& dims); |
4588 | 51 |
6108 | 52 extern OCTAVE_API Array<octave_idx_type> conv_to_int_array (const Array<idx_vector>& a); |
4588 | 53 |
6108 | 54 extern OCTAVE_API Array<idx_vector> conv_to_array (const idx_vector *tmp, const octave_idx_type len); |
4588 | 55 |
6108 | 56 extern OCTAVE_API dim_vector freeze (Array<idx_vector>& ra_idx, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
57 const dim_vector& dimensions, int resize_ok); |
4588 | 58 |
6108 | 59 extern OCTAVE_API bool vector_equivalent (const dim_vector& dv); |
4588 | 60 |
6108 | 61 extern OCTAVE_API bool all_ok (const Array<idx_vector>& ra_idx); |
4588 | 62 |
6108 | 63 extern OCTAVE_API bool any_orig_empty (const Array<idx_vector>& ra_idx); |
4588 | 64 |
6108 | 65 extern OCTAVE_API bool all_colon_equiv (const Array<idx_vector>& ra_idx, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
66 const dim_vector& frozen_lengths); |
4588 | 67 |
6108 | 68 extern OCTAVE_API bool all_ones (const Array<octave_idx_type>& arr); |
4588 | 69 |
6108 | 70 extern OCTAVE_API Array<octave_idx_type> get_elt_idx (const Array<idx_vector>& ra_idx, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
71 const Array<octave_idx_type>& result_idx); |
4588 | 72 |
6108 | 73 extern OCTAVE_API Array<octave_idx_type> get_ra_idx (octave_idx_type idx, const dim_vector& dims); |
4588 | 74 |
8290
7cbe01c21986
improve dense array indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
75 extern OCTAVE_API dim_vector zero_dims_inquire (const Array<idx_vector>& ia, |
7cbe01c21986
improve dense array indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
76 const dim_vector& rhdv); |
7cbe01c21986
improve dense array indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
77 |
7cbe01c21986
improve dense array indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
78 extern OCTAVE_API dim_vector zero_dims_inquire (const idx_vector& i, const idx_vector& j, |
7cbe01c21986
improve dense array indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
7922
diff
changeset
|
79 const dim_vector& rhdv); |
4588 | 80 |
9479
d9716e3ee0dd
supply optimized compiled sub2ind & ind2sub
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
81 extern OCTAVE_API idx_vector sub2ind (const dim_vector& dv, const Array<idx_vector>& idxa); |
d9716e3ee0dd
supply optimized compiled sub2ind & ind2sub
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
82 |
d9716e3ee0dd
supply optimized compiled sub2ind & ind2sub
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
83 extern OCTAVE_API Array<idx_vector> ind2sub (const dim_vector& dv, const idx_vector& idx); |
d9716e3ee0dd
supply optimized compiled sub2ind & ind2sub
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
84 |
7241 | 85 struct |
86 permute_vector | |
87 { | |
88 octave_idx_type pidx; | |
89 octave_idx_type iidx; | |
90 }; | |
91 | |
7246 | 92 extern int OCTAVE_API permute_vector_compare (const void *a, const void *b); |
7241 | 93 |
10370
9c4daf174387
implement IDs for common liboctave exceptions
Jaroslav Hajek <highegg@gmail.com>
parents:
10366
diff
changeset
|
94 extern OCTAVE_API const char *error_id_nonconformant_args; |
9c4daf174387
implement IDs for common liboctave exceptions
Jaroslav Hajek <highegg@gmail.com>
parents:
10366
diff
changeset
|
95 |
9c4daf174387
implement IDs for common liboctave exceptions
Jaroslav Hajek <highegg@gmail.com>
parents:
10366
diff
changeset
|
96 extern OCTAVE_API const char *error_id_index_out_of_bounds; |
9c4daf174387
implement IDs for common liboctave exceptions
Jaroslav Hajek <highegg@gmail.com>
parents:
10366
diff
changeset
|
97 |
9c4daf174387
implement IDs for common liboctave exceptions
Jaroslav Hajek <highegg@gmail.com>
parents:
10366
diff
changeset
|
98 extern OCTAVE_API const char *error_id_invalid_index; |
9c4daf174387
implement IDs for common liboctave exceptions
Jaroslav Hajek <highegg@gmail.com>
parents:
10366
diff
changeset
|
99 |
7922
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7642
diff
changeset
|
100 extern void OCTAVE_API gripe_nan_to_logical_conversion (void); |
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7642
diff
changeset
|
101 |
6108 | 102 extern void OCTAVE_API gripe_nonconformant (const char *op, int op1_len, int op2_len); |
4669 | 103 |
6108 | 104 extern void OCTAVE_API gripe_nonconformant (const char *op, int op1_nr, int op1_nc, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
105 int op2_nr, int op2_nc); |
4669 | 106 |
107 | |
10366
e5ae13b8b2c2
improve Array indexing error messages
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
108 extern void OCTAVE_API gripe_nonconformant (const char *op, const dim_vector& op1_dims, |
e5ae13b8b2c2
improve Array indexing error messages
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
109 const dim_vector& op2_dims); |
e5ae13b8b2c2
improve Array indexing error messages
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
110 |
e5ae13b8b2c2
improve Array indexing error messages
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
111 extern void OCTAVE_API gripe_index_out_of_range (int nd, int dim, |
e5ae13b8b2c2
improve Array indexing error messages
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
112 octave_idx_type iext, octave_idx_type ext); |
e5ae13b8b2c2
improve Array indexing error messages
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
113 |
e5ae13b8b2c2
improve Array indexing error messages
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
114 extern void OCTAVE_API gripe_del_index_out_of_range (bool is1d, octave_idx_type iext, |
e5ae13b8b2c2
improve Array indexing error messages
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
115 octave_idx_type ext); |
4669 | 116 |
10370
9c4daf174387
implement IDs for common liboctave exceptions
Jaroslav Hajek <highegg@gmail.com>
parents:
10366
diff
changeset
|
117 extern void OCTAVE_API gripe_invalid_index (void); |
9c4daf174387
implement IDs for common liboctave exceptions
Jaroslav Hajek <highegg@gmail.com>
parents:
10366
diff
changeset
|
118 |
4588 | 119 #endif |