本文整理汇总了C++中output_data函数的典型用法代码示例。如果您正苦于以下问题:C++ output_data函数的具体用法?C++ output_data怎么用?C++ output_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了output_data函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char const *argv[])
{
float x0 = -1.;
float x_max = 10.;
float dx = 0.05;
size_t x_size;
float* x_all = create_range(x0, x_max, dx, &x_size);
float t0 = 0.;
float t_max = 10.;
float dt = 0.02;
int plot_count = 10;
int plot_every = (int) t_max / dt / plot_count;
char *tag = "pure_1D";
char *dir = "pure_1D";
mkdir(dir);
float* phi = create_empty_array(x_size);
init_phi_1D(phi, x_all, x_size);
float mu = dt * M / (dx * dx);
float t = t0;
int i = 0;
while (t < t_max) {
if (i % plot_every == 0) {
output_data(x_all, phi, x_size, t, dir, tag);
}
i++;
t += dt;
update_phi(x_all, phi, x_size, t, mu, eps2, u_iso);
}
}
开发者ID:samuelbritt,项目名称:phase-field,代码行数:34,代码来源:1D-pure.c
示例2: convert_UnicodetoANSI
static void* convert_UnicodetoANSI (const ustring::awareness_t* dest, const ustring::awareness_t* src, const void* p, void* result)
{
// convert from 16-bit to 8-bit characters
const int len= src->length(p);
const int hopefully_enough_slack= 100;
// A known problem. Sometimes WideCharToMultiByte can require a larger
// buffer when working than it does when finished. How big is unknown.
// It appears to only be a problem when composite characters are near the
// end of the input.
const int destsize= Unicode_converted_length (dest, src, p);
result= dest->create (destsize, result); //create or re-allocate as needed
// prepare output area
fastbuf<char, 1024> output_data (destsize+hopefully_enough_slack);
// do the actual converting
int srcpos= 0; // position of this gulp
int destpos= 0;
while (srcpos < len) { //still stuff left to process
// read input data
int srccount= len-srcpos; // number of input bytes to process in one gulp
const wchar_t* input_data= static_cast<const wchar_t*>(src->read_data(p,srcpos,srccount));
//note: call to read_data will reduce value of srccount if it can't get it all at once.
srcpos += srccount;
// convert this gulp
int putlen= ratwin::WideCharToMultiByte (input_data, srccount, output_data, output_data.elcount());
if (putlen == 0) {
win_exception X ("Classics", FNAME, __LINE__);
X += L"error calling WideCharToMultiByte\n";
throw X;
}
dest->write_data (result, destpos, putlen, output_data);
destpos += putlen;
}
return result;
}
开发者ID:jdlugosz,项目名称:repertoire,代码行数:34,代码来源:ustring.cpp
示例3: convert_ANSItoUnicode
static void* convert_ANSItoUnicode (const ustring::awareness_t* dest, const ustring::awareness_t* src, const void* p, void* result)
{
// convert from 8-bit to 16-bit characters
const int len= src->length(p); //total number of BYTES to be converted
const int destsize= ANSI_converted_length (dest, src, p);
result= dest->create (destsize, result); //create or re-allocate as needed
// prepare output area
fastbuf<wchar_t, 1024> output_data (destsize);
// do the actual converting
int srcpos= 0; // position of this gulp
int destpos= 0;
while (srcpos < len) { //still stuff left to process
// read input data
int srccount= len-srcpos; // number of input bytes to process in one gulp
const char* input_data= static_cast<const char*>(src->read_data(p,srcpos,srccount));
//note: call to read_data will reduce value of srccount if it can't get it all at once.
srcpos += srccount;
// convert this gulp
int putlen= ratwin::MultiByteToWideChar (input_data, srccount, output_data, destsize);
if (putlen == 0) {
win_exception X ("Classics", FNAME, __LINE__);
X += L"error calling MultiByteToWideChar\n";
throw X;
}
dest->write_data (result, destpos, putlen, output_data);
destpos += putlen;
}
return result;
}
开发者ID:jdlugosz,项目名称:repertoire,代码行数:29,代码来源:ustring.cpp
示例4: ISR_Timer_B_CCR0
__interrupt void ISR_Timer_B_CCR0 (void) {
// Feststellen welche Werte im timestruct der aktuellen Zeit
// geaendert werden muessen
if (now.s==10) { // eine Sekunde ist vergangen
now.s=0;
now.ss++;
// im Sekundentakt Uhrzeit und Werte des SHT11 ausgeben
output_data();
if (now.ss==60) { // eine Minute ist vergangen
now.ss=0;
now.mm++;
if (now.mm==60) { // eine Stunde ist vergangen
now.mm=0;
now.hh++;
if(now.hh==24) { // ein Tag ist vergangen
now.hh=0;
}
}
}
}
else { // eine Zentelsekunde ist Vergangen
now.s++;
}
// Interruptflag entfernen um eine Wiederholung der ISR, wegen
// gesetzem Interruptflag, zu verhindern
TBCCTL0 &= ~CCIFG;
}
开发者ID:slomo,项目名称:Mikrocontroller-WS09-10,代码行数:28,代码来源:interrupts_aufgabe21.c
示例5: use_temper1
static int use_temper1(struct usb_dev_handle *handle)
{
int r, do_read = TRUE;
char data[8];
char busport[100] = {};
r = handle_bus_port(handle, busport);
if (strlen(opts.only_device) > 0) {
do_read = (strcmp(busport, opts.only_device) == 0);
}
if (do_read) {
bzero(data, 8);
r = read_temper1(handle, data, 8);
if (r != 0) {
if (decode_raw_data(data) != 0) {
output_data(busport, data);
}
else {
if (opts.verbose) fprintf(stderr, "Read returned 0 value (r = %i)\n", r);
r = -1;
}
}
else {
if (opts.verbose) fprintf(stderr, "use_temper1: read_temper1 returned (r = %i)\n", r);
}
}
return r;
}
开发者ID:ssllab,项目名称:temper1,代码行数:31,代码来源:temper1.c
示例6: get_lifetime
int get_lifetime(int argc, char **argv)
{
int ret;
uint32_t timestamp;
uint8_t nonce[TOKEN_NONCE_LENGTH];
uint8_t mac[TOKEN_MAC_LENGTH];
ret = tee_token_lifetimedata_get(×tamp, nonce, mac);
if (ret != 0)
{
raise_error("tee_token_lifetimedata_get call failed, return=0x%x", ret);
return ret;
}
output_data((uint8_t *)×tamp, sizeof(timestamp));
output_data(nonce, sizeof(nonce));
output_data(mac, sizeof(mac));
return ret;
}
开发者ID:bju2000,项目名称:android_hardware_intel,代码行数:20,代码来源:tee_connector.c
示例7: flowstat
/*
* flowstat
*
* Check for changes to flow control
*/
void
flowstat(void)
{
if (his_state_is_will(TELOPT_LFLOW)) {
if (tty_flowmode() != flowmode) {
flowmode = tty_flowmode();
output_data("%c%c%c%c%c%c",
IAC, SB, TELOPT_LFLOW,
flowmode ? LFLOW_ON : LFLOW_OFF,
IAC, SE);
}
if (tty_restartany() != restartany) {
restartany = tty_restartany();
output_data("%c%c%c%c%c%c",
IAC, SB, TELOPT_LFLOW,
restartany ? LFLOW_RESTART_ANY
: LFLOW_RESTART_XON,
IAC, SE);
}
}
}
开发者ID:aosm,项目名称:remote_cmds,代码行数:26,代码来源:termstat.c
示例8: main
int main(int argc, const char *argv[]) {
// Allocate flList
printf("-------- Allocating (list - length 4)\n");
flList *list = flList_alloc(4);
output_data(list);
// Populate flList
printf("-------- Populating\n");
int i = 100;
flList_set(list, 0, &i);
flList_set(list, 1, &(int){ 200 });
开发者ID:hzeis,项目名称:flic,代码行数:12,代码来源:flt_alloc.c
示例9: get_part_id
int get_part_id (int argc, char **argv)
{
int ret;
uint8_t partid_buf[TOKEN_PSID_LENGTH];
ret = tee_partid_get(partid_buf);
if (ret != 0)
raise_error("tee_partid_get() call failed, return=0x%x", ret);
else
output_data(partid_buf, sizeof(partid_buf));
return ret;
}
开发者ID:bju2000,项目名称:android_hardware_intel,代码行数:13,代码来源:tee_connector.c
示例10: process_image
void process_image(const void *p, int size) {
byte *jpg = NULL;
unsigned int jpgSize = 0;
jpg = mjpeg2jpeg((const byte*)p, size, &jpgSize);
if ( jpg == NULL )
errno_exit("mjpeg2jpeg");
fprintf(stderr, "process_image %d\n", jpgSize);
output_data(jpg, jpgSize);
free(jpg);
}
开发者ID:chubahowsmall,项目名称:v4l2jpeg,代码行数:14,代码来源:main.c
示例11: get_ssn
int get_ssn(int argc, char **argv)
{
int ret;
uint8_t data[ssn_item.size];
ret = tee_token_item_read(SERIAL_NUMBER_DATAGROUP, ssn_item.subgroup_id,
ssn_item.item_id, 0, data, ssn_item.size, 0);
if (ret != 0)
raise_error("tee_token_item_read() call failed, return=0x%x", ret);
else
output_data(data, ssn_item.size);
return ret;
}
开发者ID:bju2000,项目名称:android_hardware_intel,代码行数:14,代码来源:tee_connector.c
示例12: image_fireflies_filter
ImageRawData image_fireflies_filter ( ImageRawData * image_array, size_t array_num )
{
size_t width = image_array[ 0 ].GetImageWidth();
size_t height = image_array[ 0 ].GetImageHeight();
ImageRawData average_data( width, height );
ImageRawData output_data( width, height );
// for (int i = 0; i < width; i++)
// {
// for (int j = 0; j < height; j++)
// {
// for (int k = 0; k < array_num; k++)
// average_data.rawData[ i ][ j ] +=
// image_array[ k ].rawData[ i ][ j ] / array_num;
// }
// }
//
// double * weight;
//
// weight = static_cast<double * >( malloc ( sizeof ( double ) * array_num ) );
// for (int i = 0; i < width; i++)
// {
// for (int j = 0; j < height; j++)
// {
// double total = 0;
// for (int k = 0; k < array_num; k++)
// {
// weight[ i ] = ( average_data.rawData[ i ][ j ] - image_array[ k ].rawData[ i ][ j ] ).Length ();
// total += weight[ i ];
// }
//
// for (int k = 0; k < array_num; k++)
// {
// weight[ i ] /= total;
// // output_data.rawData[ i ][ j ] +=
// // image_array[ k ].rawData[ i ][ j ] * weight[ i ];
// output_data.rawData[ i ][ j ] +=
// image_array[ k ].rawData[ i ][ j ].Length() > average_data.rawData[ i ][ j ].Length()
// ? average_data.rawData[ i ][ j ]
// : image_array[ k ].rawData[ i ][ j ];
// }
// }
// }
return output_data;
}
开发者ID:wangchi87,项目名称:Chi_render_vs2015,代码行数:49,代码来源:ImageRawData.cpp
示例13: input_data
void ReLULayer::forward(std::vector<Tensor> &input, std::vector<Tensor> &output) {
Tensor input_data(input[0]);
Tensor output_data(output[0]);
float* input_data_ptr = input_data.get_data().get();
float* output_data_ptr = output_data.get_data().get();
int N_in = input_data.get_N();
int C_in = input_data.get_C();
int H_in = input_data.get_H();
int W_in = input_data.get_W();
int data_size = N_in * C_in * H_in * W_in;
for(int index = 0; index < data_size; ++index) {
output_data_ptr[index] = input_data_ptr[index] > 0 ? input_data_ptr[index] : 0;
}
}
开发者ID:Eniac-Xie,项目名称:PyConvNet,代码行数:16,代码来源:relu_layer.cpp
示例14: read_token
int read_token(int argc, char **argv)
{
uint8_t *buf;
int ret, datagroup_id;
struct tee_token_info info;
if (argc != 2)
{
raise_error("datagroup_id argument is missing");
return EXIT_FAILURE;
}
datagroup_id = parse_datagroup_id(argv[1]);
if (datagroup_id == -1)
return EXIT_FAILURE;
bzero(&info, sizeof(info));
ret = tee_token_info_get(datagroup_id, &info, 0);
if (ret != 0)
{
raise_error("tee_token_info_get() call failed, return=0x%x", ret);
return ret;
}
if (info.lifetime.token_size == 0)
{
raise_error("Failed, token has been provided with the old format...");
return EXIT_FAILURE;
}
buf = (uint8_t *)malloc(info.lifetime.token_size * sizeof(uint32_t));
if (buf == NULL)
{
raise_error("Failed to alloc the buffer to retrieve the token data, error=%s", strerror(ENOMEM));
return EXIT_FAILURE;
}
ret = tee_token_read(datagroup_id, buf, info.lifetime.token_size * sizeof(uint32_t), 0);
if (ret != 0)
raise_error("tee_token_read() call failed, return=0x%x", ret);
else
output_data(buf, info.lifetime.token_size * sizeof(uint32_t));
free(buf);
return EXIT_SUCCESS;
}
开发者ID:bju2000,项目名称:android_hardware_intel,代码行数:47,代码来源:tee_connector.c
示例15: generate_shared_ecc
int generate_shared_ecc(int argc, char **argv)
{
int ret;
size_t pub_key_size;
uint8_t *pub_key = NULL;
ret = tee_token_gen_shared_ecc(&pub_key_size, &pub_key);
if (ret != 0)
raise_error("tee_token_gen_shared_ecc() call failed, return=0x%x", ret);
else {
output_data(pub_key, pub_key_size);
free(pub_key);
}
return ret;
}
开发者ID:bju2000,项目名称:android_hardware_intel,代码行数:17,代码来源:tee_connector.c
示例16: send_cryptid_request
int send_cryptid_request(void *data, size_t size)
{
int ret;
size_t response_size;
uint8_t *response;
ret = tee_token_cryptid_request(size, data, &response_size, &response);
if (ret != 0)
raise_error("tee_token_cryptid_request() call failed, return=0x%x", ret);
else {
output_data(response, response_size);
free(response);
}
return ret;
}
开发者ID:bju2000,项目名称:android_hardware_intel,代码行数:17,代码来源:tee_connector.c
示例17: execute_line
void NerveTool::execute_data( StringList& data , FILE *sout ) {
ClassList<Nerve> nn;
// parse
for( int k = 0; k < data.count(); k++ ) {
String so = data.get( k );
if( so.isEmpty() )
continue;
String s = so;
int res = execute_line( s , sout , nn );
if( res != 0 )
fprintf( sout , "invalid string (%d): error=%s, full=%s\n" , res , ( const char * )s , ( const char * )so );
}
// output
output_data( sout , nn );
}
开发者ID:AbhishekGhosh,项目名称:Artificial-Human,代码行数:18,代码来源:nervetool.cpp
示例18: clean_iterator
static enum ht_traverse_action clean_iterator(void *key, void *value, void *dataptr)
{
struct {time_t current; struct hashtable *ht; bool force;} *data = dataptr;
struct ip_port_pair *pair = (struct ip_port_pair*)key;
// If I haven't recieved data from a connection for 60
// seconds, I consider it's closed.
if(data->current - pair->timestamp > 60 || data->force) {
if(data->ht == sending_pairs) {
FILE *f = fopen("history.txt", "a");
if(f == NULL) {
perror("fopen");
} else {
struct rtp_connect_data *rtpdata = (struct rtp_connect_data*)value;
if(verbose) {
printf("FINISH an rtp connection: [");
dump_ip_port_pair(pair, (print_func)fprintf, stdout);
printf("]\n");
}
if(rtpdata->inited) {
int i;
// The packets cached in the buffer should be counted here.
for(i=0; i<RECIEVED_MESSAGE_COUNT; i++) {
add_up_data_at_pos(rtpdata, i);
}
rtpdata->packet_count += RECIEVED_MESSAGE_COUNT;
output_data(f, rtpdata);
}
fclose(f);
}
free(value);
}
free(key);
return REMOVE_ITEM;
}
return NO_ACTION;
}
开发者ID:hewenhao2008,项目名称:ibpsolve,代码行数:41,代码来源:main.c
示例19: input_file
int wxbencode_test::OnRun()
{
wxFileInputStream input_file(wxT("original.torrent"));
wxFileOutputStream output_file(wxT("test_binary.torrent"));
wxDataInputStream input_data(input_file);
wxDataOutputStream output_data(output_file);
wxTextOutputStream output_text(output_file);
wxLogMessage(wxT("decoding torrent file"));
wx_bdecode(input_file, input_data, e, 0);
wxLogMessage(wxT("done decoding"));
//wx_entry_print(e,0);
wxLogMessage(wxT("encoding torrent file"));
wx_bencode(output_data, output_text, e);
wxLogMessage(wxT("done encoding"));
return 0;
}
开发者ID:audiohacked,项目名称:audiohacked,代码行数:21,代码来源:wxbencode.cpp
示例20: prv_notify_callback
static void prv_notify_callback(uint16_t clientID,
lwm2m_uri_t * uriP,
int count,
lwm2m_media_type_t format,
uint8_t * data,
int dataLength,
void * userData)
{
fprintf(stdout, "\r\nNotify from client #%d /%d", clientID, uriP->objectId);
if (LWM2M_URI_IS_SET_INSTANCE(uriP))
fprintf(stdout, "/%d", uriP->instanceId);
else if (LWM2M_URI_IS_SET_RESOURCE(uriP))
fprintf(stdout, "/");
if (LWM2M_URI_IS_SET_RESOURCE(uriP))
fprintf(stdout, "/%d", uriP->resourceId);
fprintf(stdout, " number %d\r\n", count);
output_data(stdout, format, data, dataLength, 1);
fprintf(stdout, "\r\n> ");
fflush(stdout);
}
开发者ID:duanlhjoe,项目名称:wakaama,代码行数:22,代码来源:lwm2mserver.c
注:本文中的output_data函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论