本文整理汇总了C++中sCopy函数的典型用法代码示例。如果您正苦于以下问题:C++ sCopy函数的具体用法?C++ sCopy怎么用?C++ sCopy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sCopy函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: sCopy
int MelBanks::GetFeatures(float *ret_features)
{
if(input_vector == 0)
return 0; // we do not have input data
// copy one frame from the input buffer to the temporary one during the first pass through this function,
// shift the temporal buffer left an copy next 10 ms from the input buffer in all follow passes.
if(first_frame)
{
sCopy(vector_size, frame, input_vector);
// input_vector -> frame
// backup the frame
sCopy(vector_size, frame_backup, frame);
frame_pos = vector_size;
input_vector_pos += vector_size;
first_frame = false;
}
else
{
// restore the last frame and shift it 10 ms left
if(frame_pos == vector_size - step)
{
sCopy(vector_size, frame, frame_backup); // frame_backup -> frame
sShiftLeft(vector_size, frame, step);
}
int n_input = input_vector_len - input_vector_pos;
int n_output = vector_size - frame_pos;
int n_process = (n_input < n_output ? n_input : n_output);
sCopy(n_process, frame + frame_pos, input_vector + input_vector_pos);
input_vector_pos += n_process;
frame_pos += n_process;
if(input_vector_pos > input_vector_len)
input_vector = 0;
}
if(frame_pos == vector_size)
{
// backup the frame
sCopy(vector_size, frame_backup, frame);
frame_pos = vector_size - step;
// perform parameterisation of one frame
ProcessFrame(frame, ret_features);
return 1;
}
return 0;
}
开发者ID:alongwithyou,项目名称:PhnRec,代码行数:54,代码来源:melbanks.cpp
示例2: push
void push(str_t *str, bstack_t *stack)
{
//str_t *newstr;
//add an element to the stack, growing the stack if necessary
if (stack->num >= stack->size)
{
stack->size *=2;
stack->elements = (str_t **)realloc(stack->elements,
stack->size * sizeof(str_t*));
if (stack->elements == NULL)
{
printf("error allocating stack space\n");
return;
}
}
//create a new string
//newstr = (str_t *)malloc(sizeof(str_t));
//sInit(newstr);
//sCopy(newstr,str);
sCopy(stack->elements[stack->num],str);
stack->num++;
//both stacks and queues push to the same side of the array
//the top element and the number of elements are the same
stack->top = stack->num - 1;
//store the pointer to it in the stack
//stack->elements[stack->top] = newstr;
return;
}
开发者ID:CplusHua,项目名称:yafu-setup-package,代码行数:32,代码来源:stack.c
示例3: list
void projects::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int)
{
QAction *menuItem;
bool editPriv =
(omfgThis->username() == list()->currentItem()->rawValue("prj_owner_username") && _privileges->check("MaintainPersonalProjects")) ||
(omfgThis->username() == list()->currentItem()->rawValue("prj_username") && _privileges->check("MaintainPersonalProjects")) ||
(_privileges->check("MaintainAllProjects"));
bool viewPriv =
(omfgThis->username() == list()->currentItem()->rawValue("prj_owner_username") && _privileges->check("ViewPersonalProjects")) ||
(omfgThis->username() == list()->currentItem()->rawValue("prj_username") && _privileges->check("ViewPersonalProjects")) ||
(_privileges->check("ViewAllProjects"));
menuItem = pMenu->addAction("View...", this, SLOT(sView()));
menuItem->setEnabled(viewPriv);
menuItem = pMenu->addAction("Edit...", this, SLOT(sEdit()));
menuItem->setEnabled(editPriv);
menuItem = pMenu->addAction("Delete...", this, SLOT(sDelete()));
menuItem->setEnabled(editPriv);
menuItem = pMenu->addAction("Copy...", this, SLOT(sCopy()));
menuItem->setEnabled(editPriv);
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:26,代码来源:projects.cpp
示例4: XWidget
budgets::budgets(QWidget* parent, const char* name, Qt::WFlags fl)
: XWidget(parent, name, fl)
{
setupUi(this);
connect(_copy, SIGNAL(clicked()), this, SLOT(sCopy()));
connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
connect(_new, SIGNAL(clicked()), this, SLOT(sNew()));
connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
connect(_view, SIGNAL(clicked()), this, SLOT(sView()));
_budget->addColumn(tr("Start Date"),_dateColumn, Qt::AlignLeft, true, "startdate");
_budget->addColumn(tr("End Date"), _dateColumn, Qt::AlignLeft, true, "enddate");
_budget->addColumn(tr("Code"), _itemColumn, Qt::AlignLeft, true, "budghead_name");
_budget->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "budghead_descrip");
if (_privileges->check("MaintainBudgets"))
{
connect(_budget, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool)));
connect(_budget, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool)));
connect(_budget, SIGNAL(valid(bool)), _copy, SLOT(setEnabled(bool)));
connect(_budget, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick()));
}
else
{
connect(_budget, SIGNAL(itemSelected(int)), _view, SLOT(animateClick()));
_new->setEnabled(FALSE);
}
connect(omfgThis, SIGNAL(budgetsUpdated(int, bool)), this, SLOT(sFillList()));
sFillList();
}
开发者ID:Wushaowei001,项目名称:xtuple-1,代码行数:34,代码来源:budgets.cpp
示例5: XDialog
copyItem::copyItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
: XDialog(parent, name, modal, fl)
{
setupUi(this);
connect(_copy, SIGNAL(clicked()), this, SLOT(sCopy()));
connect(_source, SIGNAL(typeChanged(const QString&)), this, SLOT(sHandleItemType(const QString&)));
_captive = FALSE;
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:10,代码来源:copyItem.cpp
示例6: XDialog
/*
* Constructs a copyBudget as a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*
* The dialog will by default be modeless, unless you set 'modal' to
* true to construct a modal dialog.
*/
copyBudget::copyBudget(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
: XDialog(parent, name, modal, fl)
{
setupUi(this);
_budgheadid = -1;
// signals and slots connections
connect(_copy, SIGNAL(clicked()), this, SLOT(sCopy()));
connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
}
开发者ID:Wushaowei001,项目名称:xtuple-1,代码行数:18,代码来源:copyBudget.cpp
示例7: XDialog
copyContract::copyContract(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
: XDialog(parent, name, modal, fl)
{
setupUi(this);
connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sCopy()));
_contrctid = -1;
_vendid = -1;
_captive = false;
}
开发者ID:dwatson78,项目名称:qt-client,代码行数:12,代码来源:copyContract.cpp
示例8: sCopy
CString CFilePath::QuoteSpaces(CString const &sString)
{
if (sString.Find(' ')>=0)
{
CString sCopy(sString);
CStringLock Buffer(sCopy, sCopy.GetLength() + 2);
PathQuoteSpaces(Buffer);
Buffer.Release();
return sCopy;
}
return sString;
}
开发者ID:KnowNo,项目名称:test-code-backup,代码行数:13,代码来源:FilePath.cpp
示例9: sSubtractAverage
void MelBanks::ProcessFrame(float *inp_frame, float *ret_features)
{
// preprocessing in the time domain
if(z_mean_source)
{
sSubtractAverage(vector_size, inp_frame);
}
if(preem_coef != 0.0f)
{
sPreemphasisBW(vector_size, inp_frame, preem_coef);
}
sMultVect(vector_size, inp_frame, hamming);
// FFT
sSet(fft_vector_size, FFT_real, 0.0f);
sSet(fft_vector_size, FFT_imag, 0.0f);
sCopy(vector_size, FFT_real, inp_frame);
cComplex22N(fft_vector_size, FFT_real, FFT_imag, FFT_vector + 1);
FFT_vector[0] = 0.0f;
cFour1(FFT_vector, fft_vector_size, -1);
c2N2Complex(fft_vector_size_2, FFT_vector + 1, FFT_real, FFT_imag);
cPower(fft_vector_size_2, FFT_real, FFT_imag);
//sSqrt(MB_FFTVECTORSIZE_2, FFTReal);
// Get logarithms of energies in critical bands
_mbApply(mel_banks, FFT_real, out_en, false);
if(take_log)
{
sLn(nbanks, out_en);
}
sCopy(nbanks, ret_features, out_en);
}
开发者ID:alongwithyou,项目名称:PhnRec,代码行数:39,代码来源:melbanks.cpp
示例10: ProcessLastBunch
bool SpeechRec::ProcessTail()
{
if(mTrapsEnabled)
{
ProcessLastBunch();
if(lastParamVector < 0)
return false;
int nparams = actualParams->GetNParams();
int tshift = TR.GetTrapShift();
// repeate last vector tshift times
int i;
for(i = 0; i < tshift; i++)
{
if(i != lastParamVector)
sCopy(nparams, params + i * nparams, params + lastParamVector * nparams);
}
TR.CalcFeaturesBunched(params, posteriors, tshift);
int j;
for(j = 0; j < tshift * TR.GetNumOuts(); j++)
posteriors[j] = (*postSoftFunc)(posteriors[j], postSoftArg1, postSoftArg2, postSoftArg3);
for(j = 0; j < tshift * TR.GetNumOuts(); j++)
posteriors[j] = (*decSoftFunc)(posteriors[j], decSoftArg1, decSoftArg2, decSoftArg3);
for(i = 0; i < tshift; i++)
{
if(TR.GetDelay() >= TR.GetTrapShift())
DE->ProcessFrame(posteriors + i * TR.GetNumOuts());
}
}
else
{
int i;
for(i = 0; i < bunchIdx; i++)
{
DE->ProcessFrame(params + i * actualParams->GetNParams());
}
}
bunchIdx = 0;
lastParamVector = -1;
return true;
}
开发者ID:alongwithyou,项目名称:PhnRec,代码行数:51,代码来源:srec.cpp
示例11: GetNBanks
void PLPCoefs::ProcessFrame(float *pInpFrame, float *pOutFrame)
{
MelBanks::ProcessFrame(pInpFrame, mpEnergies);
//float a[] = {6.728697e+005, 9.397764e+005, 1.477376e+006, 2.738733e+005, 4.895320e+004, 8.109916e+004, 9.704898e+004, 2.696904e+004, 4.563343e+004, 2.192602e+005, 4.360400e+005, 6.248051e+005, 2.641279e+005, 5.159555e+004, 4.087839e+004, 5.961117e+004, 1.200557e+005, 4.983299e+004, 2.235987e+004, 2.777589e+004, 4.005698e+004, 2.035172e+004, 3.305208e+004, 6.939732e+004};
//sCopy(24, mpEnergies, a);
int nbanks = GetNBanks();
// limit energies
sLowerFloor(nbanks, mpEnergies, 1.0f);
// apply equal laudness curve
sMultVect(nbanks, mpEnergies, mpEqualLaudnessCurve);
// compression of energies
sPower(nbanks, mpEnergies, mCompressFactor);
// duplicate the first and the last value
sShiftRight(nbanks + 1, mpEnergies, 1);
mpEnergies[0] = mpEnergies[1];
mpEnergies[nbanks + 1] = mpEnergies[nbanks];
// IDCT
ApplyLinTransform(mppIDFTBases, mLPCOrder + 1, GetNBanks() + 2, mpEnergies, mpAutocorrCoefs);
// autocerrelation -> LPC
float gain = sDurbin(mpAutocorrCoefs, mpLPC, mpTmp, mLPCOrder);
assert(gain > 0.0f);
// LPC -> cepstrum
sLPC2Cepstrum(mLPCOrder, mpLPC, mpCepst);
// calculate C0
mpCepst[mLPCOrder] = -logf(1.0f/gain);
// appply liftering window
if(mCepstralLifter != 0.0f)
{
sMultVect(mLPCOrder, mpCepst, mpLifteringWindow);
}
// cepstral scaling
if(mCepstralScale != 1.0f)
{
sMultiplication(mLPCOrder + 1, mpCepst, mCepstralScale);
}
sCopy((mAddC0 ? mLPCOrder + 1 : mLPCOrder), pOutFrame, mpCepst);
}
开发者ID:alongwithyou,项目名称:PhnRec,代码行数:51,代码来源:plp.cpp
示例12: pop
int pop(str_t *str, bstack_t *stack)
{
//take an element off the stack. return 0 if there are no elements
//pass in a pointer to a string. if necessary, this routine will
//reallocate space for the string to accomodate its size. If this happens
//the pointer to the string's (likely) new location is automatically
//updated and returned.
int i;
//copy out the string at the top of the stack
//then free the stack's copy.
if (stack->num != 0)
{
stack->num--;
if (stack->type == QUEUE)
{
//for queues, the top element is always node 0
sCopy(str,stack->elements[0]);
sFree(stack->elements[0]);
free(stack->elements[0]);
stack->top--;
//now we need to adjust all the pointers down 1
for (i=1;i<stack->num;i++)
stack->elements[i-1] = stack->elements[i];
}
else
{
sCopy(str,stack->elements[stack->top]);
//sFree(stack->elements[stack->top]);
//free(stack->elements[stack->top]);
stack->top--;
}
return 1;
}
else
return 0;
}
开发者ID:CplusHua,项目名称:yafu-setup-package,代码行数:37,代码来源:stack.c
示例13: split
void split(const std::string& s,
const std::string& delim,
std::vector<std::string>& ret)
{
std::string sCopy(s);
size_t pos = 0;
std::string token;
while ((pos = sCopy.find(delim)) != std::string::npos)
{
token = sCopy.substr(0, pos);
ret.push_back(token);
sCopy.erase(0, pos + delim.size());
}
ret.push_back(sCopy);
}
开发者ID:LCClyde,项目名称:NyraCore,代码行数:15,代码来源:StringUtils.cpp
注:本文中的sCopy函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论