SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
lib
Compressor.h
浏览该文件的文档.
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) 2009 Soeren Sonnenburg
8
* Copyright (C) 2009 Berlin Institute of Technology
9
*/
10
#ifndef __COMPRESSOR_H__
11
#define __COMPRESSOR_H__
12
13
#include <
shogun/lib/config.h
>
14
#include <
shogun/lib/common.h
>
15
#include <
shogun/base/SGObject.h
>
16
#include <
shogun/io/SGIO.h
>
17
18
namespace
shogun
19
{
21
enum
E_COMPRESSION_TYPE
22
{
23
UNCOMPRESSED
,
24
LZO
,
25
GZIP
,
26
BZIP2
,
27
LZMA
,
28
SNAPPY
29
};
30
31
46
class
CCompressor
:
public
CSGObject
47
{
48
public
:
50
CCompressor
();
51
56
CCompressor
(
E_COMPRESSION_TYPE
ct) :
CSGObject
(),
compression_type
(ct)
57
{
58
}
59
61
virtual
~CCompressor
()
62
{
63
}
64
76
void
compress
(uint8_t* uncompressed, uint64_t uncompressed_size,
77
uint8_t* &compressed, uint64_t &compressed_size, int32_t level=1);
78
91
void
decompress
(uint8_t* compressed, uint64_t compressed_size,
92
uint8_t* uncompressed, uint64_t& uncompressed_size);
93
95
virtual
const
char
*
get_name
()
const
{
return
"Compressor"
; }
96
97
protected
:
99
E_COMPRESSION_TYPE
compression_type
;
100
};
101
}
102
#endif //__COMPRESSOR_H__
SHOGUN
机器学习工具包 - 项目文档