5164
|
1 /* |
|
2 |
|
3 Copyright (C) 2004 David Bateman |
|
4 Copyright (C) 1998-2004 Andy Adler |
|
5 |
|
6 Octave is free software; you can redistribute it and/or modify it |
|
7 under the terms of the GNU General Public License as published by the |
|
8 Free Software Foundation; either version 2, or (at your option) any |
|
9 later version. |
|
10 |
|
11 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 for more details. |
|
15 |
|
16 You should have received a copy of the GNU General Public License |
5307
|
17 along with this program; see the file COPYING. If not, write to the |
|
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
19 Boston, MA 02110-1301, USA. |
5164
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_oct_spparms_h) |
|
24 #define octave_oct_spparms_h 1 |
|
25 |
|
26 #include <cassert> |
|
27 #include <cstddef> |
|
28 |
|
29 #include <iostream> |
|
30 |
|
31 #include "str-vec.h" |
|
32 #include "dColVector.h" |
|
33 |
|
34 #define OCTAVE_SPARSE_CONTROLS_SIZE 12 |
|
35 |
|
36 class |
|
37 SparseParams |
|
38 { |
|
39 public: |
|
40 SparseParams (void) : params (ColumnVector (OCTAVE_SPARSE_CONTROLS_SIZE)), |
|
41 keys (string_vector (OCTAVE_SPARSE_CONTROLS_SIZE)) |
|
42 { defaults (); init_keys (); } |
|
43 |
|
44 void defaults (void); |
|
45 |
|
46 void tight (void); |
|
47 |
|
48 SparseParams& operator = (const SparseParams& a); |
|
49 |
|
50 double& operator () (int n) { return params (n); } |
|
51 double operator () (int n) const { return params (n); } |
|
52 |
|
53 string_vector get_keys (void) const { return keys; } |
|
54 |
|
55 ColumnVector get_vals (void) const { return params; } |
|
56 |
|
57 bool set_key (const std::string key, const double& val); |
|
58 |
|
59 double get_key (const std::string key); |
|
60 |
|
61 void print_info (std::ostream& os, const std::string& prefix) const; |
|
62 |
|
63 private: |
|
64 void init_keys (void); |
|
65 |
|
66 ColumnVector params; |
|
67 |
|
68 string_vector keys; |
|
69 }; |
|
70 |
|
71 extern SparseParams Voctave_sparse_controls; |
|
72 |
|
73 #endif |
|
74 |
|
75 /* |
|
76 ;;; Local Variables: *** |
|
77 ;;; mode: C++ *** |
|
78 ;;; End: *** |
|
79 */ |