本文整理汇总了C++中Matrix4d函数的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4d函数的具体用法?C++ Matrix4d怎么用?C++ Matrix4d使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Matrix4d函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: test_mapped_matrix
void test_mapped_matrix()
{
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( map_class_vector(Matrix<float, 1, 1>()) );
CALL_SUBTEST_1( check_const_correctness(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2( map_class_vector(Vector4d()) );
CALL_SUBTEST_2( map_class_vector(VectorXd(13)) );
CALL_SUBTEST_2( check_const_correctness(Matrix4d()) );
CALL_SUBTEST_3( map_class_vector(RowVector4f()) );
CALL_SUBTEST_4( map_class_vector(VectorXcf(8)) );
CALL_SUBTEST_5( map_class_vector(VectorXi(12)) );
CALL_SUBTEST_5( check_const_correctness(VectorXi(12)) );
CALL_SUBTEST_1( map_class_matrix(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2( map_class_matrix(Matrix4d()) );
CALL_SUBTEST_11( map_class_matrix(Matrix<float,3,5>()) );
CALL_SUBTEST_4( map_class_matrix(MatrixXcf(internal::random<int>(1,10),internal::random<int>(1,10))) );
CALL_SUBTEST_5( map_class_matrix(MatrixXi(internal::random<int>(1,10),internal::random<int>(1,10))) );
CALL_SUBTEST_6( map_static_methods(Matrix<double, 1, 1>()) );
CALL_SUBTEST_7( map_static_methods(Vector3f()) );
CALL_SUBTEST_8( map_static_methods(RowVector3d()) );
CALL_SUBTEST_9( map_static_methods(VectorXcd(8)) );
CALL_SUBTEST_10( map_static_methods(VectorXf(12)) );
CALL_SUBTEST_11( map_not_aligned_on_scalar<double>() );
}
}
开发者ID:muhammedabdelnasser,项目名称:Vehicle-Steering-Using-Model-Predictive-Control,代码行数:28,代码来源:mapped_matrix.cpp
示例2: test_eigen2_array
void test_eigen2_array()
{
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( array(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2( array(Matrix2f()) );
CALL_SUBTEST_3( array(Matrix4d()) );
CALL_SUBTEST_4( array(MatrixXcf(3, 3)) );
CALL_SUBTEST_5( array(MatrixXf(8, 12)) );
CALL_SUBTEST_6( array(MatrixXi(8, 12)) );
}
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( comparisons(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2( comparisons(Matrix2f()) );
CALL_SUBTEST_3( comparisons(Matrix4d()) );
CALL_SUBTEST_5( comparisons(MatrixXf(8, 12)) );
CALL_SUBTEST_6( comparisons(MatrixXi(8, 12)) );
}
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( lpNorm(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2( lpNorm(Vector2f()) );
CALL_SUBTEST_3( lpNorm(Vector3d()) );
CALL_SUBTEST_4( lpNorm(Vector4f()) );
CALL_SUBTEST_5( lpNorm(VectorXf(16)) );
CALL_SUBTEST_7( lpNorm(VectorXcd(10)) );
}
}
开发者ID:aeslaughter,项目名称:libmesh,代码行数:26,代码来源:eigen2_array.cpp
示例3: test_mapstride
void test_mapstride()
{
for(int i = 0; i < g_repeat; i++) {
EIGEN_UNUSED int maxn = 30;
CALL_SUBTEST_1( map_class_vector<Aligned>(Matrix<float, 1, 1>()) );
CALL_SUBTEST_1( map_class_vector<Unaligned>(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2( map_class_vector<Aligned>(Vector4d()) );
CALL_SUBTEST_2( map_class_vector<Unaligned>(Vector4d()) );
CALL_SUBTEST_3( map_class_vector<Aligned>(RowVector4f()) );
CALL_SUBTEST_3( map_class_vector<Unaligned>(RowVector4f()) );
CALL_SUBTEST_4( map_class_vector<Aligned>(VectorXcf(internal::random<int>(1,maxn))) );
CALL_SUBTEST_4( map_class_vector<Unaligned>(VectorXcf(internal::random<int>(1,maxn))) );
CALL_SUBTEST_5( map_class_vector<Aligned>(VectorXi(internal::random<int>(1,maxn))) );
CALL_SUBTEST_5( map_class_vector<Unaligned>(VectorXi(internal::random<int>(1,maxn))) );
CALL_SUBTEST_1( map_class_matrix<Aligned>(Matrix<float, 1, 1>()) );
CALL_SUBTEST_1( map_class_matrix<Unaligned>(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2( map_class_matrix<Aligned>(Matrix4d()) );
CALL_SUBTEST_2( map_class_matrix<Unaligned>(Matrix4d()) );
CALL_SUBTEST_3( map_class_matrix<Aligned>(Matrix<float,3,5>()) );
CALL_SUBTEST_3( map_class_matrix<Unaligned>(Matrix<float,3,5>()) );
CALL_SUBTEST_3( map_class_matrix<Aligned>(Matrix<float,4,8>()) );
CALL_SUBTEST_3( map_class_matrix<Unaligned>(Matrix<float,4,8>()) );
CALL_SUBTEST_4( map_class_matrix<Aligned>(MatrixXcf(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
CALL_SUBTEST_4( map_class_matrix<Unaligned>(MatrixXcf(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
CALL_SUBTEST_5( map_class_matrix<Aligned>(MatrixXi(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
CALL_SUBTEST_5( map_class_matrix<Unaligned>(MatrixXi(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
CALL_SUBTEST_6( map_class_matrix<Aligned>(MatrixXcd(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
CALL_SUBTEST_6( map_class_matrix<Unaligned>(MatrixXcd(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
}
}
开发者ID:vivek7003,项目名称:tools,代码行数:31,代码来源:mapstride.cpp
示例4: test_array_for_matrix
void test_array_for_matrix()
{
int maxsize = 40;
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( array_for_matrix(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2( array_for_matrix(Matrix2f()) );
CALL_SUBTEST_3( array_for_matrix(Matrix4d()) );
CALL_SUBTEST_4( array_for_matrix(MatrixXcf(internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
CALL_SUBTEST_5( array_for_matrix(MatrixXf(internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
CALL_SUBTEST_6( array_for_matrix(MatrixXi(internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
}
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( comparisons(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2( comparisons(Matrix2f()) );
CALL_SUBTEST_3( comparisons(Matrix4d()) );
CALL_SUBTEST_5( comparisons(MatrixXf(internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
CALL_SUBTEST_6( comparisons(MatrixXi(internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
}
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( lpNorm(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2( lpNorm(Vector2f()) );
CALL_SUBTEST_7( lpNorm(Vector3d()) );
CALL_SUBTEST_8( lpNorm(Vector4f()) );
CALL_SUBTEST_5( lpNorm(VectorXf(internal::random<int>(1,maxsize))) );
CALL_SUBTEST_4( lpNorm(VectorXcf(internal::random<int>(1,maxsize))) );
}
}
开发者ID:151706061,项目名称:ParaView,代码行数:27,代码来源:array_for_matrix.cpp
示例5: solveLinSys
Vector3d Sphere::solveLinSys(Vector3d &a,Vector3d &b,Vector3d &c){
Vector3d n=(a-b)%(a-c);
Matrix4d m=Matrix4d((b-a)[0],(b-a)[1],(b-a)[2],0,
(c-a)[0],(c-a)[1],(c-a)[2],0,
n[0], n[1], n[2],0,
0, 0, 0,1
);
Vector3d g=Vector3d(b.lengthSquared()-a.lengthSquared(),c.lengthSquared()-a.lengthSquared(),a*n*2);
g=g*0.5;
Matrix4d k=Matrix4d();
k=k.inverse(m);
Vector3d result=k*g;
return result;
}
开发者ID:msebas,项目名称:JGU_CG_SS2015,代码行数:14,代码来源:Sphere.cpp
示例6: Matrix4d
Matrix4d Matrix4d::inverse()
{
//from Mathematica
float result[4][4];
result[0][0] = -mat[2][3] * mat[3][2] * mat[1][1] + mat[2][2] * mat[3][3] * mat[1][1] + mat[2][3] * mat[3][1] * mat[1][2] - mat[2][2] * mat[3][1] * mat[1][3] - mat[3][3] * mat[1][2] * mat[2][1] + mat[3][2] * mat[1][3] * mat[2][1];
result[0][1] = mat[0][1] * mat[2][3] * mat[3][2] - mat[0][1] * mat[2][2] * mat[3][3] - mat[2][3] * mat[3][1] * mat[0][2] + mat[2][2] * mat[3][1] * mat[0][3] + mat[3][3] * mat[0][2] * mat[2][1] - mat[3][2] * mat[0][3] * mat[2][1];
result[0][2] = -mat[3][3] * mat[0][2] * mat[1][1] + mat[3][2] * mat[0][3] * mat[1][1] + mat[0][1] * mat[3][3] * mat[1][2] - mat[3][1] * mat[0][3] * mat[1][2] - mat[0][1] * mat[3][2] * mat[1][3] + mat[3][1] * mat[0][2] * mat[1][3];
result[0][3] = mat[2][3] * mat[0][2] * mat[1][1] - mat[2][2] * mat[0][3] * mat[1][1] - mat[0][1] * mat[2][3] * mat[1][2] + mat[0][1] * mat[2][2] * mat[1][3] + mat[0][3] * mat[1][2] * mat[2][1] - mat[0][2] * mat[1][3] * mat[2][1];
result[1][0] = mat[2][3] * mat[3][2] * mat[1][0] - mat[2][2] * mat[3][3] * mat[1][0] - mat[2][3] * mat[3][0] * mat[1][2] + mat[2][2] * mat[3][0] * mat[1][3] + mat[3][3] * mat[1][2] * mat[2][0] - mat[3][2] * mat[1][3] * mat[2][0];
result[1][1] = -mat[0][0] * mat[2][3] * mat[3][2] + mat[0][0] * mat[2][2] * mat[3][3] + mat[2][3] * mat[3][0] * mat[0][2] - mat[2][2] * mat[3][0] * mat[0][3] - mat[3][3] * mat[0][2] * mat[2][0] + mat[3][2] * mat[0][3] * mat[2][0];
result[1][2] = mat[3][3] * mat[0][2] * mat[1][0] - mat[3][2] * mat[0][3] * mat[1][0] - mat[0][0] * mat[3][3] * mat[1][2] + mat[3][0] * mat[0][3] * mat[1][2] + mat[0][0] * mat[3][2] * mat[1][3] - mat[3][0] * mat[0][2] * mat[1][3];
result[1][3] = -mat[2][3] * mat[0][2] * mat[1][0] + mat[2][2] * mat[0][3] * mat[1][0] + mat[0][0] * mat[2][3] * mat[1][2] - mat[0][0] * mat[2][2] * mat[1][3] - mat[0][3] * mat[1][2] * mat[2][0] + mat[0][2] * mat[1][3] * mat[2][0];
result[2][0] = -mat[2][3] * mat[3][1] * mat[1][0] + mat[2][3] * mat[3][0] * mat[1][1] - mat[3][3] * mat[1][1] * mat[2][0] + mat[3][1] * mat[1][3] * mat[2][0] + mat[3][3] * mat[1][0] * mat[2][1] - mat[3][0] * mat[1][3] * mat[2][1];
result[2][1] = -mat[0][1] * mat[2][3] * mat[3][0] + mat[0][0] * mat[2][3] * mat[3][1] + mat[0][1] * mat[3][3] * mat[2][0] - mat[3][1] * mat[0][3] * mat[2][0] - mat[0][0] * mat[3][3] * mat[2][1] + mat[3][0] * mat[0][3] * mat[2][1];
result[2][2] = -mat[0][1] * mat[3][3] * mat[1][0] + mat[3][1] * mat[0][3] * mat[1][0] + mat[0][0] * mat[3][3] * mat[1][1] - mat[3][0] * mat[0][3] * mat[1][1] + mat[0][1] * mat[3][0] * mat[1][3] - mat[0][0] * mat[3][1] * mat[1][3];
result[2][3] = mat[0][1] * mat[2][3] * mat[1][0] - mat[0][0] * mat[2][3] * mat[1][1] + mat[0][3] * mat[1][1] * mat[2][0] - mat[0][1] * mat[1][3] * mat[2][0] - mat[0][3] * mat[1][0] * mat[2][1] + mat[0][0] * mat[1][3] * mat[2][1];
result[3][0] = mat[2][2] * mat[3][1] * mat[1][0] - mat[2][2] * mat[3][0] * mat[1][1] + mat[3][2] * mat[1][1] * mat[2][0] - mat[3][1] * mat[1][2] * mat[2][0] - mat[3][2] * mat[1][0] * mat[2][1] + mat[3][0] * mat[1][2] * mat[2][1];
result[3][1] = mat[0][1] * mat[2][2] * mat[3][0] - mat[0][0] * mat[2][2] * mat[3][1] - mat[0][1] * mat[3][2] * mat[2][0] + mat[3][1] * mat[0][2] * mat[2][0] + mat[0][0] * mat[3][2] * mat[2][1] - mat[3][0] * mat[0][2] * mat[2][1];
result[3][2] = mat[0][1] * mat[3][2] * mat[1][0] - mat[3][1] * mat[0][2] * mat[1][0] - mat[0][0] * mat[3][2] * mat[1][1] + mat[3][0] * mat[0][2] * mat[1][1] - mat[0][1] * mat[3][0] * mat[1][2] + mat[0][0] * mat[3][1] * mat[1][2];
result[3][3] = -mat[0][1] * mat[2][2] * mat[1][0] + mat[0][0] * mat[2][2] * mat[1][1] - mat[0][2] * mat[1][1] * mat[2][0] + mat[0][1] * mat[1][2] * mat[2][0] + mat[0][2] * mat[1][0] *mat[2][1] - mat[0][0] * mat[1][2] * mat[2][1];
float d = 1.0 / (mat[0][0] * result[0][0] + mat[0][1] * result[1][0] + mat[0][2] * result[2][0] + mat[0][3] * result[3][0]);
for(int i=0; i<4; i++)
for(int j=0; j<4; j++)
result[i][j] *= d;
return Matrix4d(result);
}
开发者ID:wertkh32,项目名称:stonefish,代码行数:29,代码来源:Matrix4d.cpp
示例7: test_redux
void test_redux()
{
// the max size cannot be too large, otherwise reduxion operations obviously generate large errors.
int maxsize = (std::min)(100,EIGEN_TEST_MAX_SIZE);
EIGEN_UNUSED_VARIABLE(maxsize);
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( matrixRedux(Matrix<float, 1, 1>()) );
CALL_SUBTEST_1( matrixRedux(Array<float, 1, 1>()) );
CALL_SUBTEST_2( matrixRedux(Matrix2f()) );
CALL_SUBTEST_2( matrixRedux(Array2f()) );
CALL_SUBTEST_3( matrixRedux(Matrix4d()) );
CALL_SUBTEST_3( matrixRedux(Array4d()) );
CALL_SUBTEST_4( matrixRedux(MatrixXcf(internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
CALL_SUBTEST_4( matrixRedux(ArrayXXcf(internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
CALL_SUBTEST_5( matrixRedux(MatrixXd (internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
CALL_SUBTEST_5( matrixRedux(ArrayXXd (internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
CALL_SUBTEST_6( matrixRedux(MatrixXi (internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
CALL_SUBTEST_6( matrixRedux(ArrayXXi (internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
}
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_7( vectorRedux(Vector4f()) );
CALL_SUBTEST_7( vectorRedux(Array4f()) );
CALL_SUBTEST_5( vectorRedux(VectorXd(internal::random<int>(1,maxsize))) );
CALL_SUBTEST_5( vectorRedux(ArrayXd(internal::random<int>(1,maxsize))) );
CALL_SUBTEST_8( vectorRedux(VectorXf(internal::random<int>(1,maxsize))) );
CALL_SUBTEST_8( vectorRedux(ArrayXf(internal::random<int>(1,maxsize))) );
}
}
开发者ID:gorlak,项目名称:panda3d-thirdparty,代码行数:28,代码来源:redux.cpp
示例8: test_qtvector
void test_qtvector()
{
// some non vectorizable fixed sizes
CALL_SUBTEST(check_qtvector_matrix(Vector2f()));
CALL_SUBTEST(check_qtvector_matrix(Matrix3f()));
CALL_SUBTEST(check_qtvector_matrix(Matrix3d()));
// some vectorizable fixed sizes
CALL_SUBTEST(check_qtvector_matrix(Matrix2f()));
CALL_SUBTEST(check_qtvector_matrix(Vector4f()));
CALL_SUBTEST(check_qtvector_matrix(Matrix4f()));
CALL_SUBTEST(check_qtvector_matrix(Matrix4d()));
// some dynamic sizes
CALL_SUBTEST(check_qtvector_matrix(MatrixXd(1,1)));
CALL_SUBTEST(check_qtvector_matrix(VectorXd(20)));
CALL_SUBTEST(check_qtvector_matrix(RowVectorXf(20)));
CALL_SUBTEST(check_qtvector_matrix(MatrixXcf(10,10)));
// some Transform
CALL_SUBTEST(check_qtvector_transform(Transform2f()));
CALL_SUBTEST(check_qtvector_transform(Transform3f()));
CALL_SUBTEST(check_qtvector_transform(Transform3d()));
//CALL_SUBTEST(check_qtvector_transform(Transform4d()));
// some Quaternion
CALL_SUBTEST(check_qtvector_quaternion(Quaternionf()));
CALL_SUBTEST(check_qtvector_quaternion(Quaternionf()));
}
开发者ID:hrehfeld,项目名称:ezrgraphicsdemo,代码行数:29,代码来源:qtvector.cpp
示例9: dyadicProdukt
Matrix4d OBB::dyadicProdukt(Vector3d v1, Vector3d v2){
Matrix4d result=Matrix4d(v1.x()*v2.x(),v1.x()*v2.y(),v1.x()*v2.z(),0.,
v1.y()*v2.x(),v1.y()*v2.y(),v1.y()*v2.z(),0.,
v1.z()*v2.x(),v1.z()*v2.y(),v1.z()*v2.z(),0.,
0 , 0 , 0 ,1e-4);
return result;
}
开发者ID:msebas,项目名称:JGU_CG_SS2015,代码行数:7,代码来源:obb.cpp
示例10: test_stdvector_overload
void test_stdvector_overload()
{
// some non vectorizable fixed sizes
CALL_SUBTEST_1(check_stdvector_matrix(Vector2f()));
CALL_SUBTEST_1(check_stdvector_matrix(Matrix3f()));
CALL_SUBTEST_2(check_stdvector_matrix(Matrix3d()));
// some vectorizable fixed sizes
CALL_SUBTEST_1(check_stdvector_matrix(Matrix2f()));
CALL_SUBTEST_1(check_stdvector_matrix(Vector4f()));
CALL_SUBTEST_1(check_stdvector_matrix(Matrix4f()));
CALL_SUBTEST_2(check_stdvector_matrix(Matrix4d()));
// some dynamic sizes
CALL_SUBTEST_3(check_stdvector_matrix(MatrixXd(1,1)));
CALL_SUBTEST_3(check_stdvector_matrix(VectorXd(20)));
CALL_SUBTEST_3(check_stdvector_matrix(RowVectorXf(20)));
CALL_SUBTEST_3(check_stdvector_matrix(MatrixXcf(10,10)));
// some Transform
CALL_SUBTEST_4(check_stdvector_transform(Affine2f())); // does not need the specialization (2+1)^2 = 9
CALL_SUBTEST_4(check_stdvector_transform(Affine3f()));
CALL_SUBTEST_4(check_stdvector_transform(Affine3d()));
// some Quaternion
CALL_SUBTEST_5(check_stdvector_quaternion(Quaternionf()));
CALL_SUBTEST_5(check_stdvector_quaternion(Quaterniond()));
}
开发者ID:13221325403,项目名称:openbr,代码行数:28,代码来源:stdvector_overload.cpp
示例11: caluculateC
void OBB::caluculateC(){
C=Matrix4d(0.0);
for(uint i=0;i<points.size();i++){
C+=dyadicProdukt(points[i],points[i]);
}
int rot=0;
C.jacobi(eigenvaluesC,R,rot);
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
std::cout << R(i,j) <<" ; ";
}
std::cout << std::endl;
}
std::cout << std::endl;
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
std::cout << C(i,j) <<" ; ";
}
std::cout << std::endl;
}
std::cout << std::endl;
for (int j = 0; j < 4; ++j) {
std::cout << eigenvaluesC[j] <<" ; ";
}
std::cout << std::endl << std::endl;
}
开发者ID:msebas,项目名称:JGU_CG_SS2015,代码行数:29,代码来源:obb.cpp
示例12: test_sizeof
void test_sizeof()
{
CALL_SUBTEST(verifySizeOf(Matrix<float, 1, 1>()) );
CALL_SUBTEST(verifySizeOf(Array<float, 2, 1>()) );
CALL_SUBTEST(verifySizeOf(Array<float, 3, 1>()) );
CALL_SUBTEST(verifySizeOf(Array<float, 4, 1>()) );
CALL_SUBTEST(verifySizeOf(Array<float, 5, 1>()) );
CALL_SUBTEST(verifySizeOf(Array<float, 6, 1>()) );
CALL_SUBTEST(verifySizeOf(Array<float, 7, 1>()) );
CALL_SUBTEST(verifySizeOf(Array<float, 8, 1>()) );
CALL_SUBTEST(verifySizeOf(Array<float, 9, 1>()) );
CALL_SUBTEST(verifySizeOf(Array<float, 10, 1>()) );
CALL_SUBTEST(verifySizeOf(Array<float, 11, 1>()) );
CALL_SUBTEST(verifySizeOf(Array<float, 12, 1>()) );
CALL_SUBTEST(verifySizeOf(Vector2d()) );
CALL_SUBTEST(verifySizeOf(Vector4f()) );
CALL_SUBTEST(verifySizeOf(Matrix4d()) );
CALL_SUBTEST(verifySizeOf(Matrix<double, 4, 2>()) );
CALL_SUBTEST(verifySizeOf(Matrix<bool, 7, 5>()) );
CALL_SUBTEST(verifySizeOf(MatrixXcf(3, 3)) );
CALL_SUBTEST(verifySizeOf(MatrixXi(8, 12)) );
CALL_SUBTEST(verifySizeOf(MatrixXcd(20, 20)) );
CALL_SUBTEST(verifySizeOf(Matrix<float, 100, 100>()) );
VERIFY(sizeof(std::complex<float>) == 2*sizeof(float));
VERIFY(sizeof(std::complex<double>) == 2*sizeof(double));
}
开发者ID:RomainBrault,项目名称:OV2SGD,代码行数:27,代码来源:sizeof.cpp
示例13: test_stdvector
void test_stdvector()
{
// some non vectorizable fixed sizes
CALL_SUBTEST_1(check_stdvector_matrix(Vector2f()));
CALL_SUBTEST_1(check_stdvector_matrix(Matrix3f()));
CALL_SUBTEST_2(check_stdvector_matrix(Matrix3d()));
// some vectorizable fixed sizes
CALL_SUBTEST_1(check_stdvector_matrix(Matrix2f()));
CALL_SUBTEST_1(check_stdvector_matrix(Vector4f()));
CALL_SUBTEST_1(check_stdvector_matrix(Matrix4f()));
CALL_SUBTEST_2(check_stdvector_matrix(Matrix4d()));
// some dynamic sizes
CALL_SUBTEST_3(check_stdvector_matrix(MatrixXd(1,1)));
CALL_SUBTEST_3(check_stdvector_matrix(VectorXd(20)));
CALL_SUBTEST_3(check_stdvector_matrix(RowVectorXf(20)));
CALL_SUBTEST_3(check_stdvector_matrix(MatrixXcf(10,10)));
// some Transform
CALL_SUBTEST_4(check_stdvector_transform(Projective2f()));
CALL_SUBTEST_4(check_stdvector_transform(Projective3f()));
CALL_SUBTEST_4(check_stdvector_transform(Projective3d()));
//CALL_SUBTEST(heck_stdvector_transform(Projective4d()));
// some Quaternion
CALL_SUBTEST_5(check_stdvector_quaternion(Quaternionf()));
CALL_SUBTEST_5(check_stdvector_quaternion(Quaterniond()));
}
开发者ID:151706061,项目名称:ParaView,代码行数:29,代码来源:stdvector.cpp
示例14: test_swap
void test_swap()
{
CALL_SUBTEST_1( swap(Matrix3f()) ); // fixed size, no vectorization
CALL_SUBTEST_2( swap(Matrix4d()) ); // fixed size, possible vectorization
CALL_SUBTEST_3( swap(MatrixXd(3,3)) ); // dyn size, no vectorization
CALL_SUBTEST_4( swap(MatrixXf(30,30)) ); // dyn size, possible vectorization
}
开发者ID:151706061,项目名称:ParaView,代码行数:7,代码来源:swap.cpp
示例15: test_eigensolver_selfadjoint
void test_eigensolver_selfadjoint()
{
int s = 0;
for(int i = 0; i < g_repeat; i++) {
// very important to test 3x3 and 2x2 matrices since we provide special paths for them
CALL_SUBTEST_1( selfadjointeigensolver(Matrix2f()) );
CALL_SUBTEST_1( selfadjointeigensolver(Matrix2d()) );
CALL_SUBTEST_1( selfadjointeigensolver(Matrix3f()) );
CALL_SUBTEST_1( selfadjointeigensolver(Matrix3d()) );
CALL_SUBTEST_2( selfadjointeigensolver(Matrix4d()) );
s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4);
CALL_SUBTEST_3( selfadjointeigensolver(MatrixXf(s,s)) );
s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4);
CALL_SUBTEST_4( selfadjointeigensolver(MatrixXd(s,s)) );
s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4);
CALL_SUBTEST_5( selfadjointeigensolver(MatrixXcd(s,s)) );
s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4);
CALL_SUBTEST_9( selfadjointeigensolver(Matrix<std::complex<double>,Dynamic,Dynamic,RowMajor>(s,s)) );
// some trivial but implementation-wise tricky cases
CALL_SUBTEST_4( selfadjointeigensolver(MatrixXd(1,1)) );
CALL_SUBTEST_4( selfadjointeigensolver(MatrixXd(2,2)) );
CALL_SUBTEST_6( selfadjointeigensolver(Matrix<double,1,1>()) );
CALL_SUBTEST_7( selfadjointeigensolver(Matrix<double,2,2>()) );
}
// Test problem size constructors
s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4);
CALL_SUBTEST_8(SelfAdjointEigenSolver<MatrixXf> tmp1(s));
CALL_SUBTEST_8(Tridiagonalization<MatrixXf> tmp2(s));
TEST_SET_BUT_UNUSED_VARIABLE(s)
}
开发者ID:aeslaughter,项目名称:libmesh,代码行数:34,代码来源:eigensolver_selfadjoint.cpp
示例16: test_eigen2_nomalloc
void test_eigen2_nomalloc()
{
// check that our operator new is indeed called:
VERIFY_RAISES_ASSERT(MatrixXd dummy = MatrixXd::Random(3,3));
CALL_SUBTEST_1( nomalloc(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2( nomalloc(Matrix4d()) );
CALL_SUBTEST_3( nomalloc(Matrix<float,32,32>()) );
}
开发者ID:151706061,项目名称:ParaView,代码行数:8,代码来源:eigen2_nomalloc.cpp
示例17: test_swap
void test_swap()
{
int s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE);
CALL_SUBTEST_1( swap(Matrix3f()) ); // fixed size, no vectorization
CALL_SUBTEST_2( swap(Matrix4d()) ); // fixed size, possible vectorization
CALL_SUBTEST_3( swap(MatrixXd(s,s)) ); // dyn size, no vectorization
CALL_SUBTEST_4( swap(MatrixXf(s,s)) ); // dyn size, possible vectorization
TEST_SET_BUT_UNUSED_VARIABLE(s)
}
开发者ID:BRAINSia,项目名称:eigen,代码行数:9,代码来源:swap.cpp
示例18: test_miscmatrices
void test_miscmatrices()
{
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( miscMatrices(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2( miscMatrices(Matrix4d()) );
CALL_SUBTEST_3( miscMatrices(MatrixXcf(3, 3)) );
CALL_SUBTEST_4( miscMatrices(MatrixXi(8, 12)) );
CALL_SUBTEST_5( miscMatrices(MatrixXcd(20, 20)) );
}
}
开发者ID:23119841,项目名称:openbr,代码行数:10,代码来源:miscmatrices.cpp
示例19: test_eigen2_product_small
void test_eigen2_product_small()
{
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( product(Matrix<float, 3, 2>()) );
CALL_SUBTEST_2( product(Matrix<int, 3, 5>()) );
CALL_SUBTEST_3( product(Matrix3d()) );
CALL_SUBTEST_4( product(Matrix4d()) );
CALL_SUBTEST_5( product(Matrix4f()) );
}
}
开发者ID:151706061,项目名称:ParaView,代码行数:10,代码来源:eigen2_product_small.cpp
示例20: test_nomalloc
void test_nomalloc()
{
// check that our operator new is indeed called:
VERIFY_RAISES_ASSERT(MatrixXd dummy(MatrixXd::Random(3,3)));
CALL_SUBTEST_1(nomalloc(Matrix<float, 1, 1>()) );
CALL_SUBTEST_2(nomalloc(Matrix4d()) );
CALL_SUBTEST_3(nomalloc(Matrix<float,32,32>()) );
// Check decomposition modules with dynamic matrices that have a known compile-time max size (ctms)
CALL_SUBTEST_4(ctms_decompositions<float>());
}
开发者ID:Aerobota,项目名称:c2tam,代码行数:12,代码来源:nomalloc.cpp
注:本文中的Matrix4d函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论