Skip to content

Commit

Permalink
src/shogun/io/BinaryFile.cpp
Browse files Browse the repository at this point in the history
src/shogun/io/CSVFile.cpp
src/shogun/io/File.cpp
src/shogun/io/IOBuffer.cpp
src/shogun/io/LibSVMFile.cpp
src/shogun/io/LineReader.cpp
src/shogun/io/Parser.cpp
src/shogun/io/SerializableAsciiFile.h
src/shogun/io/SerializableAsciiReader00.cpp
src/shogun/io/SerializableFile.cpp
src/shogun/base/Parameter.h needs a SGVector
src/shogun/io/SGIO.cpp
src/shogun/io/streaming/StreamingAsciiFile.cpp
src/shogun/lib/Signal.cpp
src/shogun/io/streaming/StreamingAsciiFile.cpp
src/shogun/io/streaming/StreamingFile.cpp
src/shogun/io/streaming/StreamingFileFromFeatures.cpp
  • Loading branch information
tklein23 committed Mar 17, 2014
1 parent 3995eec commit 4c4a5b2
Show file tree
Hide file tree
Showing 32 changed files with 95 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/shogun/base/Parameter.h
Expand Up @@ -14,6 +14,7 @@
#include <shogun/lib/common.h>
#include <shogun/lib/DataType.h>
#include <shogun/base/DynArray.h>
#include <shogun/lib/SGVector.h>

