Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102018924
tut_arithmetic_dot_cross.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
Sun, Feb 16, 06:14
Size
393 B
Mime Type
text/x-c
Expires
Tue, Feb 18, 06:14 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24249258
Attached To
rDLMA Diffusion limited mixed aggregation
tut_arithmetic_dot_cross.cpp
View Options
#include <iostream>
#include <Eigen/Dense>
using
namespace
Eigen
;
using
namespace
std
;
int
main
()
{
Vector3d
v
(
1
,
2
,
3
);
Vector3d
w
(
0
,
1
,
2
);
cout
<<
"Dot product: "
<<
v
.
dot
(
w
)
<<
endl
;
double
dp
=
v
.
adjoint
()
*
w
;
// automatic conversion of the inner product to a scalar
cout
<<
"Dot product via a matrix product: "
<<
dp
<<
endl
;
cout
<<
"Cross product:
\n
"
<<
v
.
cross
(
w
)
<<
endl
;
}
Event Timeline
Log In to Comment