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

complex_parameter Class Reference

Class complex_parameter holds a complex value to be used as a parameter by the SuperMix program. More...

#include <complex_parameter.h>

Inheritance diagram for complex_parameter::

abstract_complex_parameter List of all members.

Public Types

enum  { CARTESIAN = 1, POLAR = 2 }

Public Methods

 complex_parameter (Complex v=Complex(0.0))
 Create a parameter with value v, no shadowing. More...

 complex_parameter (int v)
 Typecast an int to a complex_parameter. More...

 complex_parameter (double v)
 Typecast a double to a complex_parameter. More...

 complex_parameter (const abstract_complex_parameter *p)
 Create a shadowed parameter. More...

 complex_parameter (const abstract_real_parameter *p)
 Create a shadowed parameter. More...

 complex_parameter (const abstract_real_parameter &p1, const abstract_real_parameter &p2, int imode=CARTESIAN)
 Create a complex_parameter which will shadow two real_parameters. More...

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

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

bool is_cartesian () const
 Returns false if not shadowing two real_parameters. More...

bool is_polar () const
 Returns false if not shadowing two real_parameters. More...

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

complex_parameter& set (Complex v)
 Set the value of this parameter. More...

complex_parameter& clone (const complex_parameter &p)
 Make this instance a clone of the argument (as default oper= would). More...

complex_parameter& shadow (const abstract_complex_parameter &p)
 Set this parameter to shadow another parameter. More...

complex_parameter& shadow (const abstract_real_parameter &p)
 Shadow a single real_parameter. More...

complex_parameter& shadow (const abstract_real_parameter &p1, const abstract_real_parameter &p2, int imode=CARTESIAN)
 Shadow two real_parameters. More...

complex_parameter& operator= (Complex v)
 Assign this object a specific value using set(). More...

complex_parameter& operator= (double v)
 Assign this object a specific value using set(). More...

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

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

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

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


Private Types

enum  { VALUE = 0, C_SHADOW = 3, R_SHADOW = 4 }

Private Attributes

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

int mode
 This tells the mode. More...

const abstract_real_parameterrp2
 A pointer to a parameter instance we may be shadowing. More...

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


Detailed Description

Class complex_parameter holds a complex value to be used as a parameter by the SuperMix program.

Definition at line 61 of file complex_parameter.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
CARTESIAN  
POLAR  

Definition at line 106 of file complex_parameter.h.

anonymous enum [private]
 

Enumeration values:
VALUE  
C_SHADOW  
R_SHADOW  

Definition at line 244 of file complex_parameter.h.


Constructor & Destructor Documentation

complex_parameter::complex_parameter ( Complex v = Complex(0.0) )
 

Create a parameter with value v, no shadowing.

Also serves to cast a complex into a complex_parameter.

Parameters:
v   the initial value for this parameter, defaults to 0

Definition at line 43 of file complex_parameter.cc.

complex_parameter::complex_parameter ( int v )
 

Typecast an int to a complex_parameter.

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

Parameters:
v   the initial value for this parameter

Definition at line 51 of file complex_parameter.cc.

complex_parameter::complex_parameter ( double v )
 

Typecast a double to a complex_parameter.

We need this to avoid casting a double argument to int.

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

Definition at line 59 of file complex_parameter.cc.

complex_parameter::complex_parameter ( const abstract_complex_parameter * p )
 

Create a shadowed parameter.

Parameters:
p   the parameter to be shadowed

Definition at line 67 of file complex_parameter.cc.

complex_parameter::complex_parameter ( const abstract_real_parameter * p )
 

Create a shadowed parameter.

Resulting values will be real.

Parameters:
p   the parameter to be shadowed

Definition at line 81 of file complex_parameter.cc.

complex_parameter::complex_parameter ( const abstract_real_parameter & p1,
const abstract_real_parameter & p2,
int imode = CARTESIAN )
 

Create a complex_parameter which will shadow two real_parameters.

Parameters:
p1   real part (CARTESIAN) or magnitude (POLAR)
p2   imag part (CARTESIAN) or radians (POLAR)
imode   mode to use to interpret p1 and p2

Definition at line 95 of file complex_parameter.cc.


Member Function Documentation

