Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

real_parameter Class Reference

Class real_parameter holds a double value to be used as a parameter by the SuperMix program. More...

#include <real_parameter.h>

Inheritance diagram for real_parameter::

abstract_real_parameter List of all members.

Public Methods

 real_parameter (double v=0.0)
 Create a parameter with value v, no shadowing, no max or min. More...

 real_parameter (int v)
 Typecast an int to a parameter. More...

 real_parameter (const abstract_real_parameter *p)
 Create a shadowed parameter, no max or min. More...

bool is_shadow () const
 Function to query whether this parameter shadows another parameter or stores its value locally. More...

bool is_local () const
 Function to query whether this parameter shadows another parameter or stores its value locally. More...

double get () const
 Get the value of this parameter. More...

real_parameter& set (double v)
 Set the value of this parameter, checking max and min as necessary. More...

real_parameter& shadow (const abstract_real_parameter &p)
 Set this parameter to shadow another parameter. More...

real_parameter& set_min (double m)
 Set the minimum value for this parameter. More...

real_parameter& set_max (double m)
 Set the maximum value for this parameter. More...

real_parameter& no_min ()
 Turn of the min if desired. More...

real_parameter& no_max ()
 Turn of the max if desired. More...

double get_min () const
double get_max () const
real_parameter& operator= (const double v)
 Assign this object a specific value using set(). More...

real_parameter& operator= (const int v)
 Assign this object a specific value using set(). More...

real_parameter& clone (const real_parameter &p)
 Make this instance a clone of the argument. More...

real_parameter& operator= (const real_parameter &p)
 Make this instance a clone of the argument. More...

real_parameter& operator= (const abstract_real_parameter *p)
 Assign this instance to shadow another abstract_real_parameter. More...


Private Methods

double limit (double x) const
 Limit a value by any active limits. More...


Private Attributes

double value
 Keep the value here if we aren't shadowing another parameter instance. More...

const abstract_real_parametershadowed
 This points to the parameter instance we are shadowing. More...

bool get_flag
 We need a flag to avoid possible infinite self-referential loops of shadowed parameters. More...

bool use_min
 Boolean for whether or not a minimum value has been set. More...

double min
 Minimum value to be used by "get" and "set" if use_min == true. More...

bool use_max
 Boolean for whether or not a maximum value has been set. More...

double max
 Maximum value to be used by "get" and "set" if use_max == true. More...


Detailed Description

Class real_parameter holds a double value to be used as a parameter by the SuperMix program.

real_parameters can do upper and lower bounds checking. They can also "shadow" (or reference) other parameter instances.

This is the most commonly used type of parameter.

Definition at line 60 of file real_parameter.h.


Constructor & Destructor Documentation

real_parameter::real_parameter ( double v = 0.0 )
 

Create a parameter with value v, no shadowing, no max or min.

Also serves to cast a double into a real_parameter.

Parameters:
v   the initial value for this parameter

Definition at line 40 of file real_parameter.cc.

real_parameter::real_parameter ( int v )
 

Typecast an int to a parameter.

We need this to avoid confusion with casting int(0) to pointer.

Parameters:
v   the initial value for this parameter or value to typecast

Definition at line 48 of file real_parameter.cc.

real_parameter::real_parameter ( const abstract_real_parameter * p )
 

Create a shadowed parameter, no max or min.

Parameters:
p   the parameter to be shadowed

Definition at line 57 of file real_parameter.cc.


Member Function Documentation

real_parameter & real_parameter::clone ( const real_parameter & p )
 

Make this instance a clone of the argument.

If argument already directly shadows this instance, do nothing.

Parameters:
p   the parameter to be cloned

Definition at line 143 of file real_parameter.cc.

Referenced by operator=().

double real_parameter::get ( ) const [virtual]
 

Get the value of this parameter.

Returns:
the value of this parameter

Reimplemented from abstract_real_parameter.

Definition at line 70 of file real_parameter.cc.

Referenced by const_diel::epsilon(), operator *=(), operator+=(), operator-=(), operator/=(), surfimp::thickness(), r_waveguide::update(), and microstrip::update().

double real_parameter::get_max ( ) const [inline]
 

Returns:
the maximum bound, or 0.0 if bound limiting not active

Definition at line 157 of file real_parameter.h.

double real_parameter::get_min ( ) const [inline]
 

Returns:
the minimum bound, or 0.0 if bound limiting not active

Definition at line 154 of file real_parameter.h.

bool real_parameter::is_local ( ) const [inline]
 

Function to query whether this parameter shadows another parameter or stores its value locally.

Returns:
true if this instance stores its value locally

