File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 1
1
- 3.0.1
2
+ - Add positive semi-definite typehinting
2
3
3
4
- 3.0.0
4
5
- No changes
Original file line number Diff line number Diff line change @@ -41,14 +41,14 @@ class Matrix implements Tensor
41
41
/**
42
42
* The number of rows in the matrix.
43
43
*
44
- * @var int
44
+ * @var int<0,max>
45
45
*/
46
46
protected int $ m ;
47
47
48
48
/**
49
49
* The number of columns in the matrix.
50
50
*
51
- * @var int
51
+ * @var int<0,max>
52
52
*/
53
53
protected int $ n ;
54
54
@@ -389,7 +389,7 @@ public function __construct(array $a, bool $validate = true)
389
389
/**
390
390
* Return a tuple with the dimensionality of the tensor.
391
391
*
392
- * @return int[]
392
+ * @return array{ int<0,max>,int<0,max>}
393
393
*/
394
394
public function shape () : array
395
395
{
@@ -419,7 +419,7 @@ public function isSquare() : bool
419
419
/**
420
420
* Return the number of elements in the tensor.
421
421
*
422
- * @return int
422
+ * @return int<0,max>
423
423
*/
424
424
public function size () : int
425
425
{
@@ -429,7 +429,7 @@ public function size() : int
429
429
/**
430
430
* Return the number of rows in the matrix.
431
431
*
432
- * @return int
432
+ * @return int<0,max>
433
433
*/
434
434
public function m () : int
435
435
{
@@ -439,7 +439,7 @@ public function m() : int
439
439
/**
440
440
* Return the number of columns in the matrix.
441
441
*
442
- * @return int
442
+ * @return int<0,max>
443
443
*/
444
444
public function n () : int
445
445
{
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class Vector implements Tensor
34
34
/**
35
35
* The number of elements in the vector.
36
36
*
37
- * @var int
37
+ * @var int<0,max>
38
38
*/
39
39
protected int $ n ;
40
40
@@ -294,7 +294,7 @@ final public function __construct(array $a, bool $validate = true)
294
294
/**
295
295
* Return a tuple with the dimensionality of the tensor.
296
296
*
297
- * @return int[]
297
+ * @return array{ int<0,max>}
298
298
*/
299
299
public function shape () : array
300
300
{
@@ -314,7 +314,7 @@ public function shapeString() : string
314
314
/**
315
315
* Return the number of elements in the vector.
316
316
*
317
- * @return int
317
+ * @return int<0,max>
318
318
*/
319
319
public function size () : int
320
320
{
@@ -324,7 +324,7 @@ public function size() : int
324
324
/**
325
325
* Return the number of rows in the vector.
326
326
*
327
- * @return int
327
+ * @return int<0,max>
328
328
*/
329
329
public function m () : int
330
330
{
@@ -334,7 +334,7 @@ public function m() : int
334
334
/**
335
335
* Return the number of columns in the vector.
336
336
*
337
- * @return int
337
+ * @return int<0,max>
338
338
*/
339
339
public function n () : int
340
340
{
You can’t perform that action at this time.
0 commit comments