Xyce  6.1
N_ANP_NoiseData.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // Copyright Notice
3 //
4 // Copyright 2002 Sandia Corporation. Under the terms
5 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
6 // Government retains certain rights in this software.
7 //
8 // Xyce(TM) Parallel Electrical Simulator
9 // Copyright (C) 2002-2015 Sandia Corporation
10 //
11 // This program is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //-----------------------------------------------------------------------------
24 
25 //-----------------------------------------------------------------------------
26 // Filename : $RCSfile: N_ANP_NoiseData.h,v $
27 //
28 // Purpose :
29 //
30 // Special Notes :
31 //
32 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
33 //
34 // Creation Date : 12/21/2014
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.2 $
40 //
41 // Revision Date : $Date: 2015/04/08 19:18:20 $
42 //
43 // Current Owner : $Author: tvrusso $
44 //-----------------------------------------------------------------------------
45 
46 #ifndef Xyce_N_ANP_NoiseData_h
47 #define Xyce_N_ANP_NoiseData_h
48 
49 // ---------- Xyce Includes ----------
50 
51 // ---------- Forward Declarations -------
52 #include <iosfwd>
53 
54 namespace Xyce {
55 namespace Analysis {
56 
57 //-----------------------------------------------------------------------------
58 // Class : NoiseData
59 // Purpose :
60 // Special Notes :
61 // Creator : Eric Keiter
62 // Creation Date : 12/21/2014
63 //-----------------------------------------------------------------------------
64 class NoiseData
65 {
66 private:
67 protected:
68 public:
70  deviceName(""),
71  omega(0.0),
72  freq(0.0),
73  totalNoise(0.0),
74  totalOutputNoise(0.0),
75  totalInputNoise(0.0),
76  numSources(0)
77  {};
78 
79  virtual ~NoiseData ();
80 
81  void resize(int size);
82 
83 private:
84 protected:
85 public:
86  // device name
87  std::string deviceName;
88 
89  // noise source names
90  std::vector<std::string> noiseNames;
91 
92  double omega;
93  double freq;
94 
95  std::vector<double> inputNoiseTotal;
96  std::vector<double> outputNoiseTotal;
97 
98  std::vector<double> inputNoiseDens;
99  std::vector<double> outputNoiseDens;
100  std::vector<double> noiseDens;
101  std::vector<double> lnNoiseDens;
102  std::vector<double> lastLnNoiseDens;
103  std::vector<int> li_Pos;
104  std::vector<int> li_Neg;
105 
106  double totalNoise;
109 
111 };
112 
113 // inline functions
114 //-----------------------------------------------------------------------------
115 // Function : NoiseData::resize
116 // Purpose : resizes everything
117 // Creator : Eric R. Keiter
118 // Creation Date : 1/6/2014
119 //-----------------------------------------------------------------------------
120 inline void NoiseData::resize(int size)
121 {
122  noiseNames.clear();
123  inputNoiseDens.clear();
124  outputNoiseDens.clear();
125  noiseDens.clear();
126  lnNoiseDens.clear();
127  lastLnNoiseDens.clear();
128  li_Pos.clear();
129  li_Neg.clear();
130 
131  noiseNames.resize(size);
132 
133  inputNoiseTotal.resize(size,0.0);
134  outputNoiseTotal.resize(size,0.0);
135 
136  inputNoiseDens.resize(size,0.0);
137  outputNoiseDens.resize(size,0.0);
138  noiseDens.resize(size,0.0);
139  lnNoiseDens.resize(size,0.0);
140  lastLnNoiseDens.resize(size,0.0);
141 
142  li_Pos.resize(size);
143  li_Neg.resize(size);
144 }
145 
146 //-----------------------------------------------------------------------------
147 // Function : NoiseData::~NoiseData
148 // Purpose : destructor
149 // Creator : Eric R. Keiter
150 // Creation Date : 1/6/2014
151 //-----------------------------------------------------------------------------
153 {
154  noiseNames.clear();
155  inputNoiseTotal.clear();
156  outputNoiseTotal.clear();
157  inputNoiseDens.clear();
158  outputNoiseDens.clear();
159  noiseDens.clear();
160  lnNoiseDens.clear();
161  lastLnNoiseDens.clear();
162  li_Pos.clear();
163  li_Neg.clear();
164 }
165 
166 //-----------------------------------------------------------------------------
167 // Function : NoiseData::operator<<
168 // Purpose : "<<" operator
169 // Scope : public
170 // Creator : Eric R. Keiter
171 // Creation Date : 12/21/2014
172 //-----------------------------------------------------------------------------
173 inline std::ostream & operator<<(std::ostream & os, const NoiseData & nd)
174 {
175  os << Xyce::section_divider << std::endl;
176  os << "noise device name = " << nd.deviceName << "\n";
177 
178  os << Xyce::section_divider << std::endl;
179  os << std::endl;
180  return os;
181 }
182 
183 } // namespace Device
184 } // namespace Xyce
185 
186 #endif
std::vector< double > inputNoiseDens
Pure virtual class to augment a linear system.
std::vector< int > li_Neg
std::vector< int > li_Pos
Util::JSON & operator<<(Util::JSON &json, const StatCounts &s)
std::vector< double > lastLnNoiseDens
std::vector< double > outputNoiseDens
std::vector< double > noiseDens
std::vector< std::string > noiseNames
std::vector< double > lnNoiseDens
std::vector< double > outputNoiseTotal
std::vector< double > inputNoiseTotal