Joint Dimension Reduction and Clustering