summaryrefslogtreecommitdiffstats
path: root/bench/libdimension/geometry.c
diff options
context:
space:
mode:
Diffstat (limited to 'bench/libdimension/geometry.c')
-rw-r--r--bench/libdimension/geometry.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/bench/libdimension/geometry.c b/bench/libdimension/geometry.c
index 074f34c..a80c0ff 100644
--- a/bench/libdimension/geometry.c
+++ b/bench/libdimension/geometry.c
@@ -30,7 +30,7 @@ main()
double result;
sandglass_t sandglass;
- sandglass_attributes_t attr = { SANDGLASS_MONOTONIC, SANDGLASS_REALTICKS };
+ sandglass_attributes_t attr = { SANDGLASS_MONOTONIC, SANDGLASS_CPUTIME };
if (sandglass_create(&sandglass, &attr, &attr) != 0) {
perror("sandglass_create()");
@@ -38,13 +38,13 @@ main()
}
/* dmnsn_vector_construct() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
vector = dmnsn_vector_construct(1.0, 2.0, 3.0);
});
printf("dmnsn_vector_construct(): %ld\n", sandglass.grains);
/* dmnsn_matrix_construct() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
matrix = dmnsn_matrix_construct(1.0, 1.0, 0.0, 0.0,
1.0, 1.0, 1.0, 0.0,
0.0, 1.0, 1.0, 0.0,
@@ -53,86 +53,86 @@ main()
printf("dmnsn_matrix_construct(): %ld\n", sandglass.grains);
/* dmnsn_identity_matrix() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
matrix = dmnsn_identity_matrix();
});
printf("dmnsn_identity_matrix(): %ld\n", sandglass.grains);
/* dmnsn_scale_matrix() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
matrix = dmnsn_scale_matrix(vector);
});
printf("dmnsn_scale_matrix(): %ld\n", sandglass.grains);
/* dmnsn_identity_matrix() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
matrix = dmnsn_translation_matrix(vector);
});
printf("dmnsn_translation_matrix(): %ld\n", sandglass.grains);
/* dmnsn_rotation_matrix() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
matrix = dmnsn_rotation_matrix(vector);
});
printf("dmnsn_rotation_matrix(): %ld\n", sandglass.grains);
/* dmnsn_line_construct() */
vector2 = dmnsn_vector_construct(3.0, 2.0, 1.0);
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
line = dmnsn_line_construct(vector, vector2);
});
printf("dmnsn_line_construct(): %ld\n", sandglass.grains);
/* dmnsn_vector_add() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
vector = dmnsn_vector_add(vector, vector2);
});
printf("dmnsn_vector_add(): %ld\n", sandglass.grains);
/* dmnsn_vector_sub() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
vector = dmnsn_vector_sub(vector, vector2);
});
printf("dmnsn_vector_sub(): %ld\n", sandglass.grains);
/* dmnsn_vector_mul() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
vector = dmnsn_vector_mul(2.0, vector);
});
printf("dmnsn_vector_mul(): %ld\n", sandglass.grains);
/* dmnsn_vector_div() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
vector = dmnsn_vector_div(vector, 2.0);
});
printf("dmnsn_vector_div(): %ld\n", sandglass.grains);
/* dmnsn_vector_cross() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
vector = dmnsn_vector_cross(vector, vector2);
});
printf("dmnsn_vector_cross(): %ld\n", sandglass.grains);
/* dmnsn_vector_dot() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
result = dmnsn_vector_dot(vector, vector2);
});
printf("dmnsn_vector_dot(): %ld\n", sandglass.grains);
/* dmnsn_vector_norm() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
result = dmnsn_vector_norm(vector);
});
printf("dmnsn_vector_norm(): %ld\n", sandglass.grains);
/* dmnsn_vector_normalize() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
vector = dmnsn_vector_normalize(vector);
});
printf("dmnsn_vector_normalize(): %ld\n", sandglass.grains);
/* dmnsn_matrix_inverse() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
matrix = dmnsn_matrix_inverse(matrix);
});
printf("dmnsn_matrix_inverse(): %ld\n", sandglass.grains);
@@ -142,37 +142,37 @@ main()
1.0, 1.0, 1.0, 0.0,
0.0, 1.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0);
- sandglass_bench(&sandglass, {
- matrix2 = dmnsn_matrix_inverse(matrix2);
+ sandglass_bench_fine(&sandglass, {
+ matrix = dmnsn_matrix_inverse(matrix2);
});
printf("dmnsn_matrix_inverse(HARD): %ld\n", sandglass.grains);
/* dmnsn_matrix_mul() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
matrix = dmnsn_matrix_mul(matrix, matrix2);
});
printf("dmnsn_matrix_mul(): %ld\n", sandglass.grains);
/* dmnsn_matrix_vector_mul() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
vector = dmnsn_matrix_vector_mul(matrix, vector);
});
printf("dmnsn_matrix_vector_mul(): %ld\n", sandglass.grains);
/* dmnsn_matrix_line_mul() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
line = dmnsn_matrix_line_mul(matrix, line);
});
printf("dmnsn_matrix_line_mul(): %ld\n", sandglass.grains);
/* dmnsn_line_point() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
vector = dmnsn_line_point(line, result);
});
printf("dmnsn_line_point(): %ld\n", sandglass.grains);
/* dmnsn_line_index() */
- sandglass_bench(&sandglass, {
+ sandglass_bench_fine(&sandglass, {
result = dmnsn_line_index(line, vector);
});
printf("dmnsn_line_index(): %ld\n", sandglass.grains);