Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102859778
ch-06-ex-01-solution.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
Mon, Feb 24, 22:50
Size
691 B
Mime Type
text/x-c
Expires
Wed, Feb 26, 22:50 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24443502
Attached To
R1106 Programming Concept Rouaze
ch-06-ex-01-solution.cpp
View Options
/*
* chapter-06-exercise-01.cpp
*
* Complex matrix exponential
*
* Created on: Oct 18, 2012
* Author: Radu Popescu <radu.popescu@epfl.ch>
*/
#include <iostream>
#include "ComplexMatrix3x3.hpp"
int main(int argc, char* argv[])
{
// Allocate matrix A
ComplexMatrix3x3 A;
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
A.Set(i, j, ComplexNumber(i, j));
}
}
// Calculate the exponential
ComplexMatrix3x3 E;
// There is a bug. Result doesn't correspond to Matlab
A.Exponential(E, 1000);
std::cout << "The matrix A is: \n";
A.Print(std::cout);
std::cout << "Exponential matrix is: \n";
E.Print(std::cout);
std::cout << std::endl;
return 0;
}
Event Timeline
Log In to Comment