本文整理汇总了C++中OUT函数的典型用法代码示例。如果您正苦于以下问题:C++ OUT函数的具体用法?C++ OUT怎么用?C++ OUT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OUT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Demand_next_ak
void Demand_next_ak(Demand *unit, int inNumSamples)
{
float *trig = ZIN(0);
float zreset = IN0(1);
float** out = unit->m_out;
float *prevout = unit->m_prevout;
for (int i=0; i<unit->mNumOutputs; ++i) {
out[i] = OUT(i);
}
float prevtrig = unit->m_prevtrig;
float prevreset = unit->m_prevreset;
for (int i=0; i<inNumSamples; ++i) {
float ztrig = ZXP(trig);
if (zreset > 0.f && prevreset <= 0.f) {
for (int j=2; j<unit->mNumInputs; ++j) {
RESETINPUT(j);
}
}
if (ztrig > 0.f && prevtrig <= 0.f) {
for (int j=2, k=0; j<unit->mNumInputs; ++j, ++k) {
float x = DEMANDINPUT_A(j, i + 1);
if (sc_isnan(x)) x = prevout[k];
else prevout[k] = x;
out[k][i] = x;
}
} else {
for (int j=2, k=0; j<unit->mNumInputs; ++j, ++k) {
out[k][i] = prevout[k];
}
}
prevtrig = ztrig;
prevreset = zreset;
}
unit->m_prevtrig = prevtrig;
unit->m_prevreset = prevreset;
}
示例2: client_socket
/** A basic client, note that he will create the sockets, not the server
* @param path Path to the server socket
*/
void client_socket(char *path){
lsocket*main_socket=make_socket(path);
/* Connect to the given socket address */
open_socket(main_socket,S_IWUSR);
/* Creation of the two sockets */
sockets=open_communication();
/* Send the socket to listen to */
if (handshake(main_socket,sockets)<0) OUT("The server didn't accepted connection");
/* Acknoledge user requests */
bor_signal(SIGINT,gotcha,0);
while (user_request(sockets));
/* Properly close connection */
self_terminate();
}
示例3: main
int
main(int argc, char *argv[])
{
int i, j;
size_t size;
START(argc, argv, "vmmalloc_check_allocations");
for (size = MAX_SIZE; size >= MIN_SIZE; size /= 2) {
OUT("size %zu", size);
memset(allocs, 0, sizeof (allocs));
for (i = 0; i < MAX_ALLOCS; ++i) {
allocs[i] = malloc(size);
if (allocs[i] == NULL) {
/* out of memory in pool */
break;
}
/* fill each allocation with a unique value */
memset(allocs[i], (char)i, size);
}
/* at least one allocation for each size must succeed */
ASSERT(i > 0);
/* check for unexpected modifications of the data */
for (i = 0; i < MAX_ALLOCS && allocs[i] != NULL; ++i) {
char *buffer = allocs[i];
for (j = 0; j < size; ++j) {
if (buffer[j] != (char)i)
FATAL("Content of data object was "
"modified unexpectedly for "
"object size: %zu, id: %d",
size, j);
}
free(allocs[i]);
}
}
DONE(NULL);
}
示例4: Duty_next_dd
void Duty_next_dd(Duty *unit, int inNumSamples)
{
float *out = OUT(0);
float prevout = unit->m_prevout;
float count = unit->m_count;
float reset = unit->m_prevreset;
float sr = (float) SAMPLERATE;
for (int i=0; i<inNumSamples; ++i) {
if (reset <= 0.f) {
RESETINPUT(duty_level);
RESETINPUT(duty_dur);
count = 0.f;
reset = DEMANDINPUT_A(duty_reset, i + 1) * sr + reset;
} else {
reset--;
}
if (count <= 0.f) {
count = DEMANDINPUT_A(duty_dur, i + 1) * sr + count;
if(sc_isnan(count)) {
int doneAction = (int)ZIN0(duty_doneAction);
DoneAction(doneAction, unit);
}
float x = DEMANDINPUT_A(duty_level, i + 1);
//printf("in %d %g\n", k, x);
if(sc_isnan(x)) {
x = prevout;
int doneAction = (int)ZIN0(duty_doneAction);
DoneAction(doneAction, unit);
} else {
prevout = x;
}
}
out[i] = prevout;
count--;
}
unit->m_count = count;
unit->m_prevreset = reset;
unit->m_prevout = prevout;
}
示例5: free_CSG
void free_CSG(CSG *csg)
{
int i = 0;
//int t = 0;
int j = 0;
int nout = 0;
CSG_Node *actual;
CSG_Node *base = csg->node;
for (i = 0; i < csg->last_state; i++) {
actual = base + i;
nout = OUT(actual);
if (0 && nout==1) {
if (((CSG_Node *)actual->arc <= base)
||((CSG_Node *)actual->arc >= (base + csg->last_state))) {
if(actual != NULL)
free(actual);
//printf("%s \n","uo");
}
}
else {
for(j=0;j<nout;j++) {
CSG_Node *act = actual->arc[j];
if (0 && ((act <= base) || (act >= (base + csg->last_state)))) {
if(act != NULL)
free(act);
}
}
if(nout>2)
{
if (csg->node[i].arc != NULL)
free(csg->node[i].arc);
}
}
}
if (csg->node != NULL)
free((void *)csg->node);
if (csg != NULL)
free((void *)csg);
}
示例6: Demand_next_aa
void Demand_next_aa(Demand *unit, int inNumSamples)
{
float *trig = ZIN(0);
float *reset = ZIN(1);
float** out = unit->m_out;
float* prevout = unit->m_prevout;
for (int i=0; i<unit->mNumOutputs; ++i) {
out[i] = OUT(i);
}
float prevtrig = unit->m_prevtrig;
float prevreset = unit->m_prevreset;
//Print("Demand_next_aa %d %g\n", inNumSamples, prevtrig);
for (int i=0; i<inNumSamples; ++i) {
float ztrig = ZXP(trig);
float zreset = ZXP(reset);
if (zreset > 0.f && prevreset <= 0.f) {
for (int j=2; j<unit->mNumInputs; ++j) {
RESETINPUT(j);
}
}
if (ztrig > 0.f && prevtrig <= 0.f) {
//Print("triggered\n");
for (int j=2, k=0; j<unit->mNumInputs; ++j, ++k) {
float x = DEMANDINPUT_A(j, i + 1);
//printf("in %d %g\n", k, x);
if (sc_isnan(x)) x = prevout[k];
else prevout[k] = x;
out[k][i] = x;
}
} else {
for (int j=2, k=0; j<unit->mNumInputs; ++j, ++k) {
out[k][i] = prevout[k];
}
}
prevtrig = ztrig;
prevreset = zreset;
}
}
示例7: MatchingPResynth_next
void MatchingPResynth_next(MatchingPResynth *unit, int inNumSamples)
{
GET_BUF
int audioplaybackpos = unit->m_audioplaybackpos;
float* audiobuf = unit->m_audiobuf;
int nactivs = unit->m_nactivs;
float* triggerinput = IN(3);
float* residualinput = IN(4);
for (int i=0; i < inNumSamples; ++i)
{
// Ensure we keep within internal buffer limit
if (audioplaybackpos == bufFrames){
// Shunt the top half down to the start
memmove(audiobuf, audiobuf + bufFrames, bufFrames * sizeof(float));
audioplaybackpos = 0;
// Clear the 'new' top half
Clear(bufFrames, audiobuf + bufFrames);
}
// If trigger, add the activations to the output buffer
if (triggerinput[i] > 0.f){
//printf("Triggered\n");
for(int which=0; which<nactivs; ++which){
int whichchannel = static_cast<int>(IN(5 + which + which )[i]);
float magnitude = IN(5 + which + which + 1)[i];
//printf("Outputting channel %i at magnitude %g\n", whichchannel, magnitude);
float *readpos = buf->data + whichchannel;
for(int j=0; j<bufFrames; ++j){
audiobuf[audioplaybackpos + j] += (*readpos) * magnitude;
readpos += bufChannels;
}
}
}
// Output the reconstructed version plus residual
float residualval = residualinput[i];
OUT(0)[i] = audiobuf[audioplaybackpos] + residualval;
++audioplaybackpos;
}
unit->m_audioplaybackpos = audioplaybackpos;
}
示例8: cmd_rping
int8_t cmd_rping(uint8_t argc, char **argv)
{
node_id_t recipient;
uint8_t token;
int8_t rc;
if (argc != 2 && argc != 3) {
OUT("usage: rping <recipient> [<token>]\r\n");
return NRK_ERROR;
}
recipient = atoi(argv[1]);
token = argc == 3 ? atoi(argv[2]) : 0;
nrk_led_set(led_awaiting_pong);
rc = rpc_ping(recipient, token);
nrk_led_clr(led_awaiting_pong);
return rc;
}
示例9: A8
A8(PRIVATE, void, scodydxx1x2, register LONGINT, y1, register INTEGER, x1,
INTEGER, dy, INTEGER, dx, INTEGER **, opp, INTEGER **, opp2,
register INTEGER, offy, register INTEGER, offx)
{
register INTEGER *op, *op2;
register INTEGER x2;
register LONGINT incr;
op = *opp;
op2 = *opp2;
x2 = x1 - dx;
if (dy > dx) {
incr = ((LONGINT) dy << 16) / (dx+1) + 1;
OUT(y1, x1);
y1 = (y1 << 16) | (1L << 15);
while (x1 != x2) {
y1 += incr;
OUT(y1 >> 16, --x1);
}
} else {
示例10: TaxMan
void TaxMan(void)
{
double tax;
int i;
char c;
JOUST(PLAYER.Level);
d *= 1000.;
if(PLAYER.Gold + PLAYER.Bank > d) {
NL;
tax = PLAYER.Gold + PLAYER.Bank - d;
sprintf(outbuf, "%s, the tax collector, looks at your bulging money purse", IRSREC->Handle);
OUT(outbuf); NL;
OUT("and says, \"Ah, it is time to pay your taxes!\" You check out the two burly"); NL;
sprintf(outbuf, "guards who stand ready to enforce %s's will.", SYSREC->Handle);
OUT(outbuf); NL; NL;
Delay(100);
sprintf(outbuf, "The tax will cost you %s.", money(tax,ANSI));
OUT(outbuf); NL; NL;
Delay(100);
sprintf(prompt, "%sWill you pay the tax (Y/N)? ", fore(CYN));
do {
OUT(prompt);
c = inkey('Y', 'Y');
NL;
} while(c != 'Y' && c != 'N');
NL;
if(c == 'N') {
sound2("taxman", 0);
OUT("The tax collector orders his guards, \"Run this outlaw through!\""); NL; NL;
Delay(100);
for(i = 0; i < 2; i++) {
memset(RPC[1][i], 0, sizeof(struct RPC));
sprintf(RPC[1][i]->user.Handle, "City Guard #%d", i + 1);
sprintf(RPC[1][i]->user.Class, "%s.%s", table->class[0]->Origin, table->class[0]->Character[dice(MAXCLASS(0))-1]->Name);
RPC[1][i]->user.Level = PLAYER.Level / 2 + 1;
RPC[1][i]->user.Sex = 'I';
sprintf(RPC[1][i]->user.Weapon, "NATURAL.%u", RPC[1][i]->user.Level/2 + dice(RPC[1][i]->user.Level/2));
sprintf(RPC[1][i]->user.Armor, "NATURAL.%u", RPC[1][i]->user.Level/4 + dice(RPC[1][i]->user.Level/4));
CreateRPC(RPC[1][i]);
RPC[1][i]->user.Poison = (UWORD)~0;
if(RPC[1][i]->SP)
RPC[1][i]->user.Spell = HEAL_SPELL | BLAST_SPELL;
}
from = '\0';
Battle();
if(RPC[1][0]->HP > 0 || RPC[1][1]->HP > 0 || !ONLINE->HP)
c = 'Y';
}
示例11: cmd_localize
int8_t cmd_localize(uint8_t argc, char **argv)
{
int8_t rc;
ir_graph_t *ir_graph;
node_id_t ref_node = this_node_id;
if (!(argc == 1 || argc == 2)) {
OUT("usage: loc [<ref_node>]\r\n");
return NRK_ERROR;
}
if (argc == 2)
ref_node = atoi(argv[1]);
ir_graph = get_ir_graph();
rc = localize(ir_graph, ref_node);
if (rc == NRK_OK)
print_locations();
return rc;
}
示例12: XS1S
void XS1S(){
TFile *f = new TFile("Upsilon_2D_10ptbins.root");
TH2D *H;
H = (TH2D*)gFile->Get("fXS");
double tot(0.); double totE(0.);
ofstream OUT("XS_1S.tex");
OUT << "% ----------------------------------------------------------------------" << endl;
OUT << "% -- XSections" << endl;
for ( int x = 1; x <= H->GetNbinsX(); ++x ){
for ( int y = 1; y <= H->GetNbinsY(); ++y ){
OUT << Form("\\vdef{XS%iS_bin%i_%iContent} {\\ensuremath{ {%.4f } } }",1, x, y, H->GetCellContent(x,y) ) << endl;
OUT << Form("\\vdef{XS%iS_bin%i_%iError} {\\ensuremath{ {%.4f } } }",1, x, y, H->GetCellError(x,y) ) << endl;
}
}
OUT.close();
}
示例13: main
int
main(int argc, char *argv[])
{
START(argc, argv, "pmem_is_pmem_proc");
if (argc < 4 || argc % 2)
FATAL("usage: %s file addr len [addr len]...", argv[0]);
Sfile = argv[1];
for (int arg = 2; arg < argc; arg += 2) {
void *addr;
size_t len;
addr = (void *)strtoull(argv[arg], NULL, 16);
len = (size_t)strtoull(argv[arg + 1], NULL, 10);
OUT("addr %p, len %zu: %d", addr, len, pmem_is_pmem(addr, len));
}
DONE(NULL);
}
示例14: TDuty_next_da
void TDuty_next_da(TDuty *unit, int inNumSamples)
{
float *reset = ZIN(duty_reset);
float *out = OUT(0);
float count = unit->m_count;
float prevreset = unit->m_prevreset;
float sr = (float) SAMPLERATE;
for (int i=0; i<inNumSamples; ++i) {
float zreset = ZXP(reset);
if (zreset > 0.f && prevreset <= 0.f) {
RESETINPUT(duty_level);
RESETINPUT(duty_dur);
count = 0.f;
}
if (count <= 0.f) {
count = DEMANDINPUT_A(duty_dur, i + 1) * sr + count;
if(sc_isnan(count)) {
int doneAction = (int)ZIN0(2);
DoneAction(doneAction, unit);
}
float x = DEMANDINPUT_A(duty_level, i + 1);
//printf("in %d %g\n", k, x);
if (sc_isnan(x)) x = 0.f;
out[i] = x;
} else {
out[i] = 0.f;
}
count--;
prevreset = zreset;
}
unit->m_count = count;
unit->m_prevreset = prevreset;
}
示例15: ParseTree
ParseTree* Parser::STMT()
{
ParseTree* retTree = new ParseTree();
if((*parser).get().token == ID)
{
(*retTree).SetLeaf1(ASSIGN()->getLeaf());
(*retTree).setAlt(1);
}
else if((*parser).get().token == IF)
{
(*retTree).SetLeaf1(IFF()->getLeaf());
(*retTree).setAlt(2);
}
else if((*parser).get().token == DO)
{
(*retTree).SetLeaf1(DOWHILE()->getLeaf());
(*retTree).setAlt(3);
}
else if((*parser).get().token == INPUT)
{
(*retTree).SetLeaf1(IN()->getLeaf());
(*retTree).setAlt(4);
}
else if((*parser).get().token == OUTPUT)
{
(*retTree).SetLeaf1(OUT()->getLeaf());
(*retTree).setAlt(5);
}
else if((*parser).get().token == CASE)
{
(*retTree).SetLeaf1(CASE_STMT()->getLeaf());
(*retTree).setAlt(6);
}
else
{
ThrowParserError();
}
return retTree;
}