File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1458,3 +1458,33 @@ func TestVariableVector_String1(t *testing.T) {
1458
1458
}
1459
1459
}
1460
1460
}
1461
+
1462
+ /*
1463
+ TestVariableVector_Power1
1464
+ Description:
1465
+
1466
+ Verifies that the Power method returns a MonomialVector object when
1467
+ computing a power >= 2 for a well-defined variable vector.
1468
+ */
1469
+ func TestVariableVector_Power1 (t * testing.T ) {
1470
+ // Constants
1471
+ vv := symbolic .NewVariableVector (1 )
1472
+
1473
+ // Test
1474
+ r := vv .Power (2 )
1475
+ rAsVV , ok := r .(symbolic.Monomial )
1476
+ if ! ok {
1477
+ t .Errorf (
1478
+ "Expected vv.Power(2) to return a MonomialVector object; received %T" ,
1479
+ r ,
1480
+ )
1481
+ }
1482
+
1483
+ if rAsVV .Dims ()[0 ] != 1 {
1484
+ t .Errorf (
1485
+ "Expected r to have length 1; received %v" ,
1486
+ rAsVV .Dims ()[0 ],
1487
+ )
1488
+ }
1489
+
1490
+ }
You can’t perform that action at this time.
0 commit comments