Complex Number  0.1.2
src/ComplexNumber.cpp File Reference

Representation of a complex number. More...

#include "ComplexNumber.h"
#include "MathExceptions.h"
#include "Namespace.h"
#include <iostream>
#include <cmath>

Go to the source code of this file.

Namespaces

namespace  math
 

Math namespace.


namespace  complex
 

Complex namespace.


Defines

#define COMPLEX_NUMBER_CPP

Functions

template<class T >
ComplexNumber< T > operator+ (const ComplexNumber< T > &lhs, const ComplexNumber< T > &rhs)
template<class T >
ComplexNumber< T > operator+ (const ComplexNumber< T > &lhs, const T &rhs)
template<class T >
ComplexNumber< T > operator+ (const T &lhs, const ComplexNumber< T > &rhs)
template<class T >
ComplexNumber< T > operator- (const ComplexNumber< T > &lhs, const ComplexNumber< T > &rhs)
template<class T >
ComplexNumber< T > operator- (const ComplexNumber< T > &lhs, const T &rhs)
template<class T >
ComplexNumber< T > operator- (const T &lhs, const ComplexNumber< T > &rhs)
template<class T >
ComplexNumber< T > operator* (const ComplexNumber< T > &lhs, const ComplexNumber< T > &rhs)
template<class T >
ComplexNumber< T > operator* (const ComplexNumber< T > &lhs, const T &rhs)
template<class T >
ComplexNumber< T > operator* (const T &lhs, const ComplexNumber< T > &rhs)
template<class T >
ComplexNumber< T > operator/ (const ComplexNumber< T > &lhs, const ComplexNumber< T > &rhs)
template<class T >
ComplexNumber< T > operator/ (const ComplexNumber< T > &lhs, const T &rhs)
template<class T >
ComplexNumber< T > operator/ (const T &lhs, const ComplexNumber< T > &rhs)
template<class T , class U >
bool operator== (const ComplexNumber< T > &lhs, const ComplexNumber< U > &rhs)
template<class T , class U >
bool operator== (const ComplexNumber< T > &lhs, const U &rhs)
template<class T , class U >
bool operator== (const T &lhs, const ComplexNumber< U > &rhs)
template<class T , class U >
bool operator!= (const ComplexNumber< T > &lhs, const ComplexNumber< U > &rhs)
template<class T , class U >
bool operator!= (const ComplexNumber< T > &lhs, const U &rhs)
template<class T , class U >
bool operator!= (const T &lhs, const ComplexNumber< U > &rhs)
template<class U >
std::ostream & operator<< (std::ostream &out, const ComplexNumber< U > &z)
template<class U >
std::istream & operator>> (std::istream &in, ComplexNumber< U > &z)

Detailed Description

Representation of a complex number.

Author:
Matthew Krupcale
Version:
0.1.2
Date:
2010

This file contains the implementation of the class template that represents a complex number, its function template implementations as well as its overloaded operators

Definition in file ComplexNumber.cpp.


Define Documentation

#define COMPLEX_NUMBER_CPP

Definition at line 25 of file ComplexNumber.cpp.


Function Documentation

template<class T , class U >
bool operator!= ( const ComplexNumber< T > &  lhs,
const ComplexNumber< U > &  rhs 
) [related]

Definition at line 355 of file ComplexNumber.cpp.

template<class T , class U >
bool operator!= ( const ComplexNumber< T > &  lhs,
const U &  rhs 
) [related]

Definition at line 361 of file ComplexNumber.cpp.

template<class T , class U >
bool operator!= ( const T &  lhs,
const ComplexNumber< U > &  rhs 
) [related]

Definition at line 366 of file ComplexNumber.cpp.

template<class T >
ComplexNumber<T> operator* ( const ComplexNumber< T > &  lhs,
const ComplexNumber< T > &  rhs 
) [related]

Definition at line 280 of file ComplexNumber.cpp.

template<class T >
ComplexNumber<T> operator* ( const ComplexNumber< T > &  lhs,
const T &  rhs 
) [related]

Definition at line 289 of file ComplexNumber.cpp.

template<class T >
ComplexNumber<T> operator* ( const T &  lhs,
const ComplexNumber< T > &  rhs 
) [related]

Definition at line 294 of file ComplexNumber.cpp.

template<class T >
ComplexNumber<T> operator+ ( const ComplexNumber< T > &  lhs,
const ComplexNumber< T > &  rhs 
) [related]

Definition at line 246 of file ComplexNumber.cpp.

template<class T >
ComplexNumber<T> operator+ ( const ComplexNumber< T > &  lhs,
const T &  rhs 
) [related]

Definition at line 253 of file ComplexNumber.cpp.

template<class T >
ComplexNumber<T> operator+ ( const T &  lhs,
const ComplexNumber< T > &  rhs 
) [related]

Definition at line 258 of file ComplexNumber.cpp.

template<class T >
ComplexNumber<T> operator- ( const ComplexNumber< T > &  lhs,
const ComplexNumber< T > &  rhs 
) [related]

Definition at line 263 of file ComplexNumber.cpp.

template<class T >
ComplexNumber<T> operator- ( const ComplexNumber< T > &  lhs,
const T &  rhs 
) [related]

Definition at line 270 of file ComplexNumber.cpp.

template<class T >
ComplexNumber<T> operator- ( const T &  lhs,
const ComplexNumber< T > &  rhs 
) [related]

Definition at line 275 of file ComplexNumber.cpp.

template<class T >
ComplexNumber<T> operator/ ( const ComplexNumber< T > &  lhs,
const ComplexNumber< T > &  rhs 
) [related]

Definition at line 299 of file ComplexNumber.cpp.

template<class T >
ComplexNumber<T> operator/ ( const ComplexNumber< T > &  lhs,
const T &  rhs 
) [related]

Definition at line 316 of file ComplexNumber.cpp.

template<class T >
ComplexNumber<T> operator/ ( const T &  lhs,
const ComplexNumber< T > &  rhs 
) [related]

Definition at line 325 of file ComplexNumber.cpp.

template<class U >
std::ostream& operator<< ( std::ostream &  out,
const ComplexNumber< U > &  z 
)

Sends a representation of this ComplexNumber into the ostream

Parameters:
[in]outThe ostream reference into which the ComplexNumber will be inserted
[in]zThe ComplexNumber from which the data will be obtained
Returns:
A reference to the modified ostream

Definition at line 371 of file ComplexNumber.cpp.

template<class T , class U >
bool operator== ( const ComplexNumber< T > &  lhs,
const ComplexNumber< U > &  rhs 
) [related]

Definition at line 339 of file ComplexNumber.cpp.

template<class T , class U >
bool operator== ( const ComplexNumber< T > &  lhs,
const U &  rhs 
) [related]

Definition at line 345 of file ComplexNumber.cpp.

template<class T , class U >
bool operator== ( const T &  lhs,
const ComplexNumber< U > &  rhs 
) [related]

Definition at line 350 of file ComplexNumber.cpp.

template<class U >
std::istream& operator>> ( std::istream &  in,
ComplexNumber< U > &  z 
)

Initializes a ComplexNumber from values extracted from the istream

Parameters:
[in]inThe istream reference from which the ComplexNumber will be extracted
[in]zThe ComplexNumber into which the data will be inserted
Returns:
A reference to the modified istream

Definition at line 383 of file ComplexNumber.cpp.