annotate libinterp/corefcn/oct-errno.h @ 31234:a1318deb4584

sparse-xpow.cc: Improve consistency between sparse and full matrices (bug #63080) sparse-xpow.cc: Return 0x0 matrix for empty inputs of all sizes. Return early for all-zeros matrix with positive power. Add FIXME for all-zeros matrix with negative power. Add BISTs.
author Arun Giridhar <arungiridhar@gmail.com>
date Tue, 20 Sep 2022 09:00:02 -0400
parents 796f54d4ddbf
children 597f3ee61a48
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 30151
diff changeset
3 // Copyright (C) 2005-2022 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
5465
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
25
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 19697
diff changeset
26 #if ! defined (octave_oct_errno_h)
17822
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17744
diff changeset
27 #define octave_oct_errno_h 1
5465
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
28
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
29 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
30
8020
1d2bcc163c4d oct-errno.h: include <cerrno>
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
31 #include <cerrno>
5465
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
32 #include <map>
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
33 #include <string>
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
34
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
35 #include "oct-map.h"
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
36
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
37 class
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
38 octave_errno
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
39 {
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
40 protected:
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
41
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
42 octave_errno (void);
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
43
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
44 public:
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
45
22868
87e3163f6c87 use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
46 ~octave_errno (void) = default;
5465
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
47
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
48 static bool instance_ok (void);
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
49
30151
b7727b8533d8 maint: use "m_" prefix for member variables in class octave_errno.
Rik <rik@octave.org>
parents: 29358
diff changeset
50 static void cleanup_instance (void)
b7727b8533d8 maint: use "m_" prefix for member variables in class octave_errno.
Rik <rik@octave.org>
parents: 29358
diff changeset
51 { delete s_instance; s_instance = nullptr; }
13992
e1f76bfe0452 apply singleton_cleanup to a few more classes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
52
5465
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
53 static int lookup (const std::string& name);
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
54
11057
4d9f310b32bb replace Octave_map->octave_map in oct-errno
Jaroslav Hajek <highegg@gmail.com>
parents: 10160
diff changeset
55 static octave_scalar_map list (void);
5465
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
56
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
57 static int get (void) { return errno; }
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
58
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
59 static int set (int val)
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
60 {
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
61 int retval = errno;
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
62 errno = val;
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
63 return retval;
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
64 }
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
65
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
66 private:
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
67
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
68 int do_lookup (const std::string& name);
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
69
11057
4d9f310b32bb replace Octave_map->octave_map in oct-errno
Jaroslav Hajek <highegg@gmail.com>
parents: 10160
diff changeset
70 octave_scalar_map do_list (void);
30151
b7727b8533d8 maint: use "m_" prefix for member variables in class octave_errno.
Rik <rik@octave.org>
parents: 29358
diff changeset
71
b7727b8533d8 maint: use "m_" prefix for member variables in class octave_errno.
Rik <rik@octave.org>
parents: 29358
diff changeset
72 //--------
b7727b8533d8 maint: use "m_" prefix for member variables in class octave_errno.
Rik <rik@octave.org>
parents: 29358
diff changeset
73
b7727b8533d8 maint: use "m_" prefix for member variables in class octave_errno.
Rik <rik@octave.org>
parents: 29358
diff changeset
74 std::map<std::string, int> m_errno_tbl;
b7727b8533d8 maint: use "m_" prefix for member variables in class octave_errno.
Rik <rik@octave.org>
parents: 29358
diff changeset
75
b7727b8533d8 maint: use "m_" prefix for member variables in class octave_errno.
Rik <rik@octave.org>
parents: 29358
diff changeset
76 static octave_errno *s_instance;
b7727b8533d8 maint: use "m_" prefix for member variables in class octave_errno.
Rik <rik@octave.org>
parents: 29358
diff changeset
77
5465
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
78 };
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
79
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
80 #endif