Skip to content

Commit 0fcfeef

Browse files
feat: adding the value of complex notation in base-claset
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 4304bee commit 0fcfeef

6 files changed

Lines changed: 40 additions & 290 deletions

File tree

lib/node_modules/@stdlib/lapack/base/claset/README.md

Lines changed: 7 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ Sets the off-diagonal elements and the diagonal elements of a single-precision c
3737
```javascript
3838
var Complex64Array = require( '@stdlib/array/complex64' );
3939
var Complex64 = require( '@stdlib/complex/float32/ctor' );
40-
var realf = require( '@stdlib/complex/float32/real' );
41-
var imagf = require( '@stdlib/complex/float32/imag' );
4240

4341
var A = new Complex64Array( 4 );
4442

@@ -48,22 +46,10 @@ var beta = new Complex64( 3.0, 4.0 );
4846
claset( 'row-major', 'all', 2, 2, alpha, beta, A, 2 );
4947

5048
var z = A.get( 0 );
51-
// returns <Complex64>
52-
53-
var re = realf( z );
54-
// returns 3.0
55-
56-
var im = imagf( z );
57-
// returns 4.0
49+
// returns <Complex64>[ 3.0, 4.0 ]
5850

5951
z = A.get( 1 );
60-
// returns <Complex64>
61-
62-
re = realf( z );
63-
// returns 1.0
64-
65-
im = imagf( z );
66-
// returns 2.0
52+
// returns <Complex64>[ 1.0, 2.0 ]
6753
```
6854