complex_parameter & complex_parameter::clone ( const complex_parameter & p )
 

Make this instance a clone of the argument (as default oper= would).

Parameters:
p   the parameter to be cloned

Definition at line 202 of file complex_parameter.cc.

Referenced by operator=().

Complex complex_parameter::get ( ) const [virtual]
 

Get the value of this parameter.

Returns:
the value of this parameter

Reimplemented from abstract_complex_parameter.

Definition at line 114 of file complex_parameter.cc.

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

bool complex_parameter::is_cartesian ( ) const [inline]
 

Returns false if not shadowing two real_parameters.

Returns:
true if mode is CARTESIAN

Definition at line 140 of file complex_parameter.h.

bool complex_parameter::is_local ( ) const [inline]
 

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

Returns:
true if this instance stores its value locally

Definition at line 271 of file complex_parameter.h.

bool complex_parameter::is_polar ( ) const [inline]
 

Returns false if not shadowing two real_parameters.

Returns:
true if mode is POLAR

Definition at line 147 of file complex_parameter.h.

bool complex_parameter::is_shadow ( ) const [inline]
 

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

Returns:
true if this instance shadows another parameter or parameters

Definition at line 268 of file complex_parameter.h.

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

Assign this instance to shadow an abstract_real_parameter.

Parameters:
p   the parameter to be shadowed

Definition at line 192 of file complex_parameter.cc.

complex_parameter & complex_parameter::operator= ( const abstract_complex_parameter * p )
 

Assign this instance to shadow another abstract_complex_parameter.

Parameters:
p   the parameter to be shadowed

Definition at line 182 of file complex_parameter.cc.

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

Make this instance a clone of the argument.

Parameters:
p   the parameter to be cloned

Definition at line 222 of file complex_parameter.h.

complex_parameter & complex_parameter::operator= ( int v ) [inline]
 

Assign this object a specific value using set().

Parameters:
v   the new value for this parameter

Definition at line 215 of file complex_parameter.h.

complex_parameter & complex_parameter::operator= ( double v ) [inline]
 

Assign this object a specific value using set().

Parameters:
v   the new value for this parameter

Definition at line 208 of file complex_parameter.h.

complex_parameter & complex_parameter::operator= ( Complex v ) [inline]
 

Assign this object a specific value using set().

Parameters:
v   the new value for this parameter

Definition at line 201 of file complex_parameter.h.

complex_parameter & complex_parameter::set ( Complex v ) [inline]
 

Set the value of this parameter.

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 274 of file complex_parameter.h.

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

complex_parameter & complex_parameter::shadow ( const abstract_real_parameter & p1,
const abstract_real_parameter & p2,
int imode = CARTESIAN )
 

Shadow two real_parameters.

Parameters:
p1   real part (CARTESIAN) or magnitude (POLAR)
p2   imag part (CARTESIAN) or radians (POLAR)
imode   mode to use to interpret p1 and p2

Definition at line 167 of file complex_parameter.cc.

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

Shadow a single real_parameter.

Resulting values will be real.

Parameters:
p   the parameter to be shadowed

Definition at line 160 of file complex_parameter.cc.

complex_parameter & complex_parameter::shadow ( const abstract_complex_parameter & p )
 

Set this parameter to shadow another parameter.

Parameters:
p   the parameter to be shadowed

Definition at line 147 of file complex_parameter.cc.

Referenced by operator=().


Member Data Documentation

const abstract_complex_parameter* complex_parameter::cp
 

A pointer to a parameter instance we may be shadowing.

Definition at line 251 of file complex_parameter.h.

bool complex_parameter::get_flag [mutable, private]
 

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

Definition at line 263 of file complex_parameter.h.

int complex_parameter::mode [private]
 

This tells the mode.

A nonzero value implies shadowing.

Definition at line 247 of file complex_parameter.h.

const abstract_real_parameter* complex_parameter::rp1
 

A pointer to a parameter instance we may be shadowing.

Definition at line 253 of file complex_parameter.h.

const abstract_real_parameter * complex_parameter::rp2 [private]
 

A pointer to a parameter instance we may be shadowing.

Definition at line 257 of file complex_parameter.h.

Complex complex_parameter::value [private]
 

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

Definition at line 241 of file complex_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