Partial Inner Product Spaces: Theory and Applications