MCPcopy Create free account
hub / github.com/dmlc/parameter_server / compressTo

Method compressTo

src/util/shared_array_inl.h:238–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236
237template <typename V>
238SArray<char> SArray<V>::compressTo() const {
239 // otherwise, snappy will add a 0 here...
240 if (empty()) return SArray<char>();
241 size_t ssize = size_ * sizeof(V);
242 size_t dsize = snappy::MaxCompressedLength(ssize);
243 SArray<char> dest(dsize);
244 snappy::RawCompress(
245 reinterpret_cast<const char*>(data_), ssize, dest.data(), &dsize);
246 dest.resize(dsize);
247 return dest;
248}
249
250template <typename V>
251void SArray<V>::append(const SArray<V>& arr) {

Callers 3

writeToFileMethod · 0.80
TESTFunction · 0.80
encodeMethod · 0.80

Calls 2

dataMethod · 0.80
resizeMethod · 0.45

Tested by 1

TESTFunction · 0.64