コード例 #1
5
    def test_dmatrix_2dim(self):

        dmatrix = ci.dmatrix(self.dim1, self.dim2)

        self.assertEqual(dmatrix.shape, (self.dim1, self.dim2))
コード例 #2
0
    def test_zero_states(self):

        nx = 0
        xdata_ref = ci.dmatrix(0, 0)

        # In this case, the input value is not used by the function, and
        # therefor irrelevant at this point

        xdata = inputchecks.check_states_data(None, nx, self.number_of_intervals)
        assert_array_equal(xdata, xdata_ref)
コード例 #3
0
    def test_zero_controls(self):

        # In this case, the input value is not used by the function, and
        # therefor irrelevant at this point

        nq = 0
        qdata_ref = ci.dmatrix(0, 1)

        qdata = inputchecks.check_constant_controls_data(None, nq)
        assert_array_equal(qdata, qdata_ref)
コード例 #4
0
    def test_zero_controls(self):

        # In this case, the input value is not used by the function, and
        # therefor irrelevant at this point

        nu = 0
        udata_ref = ci.dmatrix(0, self.number_of_controls)

        udata = inputchecks.check_controls_data(None, nu, self.number_of_controls)
        assert_array_equal(udata, udata_ref)
コード例 #5
0
    def test_zero_controls(self):

        # In this case, the input value is not used by the function, and
        # therefor irrelevant at this point

        nq = 0
        qdata_ref = ci.dmatrix(0, 1)

        qdata = inputchecks.check_constant_controls_data(None, nq)
        assert_array_equal(qdata, qdata_ref)
コード例 #6
0
    def test_zero_equation_errors(self):

        neps_u = 0

        weps_u_ref = ci.dmatrix(0, 0)

        # In this case, the input value is not used by the function, and
        # therefor irrelevant at this point

        weps_u = inputchecks.check_input_error_weightings(None, neps_u, self.number_of_intervals)
        assert_array_equal(weps_u, weps_u_ref)
コード例 #7
0
    def test_zero_states(self):

        nx = 0
        xdata_ref = ci.dmatrix(0, 0)

        # In this case, the input value is not used by the function, and
        # therefor irrelevant at this point

        xdata = inputchecks.check_states_data(None, nx, \
            self.number_of_intervals)
        assert_array_equal(xdata, xdata_ref)
コード例 #8
0
    def test_zero_controls(self):

        # In this case, the input value is not used by the function, and
        # therefor irrelevant at this point

        nu = 0
        udata_ref = ci.dmatrix(0, self.number_of_controls)

        udata = inputchecks.check_controls_data(None, \
            nu, self.number_of_controls)
        assert_array_equal(udata, udata_ref)
コード例 #9
0
    def test_zero_equation_errors(self):

        neps_u = 0

        weps_u_ref = ci.dmatrix(0, 0)

        # In this case, the input value is not used by the function, and
        # therefor irrelevant at this point

        weps_u = inputchecks.check_input_error_weightings(None, \
            neps_u, self.number_of_intervals)
        assert_array_equal(weps_u, weps_u_ref)
コード例 #10
0
    def test_dmatrix_2dim(self):

        dmatrix = ci.dmatrix(self.dim1, self.dim2)

        self.assertEqual(dmatrix.shape, (self.dim1, self.dim2))
コード例 #11
0
    def test_dmatrix_1dim(self):

        dmatrix = ci.dmatrix(self.dim1)

        self.assertEqual(dmatrix.shape, (self.dim1, 1))
コード例 #12
0
    def test_dmatrix_1dim(self):

        dmatrix = ci.dmatrix(self.dim1)

        self.assertEqual(dmatrix.shape, (self.dim1, 1))