Skip to content

Commit

Permalink
fixed the test to do max absolute value instead of the one done by dd…
Browse files Browse the repository at this point in the history
…efault
  • Loading branch information
rjgriffin42 committed Aug 12, 2024
1 parent 8d02b91 commit 12ace31
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public void testCostStateGradientNumerically()
E hybridState = getHybridState(hybridStateIndex);

Random random = new Random(1738L);
DMatrixRMaj currentState = RandomMatrices_DDRM.rectangle(getStateVectorSize(), 1, random);
DMatrixRMaj currentControl = RandomMatrices_DDRM.rectangle(getControlVectorSize(), 1, random);
DMatrixRMaj desiredState = RandomMatrices_DDRM.rectangle(getStateVectorSize(), 1, random);
DMatrixRMaj desiredControl = RandomMatrices_DDRM.rectangle(getControlVectorSize(), 1, random);
DMatrixRMaj constant = RandomMatrices_DDRM.rectangle(getConstantVectorSize(), 1, random);
DMatrixRMaj currentState = RandomMatrices_DDRM.rectangle(getStateVectorSize(), 1, -1.0, 1.0, random);
DMatrixRMaj currentControl = RandomMatrices_DDRM.rectangle(getControlVectorSize(), 1, -1.0, 1.0, random);
DMatrixRMaj desiredState = RandomMatrices_DDRM.rectangle(getStateVectorSize(), 1, -1.0, 1.0, random);
DMatrixRMaj desiredControl = RandomMatrices_DDRM.rectangle(getControlVectorSize(), 1, -1.0, 1.0, random);
DMatrixRMaj constant = RandomMatrices_DDRM.rectangle(getConstantVectorSize(), 1, -1.0, 1.0, random);

DMatrixRMaj costGradient = new DMatrixRMaj(getStateVectorSize(), 1);
DMatrixRMaj expectedCostGradient = new DMatrixRMaj(getStateVectorSize(), 1);
Expand Down Expand Up @@ -69,11 +69,11 @@ public void testCostControlGradientNumerically()
E hybridState = getHybridState(hybridStateIndex);

Random random = new Random(1738L);
DMatrixRMaj currentState = RandomMatrices_DDRM.rectangle(getStateVectorSize(), 1, random);
DMatrixRMaj currentControl = RandomMatrices_DDRM.rectangle(getControlVectorSize(), 1, random);
DMatrixRMaj desiredState = RandomMatrices_DDRM.rectangle(getStateVectorSize(), 1, random);
DMatrixRMaj desiredControl = RandomMatrices_DDRM.rectangle(getControlVectorSize(), 1, random);
DMatrixRMaj constant = RandomMatrices_DDRM.rectangle(getConstantVectorSize(), 1, random);
DMatrixRMaj currentState = RandomMatrices_DDRM.rectangle(getStateVectorSize(), 1, -1.0, 1.0, random);
DMatrixRMaj currentControl = RandomMatrices_DDRM.rectangle(getControlVectorSize(), 1, -1.0, 1.0, random);
DMatrixRMaj desiredState = RandomMatrices_DDRM.rectangle(getStateVectorSize(), 1, -1.0, 1.0, random);
DMatrixRMaj desiredControl = RandomMatrices_DDRM.rectangle(getControlVectorSize(), 1, -1.0, 1.0, random);
DMatrixRMaj constant = RandomMatrices_DDRM.rectangle(getConstantVectorSize(), 1, -1.0, 1.0, random);

DMatrixRMaj costGradient = new DMatrixRMaj(getControlVectorSize(), 1);
DMatrixRMaj expectedCostGradient = new DMatrixRMaj(getControlVectorSize(), 1);
Expand Down Expand Up @@ -109,11 +109,11 @@ public void testCostStateHessianNumerically()
E hybridState = getHybridState(hybridStateIndex);

Random random = new Random(1738L);
DMatrixRMaj currentState = RandomMatrices_DDRM.rectangle(getStateVectorSize(), 1, random);
DMatrixRMaj currentControl = RandomMatrices_DDRM.rectangle(getControlVectorSize(), 1, random);
DMatrixRMaj desiredState = RandomMatrices_DDRM.rectangle(getStateVectorSize(), 1, random);
DMatrixRMaj desiredControl = RandomMatrices_DDRM.rectangle(getControlVectorSize(), 1, random);
DMatrixRMaj constant = RandomMatrices_DDRM.rectangle(getConstantVectorSize(), 1, random);
DMatrixRMaj currentState = RandomMatrices_DDRM.rectangle(getStateVectorSize(), 1, -1.0, 1.0, random);
DMatrixRMaj currentControl = RandomMatrices_DDRM.rectangle(getControlVectorSize(), 1, -1.0, 1.0, random);
DMatrixRMaj desiredState = RandomMatrices_DDRM.rectangle(getStateVectorSize(), 1, -1.0, 1.0, random);
DMatrixRMaj desiredControl = RandomMatrices_DDRM.rectangle(getControlVectorSize(), 1, -1.0, 1.0, random);
DMatrixRMaj constant = RandomMatrices_DDRM.rectangle(getConstantVectorSize(), 1, -1.0, 1.0, random);

DMatrixRMaj costHessian = new DMatrixRMaj(getStateVectorSize(), getStateVectorSize());
DMatrixRMaj expectedCostHessian = new DMatrixRMaj(getStateVectorSize(), getStateVectorSize());
Expand Down

0 comments on commit 12ace31

Please sign in to comment.