Cognitive radio network with multiple-input multiple-output is an effective method to improve not only spectrum efficiency, but also energy efficiency. In this article, a linear precoding matrix optimization algorithm, named gradient-aided mutual information optimization (GAMIO), is designed to maximize the secondary users' spectrum efficiency. Unlike the previous algorithms which were developed under a specific input assumption, the GAMIO algorithm can work without imposing any input assumption. Furthermore, a framework is also proposed to develop the energy-efficient algorithm which can work with arbitrary spectrum-efficient algorithm. In this way, an energy-efficient algorithm, which can work under arbitrary input assumption, be developed based on the GAMIO algorithm (EEGAMIO). Numerical results indicate that either the GAMIO algorithm or the EEGAMIO algorithm shows the best performance at the present time.