This file is indexed.

/usr/include/shogun/io/StreamingVwCacheFile.h is in libshogun-dev 1.1.0-4ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Written (W) 2011 Shashwat Lal Das
 * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
 */
#ifndef __STREAMING_VWCACHEFILE_H__
#define __STREAMING_VWCACHEFILE_H__

#include <shogun/io/StreamingFile.h>
#include <shogun/classifier/vw/vw_common.h>
#include <shogun/classifier/vw/cache/VwCacheReader.h>
#include <shogun/classifier/vw/cache/VwNativeCacheReader.h>

namespace shogun
{
/** @brief Class StreamingVwCacheFile to read vector-by-vector
 * from VW cache files.
 *
 * The cache file is usually generated either by VW
 * or by enabling the cache writing option in a CStreamingVwFile
 * object.
 *
 * This class reads the example and label into one object of
 * VwExample type.
 */
class CStreamingVwCacheFile: public CStreamingFile
{
public:
	/**
	 * Default constructor.
	 * Assumes cache file is of type C_NATIVE
	 */
	CStreamingVwCacheFile();

	/**
	 * Constructor taking cache type
	 * as an argument.
	 *
	 * @param cache_type cache type - C_NATIVE or C_PROTOBUF
	 */
	CStreamingVwCacheFile(EVwCacheType cache_type);

	/**
	 * Constructor taking file name and cache type as arguments
	 *
	 * @param fname file name
	 * @param rw read/write mode
	 * @param cache_type type of cache - C_NATIVE or C_PROTOBUF
	 */
	CStreamingVwCacheFile(char* fname, char rw='r', EVwCacheType cache_type = C_NATIVE);

	/**
	 * Destructor
	 */
	virtual ~CStreamingVwCacheFile();

	/**
	 * Returns the parsed example.
	 *
	 * The example contains the label if available, and
	 * also contains length of the feature vector.
	 * These parameters, passed separately are redundant.
	 *
	 * @param ex examples as VwExample*, set by reference
	 * @param len length of vector, untouched
	 */
	virtual void get_vector(VwExample* &ex, int32_t &len);

	/**
	 * Returns the parsed example.
	 *
	 * TODO: Make this fail if examples are found to be unlabelled.
	 *
	 * @param ex example as VwExample*, set by reference
	 * @param len length of vector, untouched
	 * @param label label, untouched
	 */
	virtual void get_vector_and_label(VwExample* &ex, int32_t &len, float64_t &label);

	/** @return object name */
	inline virtual const char* get_name() const
	{
		return "StreamingVwCacheFile";
	}

	/**
	 * Set environment for vw
	 *
	 * @param env_to_use CVwEnvironment* environment
	 */
	void set_env(CVwEnvironment* env_to_use);

	/**
	 * Return the environment
	 *
	 * @return environment as CVwEnvironment*
	 */
	CVwEnvironment* get_env()
	{
		SG_REF(env);
		return env;
	}

	/**
	 * Whether this stream is seekable
	 *
	 * @return true, since caches can be reset
	 */
	bool is_seekable() { return true; }

	/**
	 * Reset cache file back to first example.
	 *
	 * Used when multiple passes are to be performed
	 */
	void reset_stream();

private:
	/**
	 * Initialize members
	 *
	 * @param cache_type type of cache
	 */
	virtual void init(EVwCacheType cache_type);

protected:
	/// Cache reader
	CVwCacheReader* cache_reader;

	/// Environment used for vw
	CVwEnvironment* env;

	/// Cache type
	EVwCacheType cache_format;
};
}
#endif //__STREAMING_VWCACHEFILE_H__