annotate src/ov-null-mat.h @ 14138:72c96de7a403 stable

maint: update copyright notices for 2012
author John W. Eaton <jwe@octave.org>
date Mon, 02 Jan 2012 14:25:41 -0500
parents 12df7854fa7c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8150
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
1 /*
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
2
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
3 Copyright (C) 2008-2012 Jaroslav Hajek
8150
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
4
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
5 This file is part of Octave.
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
6
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
10 option) any later version.
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
11
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
15 for more details.
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
16
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, see
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
19 <http://www.gnu.org/licenses/>.
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
20
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
21 */
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
22
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
23 #if !defined (octave_null_matrix_h)
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
24 #define octave_null_matrix_h 1
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
25
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
26 #include "ov.h"
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
27 #include "ov-re-mat.h"
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
28 #include "ov-str-mat.h"
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
29
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
30 // Design rationale:
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
31 // The constructors are hidden. There is only one null matrix (or null string) object,
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
32 // that can have shallow copies. Cloning the object returns just a normal empty matrix,
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
33 // so all the shallow copies are, in fact, read-only. This conveniently ensures that any
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
34 // attempt to fiddle with the null matrix destroys its special status.
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
35
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
36 // The special [] value.
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
37
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
38 class
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
39 OCTINTERP_API
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
40 octave_null_matrix : public octave_matrix
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
41 {
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
42 octave_null_matrix (void) : octave_matrix () { }
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
43
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
44 public:
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
45
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
46 static const octave_value instance;
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
47
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
48 bool is_null_value (void) const { return true; }
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
49
8345
c777f3ce02d8 smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents: 8150
diff changeset
50 type_conv_info numeric_conversion_function (void) const;
8150
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
51
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
52 private:
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
53
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
54 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
55 };
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
56
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
57 // The special "" value
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
58
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
59 class
8150
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
60 OCTINTERP_API
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
61 octave_null_str : public octave_char_matrix_str
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
62 {
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
63 octave_null_str (void) : octave_char_matrix_str () { }
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
64
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
65 public:
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
66
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
67 static const octave_value instance;
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
68
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
69 bool is_null_value (void) const { return true; }
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
70
8345
c777f3ce02d8 smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents: 8150
diff changeset
71 type_conv_info numeric_conversion_function (void) const;
8150
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
72
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
73
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
74 private:
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
75
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
76 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
77 };
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
78
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
79 // The special '' value
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
80
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
81 class
8150
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
82 OCTINTERP_API
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
83 octave_null_sq_str : public octave_char_matrix_sq_str
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
84 {
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
85 octave_null_sq_str (void) : octave_char_matrix_sq_str () { }
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
86
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
87 public:
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
88
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
89 static const octave_value instance;
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
90
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
91 bool is_null_value (void) const { return true; }
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
92
8345
c777f3ce02d8 smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents: 8150
diff changeset
93 type_conv_info numeric_conversion_function (void) const;
8150
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
94
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
95 private:
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
96
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
97 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
98 };
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
99
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
100 #endif