annotate README @ 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
2993
91589ab98e37 [project @ 1997-05-21 21:44:54 by jwe]
jwe
parents: 2885
diff changeset
1 GNU Octave -- a high-level language for numerical computations.
2330
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
2
19731
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 19192
diff changeset
3 Copyright (C) 1996-2015 John W. Eaton
2330
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
4
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
5 Overview
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
6 --------
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
7
2993
91589ab98e37 [project @ 1997-05-21 21:44:54 by jwe]
jwe
parents: 2885
diff changeset
8 GNU Octave is a high-level language, primarily intended for numerical
2330
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
9 computations. It provides a convenient command line interface for
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
10 solving linear and nonlinear problems numerically.
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
11
2993
91589ab98e37 [project @ 1997-05-21 21:44:54 by jwe]
jwe
parents: 2885
diff changeset
12 GNU Octave is free software; you can redistribute it and/or modify it
2330
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
13 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
14 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
15 option) any later version.
2330
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
16
2993
91589ab98e37 [project @ 1997-05-21 21:44:54 by jwe]
jwe
parents: 2885
diff changeset
17 GNU Octave is distributed in the hope that it will be useful, but
91589ab98e37 [project @ 1997-05-21 21:44:54 by jwe]
jwe
parents: 2885
diff changeset
18 WITHOUT ANY WARRANTY; without even the implied warranty of
91589ab98e37 [project @ 1997-05-21 21:44:54 by jwe]
jwe
parents: 2885
diff changeset
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file
91589ab98e37 [project @ 1997-05-21 21:44:54 by jwe]
jwe
parents: 2885
diff changeset
20 COPYING for more details.
2330
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
21
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
22 Availability
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
23 ------------
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
24
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
25 The latest released version of Octave is always available via
8922
25b85c36208f update README
John W. Eaton <jwe@octave.org>
parents: 7088
diff changeset
26 anonymous ftp from ftp.gnu.org and its many mirror sites around the
25b85c36208f update README
John W. Eaton <jwe@octave.org>
parents: 7088
diff changeset
27 world. You may also find links to binary distributions at
25b85c36208f update README
John W. Eaton <jwe@octave.org>
parents: 7088
diff changeset
28 http://www.octave.org/download.html. The current development sources
11453
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
29 may be found on Savannah (http://savannah.gnu.org/projects/octave)
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
30 under the Source Code tab.
2330
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
31
11453
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
32 Installation
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
33 ------------
2330
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
34
11453
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
35 Octave requires approximately 1.4 GB of disk storage to unpack and
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
36 compile from source (significantly less, 400 MB, if you don't compile
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
37 with debugging symbols). Once installed, Octave requires
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
38 approximately 350MB of disk space (again, considerably less, 70 MB,
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
39 if you don't build shared libraries or the binaries and libraries do
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
40 not include debugging symbols).
2484
ccaffe93c32f [project @ 1996-11-07 23:24:46 by jwe]
jwe
parents: 2330
diff changeset
41
3148
8cdcb8945695 [project @ 1998-02-06 21:25:11 by jwe]
jwe
parents: 2993
diff changeset
42 To compile Octave, you will need a recent version of GNU Make. You
9031
1052a66078cf Documentation cleanup of top-level Octave directory (READMEs, INSTALL)
Rik <rdrider0-list@yahoo.com>
parents: 8922
diff changeset
43 will also need a recent version of g++ or another ANSI C++ compiler.
7088
5eb3db6e4042 [project @ 2007-10-31 20:35:10 by jwe]
jwe
parents: 7016
diff changeset
44 You will also need a Fortran 77 compiler or f2c. If you use f2c, you
5eb3db6e4042 [project @ 2007-10-31 20:35:10 by jwe]
jwe
parents: 7016
diff changeset
45 will need a script like fort77 that works like a normal Fortran
5eb3db6e4042 [project @ 2007-10-31 20:35:10 by jwe]
jwe
parents: 7016
diff changeset
46 compiler by combining f2c with your C compiler in a single script.
2330
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
47
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
48 YOU MUST HAVE GNU MAKE TO COMPILE OCTAVE. Octave's Makefiles use
2484
ccaffe93c32f [project @ 1996-11-07 23:24:46 by jwe]
jwe
parents: 2330
diff changeset
49 features of GNU Make that are not present in other versions of make.
2330
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
50 GNU Make is very portable and easy to install.
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
51
19192
9c28728a3041 * README: Mention INSTALL.OCTAVE instead of INSTALL.
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
52 See the notes in the files INSTALL.OCTAVE and the system-specific README
9c28728a3041 * README: Mention INSTALL.OCTAVE instead of INSTALL.
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
53 files in the etc directory of the Octave source distribution for more
9c28728a3041 * README: Mention INSTALL.OCTAVE instead of INSTALL.
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
54 specific installation instructions.
2330
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
55
11453
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
56 Bugs and Patches
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
57 ----------------
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
58
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
59 The file BUGS explains the recommended procedure for reporting bugs
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
60 or contributing patches.
2330
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
61
2580
fa7dd5fc7c59 [project @ 1996-12-10 06:30:41 by jwe]
jwe
parents: 2484
diff changeset
62 Documentation
fa7dd5fc7c59 [project @ 1996-12-10 06:30:41 by jwe]
jwe
parents: 2484
diff changeset
63 -------------
2330
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
64
11453
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
65 Octave's manual has been revised for version 3.4, but it is lagging a
2580
fa7dd5fc7c59 [project @ 1996-12-10 06:30:41 by jwe]
jwe
parents: 2484
diff changeset
66 bit behind the development of the software. In particular, there is
7088
5eb3db6e4042 [project @ 2007-10-31 20:35:10 by jwe]
jwe
parents: 7016
diff changeset
67 currently no complete documentation of the C++ class libraries. If
11453
780a8b80c3e8 README: Update WWW links and disk space requirements.
Rik <octave@nomad.inbox5.com>
parents: 9031
diff changeset
68 you notice omissions or inconsistencies, please report them on the
15497
c49d891eb263 Update broken or inconsistent project and wiki urls
Mike Miller <mtmiller@ieee.org>
parents: 14138
diff changeset
69 bug tracker at http://bugs.octave.org. Specific suggestions for ways
c49d891eb263 Update broken or inconsistent project and wiki urls
Mike Miller <mtmiller@ieee.org>
parents: 14138
diff changeset
70 to improve Octave and its documentation are always welcome. Reports
c49d891eb263 Update broken or inconsistent project and wiki urls
Mike Miller <mtmiller@ieee.org>
parents: 14138
diff changeset
71 with patches are even more welcome.
2330
12ff450cbb1f [project @ 1996-07-19 01:39:22 by jwe]
jwe
parents:
diff changeset
72
2582
c6385e7b5e8f [project @ 1996-12-10 07:41:44 by jwe]
jwe
parents: 2580
diff changeset
73 Additional Information
c6385e7b5e8f [project @ 1996-12-10 07:41:44 by jwe]
jwe
parents: 2580
diff changeset
74 ----------------------
c6385e7b5e8f [project @ 1996-12-10 07:41:44 by jwe]
jwe
parents: 2580
diff changeset
75
c6385e7b5e8f [project @ 1996-12-10 07:41:44 by jwe]
jwe
parents: 2580
diff changeset
76 Up to date information about Octave is available on the WWW at the
7088
5eb3db6e4042 [project @ 2007-10-31 20:35:10 by jwe]
jwe
parents: 7016
diff changeset
77 URL http://www.octave.org, including archives of the help, bug, and
5eb3db6e4042 [project @ 2007-10-31 20:35:10 by jwe]
jwe
parents: 7016
diff changeset
78 maintainers mailing lists.
2582
c6385e7b5e8f [project @ 1996-12-10 07:41:44 by jwe]
jwe
parents: 2580
diff changeset
79
7088
5eb3db6e4042 [project @ 2007-10-31 20:35:10 by jwe]
jwe
parents: 7016
diff changeset
80
12733
b67c2d580a25 maint: clean up top-level directory
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
81 Last updated: Fri, 10 Jun 2011 14:02:32 EDT