SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
File.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 1999-2009 Soeren Sonnenburg
8  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  * Copyright (C) 2010 Berlin Institute of Technology
10  */
11 
12 #ifndef __FILE_H__
13 #define __FILE_H__
14 
15 #include <shogun/lib/config.h>
16 
17 #include <shogun/base/SGObject.h>
18 
19 namespace shogun
20 {
21 template <class ST> class SGString;
22 template <class ST> class SGSparseVector;
23 template <class ST> struct SGSparseVectorEntry;
24 
34 class CFile : public CSGObject
35 {
36 public:
38  CFile();
39 
45  CFile(FILE* f, const char* name=NULL);
46 
47 #ifdef HAVE_FDOPEN
48 
54  CFile(int fd, const char* mode, const char* name=NULL);
55 #endif
56 
63  CFile(const char* fname, char rw='r', const char* name=NULL);
64 
66  virtual ~CFile();
67 
69  void close()
70  {
71  SG_FREE(variable_name);
72  SG_FREE(filename);
73  if (file)
74  fclose(file);
75  variable_name=NULL;
76  filename=NULL;
77  file=NULL;
78  }
79 
80 #ifndef SWIG // SWIG should skip this
81 
86  {
87  return file;
88  }
89 
96  void set_variable_name(const char* name);
97 
104  char* get_variable_name();
105 
107  /*virtual DataType get_data_type()=0;*/
108 
110  /*virtual void get_vector(void*& vector, int32_t& len, DataType& dtype);*/
111 
119  virtual void get_vector(bool*& vector, int32_t& len);
120  virtual void get_vector(int8_t*& vector, int32_t& len){};
121  virtual void get_vector(uint8_t*& vector, int32_t& len){};
122  virtual void get_vector(char*& vector, int32_t& len){};
123  virtual void get_vector(int32_t*& vector, int32_t& len){};
124  virtual void get_vector(uint32_t*& vector, int32_t& len){};
125  virtual void get_vector(float64_t*& vector, int32_t& len){};
126  virtual void get_vector(float32_t*& vector, int32_t& len){};
127  virtual void get_vector(floatmax_t*& vector, int32_t& len){};
128  virtual void get_vector(int16_t*& vector, int32_t& len){};
129  virtual void get_vector(uint16_t*& vector, int32_t& len){};
130  virtual void get_vector(int64_t*& vector, int32_t& len){};
131  virtual void get_vector(uint64_t*& vector, int32_t& len){};
133 
135  /*virtual void get_matrix(
136  void*& matrix, int32_t& num_feat, int32_t& num_vec, DataType& dtype);*/
137 
146  virtual void get_matrix(
147  bool*& matrix, int32_t& num_feat, int32_t& num_vec);
148  virtual void get_matrix(
149  uint8_t*& matrix, int32_t& num_feat, int32_t& num_vec){};
150  virtual void get_matrix(
151  int8_t*& matrix, int32_t& num_feat, int32_t& num_vec){};
152  virtual void get_matrix(
153  char*& matrix, int32_t& num_feat, int32_t& num_vec){};
154  virtual void get_matrix(
155  int32_t*& matrix, int32_t& num_feat, int32_t& num_vec){};
156  virtual void get_matrix(
157  uint32_t*& matrix, int32_t& num_feat, int32_t& num_vec){};
158  virtual void get_matrix(
159  int64_t*& matrix, int32_t& num_feat, int32_t& num_vec){};
160  virtual void get_matrix(
161  uint64_t*& matrix, int32_t& num_feat, int32_t& num_vec){};
162  virtual void get_matrix(
163  float32_t*& matrix, int32_t& num_feat, int32_t& num_vec){};
164  virtual void get_matrix(
165  float64_t*& matrix, int32_t& num_feat, int32_t& num_vec){};
166  virtual void get_matrix(
167  floatmax_t*& matrix, int32_t& num_feat, int32_t& num_vec){};
168  virtual void get_matrix(
169  int16_t*& matrix, int32_t& num_feat, int32_t& num_vec){};
170  virtual void get_matrix(
171  uint16_t*& matrix, int32_t& num_feat, int32_t& num_vec){};
173 
175  /*virtual void get_ndarray(
176  void*& array, int32_t*& dims, int32_t& num_dims, DataType& dtype);*/
177 
186  virtual void get_ndarray(
187  uint8_t*& array, int32_t*& dims, int32_t& num_dims){};
188  virtual void get_ndarray(
189  char*& array, int32_t*& dims, int32_t& num_dims){};
190  virtual void get_ndarray(
191  int32_t*& array, int32_t*& dims, int32_t& num_dims){};
192  virtual void get_ndarray(
193  float32_t*& array, int32_t*& dims, int32_t& num_dims){};
194  virtual void get_ndarray(
195  float64_t*& array, int32_t*& dims, int32_t& num_dims){};
196  virtual void get_ndarray(
197  int16_t*& array, int32_t*& dims, int32_t& num_dims){};
198  virtual void get_ndarray(
199  uint16_t*& array, int32_t*& dims, int32_t& num_dims){};
201  //
209  virtual void get_sparse_vector(
210  SGSparseVectorEntry<bool>*& entries, int32_t& num_feat);
211  virtual void get_sparse_vector(
212  SGSparseVectorEntry<uint8_t>*& entries, int32_t& num_feat);
213  virtual void get_sparse_vector(
214  SGSparseVectorEntry<int8_t>*& entries, int32_t& num_feat);
215  virtual void get_sparse_vector(
216  SGSparseVectorEntry<char>*& entries, int32_t& num_feat);
217  virtual void get_sparse_vector(
218  SGSparseVectorEntry<int32_t>*& entries, int32_t& num_feat);
219  virtual void get_sparse_vector(
220  SGSparseVectorEntry<uint32_t>*& entries, int32_t& num_feat);
221  virtual void get_sparse_vector(
222  SGSparseVectorEntry<int64_t>*& entries, int32_t& num_feat);
223  virtual void get_sparse_vector(
224  SGSparseVectorEntry<uint64_t>*& entries, int32_t& num_feat);
225  virtual void get_sparse_vector(
226  SGSparseVectorEntry<int16_t>*& entries, int32_t& num_feat);
227  virtual void get_sparse_vector(
228  SGSparseVectorEntry<uint16_t>*& entries, int32_t& num_feat);
229  virtual void get_sparse_vector(
230  SGSparseVectorEntry<float32_t>*& entries, int32_t& num_feat);
231  virtual void get_sparse_vector(
232  SGSparseVectorEntry<float64_t>*& entries, int32_t& num_feat);
233  virtual void get_sparse_vector(
234  SGSparseVectorEntry<floatmax_t>*& entries, int32_t& num_feat);
236 
245  virtual void get_sparse_matrix(
246  SGSparseVector<bool>*& matrix, int32_t& num_feat, int32_t& num_vec){};
247  virtual void get_sparse_matrix(
248  SGSparseVector<uint8_t>*& matrix, int32_t& num_feat, int32_t& num_vec){};
249  virtual void get_sparse_matrix(
250  SGSparseVector<int8_t>*& matrix, int32_t& num_feat, int32_t& num_vec){};
251  virtual void get_sparse_matrix(
252  SGSparseVector<char>*& matrix, int32_t& num_feat, int32_t& num_vec){};
253  virtual void get_sparse_matrix(
254  SGSparseVector<int32_t>*& matrix, int32_t& num_feat, int32_t& num_vec){};
255  virtual void get_sparse_matrix(
256  SGSparseVector<uint32_t>*& matrix, int32_t& num_feat, int32_t& num_vec){};
257  virtual void get_sparse_matrix(
258  SGSparseVector<int64_t>*& matrix, int32_t& num_feat, int32_t& num_vec){};
259  virtual void get_sparse_matrix(
260  SGSparseVector<uint64_t>*& matrix, int32_t& num_feat, int32_t& num_vec){};
261  virtual void get_sparse_matrix(
262  SGSparseVector<int16_t>*& matrix, int32_t& num_feat, int32_t& num_vec){};
263  virtual void get_sparse_matrix(
264  SGSparseVector<uint16_t>*& matrix, int32_t& num_feat, int32_t& num_vec){};
265  virtual void get_sparse_matrix(
266  SGSparseVector<float32_t>*& matrix, int32_t& num_feat, int32_t& num_vec){};
267  virtual void get_sparse_matrix(
268  SGSparseVector<float64_t>*& matrix, int32_t& num_feat, int32_t& num_vec){};
269  virtual void get_sparse_matrix(
270  SGSparseVector<floatmax_t>*& matrix, int32_t& num_feat, int32_t& num_vec){};
272 
273 
282  virtual void get_string_list(
283  SGString<bool>*& strings, int32_t& num_str,
284  int32_t& max_string_len);
285  virtual void get_string_list(
286  SGString<uint8_t>*& strings, int32_t& num_str,
287  int32_t& max_string_len){};
288  virtual void get_string_list(
289  SGString<int8_t>*& strings, int32_t& num_str,
290  int32_t& max_string_len){};
291  virtual void get_string_list(
292  SGString<char>*& strings, int32_t& num_str,
293  int32_t& max_string_len){};
294  virtual void get_string_list(
295  SGString<int32_t>*& strings, int32_t& num_str,
296  int32_t& max_string_len){};
297  virtual void get_string_list(
298  SGString<uint32_t>*& strings, int32_t& num_str,
299  int32_t& max_string_len){};
300  virtual void get_string_list(
301  SGString<int16_t>*& strings, int32_t& num_str,
302  int32_t& max_string_len){};
303  virtual void get_string_list(
304  SGString<uint16_t>*& strings, int32_t& num_str,
305  int32_t& max_string_len){};
306  virtual void get_string_list(
307  SGString<int64_t>*& strings, int32_t& num_str,
308  int32_t& max_string_len){};
309  virtual void get_string_list(
310  SGString<uint64_t>*& strings, int32_t& num_str,
311  int32_t& max_string_len){};
312  virtual void get_string_list(
313  SGString<float32_t>*& strings, int32_t& num_str,
314  int32_t& max_string_len){};
315  virtual void get_string_list(
316  SGString<float64_t>*& strings, int32_t& num_str,
317  int32_t& max_string_len){};
318  virtual void get_string_list(
319  SGString<floatmax_t>*& strings, int32_t& num_str,
320  int32_t& max_string_len){};
322 
324  /*virtual void get_vector(void*& vector, int32_t& len, DataType& dtype);*/
325 
333  virtual void set_vector(const bool* vector, int32_t len);
334  virtual void set_vector(const int8_t* vector, int32_t len){};
335  virtual void set_vector(const uint8_t* vector, int32_t len){};
336  virtual void set_vector(const char* vector, int32_t len){};
337  virtual void set_vector(const int32_t* vector, int32_t len){};
338  virtual void set_vector(const uint32_t* vector, int32_t len){};
339  virtual void set_vector(const float32_t* vector, int32_t len){};
340  virtual void set_vector(const float64_t* vector, int32_t len){};
341  virtual void set_vector(const floatmax_t* vector, int32_t len){};
342  virtual void set_vector(const int16_t* vector, int32_t len){};
343  virtual void set_vector(const uint16_t* vector, int32_t len){};
344  virtual void set_vector(const int64_t* vector, int32_t len){};
345  virtual void set_vector(const uint64_t* vector, int32_t len){};
347 
348 
356  virtual void set_matrix(
357  const bool* matrix, int32_t num_feat, int32_t num_vec);
358  virtual void set_matrix(
359  const uint8_t* matrix, int32_t num_feat, int32_t num_vec){};
360  virtual void set_matrix(
361  const int8_t* matrix, int32_t num_feat, int32_t num_vec){};
362  virtual void set_matrix(
363  const char* matrix, int32_t num_feat, int32_t num_vec){};
364  virtual void set_matrix(
365  const int32_t* matrix, int32_t num_feat, int32_t num_vec){};
366  virtual void set_matrix(
367  const uint32_t* matrix, int32_t num_feat, int32_t num_vec){};
368  virtual void set_matrix(
369  const int64_t* matrix, int32_t num_feat, int32_t num_vec){};
370  virtual void set_matrix(
371  const uint64_t* matrix, int32_t num_feat, int32_t num_vec){};
372  virtual void set_matrix(
373  const float32_t* matrix, int32_t num_feat, int32_t num_vec){};
374  virtual void set_matrix(
375  const float64_t* matrix, int32_t num_feat, int32_t num_vec){};
376  virtual void set_matrix(
377  const floatmax_t* matrix, int32_t num_feat, int32_t num_vec){};
378  virtual void set_matrix(
379  const int16_t* matrix, int32_t num_feat, int32_t num_vec){};
380  virtual void set_matrix(
381  const uint16_t* matrix, int32_t num_feat, int32_t num_vec){};
383  //
391  virtual void set_sparse_vector(
392  const SGSparseVectorEntry<bool>* entries, int32_t num_feat);
393  virtual void set_sparse_vector(
394  const SGSparseVectorEntry<uint8_t>* entries, int32_t num_feat);
395  virtual void set_sparse_vector(
396  const SGSparseVectorEntry<int8_t>* entries, int32_t num_feat);
397  virtual void set_sparse_vector(
398  const SGSparseVectorEntry<char>* entries, int32_t num_feat);
399  virtual void set_sparse_vector(
400  const SGSparseVectorEntry<int32_t>* entries, int32_t num_feat);
401  virtual void set_sparse_vector(
402  const SGSparseVectorEntry<uint32_t>* entries, int32_t num_feat);
403  virtual void set_sparse_vector(
404  const SGSparseVectorEntry<int64_t>* entries, int32_t num_feat);
405  virtual void set_sparse_vector(
406  const SGSparseVectorEntry<uint64_t>* entries, int32_t num_feat);
407  virtual void set_sparse_vector(
408  const SGSparseVectorEntry<int16_t>* entries, int32_t num_feat);
409  virtual void set_sparse_vector(
410  const SGSparseVectorEntry<uint16_t>* entries, int32_t num_feat);
411  virtual void set_sparse_vector(
412  const SGSparseVectorEntry<float32_t>* entries, int32_t num_feat);
413  virtual void set_sparse_vector(
414  const SGSparseVectorEntry<float64_t>* entries, int32_t num_feat);
415  virtual void set_sparse_vector(
416  const SGSparseVectorEntry<floatmax_t>* entries, int32_t num_feat);
418 
426  virtual void set_sparse_matrix(
427  const SGSparseVector<bool>* matrix, int32_t num_feat, int32_t num_vec){};
428  virtual void set_sparse_matrix(
429  const SGSparseVector<uint8_t>* matrix, int32_t num_feat, int32_t num_vec){};
430  virtual void set_sparse_matrix(
431  const SGSparseVector<int8_t>* matrix, int32_t num_feat, int32_t num_vec){};
432  virtual void set_sparse_matrix(
433  const SGSparseVector<char>* matrix, int32_t num_feat, int32_t num_vec){};
434  virtual void set_sparse_matrix(
435  const SGSparseVector<int32_t>* matrix, int32_t num_feat, int32_t num_vec){};
436  virtual void set_sparse_matrix(
437  const SGSparseVector<uint32_t>* matrix, int32_t num_feat, int32_t num_vec){};
438  virtual void set_sparse_matrix(
439  const SGSparseVector<int64_t>* matrix, int32_t num_feat, int32_t num_vec){};
440  virtual void set_sparse_matrix(
441  const SGSparseVector<uint64_t>* matrix, int32_t num_feat, int32_t num_vec){};
442  virtual void set_sparse_matrix(
443  const SGSparseVector<int16_t>* matrix, int32_t num_feat, int32_t num_vec){};
444  virtual void set_sparse_matrix(
445  const SGSparseVector<uint16_t>* matrix, int32_t num_feat, int32_t num_vec){};
446  virtual void set_sparse_matrix(
447  const SGSparseVector<float32_t>* matrix, int32_t num_feat, int32_t num_vec){};
448  virtual void set_sparse_matrix(
449  const SGSparseVector<float64_t>* matrix, int32_t num_feat, int32_t num_vec){};
450  virtual void set_sparse_matrix(
451  const SGSparseVector<floatmax_t>* matrix, int32_t num_feat, int32_t num_vec){};
453 
454 
463  virtual void set_string_list(
464  const SGString<bool>* strings, int32_t num_str);
465  virtual void set_string_list(
466  const SGString<uint8_t>* strings, int32_t num_str){};
467  virtual void set_string_list(
468  const SGString<int8_t>* strings, int32_t num_str){};
469  virtual void set_string_list(
470  const SGString<char>* strings, int32_t num_str){};
471  virtual void set_string_list(
472  const SGString<int32_t>* strings, int32_t num_str){};
473  virtual void set_string_list(
474  const SGString<uint32_t>* strings, int32_t num_str){};
475  virtual void set_string_list(
476  const SGString<int16_t>* strings, int32_t num_str){};
477  virtual void set_string_list(
478  const SGString<uint16_t>* strings, int32_t num_str){};
479  virtual void set_string_list(
480  const SGString<int64_t>* strings, int32_t num_str){};
481  virtual void set_string_list(
482  const SGString<uint64_t>* strings, int32_t num_str){};
483  virtual void set_string_list(
484  const SGString<float32_t>* strings, int32_t num_str){};
485  virtual void set_string_list(
486  const SGString<float64_t>* strings, int32_t num_str){};
487  virtual void set_string_list(
488  const SGString<floatmax_t>* strings, int32_t num_str){};
490 
492  virtual const char* get_name() const { return "File"; }
493 
500  static char* read_whole_file(char* fname, size_t& len);
501 #endif // #ifndef SWIG
502 
503 protected:
505  FILE* file;
507  char task;
509  char* filename;
512 };
513 }
514 #endif // __FILE_H__
virtual void get_string_list(SGString< floatmax_t > *&strings, int32_t &num_str, int32_t &max_string_len)
Definition: File.h:318
virtual void set_string_list(const SGString< uint8_t > *strings, int32_t num_str)
Definition: File.h:465
virtual void get_string_list(SGString< uint8_t > *&strings, int32_t &num_str, int32_t &max_string_len)
Definition: File.h:285
virtual void get_string_list(SGString< uint32_t > *&strings, int32_t &num_str, int32_t &max_string_len)
Definition: File.h:297
virtual void set_sparse_matrix(const SGSparseVector< bool > *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:426
virtual void get_vector(int8_t *&vector, int32_t &len)
Definition: File.h:120
virtual void get_vector(int32_t *&vector, int32_t &len)
Definition: File.h:123
virtual void set_sparse_matrix(const SGSparseVector< int8_t > *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:430
virtual void get_sparse_matrix(SGSparseVector< int16_t > *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:261
virtual void get_matrix(int32_t *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:154
virtual void set_sparse_matrix(const SGSparseVector< float32_t > *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:446
virtual void set_vector(const uint32_t *vector, int32_t len)
Definition: File.h:338
virtual void set_matrix(const bool *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.cpp:126
virtual void set_vector(const uint8_t *vector, int32_t len)
Definition: File.h:335
virtual void get_matrix(uint32_t *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:156
virtual void get_vector(uint64_t *&vector, int32_t &len)
Definition: File.h:131
virtual void set_vector(const float32_t *vector, int32_t len)
Definition: File.h:339
virtual void get_sparse_matrix(SGSparseVector< uint16_t > *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:263
virtual void get_matrix(float64_t *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:164
virtual void set_sparse_matrix(const SGSparseVector< int64_t > *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:438
virtual void get_string_list(SGString< int64_t > *&strings, int32_t &num_str, int32_t &max_string_len)
Definition: File.h:306
virtual void get_matrix(floatmax_t *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:166
virtual void get_vector(floatmax_t *&vector, int32_t &len)
Definition: File.h:127
virtual void get_string_list(SGString< int8_t > *&strings, int32_t &num_str, int32_t &max_string_len)
Definition: File.h:288
virtual void get_sparse_matrix(SGSparseVector< float32_t > *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:265
virtual void set_string_list(const SGString< bool > *strings, int32_t num_str)
Definition: File.cpp:163
virtual void get_string_list(SGString< uint16_t > *&strings, int32_t &num_str, int32_t &max_string_len)
Definition: File.h:303
virtual void set_string_list(const SGString< int32_t > *strings, int32_t num_str)
Definition: File.h:471
virtual void set_sparse_matrix(const SGSparseVector< int16_t > *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:442
virtual void set_sparse_vector(const SGSparseVectorEntry< bool > *entries, int32_t num_feat)
virtual void set_matrix(const uint8_t *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:358
virtual void get_vector(float32_t *&vector, int32_t &len)
Definition: File.h:126
virtual void set_matrix(const int64_t *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:368
virtual void get_string_list(SGString< char > *&strings, int32_t &num_str, int32_t &max_string_len)
Definition: File.h:291
FILE * file
Definition: File.h:505
virtual void get_matrix(uint64_t *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:160
virtual void get_ndarray(char *&array, int32_t *&dims, int32_t &num_dims)
Definition: File.h:188
virtual void set_matrix(const uint64_t *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:370
virtual void get_matrix(char *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:152
virtual void get_matrix(uint8_t *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:148
virtual const char * get_name() const
Definition: File.h:492
virtual void set_matrix(const uint32_t *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:366
virtual void get_matrix(int64_t *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:158
FILE * get_file_descriptor()
Definition: File.h:85
virtual void set_sparse_matrix(const SGSparseVector< uint32_t > *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:436
void close()
Definition: File.h:69
virtual void get_matrix(uint16_t *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:170
virtual void set_matrix(const char *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:362
virtual void set_sparse_matrix(const SGSparseVector< uint16_t > *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:444
virtual void get_string_list(SGString< int32_t > *&strings, int32_t &num_str, int32_t &max_string_len)
Definition: File.h:294
virtual void get_vector(uint16_t *&vector, int32_t &len)
Definition: File.h:129
virtual void set_matrix(const int32_t *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:364
shogun string
virtual void get_sparse_matrix(SGSparseVector< int8_t > *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:249
virtual void get_ndarray(int32_t *&array, int32_t *&dims, int32_t &num_dims)
Definition: File.h:190
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:115
virtual void get_ndarray(float32_t *&array, int32_t *&dims, int32_t &num_dims)
Definition: File.h:192
virtual ~CFile()
Definition: File.cpp:182
virtual void get_vector(bool *&vector, int32_t &len)
Definition: File.cpp:81
virtual void get_sparse_matrix(SGSparseVector< int64_t > *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:257
virtual void get_sparse_matrix(SGSparseVector< float64_t > *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:267
char * variable_name
Definition: File.h:511
virtual void get_matrix(float32_t *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:162
virtual void get_string_list(SGString< float64_t > *&strings, int32_t &num_str, int32_t &max_string_len)
Definition: File.h:315
virtual void get_matrix(bool *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.cpp:109
double float64_t
Definition: common.h:50
long double floatmax_t
Definition: common.h:51
virtual void set_sparse_matrix(const SGSparseVector< int32_t > *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:434
virtual void get_vector(float64_t *&vector, int32_t &len)
Definition: File.h:125
virtual void set_sparse_matrix(const SGSparseVector< float64_t > *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:448
A File access base class.
Definition: File.h:34
virtual void get_vector(int64_t *&vector, int32_t &len)
Definition: File.h:130
virtual void get_ndarray(int16_t *&array, int32_t *&dims, int32_t &num_dims)
Definition: File.h:196
virtual void get_sparse_vector(SGSparseVectorEntry< bool > *&entries, int32_t &num_feat)
virtual void set_string_list(const SGString< float64_t > *strings, int32_t num_str)
Definition: File.h:485
virtual void set_sparse_matrix(const SGSparseVector< floatmax_t > *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:450
virtual void get_ndarray(uint16_t *&array, int32_t *&dims, int32_t &num_dims)
Definition: File.h:198
virtual void set_string_list(const SGString< int16_t > *strings, int32_t num_str)
Definition: File.h:475
virtual void set_vector(const floatmax_t *vector, int32_t len)
Definition: File.h:341
virtual void set_string_list(const SGString< floatmax_t > *strings, int32_t num_str)
Definition: File.h:487
virtual void get_string_list(SGString< int16_t > *&strings, int32_t &num_str, int32_t &max_string_len)
Definition: File.h:300
virtual void get_ndarray(float64_t *&array, int32_t *&dims, int32_t &num_dims)
Definition: File.h:194
virtual void set_matrix(const floatmax_t *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:376
char * filename
Definition: File.h:509
virtual void set_matrix(const uint16_t *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:380
virtual void set_matrix(const float64_t *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:374
virtual void get_sparse_matrix(SGSparseVector< floatmax_t > *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:269
virtual void get_sparse_matrix(SGSparseVector< uint32_t > *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:255
virtual void set_vector(const uint16_t *vector, int32_t len)
Definition: File.h:343
float float32_t
Definition: common.h:49
virtual void get_vector(uint8_t *&vector, int32_t &len)
Definition: File.h:121
virtual void get_ndarray(uint8_t *&array, int32_t *&dims, int32_t &num_dims)
Definition: File.h:186
virtual void set_sparse_matrix(const SGSparseVector< uint8_t > *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:428
virtual void set_string_list(const SGString< uint16_t > *strings, int32_t num_str)
Definition: File.h:477
virtual void set_string_list(const SGString< int64_t > *strings, int32_t num_str)
Definition: File.h:479
char task
Definition: File.h:507
virtual void set_sparse_matrix(const SGSparseVector< char > *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:432
virtual void get_vector(int16_t *&vector, int32_t &len)
Definition: File.h:128
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual void get_vector(char *&vector, int32_t &len)
Definition: File.h:122
char * get_variable_name()
Definition: File.cpp:193
virtual void set_string_list(const SGString< char > *strings, int32_t num_str)
Definition: File.h:469
virtual void set_vector(const int64_t *vector, int32_t len)
Definition: File.h:344
virtual void get_sparse_matrix(SGSparseVector< char > *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:251
static char * read_whole_file(char *fname, size_t &len)
Definition: File.cpp:234
virtual void set_vector(const int16_t *vector, int32_t len)
Definition: File.h:342
template class SGSparseVectorEntry
Definition: File.h:23
template class SGSparseVector The assumtion is that the stored SGSparseVectorEntry* vector is orde...
virtual void set_string_list(const SGString< int8_t > *strings, int32_t num_str)
Definition: File.h:467
virtual void set_string_list(const SGString< uint64_t > *strings, int32_t num_str)
Definition: File.h:481
virtual void get_matrix(int16_t *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:168
virtual void set_matrix(const int16_t *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:378
virtual void get_string_list(SGString< float32_t > *&strings, int32_t &num_str, int32_t &max_string_len)
Definition: File.h:312
virtual void set_string_list(const SGString< float32_t > *strings, int32_t num_str)
Definition: File.h:483
virtual void get_string_list(SGString< uint64_t > *&strings, int32_t &num_str, int32_t &max_string_len)
Definition: File.h:309
virtual void get_string_list(SGString< bool > *&strings, int32_t &num_str, int32_t &max_string_len)
Definition: File.cpp:140
virtual void set_string_list(const SGString< uint32_t > *strings, int32_t num_str)
Definition: File.h:473
virtual void set_vector(const bool *vector, int32_t len)
Definition: File.cpp:95
virtual void get_sparse_matrix(SGSparseVector< uint8_t > *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:247
virtual void get_sparse_matrix(SGSparseVector< uint64_t > *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:259
virtual void get_sparse_matrix(SGSparseVector< bool > *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:245
virtual void set_vector(const float64_t *vector, int32_t len)
Definition: File.h:340
virtual void get_matrix(int8_t *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:150
void set_variable_name(const char *name)
Definition: File.cpp:187
virtual void set_vector(const int32_t *vector, int32_t len)
Definition: File.h:337
virtual void get_sparse_matrix(SGSparseVector< int32_t > *&matrix, int32_t &num_feat, int32_t &num_vec)
Definition: File.h:253
virtual void set_matrix(const float32_t *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:372
virtual void get_vector(uint32_t *&vector, int32_t &len)
Definition: File.h:124
virtual void set_matrix(const int8_t *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:360
virtual void set_vector(const uint64_t *vector, int32_t len)
Definition: File.h:345
virtual void set_vector(const int8_t *vector, int32_t len)
Definition: File.h:334
virtual void set_sparse_matrix(const SGSparseVector< uint64_t > *matrix, int32_t num_feat, int32_t num_vec)
Definition: File.h:440
virtual void set_vector(const char *vector, int32_t len)
Definition: File.h:336

SHOGUN Machine Learning Toolbox - Documentation