Quasi-Inner Products and Their Applications