Exemplo n.º 1
0
int
main(int argc, char *argv[])
{

	printf("1..7\n");

	test_special();
	printf("ok 1 - special\n");

	test_special_atan2();
	printf("ok 2 - atan2 special\n");

	test_accuracy();
	printf("ok 3 - accuracy\n");

	test_p2x_atan2();
	printf("ok 4 - atan2 p2x\n");

	test_tiny();
	printf("ok 5 - tiny inputs\n");

	test_atan_huge();
	printf("ok 6 - atan huge inputs\n");

	test_inverse();
	printf("ok 7 - inverse\n");

	return (0);
}
Exemplo n.º 2
0
int
main (int argc, const char **argv)
{
	int         res = 0;
	size_t      i, j;

	for (i = 0; i < num_angle_tests; i ++) {
		if (!test_angle (test_angles[i]))
			res = 1;
	}
	for (i = 0; i < num_angle_tests; i ++) {
		for (j = 0; j < num_scale_tests; j ++) {
			if (!test_transform (test_angles[i], test_scales[j]))
				res = 1;
		}
	}
	for (i = 0; i < num_angle_tests; i ++) {
		for (j = 0; j < num_scale_tests; j ++) {
			if (!test_transform2 (test_angles[i], test_scales[j]))
				res = 1;
		}
	}
	for (i = 0; i < num_angle_tests; i ++) {
		for (j = 0; j < num_scale_tests; j ++) {
			if (!test_inverse (test_angles[i], test_scales[j]))
				res = 1;
		}
	}
	return res;
}
Exemplo n.º 3
0
int main()
{
	int Error(0);

	Error += test_operators();
	Error += test_inverse();

	return Error;
}
Exemplo n.º 4
0
int main (int argc, char **argv)
{
   unsigned int n = 7;

   if (-1 == test_inverse (n, 1e-6, my_reverse))
     {
     }
   return 0;
}
Exemplo n.º 5
0
int main()
{
	int Failed = 0;
	Failed += test_matrixCompMult();
	Failed += test_outerProduct();
	Failed += test_transpose();
	Failed += test_determinant();
	Failed += test_inverse();
	return Failed;
}
Exemplo n.º 6
0
int main()
{
	int Error = 0;

	Error += test_inverse_dmat4x4();
	Error += test_inverse_mat4x4();
	Error += test_operators();
	Error += test_inverse();

	return Error;
}
int main()
{
	int Error = 0;

	Error += test_ctr();
	Error += test_mat3x3();
	Error += test_operators();
	Error += test_inverse();

	return Error;
}
Exemplo n.º 8
0
int main()
{
    int Error(0);

    Error += test_dquat_type();
    Error += test_scalars();
    Error += test_inverse();
    Error += test_mul();

    //std::cout << "Errors count: " << Error << std::endl;
    return Error;
}
Exemplo n.º 9
0
int main()
{
	int Error(0);

	Error += test_dual_quat_ctr();
	Error += test_dquat_type();
	Error += test_scalars();
	Error += test_inverse();
	Error += test_mul();

	return Error;
}
Exemplo n.º 10
0
int main(void)
{
	struct sigaction ding;
	struct weston_matrix M;
	struct inverse_matrix Q;
	int ret;
	double errsup;
	double det;

	ding.sa_handler = stopme;
	sigemptyset(&ding.sa_mask);
	ding.sa_flags = 0;
	sigaction(SIGALRM, &ding, NULL);

	srandom(13);

	M.d[0] = 3.0;	M.d[4] = 17.0;	M.d[8] = 10.0;	M.d[12] = 0.0;
	M.d[1] = 2.0;	M.d[5] = 4.0;	M.d[9] = -2.0;	M.d[13] = 0.0;
	M.d[2] = 6.0;	M.d[6] = 18.0;	M.d[10] = -12;	M.d[14] = 0.0;
	M.d[3] = 0.0;	M.d[7] = 0.0;	M.d[11] = 0.0;	M.d[15] = 1.0;

	ret = matrix_invert(Q.LU, Q.perm, &M);
	printf("ret = %d\n", ret);
	printf("det = %g\n\n", determinant(&M));

	if (ret != 0)
		return 1;

	print_inverse_data_matrix(&Q);
	printf("P * A = L * U\n");
	print_permutation_matrix(&Q);
	print_LU_decomposition(&Q);


	printf("a random matrix:\n");
	randomize_matrix(&M);
	det = determinant(&M);
	print_matrix(&M);
	errsup = test_inverse(&M);
	printf("\nThe matrix multiplied by its inverse, error:\n");
	print_matrix(&M);
	printf("max abs error: %g, original determinant %g\n", errsup, det);

	test_loop_precision();
	test_loop_speed_matrixvector();
	test_loop_speed_inversetransform();
	test_loop_speed_invert();
	test_loop_speed_invert_explicit();

	return 0;
}
Exemplo n.º 11
0
int main()
{
    int Error(0);

#ifdef GLM_META_PROG_HELPERS
    assert(glm::mat2::rows == glm::mat2::row_type::components);
    assert(glm::mat2::cols == glm::mat2::col_type::components);
#endif

    Error += test_ctr();
    Error += test_operators();
    Error += test_inverse();

    return Error;
}
Exemplo n.º 12
0
int main(void)
{
	size_t i;
	int formats[] = {
		FORMAT_SIGNED_WORD,
		FORMAT_SIGNED_DWORD,
		FORMAT_SIGNED_QWORD
	};

	for (i = 0; i < sizeof(formats)/sizeof(formats[0]); i++) {
		if (!test_inverse(formats[i]))
			return -1;
	}
	return 0;
}
Exemplo n.º 13
0
int main()
{
    test_op();
    test_Transformation_E3();
    test_Transformation_E3_operator_mult();
    test_rotation();
    test_inverse();
    test_Bbox_E3_operator_incr();
    test_polygon_Bbox();
    test_polygon_quad_subdivide();
    test_polygon_normal();

    test_dominant();

    runme();
}
Exemplo n.º 14
0
int main()
{
	int Error(0);

#ifdef GLM_META_PROG_HELPERS
		assert(glm::dualquat::components == glm::dualquat().length());
#endif

	Error += test_dual_quat_ctr();
	Error += test_dquat_type();
	Error += test_scalars();
	Error += test_inverse();
	Error += test_mul();

	return Error;
}
//uruchamiaj wszystkie testy po kolei
void Tester::run(){
	cout<< "Test-start" <<endl;

	autotest_crt(1000);
	test_inverse();
	autotest_inverse(100000);
	test_rest();
	test_hex();
	test_divide();
	test_multpily();
	test_bigger();
	test_smaller();
	test_add();
	test_substract();
	
	cout<< "Test-koniec" <<endl;
}
Exemplo n.º 16
0
int main()
{
	int Error = 0;

	repro Repro;

	Error += cast::test();
	Error += test_ctr();
	Error += test_inverse_dmat4x4();
	Error += test_inverse_mat4x4();
	Error += test_operators();
	Error += test_inverse();
	Error += test_size();

	Error += perf_mul();

	return Error;
}
Exemplo n.º 17
0
static int
test(void)
{
	struct weston_matrix m;
	double det, errsup;

	randomize_matrix(&m);
	det = determinant(&m);

	errsup = test_inverse(&m);
	if (errsup < 1e-6)
		return TEST_OK;

	if (fabs(det) < 1e-5 && isinf(errsup))
		return TEST_NOT_INVERTIBLE_OK;

	printf("test fail, det: %g, error sup: %g\n", det, errsup);

	return TEST_FAIL;
}
Exemplo n.º 18
0
int main()
{
	int Error = 0;

	repro Repro;

#ifdef GLM_META_PROG_HELPERS
		assert(glm::mat4::rows == glm::mat4::row_type::components);
		assert(glm::mat4::cols == glm::mat4::col_type::components);
#endif

	Error += cast::test();
	Error += test_ctr();
	Error += test_inverse_dmat4x4();
	Error += test_inverse_mat4x4();
	Error += test_operators();
	Error += test_inverse();

	Error += perf_mul();

	return Error;
}