15 using namespace shogun;
33 "void CRandomFourierGaussPreproc::copy(...): feats.randomcoeff_additive==NULL && cur_dim_feature_space>0 \n");
49 "void CRandomFourierGaussPreproc::copy(...): feats.randomcoeff_multiplicative==NULL && cur_dim_feature_space>0 &&(cur_dim_input_space>0) \n");
149 "void CRandomFourierGaussPreproc::set_dim_feature_space(const int32 dim): dim<=0 is not allowed");
161 if (kernelwidth2 <= 0) {
163 "void CRandomFourierGaussPreproc::set_kernelwidth(const float64_t kernelwidth2 ): kernelwidth2 <= 0 is not allowed");
175 "void CRandomFourierGaussPreproc::set_dim_input_space(const int32 dim): dim<=0 is not allowed");
201 "bool CRandomFourierGaussPreproc::init_randomcoefficients(): dim_feature_space<=0 is not allowed\n");
205 "bool CRandomFourierGaussPreproc::init_randomcoefficients(): dim_input_space<=0 is not allowed\n");
213 SG_INFO(
"initializing randomcoefficients \n") ;
251 SG_INFO(
"finished: initializing randomcoefficients \n") ;
258 float64_t ** randomcoeff_multiplicative2, int32_t *dim_feature_space2,
259 int32_t *dim_input_space2,
float64_t* kernelwidth2)
const {
261 ASSERT(randomcoeff_additive2);
262 ASSERT(randomcoeff_multiplicative2);
265 *dim_feature_space2 = 0;
266 *dim_input_space2 = 0;
268 *randomcoeff_additive2 = NULL;
269 *randomcoeff_multiplicative2 = NULL;
281 *randomcoeff_additive2);
283 *randomcoeff_multiplicative2);
291 const int32_t dim_feature_space2,
const int32_t dim_input_space2,
const float64_t kernelwidth2) {
310 std::copy(randomcoeff_additive2, randomcoeff_additive2
312 std::copy(randomcoeff_multiplicative2, randomcoeff_multiplicative2
321 "CRandomFourierGaussPreproc::init (CFeatures *f) requires CDenseFeatures<float64_t> as features\n");
325 "CRandomFourierGaussPreproc::init (CFeatures *f) requires CDenseFeatures<float64_t> as features\n");
329 "CRandomFourierGaussPreproc::init (CFeatures *f): dim_feature_space<=0 is not allowed, use void set_dim_feature_space(const int32 dim) before!\n");
332 SG_INFO(
"calling CRandomFourierGaussPreproc::init(...)\n");
333 int32_t num_features =
354 "float64_t * CRandomFourierGaussPreproc::apply_to_feature_vector(...): test_rfinited()==false: you need to call before CRandomFourierGaussPreproc::init (CFeatures *f) OR 1. set_dim_feature_space(const int32 dim), 2. set_dim_input_space(const int32 dim), 3. init_randomcoefficients() or set_randomcoefficients(...) \n");
374 int32_t num_vectors = 0;
375 int32_t num_features = 0;
377 num_features, num_vectors);
378 SG_INFO(
"get Feature matrix: %ix%i\n", num_vectors, num_features);
383 "float64_t * CRandomFourierGaussPreproc::apply_to_feature_matrix(CFeatures *f): num_features!=cur_dim_input_space is not allowed\n");
392 for (int32_t vec = 0; vec < num_vectors; vec++)
400 cur_dim_input_space));