Skip to content

Commit d8acfc7

Browse files
authored
Apply suggestions from code review
Co-authored-by: Athan <kgryte@gmail.com> Signed-off-by: Athan <kgryte@gmail.com>
1 parent 1322682 commit d8acfc7

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • lib/node_modules/@stdlib/blas/ext/base/ndarray/csum

lib/node_modules/@stdlib/blas/ext/base/ndarray/csum/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ Computes the sum of all elements in a one-dimensional single-precision complex f
135135
#include "stdlib/ndarray/index_modes.h"
136136
#include "stdlib/ndarray/orders.h"
137137
#include "stdlib/ndarray/base/bytes_per_element.h"
138+
#include "stdlib/complex/float32/real.h"
139+
#include "stdlib/complex/float32/imag.h"
138140
#include <stdint.h>
139141

140142
// Create an ndarray:
@@ -148,7 +150,12 @@ struct ndarray *x = stdlib_ndarray_allocate( STDLIB_NDARRAY_COMPLEX64, (uint8_t
148150
// Compute the sum:
149151
const struct ndarray *arrays[] = { x };
150152
stdlib_complex64_t v = stdlib_blas_ext_csum( arrays );
151-
// returns <Complex64>[ 4.0, 6.0 ]
153+
154+
float re = stdlib_complex64_real( v );
155+
// returns 4.0f
156+
157+
float im = stdlib_complex64_imag( v );
158+
// returns 6.0f
152159

153160
// Free allocated memory:
154161
stdlib_ndarray_free( x );

0 commit comments

Comments
 (0)