Skip to content

Commit 68f4696

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

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • lib/node_modules/@stdlib/blas/ext/base/dcartesian-square

lib/node_modules/@stdlib/blas/ext/base/dcartesian-square/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,13 @@ Note that indexing is relative to the first index. To introduce an offset, use [
7070
```javascript
7171
var Float64Array = require( '@stdlib/array/float64' );
7272

73-
// Initial array...
73+
// Initial array:
7474
var x0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );
7575

76-
// Create an offset view...
76+
// Create an offset view:
7777
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
7878

79+
// Output array:
7980
var out = new Float64Array( 8 );
8081

8182
dcartesianSquare( 'row-major', 2, x1, 1, out, 2 );
@@ -127,7 +128,7 @@ dcartesianSquare.ndarray( 2, x, 1, 2, out, 2, 1, 0 );
127128

128129
## Notes
129130

130-
- For an input array `x` of length `N`, the output array `out` must contain at least `N^2 * LDO` elements.
131+
- For an input array of length `N`, the output array must contain at least `N * N * 2` indexed elements.
131132
- The `LDO` parameter must be greater than or equal to `max(1,N)`.
132133
- If `N <= 0`, both functions return `out` unchanged.
133134

@@ -285,7 +286,7 @@ int main( void ) {
285286

286287
// Print the result:
287288
for ( int i = 0; i < N*N; i++ ) {
288-
printf( "out[ %i ] = ( %lf, %lf )\n", i, out[ i*2 ], out[ i*2+1 ] );
289+
printf( "out[ %i ] = ( %lf, %lf )\n", i, out[ i*2 ], out[ (i*2)+1 ] );
289290
}
290291
}
291292
```

0 commit comments

Comments
 (0)