MCPcopy Create free account
hub / github.com/catboost/catboost / MakeCycle

Function MakeCycle

util/ysafeptr_ut.cpp:51–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 };
50
51 std::pair<TVector<TObj<TRecursive>>, TVector<TPtr<TRecursive>>> MakeCycle(size_t length) {
52 TVector<TObj<TRecursive>> objects;
53 TVector<TPtr<TRecursive>> references;
54 for (size_t i = 0; i < length; ++i) {
55 TObj<TRecursive> p{new TRecursive{
56 objects.empty() ? nullptr : objects.back(),
57 references}};
58 objects.push_back(p.Get());
59 references.push_back(p.Get());
60 }
61 references.front()->Ref.push_back(objects.back().Get());
62 return {std::move(objects), std::move(references)};
63 }
64
65 std::pair<TVector<TObj<TRecursive>>, TVector<TPtr<TRecursive>>> MakeGraph(size_t size) {
66 TVector<TObj<TRecursive>> objects;

Callers 1

Y_UNIT_TESTFunction · 0.85

Calls 6

moveFunction · 0.50
emptyMethod · 0.45
backMethod · 0.45
push_backMethod · 0.45
GetMethod · 0.45
frontMethod · 0.45

Tested by

no test coverage detected