GNU Octave
4.4.1
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-2018 Jaroslav Hajek
4
5
This file is part of Octave.
6
7
Octave is free software: you can redistribute it and/or modify it
8
under the terms of the GNU General Public License as published by
9
the Free Software Foundation, either version 3 of the License, or
10
(at your option) any later version.
11
12
Octave is distributed in the hope that it will be useful, but
13
WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with Octave; see the file COPYING. If not, see
19
<https://www.gnu.org/licenses/>.
20
21
*/
22
23
#if ! defined (octave_ov_null_mat_h)
24
#define octave_ov_null_mat_h 1
25
26
#include "octave-config.h"
27
28
#include "
ov.h
"
29
#include "
ov-re-mat.h
"
30
#include "
ov-str-mat.h
"
31
32
// Design rationale:
33
// The constructors are hidden. There is only one null matrix (or null string)
34
// object, that can have shallow copies. Cloning the object returns just a
35
// normal empty matrix, so all the shallow copies are, in fact, read-only.
36
// This conveniently ensures that any attempt to fiddle with the null matrix
37
// destroys its special status.
38
39
// The special [] value.
40
41
class
42
OCTINTERP_API
43
octave_null_matrix
:
public
octave_matrix
44
{
45
octave_null_matrix
(
void
) :
octave_matrix
() { }
46
47
public
:
48
49
static
const
octave_value
instance
;
50
51
bool
isnull
(
void
)
const
{
return
true
; }
52
53
type_conv_info numeric_conversion_function (
void
)
const
;
54
55
private
:
56
57
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
58
};
59
60
// The special "" value
61
62
class
63
OCTINTERP_API
64
octave_null_str
:
public
octave_char_matrix_str
65
{
66
octave_null_str
(
void
) :
octave_char_matrix_str
() { }
67
68
public
:
69
70
static
const
octave_value
instance
;
71
72
bool
isnull
(
void
)
const
{
return
true
; }
73
74
type_conv_info numeric_conversion_function (
void
)
const
;
75
76
private
:
77
78
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
79
};
80
81
// The special '' value
82
83
class
84
OCTINTERP_API
85
octave_null_sq_str
:
public
octave_char_matrix_sq_str
86
{
87
octave_null_sq_str
(
void
) :
octave_char_matrix_sq_str
() { }
88
89
public
:
90
91
static
const
octave_value
instance
;
92
93
bool
isnull
(
void
)
const
{
return
true
; }
94
95
type_conv_info numeric_conversion_function (
void
)
const
;
96
97
private
:
98
99
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
100
};
101
102
#endif
octave_null_str::instance
static const octave_value instance
Definition:
ov-null-mat.h:70
octave_value
Definition:
ov.h:75
octave_null_sq_str
Definition:
ov-null-mat.h:83
ov-re-mat.h
octave_null_str::octave_null_str
octave_null_str(void)
Definition:
ov-null-mat.h:66
octave_null_sq_str::isnull
bool isnull(void) const
Definition:
ov-null-mat.h:93
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
Definition:
ov-base.h:158
octave_null_sq_str::instance
static const octave_value instance
Definition:
ov-null-mat.h:91
octave_null_sq_str::octave_null_sq_str
octave_null_sq_str(void)
Definition:
ov-null-mat.h:87
octave_null_matrix::instance
static const octave_value instance
Definition:
ov-null-mat.h:49
octave_null_str
Definition:
ov-null-mat.h:62
octave_matrix
Definition:
ov-re-mat.h:49
ov.h
octave_char_matrix_str
Definition:
ov-str-mat.h:49
octave_null_str::isnull
bool isnull(void) const
Definition:
ov-null-mat.h:72
octave_null_matrix
Definition:
ov-null-mat.h:41
octave_char_matrix_sq_str
Definition:
ov-str-mat.h:182
ov-str-mat.h
octave_null_matrix::isnull
bool isnull(void) const
Definition:
ov-null-mat.h:51
octave_null_matrix::octave_null_matrix
octave_null_matrix(void)
Definition:
ov-null-mat.h:45
libinterp
octave-value
ov-null-mat.h
Generated on Sat Sep 1 2018 14:01:41 for GNU Octave by
1.8.14