6955
The function has the following parameters:
@@ -84,8 +70,6 @@ Note that indexing is relative to the first index. To introduce an offset, use [
8470
```javascript
8571
var Complex64Array = require( '@stdlib/array/complex64' );
8672
var Complex64 = require( '@stdlib/complex/float32/ctor' );
87-
var realf = require( '@stdlib/complex/float32/real' );
88-
var imagf = require( '@stdlib/complex/float32/imag' );
8973

9074
// Initial array:
9175
var A0 = new Complex64Array( 5 );
@@ -99,13 +83,7 @@ var beta = new Complex64( 3.0, 4.0 );
9983
claset( 'row-major', 'all', 2, 2, alpha, beta, A1, 2 );
10084

10185
var z = A0.get( 1 );
102-
// returns <Complex64>
103-
104-
var re = realf( z );
105-
// returns 3.0
106-
107-
var im = imagf( z );
108-
// returns 4.0
86+
// returns <Complex64>[ 3.0, 4.0 ]
10987
```
11088

11189
#### claset.ndarray( uplo, M, N, alpha, beta, A, sa1, sa2, oa )
@@ -115,8 +93,6 @@ Sets the off-diagonal elements and the diagonal elements of a single-precision c
11593
```javascript
11694
var Complex64Array = require( '@stdlib/array/complex64' );
11795
var Complex64 = require( '@stdlib/complex/float32/ctor' );
118-
var realf = require( '@stdlib/complex/float32/real' );
119-
var imagf = require( '@stdlib/complex/float32/imag' );
12096

12197
var A = new Complex64Array( 4 );
12298

@@ -126,22 +102,10 @@ var beta = new Complex64( 3.0, 4.0 );
126102
claset.ndarray( 'all', 2, 2, alpha, beta, A, 2, 1, 0 );
127103

128104
var z = A.get( 0 );
129-
// returns <Complex64>
130-
131-
var re = realf( z );
132-
// returns 3.0
133-
134-
var im = imagf( z );
135-
// returns 4.0
105+
// returns <Complex64>[ 3.0, 4.0 ]
136106

137107
z = A.get( 1 );
138-
// returns <Complex64>
139-
140-
re = realf( z );
141-
// returns 1.0
142-
143-
im = imagf( z );
144-
// returns 2.0
108+
// returns <Complex64>[ 1.0, 2.0 ]
145109
```
146110

147111
The function has the following parameters:
@@ -161,8 +125,6 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the
161125
```javascript
162126
var Complex64Array = require( '@stdlib/array/complex64' );
163127
var Complex64 = require( '@stdlib/complex/float32/ctor' );
164-
var realf = require( '@stdlib/complex/float32/real' );
165-
var imagf = require( '@stdlib/complex/float32/imag' );
166128

167129
var A = new Complex64Array( 5 );
168130

@@ -172,22 +134,10 @@ var beta = new Complex64( 3.0, 4.0 );
172134
claset.ndarray( 'all', 2, 2, alpha, beta, A, 2, 1, 1 );
173135

174136
var z = A.get( 0 );
175-
// returns <Complex64>
176-
177-
var re = realf( z );
178-
// returns 0.0
179-
180-
var im = imagf( z );
181-
// returns 0.0
137+
// returns <Complex64>[ 0.0, 0.0 ]
182138

183139
z = A.get( 1 );
184-
// returns <Complex64>
185-
186-
re = realf( z );
187-
// returns 3.0
188-
189-
im = imagf( z );
190-
// returns 4.0
140+
// returns <Complex64>[ 3.0, 4.0 ]
191141
```
192142

193143
</section>

lib/node_modules/@stdlib/lapack/base/claset/docs/repl.txt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,8 @@
4646
> var alpha = new {{alias:@stdlib/complex/float32/ctor}}( 1.0, 2.0 );
4747
> var beta = new {{alias:@stdlib/complex/float32/ctor}}( 3.0, 4.0 );
4848
> {{alias}}( 'row-major', 'all', 2, 2, alpha, beta, A, 2 );
49-
> var z = A.get( 0 );
50-
> {{alias:@stdlib/complex/float32/real}}( z )
51-
3.0
52-
> {{alias:@stdlib/complex/float32/imag}}( z )
53-
4.0
49+
> var z = A.get( 0 )
50+
<Complex64>[ 3.0, 4.0 ]
5451

5552

5653
{{alias}}.ndarray( uplo, M, N, alpha, beta, A, sa1, sa2, oa )
@@ -103,11 +100,8 @@
103100
> var alpha = new {{alias:@stdlib/complex/float32/ctor}}( 1.0, 2.0 );
104101
> var beta = new {{alias:@stdlib/complex/float32/ctor}}( 3.0, 4.0 );
105102
> {{alias}}.ndarray( 'all', 2, 2, alpha, beta, A, 2, 1, 1 );
106-
> var z = A.get( 1 );
107-
> {{alias:@stdlib/complex/float32/real}}( z )
108-
3.0
109-
> {{alias:@stdlib/complex/float32/imag}}( z )
110-
4.0
103+
> var z = A.get( 1 )
104+
<Complex64>[ 3.0, 4.0 ]
111105

112106
See Also
113107
--------

lib/node_modules/@stdlib/lapack/base/claset/lib/base.js

Lines changed: 9 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,6 @@ function setLower( M, N, areal, aimag, breal, bimag, A, strideA1, strideA2, offs
475475
* @example
476476
* var Complex64Array = require( '@stdlib/array/complex64' );
477477
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
478-
* var realf = require( '@stdlib/complex/float32/real' );
479-
* var imagf = require( '@stdlib/complex/float32/imag' );
480478
*
481479
* var A = new Complex64Array( 4 );
482480
*
@@ -486,37 +484,17 @@ function setLower( M, N, areal, aimag, breal, bimag, A, strideA1, strideA2, offs
486484
* claset( 'all', 2, 2, alpha, beta, A, 2, 1, 0 );
487485
*
488486
* var z = A.get( 0 );
489-
* // returns <Complex64>
490-
*
491-
* var re = realf( z );
492-
* // returns 3.0
493-
*
494-
* var im = imagf( z );
495-
* // returns 4.0
487+
* // returns <Complex64>[ 3.0, 4.0 ]
496488
*
497489
* z = A.get( 1 );
498-
* // returns <Complex64>
499-
*
500-
* re = realf( z );
501-
* // returns 1.0
502-
*
503-
* im = imagf( z );
504-
* // returns 2.0
490+
* // returns <Complex64>[ 1.0, 2.0 ]
505491
*
506492
* z = A.get( 2 );
507-
* // returns <Complex64>
508-
*
509-
* re = realf( z );
510-
* // returns 1.0
511-
*
512-
* im = imagf( z );
513-
* // returns 2.0
493+
* // returns <Complex64>[ 1.0, 2.0 ]
514494
*
515495
* @example
516496
* var Complex64Array = require( '@stdlib/array/complex64' );
517497
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
518-
* var realf = require( '@stdlib/complex/float32/real' );
519-
* var imagf = require( '@stdlib/complex/float32/imag' );
520498
*
521499
* var A = new Complex64Array( 4 );
522500
*
@@ -526,37 +504,17 @@ function setLower( M, N, areal, aimag, breal, bimag, A, strideA1, strideA2, offs
526504
* claset( 'upper', 2, 2, alpha, beta, A, 2, 1, 0 );
527505
*
528506
* var z = A.get( 0 );
529-
* // returns <Complex64>
530-
*
531-
* var re = realf( z );
532-
* // returns 3.0
533-
*
534-
* var im = imagf( z );
535-
* // returns 4.0
507+
* // returns <Complex64>[ 3.0, 4.0 ]
536508
*
537509
* z = A.get( 1 );
538-
* // returns <Complex64>
539-
*
540-
* re = realf( z );
541-
* // returns 1.0
542-
*
543-
* im = imagf( z );
544-
* // returns 2.0
510+
* // returns <Complex64>[ 1.0, 2.0 ]
545511
*
546512
* z = A.get( 2 );
547-
* // returns <Complex64>
548-
*
549-
* re = realf( z );
550-
* // returns 0.0
551-
*
552-
* im = imagf( z );
553-
* // returns 0.0
513+
* // returns <Complex64>[ 0.0, 0.0 ]
554514
*
555515
* @example
556516
* var Complex64Array = require( '@stdlib/array/complex64' );
557517
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
558-
* var realf = require( '@stdlib/complex/float32/real' );
559-
* var imagf = require( '@stdlib/complex/float32/imag' );
560518
*
561519
* var A = new Complex64Array( 4 );
562520
*
@@ -566,31 +524,13 @@ function setLower( M, N, areal, aimag, breal, bimag, A, strideA1, strideA2, offs
566524
* claset( 'lower', 2, 2, alpha, beta, A, 2, 1, 0 );
567525
*
568526
* var z = A.get( 0 );
569-
* // returns <Complex64>
570-
*
571-
* var re = realf( z );
572-
* // returns 3.0
573-
*
574-
* var im = imagf( z );
575-
* // returns 4.0
527+
* // returns <Complex64>[ 3.0, 4.0 ]
576528
*
577529
* z = A.get( 1 );
578-
* // returns <Complex64>
579-
*
580-
* re = realf( z );
581-
* // returns 0.0
582-
*
583-
* im = imagf( z );
584-
* // returns 0.0
530+
* // returns <Complex64>[ 0.0, 0.0 ]
585531
*
586532
* z = A.get( 2 );
587-
* // returns <Complex64>
588-
*
589-
* re = realf( z );
590-
* // returns 1.0
591-
*
592-
* im = imagf( z );
593-
* // returns 2.0
533+
* // returns <Complex64>[ 1.0, 2.0]
594534
*/
595535
function claset( uplo, M, N, alpha, beta, A, strideA1, strideA2, offsetA ) {
596536
var viewA;

0 commit comments

Comments
 (0)