Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91108737
Test.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
Fri, Nov 8, 00:00
Size
1 KB
Mime Type
text/x-c
Expires
Sun, Nov 10, 00:00 (2 d)
Engine
blob
Format
Raw Data
Handle
22197203
Attached To
rTSUNAMIPROJECT PHPC-TSUNAMI-PROJECT
Test.cpp
View Options
//
// Created by Arnaud Pannatier on 11.05.18.
//
#include <iostream>
#include "grid.h"
int main(){
Grid A(10,10);
Grid B(10,10);
Grid C(10,10);
Grid D(10,10);
A+=2;
A*=3;
D+=1;
D = 2*A;
for(std::size_t x(0);x<10;x++) {
for (std::size_t y (0); y < 10; y++) {
B(x,y) = y+10*x;
}
}
A+=B;
A*=B;
A=sqrt(A);
for(std::size_t x(0);x<10;x++) {
std::cout << "[ ";
for (std::size_t y (0); y < 10; y++) {
std::cout << A (x, y) << " ";
}
std::cout << "]" << std::endl;
}
std::cout << std::endl;
for(std::size_t x(0);x<10;x++) {
std::cout << "[ ";
for (std::size_t y (0); y < 10; y++) {
std::cout << B (x, y) << " ";
}
std::cout << "]" << std::endl;
}
std::cout << std::endl;
for(std::size_t x(0);x<10;x++) {
std::cout << "[ ";
for (std::size_t y (0); y < 10; y++) {
std::cout << C (x, y) << " ";
}
std::cout << "]" << std::endl;
}
std::cout << std::endl;
for(std::size_t x(0);x<10;x++) {
std::cout << "[ ";
for (std::size_t y (0); y < 10; y++) {
std::cout << D (x, y) << " ";
}
std::cout << "]" << std::endl;
}
return 0;
}
Event Timeline
Log In to Comment