public double [ ] sampleToEigenSpace ( double [ ] sampleData ) { if ( sampleData . length != A . getNumCols ( ) ) throw new IllegalArgumentException ( "Unexpected sample length" ) ; DMatrixRMaj mean = DMatrixRMaj . wrap ( A . getNumCols ( ) , 1 , this . mean ) ; DMatrixRMaj s = new DMatrixRMaj ( A . getNumCols ( ) , 1 , true , sampleData ) ; DMatrixRMaj r = new DMatrixRMaj ( numComponents , 1 ) ; CommonOps_DDRM . subtract ( s , mean , s ) ; CommonOps_DDRM . mult ( V_t , s , r ) ; return r . data ; }
Converts a vector from sample space into eigen space .