GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
oct-spparms.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2004-2017 David Bateman
4 Copyright (C) 1998-2004 Andy Adler
5 
6 This file is part of Octave.
7 
8 Octave is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if ! defined (octave_oct_spparms_h)
25 #define octave_oct_spparms_h 1
26 
27 #include "octave-config.h"
28 
29 #include <cassert>
30 #include <cstddef>
31 
32 #include <iosfwd>
33 
34 #include "str-vec.h"
35 #include "dColVector.h"
36 #include "dNDArray.h"
37 
38 #define OCTAVE_SPARSE_CONTROLS_SIZE 13
39 
40 class
41 OCTAVE_API
43 {
44 protected:
45 
47  : params (OCTAVE_SPARSE_CONTROLS_SIZE),
49  {
50  init_keys ();
51  do_defaults ();
52  }
53 
54 public:
55 
57  : params (a.params), keys (a.keys) { }
58 
60  {
61  if (&a != this)
62  {
63  params = a.params;
64  keys = a.keys;
65  }
66 
67  return *this;
68  }
69 
71 
72  static bool instance_ok (void);
73 
74  static void defaults (void);
75 
76  static void tight (void);
77 
78  static string_vector get_keys (void);
79 
80  static ColumnVector get_vals (void);
81 
82  static bool set_vals (const NDArray& vals);
83 
84  static bool set_key (const std::string& key, const double& val);
85 
86  static double get_key (const std::string& key);
87 
88  static double get_bandden (void);
89 
90  static void print_info (std::ostream& os, const std::string& prefix);
91 
92 private:
93 
95 
97 
99 
100  static void cleanup_instance (void) { delete instance; instance = 0; }
101 
102  void do_defaults (void);
103 
104  void do_tight (void);
105 
106  string_vector do_get_keys (void) const { return keys; }
107 
108  ColumnVector do_get_vals (void) const { return params; }
109 
110  bool do_set_vals (const NDArray& vals);
111 
112  bool do_set_key (const std::string& key, const double& val);
113 
114  double do_get_key (const std::string& key);
115 
116  double do_get_bandden (void);
117 
118  void do_print_info (std::ostream& os, const std::string& prefix) const;
119 
120  void init_keys (void);
121 };
122 
123 #endif
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:5068
#define OCTAVE_SPARSE_CONTROLS_SIZE
Definition: oct-spparms.h:38
static octave_sparse_params * instance
Definition: oct-spparms.h:98
ColumnVector do_get_vals(void) const
Definition: oct-spparms.h:108
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:398
ColumnVector params
Definition: oct-spparms.h:94
string_vector keys
Definition: oct-spparms.h:96
octave_sparse_params(const octave_sparse_params &a)
Definition: oct-spparms.h:56
static void cleanup_instance(void)
Definition: oct-spparms.h:100
string_vector do_get_keys(void) const
Definition: oct-spparms.h:106
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:854