本文整理汇总了C++中passed函数的典型用法代码示例。如果您正苦于以下问题:C++ passed函数的具体用法?C++ passed怎么用?C++ passed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了passed函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Do_Test2
// This function performs basic drop tests, testing a data object consisting of
// two transferables.
nsresult Do_Test2()
{
nsresult rv = NS_OK;
nsresult workingrv;
workingrv = Do_CheckTwoFiles();
if (NS_FAILED(workingrv)) {
fail("Drag object tests failed on multiple files");
rv = NS_ERROR_UNEXPECTED;
} else {
passed("Successfully created a working multiple file drag object!");
}
workingrv = Do_CheckTwoStrings();
if (NS_FAILED(workingrv)) {
fail("Drag object tests failed on multiple strings");
rv = NS_ERROR_UNEXPECTED;
} else {
passed("Successfully created a working multiple string drag object!");
}
workingrv = Do_CheckSetArbitraryData(true);
if (NS_FAILED(workingrv)) {
fail("Drag object tests failed on setting arbitrary data");
rv = NS_ERROR_UNEXPECTED;
} else {
passed("Successfully set arbitrary data on a drag object");
}
return rv;
}
开发者ID:drexler,项目名称:releases-mozilla-aurora,代码行数:33,代码来源:TestWinDND.cpp
示例2: Do_Test1
// This function performs basic drop tests, testing a data object consisting
// of one transferable
nsresult Do_Test1()
{
nsresult rv = NS_OK;
nsresult workingrv;
workingrv = Do_CheckOneFile();
if (NS_FAILED(workingrv)) {
fail("Drag object tests failed on a single file");
rv = NS_ERROR_UNEXPECTED;
} else {
passed("Successfully created a working file drag object!");
}
workingrv = Do_CheckOneString();
if (NS_FAILED(workingrv)) {
fail("Drag object tests failed on a single string");
rv = NS_ERROR_UNEXPECTED;
} else {
passed("Successfully created a working string drag object!");
}
workingrv = Do_CheckSetArbitraryData(false);
if (NS_FAILED(workingrv)) {
fail("Drag object tests failed on setting arbitrary data");
rv = NS_ERROR_UNEXPECTED;
} else {
passed("Successfully set arbitrary data on a drag object");
}
return rv;
}
开发者ID:drexler,项目名称:releases-mozilla-aurora,代码行数:33,代码来源:TestWinDND.cpp
示例3: SendNoReturn
void
TestAsyncReturnsParent::Main()
{
SendNoReturn()->Then(MessageLoop::current()->SerialEventTarget(), __func__,
[](bool unused) {
fail("resolve handler should not be called");
},
[](PromiseRejectReason aReason) {
// MozPromise asserts in debug build if the
// handler is not called
if (aReason != PromiseRejectReason::ChannelClosed) {
fail("reject with wrong reason");
}
passed("reject handler called on channel close");
});
SendPing()->Then(MessageLoop::current()->SerialEventTarget(), __func__,
[this](bool one) {
if (one) {
passed("take one argument");
} else {
fail("get one argument but has wrong value");
}
Close();
},
[](PromiseRejectReason aReason) {
fail("sending Ping");
});
}
开发者ID:yrliou,项目名称:gecko-dev,代码行数:28,代码来源:TestAsyncReturns.cpp
示例4: passed
NS_IMETHODIMP
UDPClientListener::OnPacketReceived(nsIUDPSocket* socket, nsIUDPMessage* message)
{
mResult = NS_OK;
uint16_t port;
nsCString ip;
nsCOMPtr<nsINetAddr> fromAddr;
message->GetFromAddr(getter_AddRefs(fromAddr));
fromAddr->GetPort(&port);
fromAddr->GetAddress(ip);
passed("Packet received on client from %s:%d", ip.get(), port);
if (TEST_SEND_API == phase && CheckMessageContent(message, REQUEST)) {
uint32_t count;
const uint32_t data = RESPONSE;
printf("*** Attempting to write response 0x%x to server by SendWithAddr...\n", RESPONSE);
mResult = socket->SendWithAddr(fromAddr, (const uint8_t*)&data,
sizeof(uint32_t), &count);
if (mResult == NS_OK && count == sizeof(uint32_t)) {
passed("Response written");
} else {
fail("Response written");
}
return NS_OK;
} else if (TEST_OUTPUT_STREAM != phase || !CheckMessageContent(message, RESPONSE)) {
mResult = NS_ERROR_FAILURE;
}
// Notify thread
QuitPumpingEvents();
return NS_OK;
}
开发者ID:mxOBS,项目名称:deb-pkg_icedove,代码行数:33,代码来源:TestUDPSocket.cpp
示例5: passed
NS_IMETHODIMP
UDPListener::OnPacketReceived(nsIUDPServerSocket* socket, nsIUDPMessage* message)
{
mResult = NS_OK;
uint16_t port;
nsCString ip;
nsCOMPtr<nsINetAddr> fromAddr;
message->GetFromAddr(getter_AddRefs(fromAddr));
fromAddr->GetPort(&port);
fromAddr->GetAddress(ip);
passed("Packet received on server from %s:%d", ip.get(), port);
nsCString data;
message->GetData(data);
const char* buffer = data.get();
uint32_t len = data.Length();
uint32_t input = 0;
for (uint32_t i = 0; i < len; i++) {
input += buffer[i] << (8 * i);
}
if (len != sizeof(uint32_t) || input != REQUEST)
{
mResult = NS_ERROR_FAILURE;
fail("Request 0x%x received on server", input);
} else {
passed("Request 0x%x received on server", input);
// Respond with same data
nsCOMPtr<nsIOutputStream> outstream;
message->GetOutputStream(getter_AddRefs(outstream));
uint32_t count;
const uint32_t data = RESPONSE;
printf("*** Attempting to write response 0x%x to client ...\n", RESPONSE);
mResult = outstream->Write((const char*)&data, sizeof(uint32_t), &count);
if (mResult == NS_OK && count == sizeof(uint32_t)) {
passed("Response written");
} else {
fail("Response written");
}
}
// Notify thread
QuitPumpingEvents();
return NS_OK;
}
开发者ID:bcharbonnier,项目名称:mozilla-central,代码行数:51,代码来源:TestUDPServerSocket.cpp
示例6: eventSort
/*
* eventSort()
*
* This helps sort a list of events (a type implementation) based on how soon
* each event is to occur.
*/
static int eventSort(EVENT *s1, EVENT *s2)
{
if (during(s1) && during(s2))
return s1->EvMinutes - s2->EvMinutes;
if (during(s1)) return -1;
if (during(s2)) return 1;
if ((passed(s1) && passed(s2)) ||
(!passed(s1) && !passed(s2)))
return s1->EvMinutes - s2->EvMinutes;
return (s2->EvMinutes - s1->EvMinutes);
}
开发者ID:carriercomm,项目名称:citadel-86,代码行数:20,代码来源:events.c
示例7: hysteresis16
static void hysteresis16(HysteresisContext *s, const uint8_t *bbsrc, const uint8_t *aasrc,
uint8_t *ddst,
ptrdiff_t blinesize, ptrdiff_t alinesize,
ptrdiff_t dlinesize,
int w, int h)
{
const uint16_t *bsrc = (const uint16_t *)bbsrc;
const uint16_t *asrc = (const uint16_t *)aasrc;
uint16_t *dst = (uint16_t *)ddst;
const int t = s->threshold;
int x, y;
blinesize /= 2;
alinesize /= 2;
dlinesize /= 2;
for (y = 0; y < h; y++) {
for (x = 0; x < w; x++) {
if ((bsrc[x + y * blinesize] > t) && (asrc[x + y * alinesize] > t) && !passed(s, x, y, w)) {
int posx, posy;
dst[x + y * dlinesize] = asrc[x + y * alinesize];
push(s, x, y, w);
while (!is_empty(s)) {
int x_min, x_max, y_min, y_max, yy, xx;
pop(s, &posx, &posy);
x_min = posx > 0 ? posx - 1 : 0;
x_max = posx < w - 1 ? posx + 1 : posx;
y_min = posy > 0 ? posy - 1 : 0;
y_max = posy < h - 1 ? posy + 1 : posy;
for (yy = y_min; yy <= y_max; yy++) {
for (xx = x_min; xx <= x_max; xx++) {
if ((asrc[xx + yy * alinesize] > t) && !passed(s, xx, yy, w)) {
dst[xx + yy * dlinesize] = asrc[xx + yy * alinesize];
push(s, xx, yy, w);
}
}
}
}
}
}
}
}
开发者ID:DeHackEd,项目名称:FFmpeg,代码行数:48,代码来源:vf_hysteresis.c
示例8: passed
void RejectedPromises::handlerAdded(v8::PromiseRejectMessage data) {
// First look it up in the pending messages and fast return, it'll be covered
// by processQueue().
for (auto it = m_queue.begin(); it != m_queue.end(); ++it) {
if (!(*it)->isCollected() && (*it)->hasPromise(data.GetPromise())) {
m_queue.remove(it);
return;
}
}
// Then look it up in the reported errors.
for (size_t i = 0; i < m_reportedAsErrors.size(); ++i) {
std::unique_ptr<Message>& message = m_reportedAsErrors.at(i);
if (!message->isCollected() && message->hasPromise(data.GetPromise())) {
message->makePromiseStrong();
Platform::current()
->currentThread()
->scheduler()
->timerTaskRunner()
->postTask(BLINK_FROM_HERE, WTF::bind(&RejectedPromises::revokeNow,
RefPtr<RejectedPromises>(this),
passed(std::move(message))));
m_reportedAsErrors.remove(i);
return;
}
}
}
开发者ID:ollie314,项目名称:chromium,代码行数:27,代码来源:RejectedPromises.cpp
示例9: TestJemallocUsableSizeInAdvance
static nsresult
TestJemallocUsableSizeInAdvance()
{
#define K * 1024
#define M * 1024 * 1024
/*
* Test every size up to a certain point, then (N-1, N, N+1) triplets for a
* various sizes beyond that.
*/
for (size_t n = 0; n < 16 K; n++)
if (!TestOne(n))
return NS_ERROR_UNEXPECTED;
for (size_t n = 16 K; n < 1 M; n += 4 K)
if (!TestThree(n))
return NS_ERROR_UNEXPECTED;
for (size_t n = 1 M; n < 8 M; n += 128 K)
if (!TestThree(n))
return NS_ERROR_UNEXPECTED;
passed("malloc_good_size");
return NS_OK;
}
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:27,代码来源:TestJemalloc.cpp
示例10: while
void DataConsumerHandleTestUtil::HandleTwoPhaseReader::didGetReadable() {
WebDataConsumerHandle::Result r = WebDataConsumerHandle::UnexpectedError;
while (true) {
const void* buffer = nullptr;
size_t size;
r = m_reader->beginRead(&buffer, WebDataConsumerHandle::FlagNone, &size);
if (r == WebDataConsumerHandle::ShouldWait)
return;
if (r != WebDataConsumerHandle::Ok)
break;
// Read smaller than available in order to test |endRead|.
size_t readSize =
std::min(size, std::max(size * 2 / 3, static_cast<size_t>(1)));
m_data.append(static_cast<const char*>(buffer), readSize);
m_reader->endRead(readSize);
}
std::unique_ptr<HandleReadResult> result =
wrapUnique(new HandleReadResult(r, m_data));
m_data.clear();
Platform::current()->currentThread()->getWebTaskRunner()->postTask(
BLINK_FROM_HERE,
WTF::bind(&HandleTwoPhaseReader::runOnFinishedReading,
WTF::unretained(this), passed(std::move(result))));
m_reader = nullptr;
}
开发者ID:mirror,项目名称:chromium,代码行数:25,代码来源:DataConsumerHandleTestUtil.cpp
示例11: main
int main()
{
float *Ad;
hipMalloc((void**)&Ad, 1024);
// Test the different hipLaunchParm options:
hipLaunchKernel(vAdd, size_t(1024), 1, 0, 0, Ad);
hipLaunchKernel(vAdd, 1024, dim3(1), 0, 0, Ad);
hipLaunchKernel(vAdd, dim3(1024), 1, 0, 0, Ad);
hipLaunchKernel(vAdd, dim3(1024), dim3(1), 0, 0, Ad);
// Test case with hipLaunchKernel inside another macro:
float e0;
GPU_PRINT_TIME (hipLaunchKernel(vAdd, dim3(1024), dim3(1), 0, 0, Ad), e0, j);
GPU_PRINT_TIME (WRAP(hipLaunchKernel(vAdd, dim3(1024), dim3(1), 0, 0, Ad)), e0, j);
#ifdef EXTRA_PARENS_1
// Don't wrap hipLaunchKernel in extra set of parens:
GPU_PRINT_TIME ((hipLaunchKernel(vAdd, dim3(1024), dim3(1), 0, 0, Ad)), e0, j);
#endif
MY_LAUNCH (hipLaunchKernel(vAdd, dim3(1024), dim3(1), 0, 0, Ad), true, "firstCall");
float *A;
float e1;
MY_LAUNCH_WITH_PAREN (hipMalloc(&A, 100), true, "launch2");
#ifdef EXTRA_PARENS_2
//MY_LAUNCH_WITH_PAREN wraps cmd in () which can cause issues.
MY_LAUNCH_WITH_PAREN (hipLaunchKernel(vAdd, dim3(1024), dim3(1), 0, 0, Ad), true, "firstCall");
#endif
passed();
}
开发者ID:kknox,项目名称:HIP,代码行数:34,代码来源:hipLaunchParm.cpp
示例12: main
int main(int argc, char *argv[])
{
HipTest::parseStandardArguments(argc, argv, true);
// Serial version, just call once:
if (p_tests & 0x1) {
printf ("\ntest 0x1 : serial createThenDestroyStreams(10) \n");
createThenDestroyStreams(10, 10);
};
/*disable, this takess a while and if the next one works then no need to run serial*/
if (1 && (p_tests & 0x2)) {
printf ("\ntest 0x2 : serialized multiThread_pyramid(1) \n");
multiThread_pyramid(true, 3);
}
if (p_tests & 0x4) {
printf ("\ntest 0x4 : parallel multiThread_pyramid(1) \n");
multiThread_pyramid(false, 3);
}
//if (p_tests & 0x8) {
// printf ("test 0x8 : multiThread_pyramid(100) \n");
// multiThread_pyramid(false, 100);
// }
if (p_tests & 0x10) {
printf ("\ntest 0x10 : parallel multiThread_nearzero(1000) \n");
multiThread_nearzero(false, 1000);
}
passed();
}
开发者ID:GPUOpen-ProfessionalCompute-Tools,项目名称:HIP,代码行数:33,代码来源:hipMultiThreadDevice.cpp
示例13: updateMeanData
void
MSCalibrator::writeXMLOutput() {
if (myOutput != nullptr) {
updateMeanData();
const int p = passed();
// meandata will be off if vehicles are removed on the next edge instead of this one
const int discrepancy = myEdgeMeanData.nVehEntered + myEdgeMeanData.nVehDeparted - myEdgeMeanData.nVehVaporized - passed();
assert(discrepancy >= 0);
const std::string ds = (discrepancy > 0 ? "\" vaporizedOnNextEdge=\"" + toString(discrepancy) : "");
const double durationSeconds = STEPS2TIME(myCurrentStateInterval->end - myCurrentStateInterval->begin);
(*myOutput) << " <interval begin=\"" << time2string(myCurrentStateInterval->begin) <<
"\" end=\"" << time2string(myCurrentStateInterval->end) <<
"\" id=\"" << myID <<
"\" nVehContrib=\"" << p <<
"\" removed=\"" << myRemoved <<
"\" inserted=\"" << myInserted <<
"\" cleared=\"" << myClearedInJam <<
"\" flow=\"" << p * 3600.0 / durationSeconds <<
"\" aspiredFlow=\"" << myCurrentStateInterval->q <<
"\" speed=\"" << myEdgeMeanData.getTravelledDistance() / myEdgeMeanData.getSamples() <<
"\" aspiredSpeed=\"" << myCurrentStateInterval->v <<
ds << //optional
"\"/>\n";
}
myDidSpeedAdaption = false;
myInserted = 0;
myRemoved = 0;
myClearedInJam = 0;
myHaveWarnedAboutClearingJam = false;
reset();
}
开发者ID:michele-segata,项目名称:plexe-sumo,代码行数:31,代码来源:MSCalibrator.cpp
示例14: TestCJKWithDisallowLineBreaking
// Test for CJK with DisallowLineBreaking
nsresult
TestCJKWithDisallowLineBreaking()
{
nsString test;
nsString result;
test.AssignLiteral("<html><body>");
for (uint32_t i = 0; i < 400; i++) {
// Insert Kanji (U+5341)
test.Append(0x5341);
}
test.AppendLiteral("</body></html>");
ConvertBufToPlainText(test, nsIDocumentEncoder::OutputFormatted |
nsIDocumentEncoder::OutputCRLineBreak |
nsIDocumentEncoder::OutputLFLineBreak |
nsIDocumentEncoder::OutputFormatFlowed |
nsIDocumentEncoder::OutputDisallowLineBreaking);
// create result case
for (uint32_t i = 0; i < 400; i++) {
result.Append(0x5341);
}
result.AppendLiteral("\r\n");
if (!test.Equals(result)) {
fail("Wrong HTML to CJK text serialization with OutputDisallowLineBreaking");
return NS_ERROR_FAILURE;
}
passed("HTML to CJK text serialization with OutputDisallowLineBreaking");
return NS_OK;
}
开发者ID:Danielzac,项目名称:gecko-dev,代码行数:35,代码来源:TestPlainTextSerializer.cpp
示例15: TestASCIIWithFlowedDelSp
// Test for ASCII with format=flowed; delsp=yes
nsresult
TestASCIIWithFlowedDelSp()
{
nsString test;
nsString result;
test.AssignLiteral("<html><body>"
"Firefox Firefox Firefox Firefox "
"Firefox Firefox Firefox Firefox "
"Firefox Firefox Firefox Firefox"
"</body></html>");
ConvertBufToPlainText(test, nsIDocumentEncoder::OutputFormatted |
nsIDocumentEncoder::OutputCRLineBreak |
nsIDocumentEncoder::OutputLFLineBreak |
nsIDocumentEncoder::OutputFormatFlowed |
nsIDocumentEncoder::OutputFormatDelSp);
// create result case
result.AssignLiteral("Firefox Firefox Firefox Firefox "
"Firefox Firefox Firefox Firefox "
"Firefox \r\nFirefox Firefox Firefox\r\n");
if (!test.Equals(result)) {
fail("Wrong HTML to ASCII text serialization with format=flowed; delsp=yes");
return NS_ERROR_FAILURE;
}
passed("HTML to ASCII text serialization with format=flowed; delsp=yes");
return NS_OK;
}
开发者ID:70599,项目名称:Waterfox,代码行数:33,代码来源:TestPlainTextSerializer.cpp
示例16: TestMain
int TestMain(void) {
fail_count += imc_shm_mmap(65536, PROT_READ|PROT_WRITE, MAP_SHARED,
0, 0, 0);
fail_count += imc_shm_mmap(4096, PROT_READ|PROT_WRITE, MAP_SHARED,
0, 1, 0);
fail_count += imc_shm_mmap(1, PROT_READ|PROT_WRITE, MAP_SHARED,
0, 1, 0);
fail_count += imc_shm_mmap(0x20000, PROT_READ|PROT_WRITE, MAP_SHARED,
0, 0, 0);
fail_count += imc_shm_mmap(0x30000, PROT_READ, MAP_SHARED,
0, 0, 0);
fail_count += imc_shm_mmap(65536, PROT_READ|PROT_WRITE, MAP_SHARED,
0, 0, 1);
fail_count += imc_shm_mmap(0x20000, PROT_READ|PROT_WRITE, MAP_SHARED,
0, 0, 1);
fail_count += imc_shm_mmap(0x30000, PROT_READ, MAP_SHARED,
0, 0, 1);
fail_count += imc_shm_mmap(0x100000, PROT_READ|PROT_WRITE, MAP_SHARED,
0, 0, 1);
/*
* TODO(mseaborn): This triggers a LOG_FATAL error. Enable this
* when it returns a normal error from the syscall. See
* http://code.google.com/p/nativeclient/issues/detail?id=724
*/
/* test_map_private_is_not_supported(); */
printf("imc_shm_mmap: %d failures\n", fail_count);
if (0 == fail_count) passed("imc_shm_mmap: all sizes\n");
else failed("imc_shm_mmap: some test(s) failed\n");
return fail_count;
}
开发者ID:Lind-Project,项目名称:native_client,代码行数:34,代码来源:imc_shm_mmap_test.c
示例17: TestPreWrapElementForThunderbird
nsresult
TestPreWrapElementForThunderbird()
{
// This test examines the magic pre-wrap setup that Thunderbird relies on.
nsString test;
test.AppendLiteral(
"<html>" NS_LINEBREAK
"<body style=\"white-space: pre-wrap; width: 10ch;\">" NS_LINEBREAK
"<pre>" NS_LINEBREAK
" first line is too long" NS_LINEBREAK
" second line is even loooonger " NS_LINEBREAK
"</pre>" NS_LINEBREAK
"</body>" NS_LINEBREAK "</html>");
ConvertBufToPlainText(test, nsIDocumentEncoder::OutputWrap);
// "\n\n first\nline is\ntoo long\n second\nline is\neven\nloooonger\n\n\n"
if (!test.EqualsLiteral(NS_LINEBREAK NS_LINEBREAK
" first" NS_LINEBREAK
"line is" NS_LINEBREAK
"too long" NS_LINEBREAK
" second" NS_LINEBREAK
"line is" NS_LINEBREAK
"even" NS_LINEBREAK
"loooonger" NS_LINEBREAK
NS_LINEBREAK NS_LINEBREAK)) {
fail("Wrong prettyprinted html to text serialization");
return NS_ERROR_FAILURE;
}
passed("prettyprinted HTML to text serialization test");
return NS_OK;
}
开发者ID:70599,项目名称:Waterfox,代码行数:32,代码来源:TestPlainTextSerializer.cpp
示例18: TestPlainTextSerializer
nsresult
TestPlainTextSerializer()
{
nsString test;
test.AppendLiteral("<html><base>base</base><head><span>span</span></head>"
"<body>body</body></html>");
ConvertBufToPlainText(test, 0);
if (!test.EqualsLiteral("basespanbody")) {
fail("Wrong html to text serialization");
return NS_ERROR_FAILURE;
}
passed("HTML to text serialization test");
nsresult rv = TestASCIIWithFlowedDelSp();
NS_ENSURE_SUCCESS(rv, rv);
rv = TestCJKWithFlowedDelSp();
NS_ENSURE_SUCCESS(rv, rv);
rv = TestPrettyPrintedHtml();
NS_ENSURE_SUCCESS(rv, rv);
rv = TestPreElement();
NS_ENSURE_SUCCESS(rv, rv);
rv = TestBlockElement();
NS_ENSURE_SUCCESS(rv, rv);
rv = TestPreWrapElementForThunderbird();
NS_ENSURE_SUCCESS(rv, rv);
// Add new tests here...
return NS_OK;
}
开发者ID:70599,项目名称:Waterfox,代码行数:35,代码来源:TestPlainTextSerializer.cpp
示例19: main
int main()
{
unsigned flag = 0;
HIPCHECK(hipDeviceReset());
int deviceCount = 0;
HIPCHECK(hipGetDeviceCount(&deviceCount));
for(int j=0;j<deviceCount;j++){
HIPCHECK(hipSetDevice(j));
for(int i=0;i<4;i++){
flag = 1 << i;
printf ("Flag=%x\n", flag);
HIPCHECK(hipSetDeviceFlags(flag));
//HIPCHECK_API(hipSetDeviceFlags(flag), hipErrorInvalidValue);
}
flag = 0;
}
passed();
}
开发者ID:kknox,项目名称:HIP,代码行数:25,代码来源:hipSetDeviceFlags.cpp
示例20: compute_subtree_size
std::vector<int> compute_subtree_size(
const AdjacencyList<EdgeType> &conn, int root) const
{
const int n = conn.size();
std::vector<int> subtree_size(n);
std::vector<bool> passed(n), gathered(n);
std::stack<pii> count_stack;
count_stack.push(pii(root, 0));
while(!count_stack.empty()){
const pii p = count_stack.top();
count_stack.pop();
const int u = p.first, i = p.second;
if(i == 0){
passed[u] = true;
count_stack.push(pii(u, 1));
for(size_t j = 0; j < conn[u].size(); ++j){
const int v = conn[u][j].to;
if(passed[v]){ continue; }
count_stack.push(pii(v, 0));
}
}else{
int sum = 1;
gathered[u] = true;
for(size_t j = 0; j < conn[u].size(); ++j){
const int v = conn[u][j].to;
if(!gathered[v]){ continue; }
sum += subtree_size[v];
}
subtree_size[u] = sum;
}
}
return subtree_size;
}
开发者ID:logicmachine,项目名称:LibCompetitive-v3,代码行数:33,代码来源:heavy_light_decomposition.hpp
注:本文中的passed函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论