Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F122179335
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
Wed, Jul 16, 09:37
Size
393 B
Mime Type
text/x-c
Expires
Fri, Jul 18, 09:37 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27445409
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