Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101935203
Tutorial_BlockOperations_print_block.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
Sat, Feb 15, 08:12
Size
413 B
Mime Type
text/x-c
Expires
Mon, Feb 17, 08:12 (1 d, 15 h)
Engine
blob
Format
Raw Data
Handle
24249002
Attached To
rDLMA Diffusion limited mixed aggregation
Tutorial_BlockOperations_print_block.cpp
View Options
#include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(4,4);
m << 1, 2, 3, 4,
5, 6, 7, 8,
9,10,11,12,
13,14,15,16;
cout << "Block in the middle" << endl;
cout << m.block<2,2>(1,1) << endl << endl;
for (int i = 1; i <= 3; ++i)
{
cout << "Block of size " << i << "x" << i << endl;
cout << m.block(0,0,i,i) << endl << endl;
}
}
Event Timeline
Log In to Comment