NAMD
Public Member Functions | Public Attributes | List of all members
floatcomplex Class Reference

#include <ComputeEwald.h>

Public Member Functions

 floatcomplex ()
 
 floatcomplex (float c)
 
 floatcomplex (float a, float b)
 
 ~floatcomplex ()
 
floatcomplex star () const
 
float mod2 () const
 
floatcomplexoperator= (const float &c)
 
floatcomplexoperator+= (const floatcomplex &d)
 
floatcomplexoperator*= (const float &c)
 
floatcomplexoperator*= (const floatcomplex &d)
 

Public Attributes

float r
 
float i
 

Detailed Description

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 19 of file ComputeEwald.h.

Constructor & Destructor Documentation

floatcomplex::floatcomplex ( )
inline

Definition at line 22 of file ComputeEwald.h.

Referenced by star().

22 {}
floatcomplex::floatcomplex ( float  c)
inline

Definition at line 23 of file ComputeEwald.h.

23 : r(c), i(0) {}
floatcomplex::floatcomplex ( float  a,
float  b 
)
inline

Definition at line 24 of file ComputeEwald.h.

24 : r(a), i(b) {}
floatcomplex::~floatcomplex ( )
inline

Definition at line 25 of file ComputeEwald.h.

25 {}

Member Function Documentation

float floatcomplex::mod2 ( ) const
inline

Definition at line 33 of file ComputeEwald.h.

References i, and r.

34  {
35  return r*r + i*i;
36  }
floatcomplex& floatcomplex::operator*= ( const float &  c)
inline

Definition at line 52 of file ComputeEwald.h.

References i, and r.

53  {
54  r *= c;
55  i *= c;
56  return *this;
57  }
floatcomplex& floatcomplex::operator*= ( const floatcomplex d)
inline

Definition at line 59 of file ComputeEwald.h.

References i, and r.

60  {
61  float re = r*d.r - i*d.i;
62  float im = r*d.i + i*d.r;
63  r = re;
64  i = im;
65  return *this;
66  }
floatcomplex& floatcomplex::operator+= ( const floatcomplex d)
inline

Definition at line 45 of file ComputeEwald.h.

References i, and r.

46  {
47  r += d.r;
48  i += d.i;
49  return *this;
50  }
floatcomplex& floatcomplex::operator= ( const float &  c)
inline

Definition at line 38 of file ComputeEwald.h.

References i, and r.

39  {
40  r = c;
41  i = 0;
42  return *this;
43  }
floatcomplex floatcomplex::star ( ) const
inline

Definition at line 28 of file ComputeEwald.h.

References floatcomplex(), i, and r.

29  {
30  return floatcomplex(r, -i);
31  }

Member Data Documentation

float floatcomplex::i

Definition at line 21 of file ComputeEwald.h.

Referenced by mod2(), operator*=(), operator+=(), operator=(), and star().

float floatcomplex::r

Definition at line 21 of file ComputeEwald.h.

Referenced by mod2(), operator*=(), operator+=(), operator=(), and star().


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