annotate libinterp/octave-value/ov-cs-list.h @ 31246:43a6be589387

doc: New documentation for memoization techniques (bug #60860) vectorize.texi: New section on memoization octave.texi: List new section
author Arun Giridhar <arungiridhar@gmail.com>
date Thu, 29 Sep 2022 20:31:52 -0400
parents 796f54d4ddbf
children 597f3ee61a48
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 30077
diff changeset
3 // Copyright (C) 2002-2022 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
25
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 19697
diff changeset
26 #if ! defined (octave_ov_cs_list_h)
17822
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17744
diff changeset
27 #define octave_ov_cs_list_h 1
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
28
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20940
diff changeset
29 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20940
diff changeset
30
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
31 #include <cstdlib>
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
32
8950
d865363208d6 include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
33 #include <iosfwd>
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
34 #include <string>
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
35
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
36 #include "mx-base.h"
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
37 #include "str-vec.h"
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
38
4591
2c9de1be042a [project @ 2003-11-11 00:23:35 by jwe]
jwe
parents: 4563
diff changeset
39 #include "Cell.h"
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
40 #include "error.h"
20940
48b2ad5ee801 maint: Rename oct-obj.[cc|h] to ovl.[cc|h] for clarity.
Rik <rik@octave.org>
parents: 20791
diff changeset
41 #include "ovl.h"
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
42 #include "ov-typeinfo.h"
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
43
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
44 // Lists.
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
45
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
46 class
4591
2c9de1be042a [project @ 2003-11-11 00:23:35 by jwe]
jwe
parents: 4563
diff changeset
47 octave_cs_list : public octave_base_value
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
48 {
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
49 public:
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
50
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
51 octave_cs_list (void)
30077
b16e0d357437 maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
52 : octave_base_value (), m_list () { }
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
53
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
54 octave_cs_list (const octave_value_list& l)
30077
b16e0d357437 maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
55 : octave_base_value (), m_list (l) { }
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
56
4591
2c9de1be042a [project @ 2003-11-11 00:23:35 by jwe]
jwe
parents: 4563
diff changeset
57 octave_cs_list (const Cell& c);
4513
508238e65af7 [project @ 2003-09-19 21:40:57 by jwe]
jwe
parents: 4499
diff changeset
58
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
59 octave_cs_list (const octave_cs_list& l)
30077
b16e0d357437 maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
60 : octave_base_value (), m_list (l.m_list) { }
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
61
22868
87e3163f6c87 use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
62 ~octave_cs_list (void) = default;
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
63
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23220
diff changeset
64 octave_base_value * clone (void) const { return new octave_cs_list (*this); }
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23220
diff changeset
65 octave_base_value * empty_clone (void) const { return new octave_cs_list (); }
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
66
30077
b16e0d357437 maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
67 dim_vector dims (void) const { return dim_vector (1, m_list.length ()); }
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
68
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
69 bool is_defined (void) const { return true; }
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
70
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
71 bool is_constant (void) const { return true; }
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
72
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
73 bool is_cs_list (void) const { return true; }
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
74
30077
b16e0d357437 maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
75 octave_value_list list_value (void) const { return m_list; }
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
76
26916
9cd4b045fe3d avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
77 // We don't need to override all three forms of subsref. The using
9cd4b045fe3d avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
78 // declaration will avoid warnings about partially-overloaded virtual
9cd4b045fe3d avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
79 // functions.
9cd4b045fe3d avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
80 using octave_base_value::subsref;
9cd4b045fe3d avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
81
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
82 OCTINTERP_API octave_value
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
83 subsref (const std::string& type, const std::list<octave_value_list>& idx);
10579
fd6899b1b00e use common error message for indexed cs-lists
Jaroslav Hajek <highegg@gmail.com>
parents: 10232
diff changeset
84
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
85 OCTINTERP_API octave_value_list
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
86 subsref (const std::string& type, const std::list<octave_value_list>& idx,
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
87 int);
10579
fd6899b1b00e use common error message for indexed cs-lists
Jaroslav Hajek <highegg@gmail.com>
parents: 10232
diff changeset
88
4591
2c9de1be042a [project @ 2003-11-11 00:23:35 by jwe]
jwe
parents: 4563
diff changeset
89 private:
4499
55695bf73797 [project @ 2003-09-05 19:56:37 by jwe]
jwe
parents: 4247
diff changeset
90
4591
2c9de1be042a [project @ 2003-11-11 00:23:35 by jwe]
jwe
parents: 4563
diff changeset
91 // The list of Octave values.
30077
b16e0d357437 maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
92 octave_value_list m_list;
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
93
4612
d44675070f1a [project @ 2003-11-14 19:49:56 by jwe]
jwe
parents: 4604
diff changeset
94 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
3978
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
95 };
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
96
10bc4c350d61 [project @ 2002-07-05 17:55:11 by jwe]
jwe
parents:
diff changeset
97 #endif