aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/erasure/helpers.h
blob: 741186322a17a34626091f1a8ebc35c8e83086cf (plain) (blame)
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
#pragma once

#include "public.h"

namespace NErasure {

// All vectors here are assumed to be sorted.

TPartIndexList MakeSegment(int begin, int end);

TPartIndexList MakeSingleton(int elem);

TPartIndexList Difference(int begin, int end, const TPartIndexList& subtrahend);

TPartIndexList Difference(const TPartIndexList& first, const TPartIndexList& second);

TPartIndexList Difference(const TPartIndexList& first, int elem);

TPartIndexList Intersection(const TPartIndexList& first, const TPartIndexList& second);

TPartIndexList Union(const TPartIndexList& first, const TPartIndexList& second);

bool Contains(const TPartIndexList& set, int elem);

TPartIndexList UniqueSortedIndices(const TPartIndexList& indices);

TPartIndexList ExtractRows(const TPartIndexList& matrix, int width, const TPartIndexList& rows);

} // namespace NErasure