DrRaj: Formulation of element stiffness matrix will be modified within the software for each beam end release; and structure stiffness matrix rows and columns are probably removed within the software for each fixed dof at constraints.
Assuming x axis is the longitudinal axis of your beam, beam is horizontal, z is vertical direction, left-hand end of your beam is A, right-hand end is D, and loads are applied in z direction, the modeling you are inquiring about is as follows.
(1) To create an internal hinge, create a node at midspan. Let's call this point B. Delete your original beam element and create two elements instead, one from A to B, and the second one from B to D. Now release rotational dof about y axis (dof 5, also called RY) on one of your two beam elements at midspan. You have now modeled an internal hinge.
(2) To model the midspan hinge, place a constraint at B having x translation (dof 1, also called TX) free (released), and having RY free. To create the roller, now delete the beam end release you created in item 1, above.
(3) To model midspan roller and torsional spring, create two midspan nodes an "infinitesimal" distance apart. Let's call them points B and C. Delete the previous beam elements, and create three beam elements (from A to B, B to C, and C to D). Release RY on beam BC at end B. Place a constraint at B having dofs TX and RY free; this is your midspan roller. Zoom in and create a torsional spring element connecting B to C. Good luck.