All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ComplexProxy.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_PROXY_COMPLEXPROXY_H_
36 #define _BLAZE_MATH_PROXY_COMPLEXPROXY_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/shims/Clear.h>
44 #include <blaze/math/shims/Reset.h>
45 #include <blaze/system/Inline.h>
47 
48 
49 namespace blaze {
50 
51 //=================================================================================================
52 //
53 // CLASS DEFINITION
54 //
55 //=================================================================================================
56 
57 //*************************************************************************************************
65 template< typename PT // Type of the proxy
66  , typename CT > // Type of the complex number
68 {
69  public:
70  //**Type definitions****************************************************************************
71  typedef typename CT::value_type value_type;
73  //**********************************************************************************************
74 
75  //**Data access functions***********************************************************************
78  inline ValueType real() const;
79  inline void real( ValueType value ) const;
80  inline ValueType imag() const;
81  inline void imag( ValueType value ) const;
83  //**********************************************************************************************
84 
85  private:
86  //**Conversion operators************************************************************************
90  BLAZE_ALWAYS_INLINE const PT& operator~() const;
92  //**********************************************************************************************
93 
94  //**Compile time checks*************************************************************************
98  //**********************************************************************************************
99 };
100 //*************************************************************************************************
101 
102 
103 
104 
105 //=================================================================================================
106 //
107 // DATA ACCESS FUNCTIONS
108 //
109 //=================================================================================================
110 
111 //*************************************************************************************************
118 template< typename PT // Type of the proxy
119  , typename CT > // Type of the complex number
121 {
122  return (~*this).get().real();
123 }
124 //*************************************************************************************************
125 
126 
127 //*************************************************************************************************
135 template< typename PT // Type of the proxy
136  , typename CT > // Type of the complex number
137 inline void ComplexProxy<PT,CT>::real( ValueType value ) const
138 {
139  (~*this).get().real( value );
140 }
141 //*************************************************************************************************
142 
143 
144 //*************************************************************************************************
151 template< typename PT // Type of the proxy
152  , typename CT > // Type of the complex number
154 {
155  return (~*this).get().imag();
156 }
157 //*************************************************************************************************
158 
159 
160 //*************************************************************************************************
168 template< typename PT // Type of the proxy
169  , typename CT > // Type of the complex number
170 inline void ComplexProxy<PT,CT>::imag( ValueType value ) const
171 {
172  (~*this).get().imag( value );
173 }
174 //*************************************************************************************************
175 
176 
177 
178 
179 //=================================================================================================
180 //
181 // CONVERSION OPERATORS
182 //
183 //=================================================================================================
184 
185 //*************************************************************************************************
192 template< typename PT // Type of the proxy
193  , typename CT > // Type of the complex number
195 {
196  return *static_cast<PT*>( this );
197 }
198 //*************************************************************************************************
199 
200 
201 //*************************************************************************************************
208 template< typename PT // Type of the proxy
209  , typename CT > // Type of the complex number
211 {
212  return *static_cast<const PT*>( this );
213 }
214 //*************************************************************************************************
215 
216 } // namespace blaze
217 
218 #endif
Constraint on the data type.
Header file for the clear shim.
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
CT::value_type value_type
Value type of the represented complex element.
Definition: ComplexProxy.h:71
BLAZE_ALWAYS_INLINE PT & operator~()
Conversion operator for non-constant proxies.
Definition: ComplexProxy.h:194
ValueType real() const
Returns the real part of the represented complex number.
Definition: ComplexProxy.h:120
value_type ValueType
Value type of the represented complex element.
Definition: ComplexProxy.h:72
Header file for the reset shim.
#define BLAZE_CONSTRAINT_MUST_BE_COMPLEX_TYPE(T)
Constraint on the data type.This compile time constraint checks that the given data type T is a compl...
Definition: Complex.h:80
ValueType imag() const
Returns the imaginary part of the represented complex number.
Definition: ComplexProxy.h:153
Proxy backend for complex types.The ComplexProxy class serves as a backend for the Proxy class...
Definition: ComplexProxy.h:67
System settings for the inline keywords.