GNU Octave
6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ov-null-mat.h
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright (C) 2008-2021 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
45
OCTINTERP_API
46
octave_null_matrix
:
public
octave_matrix
47
{
48
octave_null_matrix
(
void
) :
octave_matrix
() { }
49
50
public
:
51
52
static
const
octave_value
instance
;
53
54
bool
isnull
(
void
)
const
{
return
true
; }
55
56
type_conv_info numeric_conversion_function (
void
)
const
;
57
58
private
:
59
60
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
61
};
62
63
// The special "" value
64
65
class
66
OCTINTERP_API
67
octave_null_str
:
public
octave_char_matrix_str
68
{
69
octave_null_str
(
void
) :
octave_char_matrix_str
() { }
70
71
public
:
72
73
static
const
octave_value
instance
;
74
75
bool
isnull
(
void
)
const
{
return
true
; }
76
77
type_conv_info numeric_conversion_function (
void
)
const
;
78
79
private
:
80
81
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
82
};
83
84
// The special '' value
85
86
class
87
OCTINTERP_API
88
octave_null_sq_str
:
public
octave_char_matrix_sq_str
89
{
90
octave_null_sq_str
(
void
) :
octave_char_matrix_sq_str
() { }
91
92
public
:
93
94
static
const
octave_value
instance
;
95
96
bool
isnull
(
void
)
const
{
return
true
; }
97
98
type_conv_info numeric_conversion_function (
void
)
const
;
99
100
private
:
101
102
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
103
};
104
105
#endif
octave_char_matrix_sq_str
Definition:
ov-str-mat.h:191
octave_char_matrix_str
Definition:
ov-str-mat.h:54
octave_matrix
Definition:
ov-re-mat.h:54
octave_null_matrix
Definition:
ov-null-mat.h:47
octave_null_matrix::instance
static const octave_value instance
Definition:
ov-null-mat.h:52
octave_null_matrix::isnull
bool isnull(void) const
Definition:
ov-null-mat.h:54
octave_null_matrix::octave_null_matrix
octave_null_matrix(void)
Definition:
ov-null-mat.h:48
octave_null_sq_str
Definition:
ov-null-mat.h:89
octave_null_sq_str::octave_null_sq_str
octave_null_sq_str(void)
Definition:
ov-null-mat.h:90
octave_null_sq_str::instance
static const octave_value instance
Definition:
ov-null-mat.h:94
octave_null_sq_str::isnull
bool isnull(void) const
Definition:
ov-null-mat.h:96
octave_null_str
Definition:
ov-null-mat.h:68
octave_null_str::isnull
bool isnull(void) const
Definition:
ov-null-mat.h:75
octave_null_str::instance
static const octave_value instance
Definition:
ov-null-mat.h:73
octave_null_str::octave_null_str
octave_null_str(void)
Definition:
ov-null-mat.h:69
octave_value
Definition:
ov.h:79
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
Definition:
ov-base.h:158
ov-re-mat.h
ov-str-mat.h
ov.h
libinterp
octave-value
ov-null-mat.h
Generated on Tue Apr 13 2021 15:27:47 for GNU Octave by
1.9.1