TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
An implementation of Complex Number as Objects. More...
#include <cassert>
#include <cmath>
#include <complex>
#include <ctime>
#include <iostream>
#include <stdexcept>
Go to the source code of this file.
Classes | |
class | Complex |
Class Complex to represent complex numbers as a field. More... | |
Functions | |
bool | operator== (const Complex &a, const Complex &b) |
Operator overload of '==' on Complex class. Logical Equal overload for our Complex class. | |
std::ostream & | operator<< (std::ostream &os, const Complex &num) |
Operator overload of '<<' of ostream for Complex class. Overloaded insersion operator to accommodate the printing of our complex number in their standard form. | |
double | get_rand () |
Function to get random numbers to generate our complex numbers for test. | |
void | tests () |
int | main () |
An implementation of Complex Number as Objects.
A basic implementation of Complex Number field as a class with operators overloaded to accommodate (mathematical) field operations.
Definition in file complex_numbers.cpp.
double get_rand | ( | ) |
Function to get random numbers to generate our complex numbers for test.
Definition at line 201 of file complex_numbers.cpp.
int main | ( | void | ) |
Main function
Definition at line 268 of file complex_numbers.cpp.
std::ostream & operator<< | ( | std::ostream & | os, |
const Complex & | num ) |
Operator overload of '<<' of ostream for Complex class. Overloaded insersion operator to accommodate the printing of our complex number in their standard form.
os | The console stream |
num | The complex number. |
Definition at line 186 of file complex_numbers.cpp.
Operator overload of '==' on Complex class. Logical Equal overload for our Complex class.
a | Left hand side of our expression |
b | Right hand side of our expression |
Definition at line 175 of file complex_numbers.cpp.
void tests | ( | ) |
Tests Function
Definition at line 206 of file complex_numbers.cpp.