namespace shogun
{
Expand All @@ -24,7 +25,6 @@ template <class ST> class SGString;
template <class T> class SGMatrix;
template <class T> class SGSparseMatrix;
template <class T> class SGSparseVector;
template <class T> class SGVector;

/** @brief parameter struct */
struct TParameter
Expand Down
1 change: 1 addition & 0 deletions src/shogun/base/SGObject.cpp
Expand Up @@ -17,6 +17,7 @@
#include <shogun/base/ParameterMap.h>
#include <shogun/base/DynArray.h>
#include <shogun/lib/Map.h>
#include <shogun/lib/SGVector.h>
#include <shogun/lib/SGStringList.h>
#include <shogun/io/SerializableFile.h>

Expand Down
1 change: 1 addition & 0 deletions src/shogun/features/streaming/StreamingDotFeatures.h
Expand Up @@ -13,6 +13,7 @@
#include <shogun/lib/common.h>
#include <shogun/features/streaming/StreamingFeatures.h>
#include <shogun/features/FeatureTypes.h>
#include <shogun/lib/SGSparseVector.h>

namespace shogun
{
Expand Down
6 changes: 5 additions & 1 deletion src/shogun/io/BinaryFile.cpp
Expand Up @@ -9,8 +9,12 @@
*/

#include <shogun/io/File.h>
#include <shogun/features/SparseFeatures.h>
#include <shogun/io/BinaryFile.h>
#include <shogun/io/SGIO.h>
#include "lib/DataType.h"
#include <shogun/lib/SGSparseVector.h>
#include <shogun/lib/SGString.h>
#include <shogun/mathematics/Math.h>

using namespace shogun;

Expand Down
6 changes: 4 additions & 2 deletions src/shogun/io/BinaryFile.h
Expand Up @@ -12,13 +12,15 @@

#include <shogun/lib/config.h>
#include <shogun/lib/common.h>
#include <shogun/base/SGObject.h>
#include <shogun/io/SGIO.h>
#include <shogun/io/SimpleFile.h>
#include <shogun/io/File.h>

namespace shogun
{
struct TSGDataType;
template <class ST> class SGString;
template <class T> class SGSparseVector;

/** @brief A Binary file access class.
*
* A file consists of a SG00 fourcc header then an alternation of a type header and
Expand Down
6 changes: 5 additions & 1 deletion src/shogun/io/CSVFile.cpp
Expand Up @@ -10,7 +10,11 @@
#include <shogun/io/CSVFile.h>

#include <shogun/lib/SGVector.h>
#include <shogun/lib/SGMatrix.h>
#include <shogun/lib/SGSparseVector.h>
#include <shogun/io/LineReader.h>
#include <shogun/io/Parser.h>
#include <shogun/lib/DelimiterTokenizer.h>
#include <shogun/lib/v_array.h>

using namespace shogun;

Expand Down
13 changes: 8 additions & 5 deletions src/shogun/io/CSVFile.h
Expand Up @@ -10,15 +10,18 @@
#ifndef __CSVFILE_H__
#define __CSVFILE_H__

#include <shogun/lib/common.h>
#include <shogun/io/File.h>

#include <shogun/io/LineReader.h>
#include <shogun/io/Parser.h>
#include <shogun/lib/DelimiterTokenizer.h>
#include <shogun/lib/v_array.h>

namespace shogun
{
class CDelimiterTokenizer;
class CLineReader;
class CParser;
struct substring;
template <class ST> class SGString;
template <class T> class SGSparseVector;
template <class T> class v_array;

/** @brief Class CSVFile used to read data from comma-separated values (CSV)
* files. See http://en.wikipedia.org/wiki/Comma-separated_values.
Expand Down
9 changes: 6 additions & 3 deletions src/shogun/io/File.cpp
Expand Up @@ -10,12 +10,15 @@
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <shogun/io/File.h>
#include <shogun/io/SGIO.h>
#include <shogun/base/SGObject.h>

#include <shogun/lib/memory.h>
#include <shogun/features/StringFeatures.h>
#include <shogun/features/SparseFeatures.h>
#include <shogun/lib/SGSparseVector.h>
#include <shogun/lib/SGString.h>

using namespace shogun;

Expand Down
1 change: 0 additions & 1 deletion src/shogun/io/File.h
Expand Up @@ -14,7 +14,6 @@

#include <stdio.h>
#include <shogun/base/SGObject.h>
#include <shogun/lib/DataType.h>

namespace shogun
{
Expand Down
4 changes: 4 additions & 0 deletions src/shogun/io/IOBuffer.cpp
Expand Up @@ -14,7 +14,11 @@
*/

#include <string.h>
#include <fcntl.h>

#include <shogun/io/IOBuffer.h>
#include <shogun/io/SGIO.h>
#include <shogun/lib/v_array.h>

using namespace shogun;

Expand Down
3 changes: 0 additions & 3 deletions src/shogun/io/IOBuffer.h
Expand Up @@ -18,11 +18,8 @@

#include <shogun/lib/v_array.h>
#include <shogun/lib/common.h>
#include <shogun/io/SGIO.h>
#include <shogun/lib/DataType.h>
#include <shogun/base/SGObject.h>

#include <stdio.h>
#include <fcntl.h>

#ifndef O_LARGEFILE //for OSX
Expand Down
3 changes: 3 additions & 0 deletions src/shogun/io/LibSVMFile.cpp
Expand Up @@ -12,6 +12,9 @@
#include <shogun/lib/SGVector.h>
#include <shogun/lib/SGSparseVector.h>
#include <shogun/base/DynArray.h>
#include <shogun/io/LineReader.h>
#include <shogun/io/Parser.h>
#include <shogun/lib/DelimiterTokenizer.h>

using namespace shogun;

Expand Down
10 changes: 6 additions & 4 deletions src/shogun/io/LibSVMFile.h
Expand Up @@ -13,13 +13,15 @@

#include <shogun/io/File.h>

#include <shogun/io/LineReader.h>
#include <shogun/io/Parser.h>
#include <shogun/lib/DelimiterTokenizer.h>

namespace shogun
{

class CDelimiterTokenizer;
class CLineReader;
class CParser;
template <class ST> class SGString;
template <class T> class SGSparseVector;

/** @brief read sparse real valued features in svm light format
* e.g. -1 1:10.0 2:100.2 1000:1.3
* with -1 == (optional) label
Expand Down
2 changes: 2 additions & 0 deletions src/shogun/io/LineReader.cpp
Expand Up @@ -8,6 +8,8 @@
*/

#include <shogun/io/LineReader.h>
#include <shogun/lib/CircularBuffer.h>
#include <shogun/lib/Tokenizer.h>
#include <cstdio>

using namespace shogun;
Expand Down
6 changes: 4 additions & 2 deletions src/shogun/io/LineReader.h
Expand Up @@ -11,11 +11,13 @@
#define __LINE_READER_H__

#include <shogun/lib/SGVector.h>
#include <shogun/lib/Tokenizer.h>
#include <shogun/lib/CircularBuffer.h>
#include <shogun/base/SGObject.h>

namespace shogun
{
class CCircularBuffer;
class CTokenizer;

/** @brief Class for buffered reading from a ascii file */
class CLineReader : public CSGObject
{
Expand Down
1 change: 1 addition & 0 deletions src/shogun/io/Parser.cpp
Expand Up @@ -9,6 +9,7 @@

#include <stdlib.h>
#include <shogun/io/Parser.h>
#include <shogun/lib/Tokenizer.h>

using namespace shogun;

Expand Down
4 changes: 3 additions & 1 deletion src/shogun/io/Parser.h
Expand Up @@ -11,10 +11,12 @@
#define __PARSER_H__

#include <shogun/lib/SGVector.h>
#include <shogun/lib/Tokenizer.h>
#include <shogun/base/SGObject.h>

namespace shogun
{
class CTokenizer;

/** @brief Class for reading from a string */
class CParser : public CSGObject
{
Expand Down
9 changes: 5 additions & 4 deletions src/shogun/io/SGIO.cpp
Expand Up @@ -9,20 +9,21 @@
* Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
*/

#include <shogun/lib/config.h>

#include <shogun/io/SGIO.h>
#include <shogun/lib/ShogunException.h>
#include <shogun/lib/Signal.h>
#include <shogun/lib/common.h>
#include <shogun/base/init.h>
#include <shogun/lib/memory.h>
#include <shogun/lib/Time.h>
#include <shogun/mathematics/Math.h>
#include <shogun/lib/RefCount.h>

#include <stdio.h>
#include <stdarg.h>
#include <ctype.h>

#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>

using namespace shogun;
Expand Down
9 changes: 3 additions & 6 deletions src/shogun/io/SGIO.h
Expand Up @@ -14,19 +14,16 @@
#define __SGIO_H__

#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <dirent.h>
#include <locale.h>
#include <sys/types.h>

#ifndef _WIN32
#include <unistd.h>
#endif
#include <locale.h>

#include <sys/types.h>
#include <sys/stat.h>

#include <shogun/lib/common.h>
#include <shogun/base/init.h>

namespace shogun
{
Expand Down
4 changes: 4 additions & 0 deletions src/shogun/io/SerializableAsciiFile.h
Expand Up @@ -12,6 +12,8 @@

#include <shogun/io/SerializableFile.h>
#include <shogun/base/DynArray.h>
#include <shogun/lib/DataType.h>
#include <shogun/lib/common.h>

#define CHAR_CONT_BEGIN '('
#define CHAR_CONT_END ')'
Expand All @@ -30,6 +32,8 @@

namespace shogun
{
template <class T> struct SGSparseVectorEntry;

/** @brief serializable ascii file */
class CSerializableAsciiFile :public CSerializableFile
{
Expand Down
1 change: 1 addition & 0 deletions src/shogun/io/SerializableAsciiReader00.cpp
Expand Up @@ -9,6 +9,7 @@
*/

#include <shogun/io/SerializableAsciiReader00.h>
#include <shogun/io/SerializableAsciiFile.h>
#include <shogun/lib/common.h>

using namespace shogun;
Expand Down
5 changes: 4 additions & 1 deletion src/shogun/io/SerializableAsciiReader00.h
Expand Up @@ -10,10 +10,13 @@
#ifndef __SERIALIZABLE_ASCII_READER_00_H__
#define __SERIALIZABLE_ASCII_READER_00_H__

#include <shogun/io/SerializableAsciiFile.h>
#include <shogun/io/SerializableFile.h>

namespace shogun
{
class CSerializableAsciiFile;
template <class T> struct SGSparseVectorEntry;

/** @brief Serializable ascii reader */
class SerializableAsciiReader00
: public CSerializableFile::TSerializableReader {
Expand Down
1 change: 1 addition & 0 deletions src/shogun/io/SerializableFile.cpp
Expand Up @@ -10,6 +10,7 @@
*/

#include <shogun/io/SerializableFile.h>
#include <shogun/io/SGIO.h>

using namespace shogun;

Expand Down
3 changes: 1 addition & 2 deletions src/shogun/io/SerializableFile.h
Expand Up @@ -15,11 +15,10 @@
#include <stdio.h>
#include <shogun/base/SGObject.h>
#include <shogun/lib/DataType.h>
#include <shogun/lib/SGSparseVector.h>

namespace shogun
{
class CSGObject;
template <class T> struct SGSparseVectorEntry;

/** @brief serializable file */
class CSerializableFile :public CSGObject
Expand Down
5 changes: 4 additions & 1 deletion src/shogun/io/streaming/StreamingAsciiFile.cpp
Expand Up @@ -9,7 +9,10 @@
*/

#include <shogun/io/streaming/StreamingAsciiFile.h>
#include <shogun/mathematics/Math.h>
#include <shogun/io/CSVFile.h>
#include <shogun/io/SGIO.h>
#include <shogun/lib/SGSparseVector.h>
#include <shogun/base/DynArray.h>

#include <ctype.h>

Expand Down
9 changes: 7 additions & 2 deletions src/shogun/io/streaming/StreamingAsciiFile.h
Expand Up @@ -10,18 +10,23 @@
#ifndef __STREAMING_ASCIIFILE_H__
#define __STREAMING_ASCIIFILE_H__

#include <shogun/io/CSVFile.h>
#include <shogun/io/streaming/StreamingFile.h>
#include <shogun/features/SparseFeatures.h>
#include <shogun/lib/v_array.h>

namespace shogun
{

struct substring;
template <class ST> struct SGSparseVectorEntry;
template <class T> class DynArray;

/** @brief Class StreamingAsciiFile to read vector-by-vector from ASCII files.
*
* The object must be initialized like a CCSVFile.
*/
class CStreamingAsciiFile: public CStreamingFile
{

public:
/**
* Default constructor
Expand Down
2 changes: 2 additions & 0 deletions src/shogun/io/streaming/StreamingFile.cpp
Expand Up @@ -10,8 +10,10 @@

#include <shogun/lib/memory.h>
#include <shogun/io/streaming/StreamingFile.h>
#include <shogun/lib/SGSparseVector.h>

#include <ctype.h>
#include <fcntl.h>

namespace shogun
{
Expand Down

0 comments on commit 4c4a5b2

Please sign in to comment.