We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39cac36 commit 4151b7eCopy full SHA for 4151b7e
lib/node_modules/@stdlib/ndarray/base/max-view-buffer-index/benchmark/c/benchmark.c
@@ -96,14 +96,14 @@ static double benchmark( void ) {
96
double t;
97
int i;
98
99
- int64_t shape[] = { 10, 10, 10 };
+ const int64_t shape[] = { 10, 10, 10 };
100
int64_t strides[] = { 100, 10, 1 };
101
- int64_t offset = 1000;
102
- int64_t ndims = 3;
+ const int64_t offset = 1000;
+ const int64_t ndims = 3;
103
104
t = tic();
105
for ( i = 0; i < ITERATIONS; i++ ) {
106
- strides[ 0 ] *= ( rand_double() < 0.5 ) ? 1 : -1;
+ strides[ 0 ] *= ( i%2 == 1 ) ? 1 : -1;
107
n = stdlib_ndarray_max_view_buffer_index( ndims, shape, strides, offset );
108
if ( n > 1e10 ) {
109
printf( "unexpected result\n" );
0 commit comments