本文整理汇总了C++中cv函数的典型用法代码示例。如果您正苦于以下问题:C++ cv函数的具体用法?C++ cv怎么用?C++ cv使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cv函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: createCompleteDocument
void KisKraSaveXmlVisitorTest::testCreateDomDocument()
{
KisDocument* doc = createCompleteDocument();
quint32 count = 0;
QDomDocument dom;
QDomElement image = dom.createElement("IMAGE"); // Legacy!
KisSaveXmlVisitor visitor(dom, image, count, "", true);
Q_ASSERT(doc->image());
QStringList list;
doc->image()->lock();
KisCountVisitor cv(list, KoProperties());
doc->image()->rootLayer()->accept(cv);
doc->image()->rootLayer()->accept(visitor);
QCOMPARE((int)visitor.m_count, (int)cv.count());
//delete doc;
}
开发者ID:ChrisJong,项目名称:krita,代码行数:25,代码来源:kis_kra_savexml_visitor_test.cpp
示例2: cv
/**
* Get the number of vertices emanating from this vertex.
* Get a count of laths representing the vertices emanating from the vertex
* this lath represents.
*
* @return Count of laths.
*/
TqInt CqLath::cQvv() const
{
TqInt c = 1; // Start with this
// Laths representing the edges that radiate from the associated vertex are obtained by
// following the clockwise vertex links around the vertex.
CqLath* pNext = cv();
const CqLath* pLast = this;
while(NULL != pNext && this != pNext)
{
c++;
pLast = pNext;
pNext = pNext->cv();
}
// If we hit a boundary, add the ec of this boundary edge and start again going backwards.
// @warning Adding ccf for the boundary edge means that the lath represents a different vertex.
if(NULL == pNext)
{
pLast = this;
pNext = ccv();
// We know we are going to hit a boundary in this direction as well so we can just look for that
// case as a terminator.
while(NULL != pNext)
{
assert( pNext != this );
c++;
pLast = pNext;
pNext = pNext->ccv();
}
// We have hit the boundary going the other way, so add the ccf of this boundary edge.
c++;
}
return( c );
}
开发者ID:UIKit0,项目名称:aqsis,代码行数:41,代码来源:lath.cpp
示例3: cQvf
/**
* Get the facets which share this vertex.
* Get a list of laths which represent the facets which share the vertex this
* lath represents.
*
* @return Pointer to an array of lath pointers.
*/
void CqLath::Qvf(std::vector<const CqLath*>& Result) const
{
TqInt len = cQvf();
const CqLath* pNext = cv();
Result.resize(len);
TqInt index = 0;
// Laths representing the edges that radiate from the associated vertex are obtained by
// following the clockwise vertex links around the vertex.
const CqLath *pTmpLath = this;
Result[index++] = pTmpLath;
while(NULL != pNext && this != pNext)
{
Result[index++] = pNext;
pNext = pNext->cv();
}
// If we hit a boundary, start again going backwards.
if(NULL == pNext)
{
pNext = ccv();
// We know we are going to hit a boundary in this direction as well so we can just look for that
// case as a terminator.
while(NULL != pNext)
{
Result[index++] = pNext;
pNext = pNext->ccv();
}
}
}
开发者ID:UIKit0,项目名称:aqsis,代码行数:40,代码来源:lath.cpp
示例4: setCoveragesByName
void SurfPhase::
setCoveragesByName(std::string cov) {
int kk = nSpecies();
int k;
compositionMap cc;
for (k = 0; k < kk; k++) {
cc[speciesName(k)] = -1.0;
}
parseCompString(cov, cc);
doublereal c;
vector_fp cv(kk, 0.0);
bool ifound = false;
for (k = 0; k < kk; k++) {
c = cc[speciesName(k)];
if (c > 0.0) {
ifound = true;
cv[k] = c;
}
}
if (!ifound) {
throw CanteraError("SurfPhase::setCoveragesByName",
"Input coverages are all zero or negative");
}
setCoverages(DATA_PTR(cv));
}
开发者ID:anujg1991,项目名称:cantera,代码行数:25,代码来源:SurfPhase.cpp
示例5: max_fs_arity
int max_fs_arity(const Constraint_Handle &c) {
int max_arity=0;
for(Constr_Vars_Iter cv(c); cv; cv++)
if((*cv).var->kind() == Global_Var)
max_arity = omega::max(max_arity,(*cv).var->get_global_var()->arity());
return max_arity;
}
开发者ID:ksluckow,项目名称:the-omega-project,代码行数:7,代码来源:elim.c
示例6: TEST
TEST(CLConditionVariable, Multi_process_for_Shared_Cond)
{
CLSharedMemory *psm = new CLSharedMemory("test_for_multi_process_for_shared_cond", 16);
long *p = (long *)(psm->GetAddress());
*p = 0;
long *flag = (long *)(((char *)p) + 8);
*flag = 0;
CLEvent event("test_for_event_auto");
CLProcess *process = new CLProcess(new CLProcessFunctionForExec);
EXPECT_TRUE(process->Run((void *)"../test_for_exec/test_for_CLConditionVariable/main").IsSuccess());
CLMutex mutex("mutex_for_test_for_multi_process_for_shared_cond", MUTEX_USE_SHARED_PTHREAD);
CLConditionVariable cv("test_conditoin_variable_for_multiprocess");
{
CLCriticalSection cs(&mutex);
while(*flag == 0)
EXPECT_TRUE((cv.Wait(&mutex)).IsSuccess());
}
EXPECT_EQ(*p, 5);
EXPECT_TRUE(event.Wait().IsSuccess());
delete psm;
}
开发者ID:ChengHuaUESTC,项目名称:LibExecutive,代码行数:31,代码来源:CLConditionVariableTester.cpp
示例7: mark_cells_on_vertices
void mark_cells_on_vertices(VertexIt seed,
CellSeq& cell_seq,
EltMarker& visited,
int level,
CellPred inside)
{
typedef typename VertexIt::grid_type grid_type;
typedef GT gt;
typedef typename gt::Cell Cell;
typedef typename gt::Vertex Vertex;
typedef typename gt::CellOnVertexIterator CellOnVertexIterator;
while(! seed.IsDone()) {
Vertex V = *seed;
for(CellOnVertexIterator cv(V); ! cv.IsDone(); ++cv)
if( inside(*cv)) {
Cell C(*cv);
if(visited(C) == 0) {
visited[C] = level;
cell_seq.append(C);
}
}
++seed;
}
}
开发者ID:BackupTheBerlios,项目名称:gral,代码行数:25,代码来源:incidence-hulls.C
示例8: main
int main()
{
Vector3DFast av(4,-2,5);
Vector3DFast bv(2,5,-3);
Vector3DFast cv(0,0,0);
cv=av+bv;
}
开发者ID:rsehgal,项目名称:HighPerformanceComparison,代码行数:8,代码来源:ex3SimpleSandro.cpp
示例9: xr
ExecStatus
Distinct<View0,View1>::post(Home home, View0 x, View1 y) {
if (x.assigned()) {
GlbRanges<View0> xr(x);
IntSet xs(xr);
ConstSetView cv(home, xs);
GECODE_ES_CHECK((DistinctDoit<View1>::post(home,y,cv)));
}
if (y.assigned()) {
GlbRanges<View1> yr(y);
IntSet ys(yr);
ConstSetView cv(home, ys);
GECODE_ES_CHECK((DistinctDoit<View0>::post(home,x,cv)));
}
(void) new (home) Distinct<View0,View1>(home,x,y);
return ES_OK;
}
开发者ID:MGKhKhD,项目名称:easy-IP,代码行数:17,代码来源:nq.hpp
示例10: Square
float CGameHelper::GuiTraceRay(const float3 &start, const float3 &dir, float length, CUnit*& hit, bool useRadar, CUnit* exclude)
{
if (dir == ZeroVector) {
return -1.0f;
}
// distance from start to ground intersection point + fudge
float groundLen = ground->LineGroundCol(start, start + dir * length);
float returnLenSq = Square( (groundLen > 0.0f)? groundLen + 200.0f: length );
hit = NULL;
CollisionQuery cq;
GML_RECMUTEX_LOCK(quad); // GuiTraceRay
vector<int> quads = qf->GetQuadsOnRay(start, dir, length);
vector<int>::iterator qi;
for (qi = quads.begin(); qi != quads.end(); ++qi) {
const CQuadField::Quad& quad = qf->GetQuad(*qi);
std::list<CUnit*>::const_iterator ui;
for (ui = quad.units.begin(); ui != quad.units.end(); ++ui) {
CUnit* unit = *ui;
if (unit == exclude) {
continue;
}
if ((unit->allyteam == gu->myAllyTeam) || gu->spectatingFullView ||
(unit->losStatus[gu->myAllyTeam] & (LOS_INLOS | LOS_CONTRADAR)) ||
(useRadar && radarhandler->InRadar(unit, gu->myAllyTeam))) {
CollisionVolume cv(unit->collisionVolume);
if (unit->isIcon) {
// for iconified units, just pretend the collision
// volume is a sphere of radius <unit->IconRadius>
cv.SetDefaultScale(unit->iconRadius);
}
if (CCollisionHandler::MouseHit(unit, start, start + dir * length, &cv, &cq)) {
// get the distance to the ray-volume egress point
// so we can still select stuff inside factories
const float len = (cq.p1 - start).SqLength();
if (len < returnLenSq) {
returnLenSq = len;
hit = unit;
}
}
}
}
}
return ((hit)? math::sqrt(returnLenSq): (math::sqrt(returnLenSq) - 200.0f));
}
开发者ID:javaphoon,项目名称:spring,代码行数:56,代码来源:GameHelper.cpp
示例11: compute_covariance
table< T > compute_covariance( const storage< T, L >& sto )
{
auto nchannels = sto.channel_size();
auto nframes = sto.frame_size();
auto means = compute_channel_means( sto );
table< T, L > cv( nchannels, nchannels );
for ( size_t row = 0; row < nchannels; ++row )
{
for ( size_t col = 0; col < nchannels; ++col )
{
T v = T( 0 );
for ( index_t i = 0; i < sto.frame_size(); ++i )
v += ( sto( i, row ) - means[ row ] ) * ( sto( i, col ) - means[ col ] );
cv( row, col ) = v / nframes;
}
}
return cv;
}
开发者ID:tgeijten,项目名称:flut,代码行数:19,代码来源:data_algorithms.hpp
示例12: m_tree
clRowEntry::clRowEntry(clTreeCtrl* tree, const wxString& label, int bitmapIndex, int bitmapSelectedIndex)
: m_tree(tree)
, m_model(tree ? &tree->GetModel() : nullptr)
{
// Fill the verctor with items constructed using the _non_ default constructor
// to makes sure that IsOk() returns TRUE
m_cells.resize(m_tree->GetHeader()->empty() ? 1 : m_tree->GetHeader()->size(),
clCellValue("", -1, -1)); // at least one column
clCellValue cv(label, bitmapIndex, bitmapSelectedIndex);
m_cells[0] = cv;
}
开发者ID:eranif,项目名称:codelite,代码行数:11,代码来源:clRowEntry.cpp
示例13: cv
nsPagePrintTimer::~nsPagePrintTimer()
{
// "Destroy" the document viewer; this normally doesn't actually
// destroy it because of the IncrementDestroyRefCount call below
// XXX This is messy; the document viewer should use a single approach
// to keep itself alive during printing
nsCOMPtr<nsIContentViewer> cv(do_QueryInterface(mDocViewerPrint));
if (cv) {
cv->Destroy();
}
}
开发者ID:ahadzi,项目名称:celtx,代码行数:11,代码来源:nsPagePrintTimer.cpp
示例14: LOG_FATAL
void AgeLength::DoExecute() {
auto age_length = model_->managers().age_length()->FindAgeLength(age_length_label_);
if (!age_length)
LOG_FATAL() << "Could not find age_length " << age_length_label_ << " for the report";
unsigned min_age = model_->min_age();
unsigned max_age = model_->max_age();
unsigned year = model_->current_year();
unsigned time_steps = model_->time_steps().size();
// Print the header
cache_ << "*"<< type_ << "[" << label_ << "]" << "\n";
cache_ << "year: " << model_->current_year() << "\n";
cache_ << "time_step: " << time_step_ << "\n";
cache_ << "year time_step ";
for (unsigned age = min_age; age <= max_age; ++age)
cache_ << age << " ";
cache_ << "\n";
for (unsigned time_step = 0; time_step < time_steps; ++time_step) {
cache_ << year << " " << time_step << " ";
for (unsigned age = min_age; age <= max_age; ++age)
cache_ << age_length->cv(year, time_step, age) << " ";
cache_ << "\n";
}
cache_ << "\n\n";
cache_ << "year time_step ";
cache_ << "age ";
for (auto length : model_->length_bins())
cache_ << "L(" << length << ") ";
cache_ << "\n";
unsigned start_year = model_->start_year();
auto age_lengths = model_->partition().age_length_proportions(category_); // map<category, vector<year, time_step, age, length, proportion>>;
for (unsigned i = 0; i < age_lengths.size(); ++i) {
if (std::find(years_.begin(), years_.end(), i + start_year) != years_.end()) {
for (unsigned j = 0; j < age_lengths[i].size(); ++j) {
for (unsigned k = 0; k < age_lengths[i][j].size(); ++k) {
cache_ << (start_year + i) << " " << j << " " << (min_age + k) << " ";
for (unsigned l = 0; l < age_lengths[i][j][k].size(); ++l) {
cache_ << age_lengths[i][j][k][l] << " ";
}
cache_ << "\n";
}
}
}
}
ready_for_writing_ = true;
}
开发者ID:NIWAFisheriesModelling,项目名称:CASAL2,代码行数:53,代码来源:AgeLength.cpp
示例15: qData
vector<ContourIndex::ContourPointIdx> ContourIndex::kNearestNeighbors(int k, Contour::ContourPart contourPoint) {
vector<double> qData(numDimensions);
qData.push_back(contourPoint->x);
qData.push_back(contourPoint->y);
qData.push_back(contourPoint->gradientAngleSmooth.normalize().degree());
qData.push_back(contourPoint->curvature.normalize().degree());
SpatialIndex::Point query(&qData[0], numDimensions);
CollectIndicesVisitor cv(this);
tree->nearestNeighborQuery(k, query, cv);
return cv.result;
}
开发者ID:carlwitt,项目名称:CW_BSc_OMR,代码行数:12,代码来源:ContourIndex.cpp
示例16: cv
TouchClassifier::~TouchClassifier()
{
#ifdef RETRAIN_THE_CLASSIFIER
std::cout << "training the color classifier..." << std::endl;
ColorClassifier::CrossValidator cv(3); //cv(60);
ColorClassifier::KnownSampleSet trainingSet;
cv.retrieveTrainingSamples(trainingSet);
_colorClassifier->train(trainingSet);
#endif
delete _colorClassifier;
cvReleaseImage(&_transformedColorImage);
}
开发者ID:alemart,项目名称:mestrado,代码行数:12,代码来源:TouchClassifier.cpp
示例17: c_eval_seq
/* N.B., c_eval_seq discards CAR(values) so pass it an extra value. */
static cv_t c_eval_seq(obj_t cont, obj_t values)
{
assert(is_cont4(cont));
obj_t env = cont_env(cont);
obj_t exprs = cont4_arg(cont);
EVAL_LOG("exprs=%O", exprs);
obj_t second = cont_cont(cont);
if (!is_null(CDR(exprs)))
second = make_cont4(c_eval_seq, second, env, CDR(exprs));
obj_t first = make_cont4(c_eval, second, env, CAR(exprs));
return cv(first, CDR(values));
}
开发者ID:kbob,项目名称:schetoo,代码行数:13,代码来源:eval.c
示例18: default_handler
static cv_t default_handler(obj_t cont, obj_t values)
{
/*
* For all non-message-irritants-who conditions,
* print the condition's class.
* For all message conditions, print the condition's message.
* If who or irritants given, print (cons who irritants).
*/
assert(is_cont(cont));
EVAL_LOG("cont=%O values=%O", cont, values);
obj_t ex = CAR(values);
obj_t parts = record_get_field(ex, 0);
const char *psn = program_short_name();
size_t psnl = strlen(psn);
size_t i, size = vector_len(parts);
for (i = 0; i < size; i++) {
obj_t rtd = record_rtd(vector_ref(parts, i));
if (rtd != message && rtd != irritants && rtd != who) {
ofprintf(stderr, "%*s: %O\n", (int)psnl, psn, rtd_name(rtd));
psn = "";
}
}
obj_t who_p = FALSE_OBJ;
obj_t irr_p = make_uninitialized();
for (i = 0; i < size; i++) {
obj_t p = vector_ref(parts, i);
obj_t rtd = record_rtd(p);
if (rtd == message) {
obj_t msg = record_get_field(p, 0);
const wchar_t *chars = string_value(msg);
fprintf(stderr, "%*s %ls\n", (int)psnl, psn, chars);
psn = "";
} else if (rtd == who)
who_p = record_get_field(p, 0);
else if (rtd == irritants)
irr_p = record_get_field(p, 0);
}
if (who_p != FALSE_OBJ && !is_uninitialized(irr_p)) {
ofprintf(stderr, "%*s %O\n", (int)psnl, psn, CONS(who_p, irr_p));
psn = "";
} else if (who_p != FALSE_OBJ) {
ofprintf(stderr, "%*s %O\n", (int)psnl, psn, who_p);
psn = "";
} else if (!is_uninitialized(irr_p)) {
ofprintf(stderr, "%*s %O\n", (int)psnl, psn, irr_p);
psn = "";
}
if (*psn)
fprintf(stderr, "%s: unknown exception\n", psn);
ofprintf(stderr, "\n");
return cv(EMPTY_LIST, CONS(make_uninitialized(), EMPTY_LIST));
}
开发者ID:kbob,项目名称:schetoo,代码行数:53,代码来源:eval.c
示例19: cv
cvec cofdm_sel::get_sel( )
{
cvec cv;
int K = sel_carriers.length();
int i;
cv.set_length(K);
for (i=0; i<K; i++) {
cv(i)= y0(sel_carriers(i));
}
return (cv);
}
开发者ID:maki63,项目名称:c_sci,代码行数:12,代码来源:csim_cofdm_sel.cpp
示例20: convert_chain
/* Runs the convert chain */
static int convert_chain(int c, ...)
{
va_list list;
char_cv_t cv;
va_start(list,c);
while (cv = va_arg(list,char_cv_t), cv) {
c = cv(c);
}
va_end(list);
return c;
}
开发者ID:9a3eedi,项目名称:Droidsound,代码行数:13,代码来源:rsc68.c
注:本文中的cv函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论