  Self-dual maximum distance separable codes (self-dual MDS codes) and
self-dual near MDS codes are very important in coding theory and practice.
Thus, it is interesting to construct self-dual MDS or self-dual near MDS codes.
In this paper, we not only give check matrices of dual codes of twisted
generalized Reed-Solomon codes (TGRS codes) but also present the efficient and
necessary condition of self-dual TGRS codes. Moreover, we construct several
classes of self-dual MDS or self-dual near MDS codes from TGRS codes.
