def compute_partials(self, inputs, partials):
    if ((self.metadata['jacobian_type'] != 'matvec') and (not self.metadata['finite_difference'])):
        angle_param = self._cycle_names[self.angle_param]
        angle = inputs[angle_param]
        num_var = self.num_var
        var_shape = self.var_shape
        var_size = np.prod(var_shape)
        x = self._inputs_to_vector(inputs)
        size = self.size
        A = _compute_A(size, angle)
        dA = _compute_dA(size, angle)
        dA_x = np.atleast_2d(dA.dot(x)).T
        pd_type = self.metadata['partial_type']
        dtheta = np.array([[1.0]])
        y_name = self._cycle_names['y']
        x_name = self._cycle_names['x']
        for out_idx in range(num_var):
            out_var = y_name.format(out_idx)
            for in_idx in range(num_var):
                in_var = x_name.format(in_idx)
                Aij = A[(array_idx(out_idx, var_size), array_idx(in_idx, var_size))]
                J_y_x = self.make_jacobian_entry(Aij, pd_type)
                J_y_angle = self.make_jacobian_entry(dA_x[array_idx(out_idx, var_size)], pd_type)
                partials[(out_var, in_var)] = J_y_x
                partials[(out_var, angle_param)] = J_y_angle
        theta_out = self._cycle_names['theta_out']
        theta = self._cycle_names['theta']
        partials[(theta_out, theta)] = self.make_jacobian_entry(dtheta, pd_type)
def compute_partials(self, inputs, partials):
    if ((self.metadata['jacobian_type'] != 'matvec') and (not self.metadata['finite_difference'])):
        angle_param = self._cycle_names[self.angle_param]
        angle = inputs[angle_param]
        num_var = self.num_var
        var_shape = self.var_shape
        var_size = np.prod(var_shape)
        x = self._inputs_to_vector(inputs)
        size = self.size
        A = _compute_A(size, angle)
        dA = _compute_dA(size, angle)
        dA_x = np.atleast_2d(dA.dot(x)).T
        pd_type = self.metadata['partial_type']
        dtheta = np.array([[1.0]])
        y_name = self._cycle_names['y']
        x_name = self._cycle_names['x']
        for out_idx in range(num_var):
            out_var = y_name.format(out_idx)
            for in_idx in range(num_var):
                in_var = x_name.format(in_idx)
                Aij = A[(array_idx(out_idx, var_size), array_idx(in_idx, var_size))]
                J_y_x = self.make_jacobian_entry(Aij, pd_type)
                J_y_angle = self.make_jacobian_entry(dA_x[array_idx(out_idx, var_size)], pd_type)
                partials[(out_var, in_var)] = J_y_x
                partials[(out_var, angle_param)] = J_y_angle
        theta_out = self._cycle_names['theta_out']
        theta = self._cycle_names['theta']
        partials[(theta_out, theta)] = self.make_jacobian_entry(dtheta, pd_type)