GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
ov-null-mat.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2008-2025 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if ! defined (octave_ov_null_mat_h)
27#define octave_ov_null_mat_h 1
28
29#include "octave-config.h"
30
31#include "ov.h"
32#include "ov-re-mat.h"
33#include "ov-str-mat.h"
34
35// Design rationale:
36// The constructors are hidden. There is only one null matrix (or null string)
37// object, that can have shallow copies. Cloning the object returns just a
38// normal empty matrix, so all the shallow copies are, in fact, read-only.
39// This conveniently ensures that any attempt to fiddle with the null matrix
40// destroys its special status.
41
42// The special [] value.
43
44class OCTINTERP_API octave_null_matrix : public octave_matrix
45{
47
48public:
49
50 static const octave_value instance;
51
52 bool isnull () const { return true; }
53 bool vm_need_storable_call () const { return true; }
54
55 type_conv_info numeric_conversion_function () const;
56
57private:
58
60};
61
62// The special "" value
63
64class OCTINTERP_API octave_null_str : public octave_char_matrix_str
65{
67
68public:
69
70 static const octave_value instance;
71
72 bool is_storable () const { return false; }
73
74 bool isnull () const { return true; }
75 bool vm_need_storable_call () const { return true; }
76
77 type_conv_info numeric_conversion_function () const;
78
79private:
80
82};
83
84// The special '' value
85
87{
89
90public:
91
92 static const octave_value instance;
93
94 bool is_storable () const { return false; }
95
96 bool isnull () const { return true; }
97
98 bool vm_need_storable_call () const { return true; }
99
100 type_conv_info numeric_conversion_function () const;
101
102private:
103
105};
106
107#endif
virtual type_conv_info numeric_conversion_function() const
Definition ov-base.h:303
bool isnull() const
Definition ov-null-mat.h:52
bool vm_need_storable_call() const
Definition ov-null-mat.h:53
static const octave_value instance
Definition ov-null-mat.h:50
static const octave_value instance
Definition ov-null-mat.h:92
bool isnull() const
Definition ov-null-mat.h:96
bool is_storable() const
Definition ov-null-mat.h:94
bool vm_need_storable_call() const
Definition ov-null-mat.h:98
bool vm_need_storable_call() const
Definition ov-null-mat.h:75
bool isnull() const
Definition ov-null-mat.h:74
bool is_storable() const
Definition ov-null-mat.h:72
static const octave_value instance
Definition ov-null-mat.h:70
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA_API(API)
Definition ov-base.h:185