std::streamsize Tree::write(OutputStream& ostream) const throw (Exception) { std::streamsize size = 0; wc3lib::write(ostream, treeId(), size); wc3lib::write(ostream, variation(), size); size += position().write(ostream); wc3lib::write(ostream, angle(), size); size += scale().write(ostream); wc3lib::write<byte>(ostream, flags(), size); wc3lib::write(ostream, life(), size); wc3lib::write(ostream, customId(), size); return size; }
void loop(int iov){ //Loop on detectors for (int j=0;j<vHistoNames.size();j++){ //cout << vHistoNames[j] << endl; char hTitle[128]; sprintf(hTitle,"Noises/%s",vHistoNames[j].c_str()); //cout << hTitle << endl; inH = (TH1F*) inFile_->Get(hTitle); refH = (TH1F*) refFile_->Get(hTitle); variation(inH,refH,iov); } }
std::vector<BitBoard> Bishops::genOccupancyVariations(Square square) { std::vector<BitBoard> result; BitBoard variationCount(1LL << __builtin_popcountll(_moveMask[square])); std::vector<size_t> indexOfOnesInMask; for (size_t j = 0; j < 64; ++j) if (_moveMask[square] & (1LL << j)) indexOfOnesInMask.push_back(j); for (BitBoard i = 0; i < variationCount; ++i) { BitBoard variation(0LL); for (size_t j = 0; j < indexOfOnesInMask.size(); ++j) if (i & (1LL << j)) variation |= (1LL << indexOfOnesInMask[j]); result.push_back(variation); } return result; }
QString Analysis::toString(const Board& board) const { Board testBoard = board; QString out; if (isMate()) { QString color = testBoard.toMove() == White ? "000080" : "800000"; QString text = "Mate in"; out = QString("<font color=\"#%1\"><b>%2 %3</b></font> ") .arg(color).arg(text).arg(movesToMate()); } else if (score() > 0) out = QString("<font color=\"#000080\"><b>+%1</b></font> ").arg(score() / 100.0, 0, 'f', 2); else out = QString("<font color=\"#800000\"><b>%1</b></font> ").arg(score() / 100.0, 0, 'f', 2); int moveNo = testBoard.moveNumber(); bool white = testBoard.toMove() == White; QString moveText; foreach (Move move, variation()) { if (white) moveText += QString::number(moveNo++) + ". "; else if (moveText.isEmpty()) moveText += QString::number(moveNo++) + "... "; moveText += testBoard.moveToSan(move); moveText += " "; testBoard.doMove(move); white = !white; } out += " <a href=\""+QString::number(-m_numpv)+"\" title=\"Click to add move to game\">[+]</a> "; out += " <a href=\""+QString::number(m_numpv)+"\" title=\"Click to add variation to game\">[*]</a> "; out += moveText; QTime t(0,0,0,0); t = t.addMSecs(time()); QString elapsed = t.toString("h:mm:ss"); out += tr(" (depth %1, %2)").arg(depth()).arg(elapsed); return out; }
GeneratedImageP LocalSymbolFile::toImage() const { SymbolVariationP variation(new SymbolVariation); variation->filter = intrusive(new SolidFillSymbolFilter); return intrusive(new SymbolToImage(true, filename, variation)); }
static void variations(FILE *dest, int num, char *n1, char *n2, char *n3, char *n4, char *n5, char *p1, char *p2, char *p3, char *p4, char *p5) { switch (num) { case 1: variation(dest, "V1", n1); break; case 2: variation(dest, "V1", n1); variation(dest, "V2", n2); break; case 3: variation(dest, "V1", n1); variation(dest, "V2", n2); variation(dest, "V3", n3); break; case 4: variation(dest, "V1", n1); variation(dest, "V2", n2); variation(dest, "V3", n3); variation(dest, "V4", n4); break; case 5: variation(dest, "V1", n1); variation(dest, "V2", n2); variation(dest, "V3", n3); variation(dest, "V4", n4); variation(dest, "V5", n5); break; } if (*p1 != 0) variation1(dest, "P1", p1, xstart[0], xend[0], xfull[0], xflags[0]); if (*p2 != 0) variation1(dest, "P2", p2, xstart[1], xend[1], xfull[1], xflags[1]); if (*p3 != 0) variation1(dest, "P3", p3, xstart[2], xend[2], xfull[2], xflags[2]); if (*p4 != 0) variation1(dest, "P4", p4, xstart[3], xend[3], xfull[3], xflags[3]); if (*p5 != 0) variation1(dest, "P5", p5, xstart[4], xend[4], xfull[4], xflags[4]); }
picture outline (picture pic, picture pen) { raster<true_color> ras= as_raster<true_color> (pic); raster<double> alpha= get_alpha (as_raster<true_color> (pen)); return raster_picture (variation (ras, alpha)); }