@@ -204,49 +204,49 @@ double stdlib_stats_dmeanors( const struct ndarray *arrays[] );
204204#include < stdio.h>
205205
206206int main ( void ) {
207- // Create a data buffer:
208- const double data[ ] = { 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 };
207+ // Create a data buffer:
208+ const double data[ ] = { 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 };
209209
210- // Specify the number of array dimensions:
211- const int64_t ndims = 1;
210+ // Specify the number of array dimensions:
211+ const int64_t ndims = 1;
212212
213213 // Specify the array shape:
214- int64_t shape[] = { 4 };
214+ int64_t shape[] = { 4 };
215215
216- // Specify the array strides:
217- int64_t strides[] = { 2*STDLIB_NDARRAY_FLOAT64_BYTES_PER_ELEMENT };
216+ // Specify the array strides:
217+ int64_t strides[] = { 2*STDLIB_NDARRAY_FLOAT64_BYTES_PER_ELEMENT };
218218
219- // Specify the byte offset:
220- const int64_t offset = 0;
219+ // Specify the byte offset:
220+ const int64_t offset = 0;
221221
222- // Specify the array order:
223- const enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
222+ // Specify the array order:
223+ const enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
224224
225- // Specify the index mode:
226- const enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
225+ // Specify the index mode:
226+ const enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
227227
228- // Specify the subscript index modes:
229- int8_t submodes[] = { STDLIB_NDARRAY_INDEX_ERROR };
230- const int64_t nsubmodes = 1;
228+ // Specify the subscript index modes:
229+ int8_t submodes[] = { STDLIB_NDARRAY_INDEX_ERROR };
230+ const int64_t nsubmodes = 1;
231231
232- // Create an ndarray:
233- struct ndarray *x = stdlib_ndarray_allocate( STDLIB_NDARRAY_FLOAT64, (uint8_t *)data, ndims, shape, strides, offset, order, imode, nsubmodes, submodes );
234- if ( x == NULL ) {
235- fprintf( stderr, "Error allocating memory.\n" );
236- exit( 1 );
237- }
232+ // Create an ndarray:
233+ struct ndarray *x = stdlib_ndarray_allocate( STDLIB_NDARRAY_FLOAT64, (uint8_t *)data, ndims, shape, strides, offset, order, imode, nsubmodes, submodes );
234+ if ( x == NULL ) {
235+ fprintf( stderr, "Error allocating memory.\n" );
236+ exit( 1 );
237+ }
238238
239- // Define a list of ndarrays:
240- const struct ndarray *arrays[] = { x };
239+ // Define a list of ndarrays:
240+ const struct ndarray *arrays[] = { x };
241241
242- // Compute the arithmetic mean value:
243- double v = stdlib_stats_dmeanors( arrays );
242+ // Compute the arithmetic mean value:
243+ double v = stdlib_stats_dmeanors( arrays );
244244
245- // Print the result:
246- printf( "mean: %lf\n", v );
245+ // Print the result:
246+ printf( "mean: %lf\n", v );
247247
248- // Free allocated memory:
249- stdlib_ndarray_free( x );
248+ // Free allocated memory:
249+ stdlib_ndarray_free( x );
250250}
251251```
252252
0 commit comments