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 |
|
17 along with this program; see the file COPYING. If not, write to the Free |
|
18 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
19 |
|
20 */ |
|
21 |
|
22 #if !defined (octave_oct_spparms_h) |
|
23 #define octave_oct_spparms_h 1 |
|
24 |
|
25 #include <cassert> |
|
26 #include <cstddef> |
|
27 |
|
28 #include <iostream> |
|
29 |
|
30 #include "str-vec.h" |
|
31 #include "dColVector.h" |
|
32 |
|
33 #define OCTAVE_SPARSE_CONTROLS_SIZE 12 |
|
34 |
|
35 class |
|
36 SparseParams |
|
37 { |
|
38 public: |
|
39 SparseParams (void) : params (ColumnVector (OCTAVE_SPARSE_CONTROLS_SIZE)), |
|
40 keys (string_vector (OCTAVE_SPARSE_CONTROLS_SIZE)) |
|
41 { defaults (); init_keys (); } |
|
42 |
|
43 void defaults (void); |
|
44 |
|
45 void tight (void); |
|
46 |
|
47 SparseParams& operator = (const SparseParams& a); |
|
48 |
|
49 double& operator () (int n) { return params (n); } |
|
50 double operator () (int n) const { return params (n); } |
|
51 |
|
52 string_vector get_keys (void) const { return keys; } |
|
53 |
|
54 ColumnVector get_vals (void) const { return params; } |
|
55 |
|
56 bool set_key (const std::string key, const double& val); |
|
57 |
|
58 double get_key (const std::string key); |
|
59 |
|
60 void print_info (std::ostream& os, const std::string& prefix) const; |
|
61 |
|
62 private: |
|
63 void init_keys (void); |
|
64 |
|
65 ColumnVector params; |
|
66 |
|
67 string_vector keys; |
|
68 }; |
|
69 |
|
70 extern SparseParams Voctave_sparse_controls; |
|
71 |
|
72 #endif |
|
73 |
|
74 /* |
|
75 ;;; Local Variables: *** |
|
76 ;;; mode: C++ *** |
|
77 ;;; End: *** |
|
78 */ |