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
44
class
OCTINTERP_API
octave_null_matrix
:
public
octave_matrix
45
{
46
octave_null_matrix
() :
octave_matrix
() { }
47
48
public
:
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
57
private
:
58
59
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA_API
(OCTINTERP_API)
60
};
61
62
// The special "" value
63
64
class
OCTINTERP_API
octave_null_str
:
public
octave_char_matrix_str
65
{
66
octave_null_str
() :
octave_char_matrix_str
() { }
67
68
public
:
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
79
private
:
80
81
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA_API
(OCTINTERP_API)
82
};
83
84
// The special '' value
85
86
class
OCTINTERP_API
octave_null_sq_str
:
public
octave_char_matrix_sq_str
87
{
88
octave_null_sq_str
() :
octave_char_matrix_sq_str
() { }
89
90
public
:
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
102
private
:
103
104
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA_API
(OCTINTERP_API)
105
};
106
107
#endif
octave_base_value::numeric_conversion_function
virtual type_conv_info numeric_conversion_function() const
Definition
ov-base.h:303
octave_char_matrix_sq_str
Definition
ov-str-mat.h:188
octave_char_matrix_str
Definition
ov-str-mat.h:52
octave_matrix
Definition
ov-re-mat.h:54
octave_matrix::octave_matrix
octave_matrix()
Definition
ov-re-mat.h:57
octave_null_matrix
Definition
ov-null-mat.h:45
octave_null_matrix::isnull
bool isnull() const
Definition
ov-null-mat.h:52
octave_null_matrix::vm_need_storable_call
bool vm_need_storable_call() const
Definition
ov-null-mat.h:53
octave_null_matrix::instance
static const octave_value instance
Definition
ov-null-mat.h:50
octave_null_sq_str
Definition
ov-null-mat.h:87
octave_null_sq_str::instance
static const octave_value instance
Definition
ov-null-mat.h:92
octave_null_sq_str::isnull
bool isnull() const
Definition
ov-null-mat.h:96
octave_null_sq_str::is_storable
bool is_storable() const
Definition
ov-null-mat.h:94
octave_null_sq_str::vm_need_storable_call
bool vm_need_storable_call() const
Definition
ov-null-mat.h:98
octave_null_str
Definition
ov-null-mat.h:65
octave_null_str::vm_need_storable_call
bool vm_need_storable_call() const
Definition
ov-null-mat.h:75
octave_null_str::isnull
bool isnull() const
Definition
ov-null-mat.h:74
octave_null_str::is_storable
bool is_storable() const
Definition
ov-null-mat.h:72
octave_null_str::instance
static const octave_value instance
Definition
ov-null-mat.h:70
octave_value
Definition
ov.h:75
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA_API
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA_API(API)
Definition
ov-base.h:185
ov-re-mat.h
ov-str-mat.h
ov.h
libinterp
octave-value
ov-null-mat.h
Generated on Sat Aug 2 2025 06:52:12 for GNU Octave by
1.9.8