Definition at line 104 of file real_parameter.h.

Referenced by get(), set_max(), and set_min().

bool real_parameter::is_shadow ( ) const [inline]
 

Function to query whether this parameter shadows another parameter or stores its value locally.

Returns:
true if this instance shadows another parameter instance

Definition at line 96 of file real_parameter.h.

double real_parameter::limit ( double x ) const [inline, private]
 

Limit a value by any active limits.

Parameters:
x   a value to be limited
Returns:
x limited by any active limits

Definition at line 230 of file real_parameter.h.

Referenced by get(), and set().

real_parameter & real_parameter::no_max ( ) [inline]
 

Turn of the max if desired.

Definition at line 151 of file real_parameter.h.

real_parameter & real_parameter::no_min ( ) [inline]
 

Turn of the min if desired.

Definition at line 148 of file real_parameter.h.

real_parameter & real_parameter::operator= ( const abstract_real_parameter * p )
 

Assign this instance to shadow another abstract_real_parameter.

Parameters:
p   the parameter to be shadowed

Definition at line 133 of file real_parameter.cc.

real_parameter & real_parameter::operator= ( const real_parameter & p ) [inline]
 

Make this instance a clone of the argument.

If argument already directly shadows this instance, do nothing.

Parameters:
p   the parameter to be cloned

Definition at line 187 of file real_parameter.h.

real_parameter & real_parameter::operator= ( const int v ) [inline]
 

Assign this object a specific value using set().

Turns off any shadowing.

Parameters:
v   the new value for this parameter

Definition at line 171 of file real_parameter.h.

real_parameter & real_parameter::operator= ( const double v ) [inline]
 

Assign this object a specific value using set().

Turns off any shadowing.

Parameters:
v   the new value for this parameter

Definition at line 164 of file real_parameter.h.

real_parameter & real_parameter::set ( double v ) [inline]
 

Set the value of this parameter, checking max and min as necessary.

If value is outside of minimum or maximum bound, set to the bound. If this parameter used to be a shadow, it won't be any more.

Parameters:
v   the new value for this parameter

Definition at line 120 of file real_parameter.h.

Referenced by operator *=(), operator+=(), operator-=(), operator/=(), operator=(), and operator>>().

real_parameter & real_parameter::set_max ( double m )
 

Set the maximum value for this parameter.

If the parameter is already outside of the bounds, reset it to the bound.

Parameters:
m   the new maximum

Definition at line 119 of file real_parameter.cc.

Referenced by super_film::super_film().

real_parameter & real_parameter::set_min ( double m )
 

Set the minimum value for this parameter.

If the parameter is already outside of the bounds, reset it to the bound.

Parameters:
m   the new minimum

Definition at line 105 of file real_parameter.cc.

Referenced by capacitor::capacitor(), current_sink::current_sink(), generator::generator(), inductor::inductor(), mixer::mixer(), parallel_RLC::parallel_RLC(), resistor::resistor(), series_RLC::series_RLC(), super_film::super_film(), and voltage_source::voltage_source().

real_parameter & real_parameter::shadow ( const abstract_real_parameter & p )
 

Set this parameter to shadow another parameter.

Bounds checking, if active, will be conducted during get().

Parameters:
p   the parameter to be shadowed

Definition at line 93 of file real_parameter.cc.

Referenced by operator=().


Member Data Documentation

bool real_parameter::get_flag [mutable, private]
 

We need a flag to avoid possible infinite self-referential loops of shadowed parameters.

Definition at line 210 of file real_parameter.h.

double real_parameter::max [private]
 

Maximum value to be used by "get" and "set" if use_max == true.

Definition at line 222 of file real_parameter.h.

double real_parameter::min [private]
 

Minimum value to be used by "get" and "set" if use_min == true.

Definition at line 216 of file real_parameter.h.

const abstract_real_parameter * real_parameter::shadowed [private]
 

This points to the parameter instance we are shadowing.

If shadowed == 0, then we aren't using shadowing.

Definition at line 204 of file real_parameter.h.

bool real_parameter::use_max [private]
 

Boolean for whether or not a maximum value has been set.

Definition at line 219 of file real_parameter.h.

bool real_parameter::use_min [private]
 

Boolean for whether or not a minimum value has been set.

Definition at line 213 of file real_parameter.h.

double real_parameter::value [private]
 

Keep the value here if we aren't shadowing another parameter instance.

Definition at line 198 of file real_parameter.h.


The documentation for this class was generated from the following files:

Please direct comments and corrections to supermix@submm.caltech.edu
Go to the supermix home page
Generated by doxygen1.2.7