Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F122155888
test_complex_numbers.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jul 16, 05:36
Size
785 B
Mime Type
text/x-c
Expires
Fri, Jul 18, 05:36 (2 d)
Engine
blob
Format
Raw Data
Handle
27441996
Attached To
R1106 Programming Concept Rouaze
test_complex_numbers.cpp
View Options
/*
* test_complex_numbers.cpp
*
* Complex matrix exponential
*
* Created on: Oct 19, 2012
* Author: Radu Popescu <radu.popescu@epfl.ch>
*/
#include <iostream>
#include "ComplexNumber.hpp"
int main(int argc, char* argv[])
{
ComplexNumber a(1.0, 0.0);
std::cout << "a = " << a << std::endl;
std::cout << "Re(a) = " << a.GetRealPart() << " Im(a) = "
<< a.GetImaginaryPart() << std::endl;
ComplexNumber b(0.0, -1.0);
std::cout << "b = " << b << std::endl;
ComplexNumber c(2.0, 3.0);
std::cout << "c = " << c << std::endl;
ComplexNumber d = a + b;
std::cout << "d = a + b = " << d << std::endl;
ComplexNumber e(a * b);
std::cout << "e = a * b = " << e << std::endl;
ComplexNumber f;
f = b * c;
std::cout << "f = b * c = " << f << std::endl;
return 0;
}
Event Timeline
Log In to Comment