Beispiel #1
0
void StandardPcaVlatCluster::add(const float * f, size_t dim){
    if(dim != dimPrim)
        retinThrowException("StandardPcaVlatCluster::add => dim != dimPrim");
    
    counter++;
    
    for(size_t i = 0 ; i<dimPrim ; i++)
    {
        (*featc)(i,0) = f[i] - (*meanPrim)(i);
        
    }

    for (size_t k = 0; k < dimPrim; k++) {
        (featDual->data())[k] = vector_ps_double(featc->data(), proj->data()+k*dimPrim, dimPrim);
    }

    if(whitening)
        vector_mul_double(featDual->data(), invsqrtvar->data(), dimPrim);

    if(degre == 1)
        vector_add_double(vlat->data(), featDual->data(), dimDual);
    else
        matrix_Cpaat_double(vlat->data(), featDual->data(), dimDual);
}
Beispiel #2
0
double	vector_n2p2_double (const double* v,size_t n)
{
	return vector_ps_double (v, v, n);
}