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");
140 "void CRandomFourierGaussPreproc::set_dim_feature_space(const int32 dim): dim<=0 is not allowed");
152 if (kernelwidth2 <= 0) {
154 "void CRandomFourierGaussPreproc::set_kernelwidth(const float64_t kernelwidth2 ): kernelwidth2 <= 0 is not allowed");
166 "void CRandomFourierGaussPreproc::set_dim_input_space(const int32 dim): dim<=0 is not allowed");
192 "bool CRandomFourierGaussPreproc::init_randomcoefficients(): dim_feature_space<=0 is not allowed\n");
196 "bool CRandomFourierGaussPreproc::init_randomcoefficients(): dim_input_space<=0 is not allowed\n");
204 SG_INFO(
"initializing randomcoefficients \n") ;
242 SG_INFO(
"finished: initializing randomcoefficients \n") ;
249 float64_t ** randomcoeff_multiplicative2, int32_t *dim_feature_space2,
250 int32_t *dim_input_space2,
float64_t* kernelwidth2)
const {
252 ASSERT(randomcoeff_additive2);
253 ASSERT(randomcoeff_multiplicative2);
256 *dim_feature_space2 = 0;
257 *dim_input_space2 = 0;
259 *randomcoeff_additive2 = NULL;
260 *randomcoeff_multiplicative2 = NULL;
272 *randomcoeff_additive2);
274 *randomcoeff_multiplicative2);
282 const int32_t dim_feature_space2,
const int32_t dim_input_space2,
const float64_t kernelwidth2) {
301 std::copy(randomcoeff_additive2, randomcoeff_additive2
303 std::copy(randomcoeff_multiplicative2, randomcoeff_multiplicative2
312 "CRandomFourierGaussPreproc::init (CFeatures *f) requires CSimpleFeatures<float64_t> as features\n");
316 "CRandomFourierGaussPreproc::init (CFeatures *f) requires CSimpleFeatures<float64_t> as features\n");
320 "CRandomFourierGaussPreproc::init (CFeatures *f): dim_feature_space<=0 is not allowed, use void set_dim_feature_space(const int32 dim) before!\n");
323 SG_INFO(
"calling CRandomFourierGaussPreproc::init(...)\n");
324 int32_t num_features =
345 "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");
365 int32_t num_vectors = 0;
366 int32_t num_features = 0;
368 num_features, num_vectors);
369 SG_INFO(
"get Feature matrix: %ix%i\n", num_vectors, num_features);
374 "float64_t * CRandomFourierGaussPreproc::apply_to_feature_matrix(CFeatures *f): num_features!=cur_dim_input_space is not allowed\n");
381 "CRandomFourierGaussPreproc::apply_to_feature_matrix(...): memory allocation failed \n");
385 for (int32_t vec = 0; vec < num_vectors; vec++) {
391 cur_dim_input_space));
395 cur_dim_feature_space, num_vectors);
398 num_features, num_vectors);
399 ASSERT(num_features==cur_dim_feature_space);