pca and lda implemented in C++