本文整理汇总了C++中F函数的典型用法代码示例。如果您正苦于以下问题:C++ F函数的具体用法?C++ F怎么用?C++ F使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了F函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: parseFileName
void MyFunctionRequestHandler::upload(ESP8266WebServer& server, String requestUri, HTTPUpload& upload){
//Serial.println(String(F("upload(")) + requestUri + String(F(")")));
String filename = parseFileName(upload.filename);
if (filename.endsWith(".bin")) { // handle firmware upload
mbRebootRequired = true;
if (upload.status == UPLOAD_FILE_START) {
if (mDebug) Serial.println("Update: " + upload.filename);
uint32_t maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;
if (!Update.begin(maxSketchSpace)) { //start with max available size
if (mDebug) Update.printError(Serial);
}
} else if (upload.status == UPLOAD_FILE_WRITE) {
if (mDebug) Serial.print(".");
if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
if (mDebug) Update.printError(Serial);
}
} else if (upload.status == UPLOAD_FILE_END) {
miUploadSize = Update.size();
if (Update.end(true)) { //true to set the size to the current progress
if (mDebug) Serial.println(String(F("Update Success - uploaded: ")) + String(upload.totalSize) + String(F(".... rebooting now!")));
} else {
if (mDebug) Update.printError(Serial);
}
if (mDebug) Serial.setDebugOutput(false);
} else if (upload.status == UPLOAD_FILE_ABORTED) {
miUploadSize = Update.size();
Update.end();
if (mDebug) Serial.println(F("Update was aborted"));
}
} else { // handle file upload
mbRebootRequired = false;
if (upload.status == UPLOAD_FILE_START) {
if (mDebug) Serial.println(String(F("uploading to SPIFFS: /")) + filename);
mUploadFile = SPIFFS.open("/" + filename, "w");
} else if (upload.status == UPLOAD_FILE_WRITE) {
if (mDebug) Serial.print(".");
if (mUploadFile.write(upload.buf, upload.currentSize) != upload.currentSize) {
if (mDebug) Serial.println(String(F("ERROR writing file ")) + String(mUploadFile.name()) + String(F("to SPIFFS.")));
mUploadFile.close();
}
} else if (upload.status == UPLOAD_FILE_END) {
miUploadSize = upload.totalSize;
if (mUploadFile.size() == upload.totalSize) {
if (mDebug) Serial.println(String(F("Upload to SPIFFS Succeeded - uploaded: ")) + String(upload.totalSize) + String(F(".... rebooting now!")));
} else {
if (mDebug) Serial.println(String(F("Upload to SPIFFS FAILED: ")) + String(mUploadFile.size()) + String(F(" bytes of ")) + String(upload.totalSize));
}
mUploadFile.close();
if (!upload.totalSize){
if (mDebug) Serial.println("Removing: " + filename);
SPIFFS.remove("/" + filename);
}
} else if (upload.status == UPLOAD_FILE_ABORTED) {
miUploadSize = upload.totalSize;
mUploadFile.close();
if (mDebug) Serial.println(F("Upload to SPIFFS was aborted"));
}
}
}
开发者ID:Dynatrace,项目名称:ufo,代码行数:62,代码来源:MyRequestHandler.cpp
示例2: F
void MyFunctionRequestHandler::infoHandler(ESP8266WebServer& server) {
String json = F("{");
json += '"'; json += F("heap"); json += '"';
json += ':';
json += '"'; json += String(ESP.getFreeHeap()); json += '"';
json += F(", ");
json += '"'; json += F("ssid"); json += '"';
json += ':';
json += '"'; json += String(WiFi.SSID()); json += '"';
json += F(", ");
json += '"'; json += F("ipaddress"); json += '"';
json += ':';
json += '"'; json += WiFi.localIP().toString(); json += '"';
json += F(", ");
json += '"'; json += F("ipgateway"); json += '"';
json += ':';
json += '"'; json += WiFi.gatewayIP().toString(); json += '"';
json += F(", ");
json += '"'; json += F("ipdns"); json += '"';
json += ':';
json += '"'; json += WiFi.dnsIP().toString(); json += '"';
json += F(", ");
json += '"'; json += F("ipsubnetmask"); json += '"';
json += ':';
json += '"'; json += WiFi.subnetMask().toString(); json += '"';
json += F(", ");
json += '"'; json += F("macaddress"); json += '"';
json += ':';
json += '"'; json += WiFi.macAddress(); json += '"';
json += F(", ");
json += '"'; json += F("hostname"); json += '"';
json += ':';
json += '"'; json += WiFi.hostname(); json += '"';
json += F(", ");
json += '"'; json += F("apipaddress"); json += '"';
json += ':';
json += '"'; json += WiFi.softAPIP().toString(); json += '"';
json += F(", ");
json += '"'; json += F("apconnectedstations"); json += '"';
json += ':';
json += '"'; json += String(WiFi.softAPgetStationNum()); json += '"';
json += F(", ");
json += '"'; json += F("wifiautoconnect"); json += '"';
json += ':';
json += '"'; json += String(WiFi.getAutoConnect()); json += '"';
json += F(", ");
json += '"'; json += F("firmwareversion"); json += '"';
json += ':';
json += '"'; json += String(FIRMWARE_VERSION); json += '"';
json += '}';
server.sendHeader(F("cache-control"), F("private, max-age=0, no-cache, no-store"));
server.send(200, F("text/json"), json);
}
开发者ID:Dynatrace,项目名称:ufo,代码行数:55,代码来源:MyRequestHandler.cpp
示例3: ASSURE_OPTION
void
Style::drawComboBox(const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const
{
ASSURE_OPTION(cmb, ComboBox);
OPT_ENABLED OPT_HOVER OPT_FOCUS
SAVE_PAINTER(Pen|Brush|Alias);
if ( widget && widget->inherits("WebView") ) {
// paints hardcoded black text bypassing the style?! grrr...
const_cast<QStyleOptionComboBox*>(cmb)->palette.setColor(QPalette::Window, QColor(230,230,230,255));
widget = 0;
}
animStep = !widget ? MAX_STEPS*hover : Animator::Hover::step(widget);
QRect ar;
const QComboBox *combo = widget ? qobject_cast<const QComboBox*>(widget) : NULL;
if ((cmb->subControls & SC_ComboBoxArrow) && (!combo || combo->count() > 0)) { // do we have an arrow?
ar = subControlRect(CC_ComboBox, cmb, SC_ComboBoxArrow, widget);
const int dx = (F(2) & ~1) / 2;
ar.translate(cmb->direction == Qt::LeftToRight ? -dx : dx, 0);
}
const bool listShown = combo && combo->view() && ((QWidget*)(combo->view()))->isVisible();
if (listShown) { // this messes up hover
hover = hover || QRect(widget->mapToGlobal(RECT.topLeft()), RECT.size()).contains(QCursor::pos()); // TODO Qt5, avoid asking for the cursor pos
animStep = MAX_STEPS;
}
QColor c = hasFocus ? FCOLOR(Highlight) : (cmb->editable ? FCOLOR(Text) : FCOLOR(WindowText));
if (cmb->editable) {
drawLineEditFrame(option, painter, widget);
c = FX::blend(FCOLOR(Base), c, MAX_STEPS, 1 + 2*animStep);
} else {
const int icon = cmb->currentIcon.isNull() ? 0 : cmb->iconSize.width() + F(4);
QFont fnt(painter->font());
fnt.setBold(true);
int text = QFontMetrics(fnt).width(cmb->currentText);
if (text)
text += F(4);
if (!(text+icon)) // webkit etc.
text = ar.left() - (F(16) + RECT.x());
painter->setRenderHint(QPainter::Antialiasing, true);
painter->setPen(QPen(hasFocus ? FCOLOR(Highlight) : FX::blend(FCOLOR(Window), c, 4, 1), FRAME_STROKE));
painter->setBrush(Qt::NoBrush);
const int y = ar.y() + ar.height()/2;
const int da = animStep * 168 / MAX_STEPS;
if (option->direction == Qt::LeftToRight) {
DRAW_SEGMENT(ar, 16*(120 - da/2), 16*(192+da));
painter->drawLine(RECT.x() + icon + text + F(6), y, ar.left()-F(2), y);
} else {
DRAW_SEGMENT(ar, 16*(30 + da/2), -16*(192+da));
painter->drawLine(RECT.right() - (icon + text + F(6)), y, ar.right()+F(2), y);
}
c = FX::blend(FCOLOR(Window), FCOLOR(WindowText), MAX_STEPS - animStep, 1 + animStep);
}
if (!isEnabled) {
RESTORE_PAINTER
return;
}
开发者ID:cazimi,项目名称:virtuality,代码行数:63,代码来源:input.cpp
示例4: F
~AutoPtr() {
if (mPtr)
F(mPtr);
}
开发者ID:kenberland,项目名称:mozilla-gnome-keyring,代码行数:4,代码来源:GnomeKeyring.cpp
示例5: F
{ "-seed", OPT_INT, &seed, "Seed for random parameters." },
{ "-points", OPT_INT, &points, "Number of points to produce." },
{ "-f0", OPT_DOUBLE, &f0, "Initial fish population." },
{ "-s0", OPT_DOUBLE, &s0, "Initial shark population." },
{ "-a", OPT_DOUBLE, &a, "Fish growth rate." },
{ "-b", OPT_DOUBLE, &b, "Shark consumption rate." },
{ "-c", OPT_DOUBLE, &c, "Fish nutritional value." },
{ "-d", OPT_DOUBLE, &d, "Shark death rate." },
{ "-dt", OPT_DOUBLE, &dt, "Time step increment." },
{ NULL, OPT_NULL, NULL, NULL }
};
char help_string[] = "\
Integrates the two-species Lotka-Volterra predator-prey system, \
\
dF/dt = F(a - bS), dS/dt = S(cF - d), \
\
according to the specified parameters.\
";
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* The two differential equations to integrate. */
void myfunc(double x, double y, double *xx, double *yy)
{
*xx = x * (a - b * y);
*yy = y * (c * x - d);
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
开发者ID:Stray,项目名称:CBofN,代码行数:31,代码来源:lotka.c
示例6: errorPrint
//------------------------------------------------------------------------------
void SdFatBase::errorPrint(Print* pr, char const* msg) {
pr->print(F("error: "));
pr->println(msg);
errorPrint(pr);
}
开发者ID:0x1abin,项目名称:Gamebuino,代码行数:6,代码来源:SdFat.cpp
示例7: open
/*
* Open for reading
*
* Returns true on success
*/
boolean SimpleConfig::open(boolean write)
{
mlog.WARNING(F("SimpleConfig::base class called"));
return false;
}
开发者ID:digitalfotografen,项目名称:Arduino-Thingspeak,代码行数:10,代码来源:SimpleConfig.cpp
示例8: close
/*
* Close file
*/
boolean SimpleConfig::close()
{
mlog.WARNING(F("SimpleConfig::base class called"));
// if writeMode, then remember to terminate file
return false;
}
开发者ID:digitalfotografen,项目名称:Arduino-Thingspeak,代码行数:9,代码来源:SimpleConfig.cpp
示例9: LAYOUT_65_ansi
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│END │
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│
* └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
*/
/* 0: ANSI qwerty */
[_BL] = LAYOUT_65_ansi(
KC_GESC,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \
F(2), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \
KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_PGDN, \
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT),
/* 1: Locking arrow keys to WASD for when you need dedicated arrow keys
* ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
* │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │ │ │ Up │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ │ │
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │
开发者ID:Depariel,项目名称:qmk_firmware,代码行数:31,代码来源:keymap.c
示例10: DATA_INTEGER
Type objective_function<Type>::operator() ()
{
DATA_INTEGER(minAge);
DATA_INTEGER(maxAge);
DATA_INTEGER(minYear);
DATA_INTEGER(maxYear);
DATA_ARRAY(catchNo);
DATA_ARRAY(stockMeanWeight);
DATA_ARRAY(propMature);
DATA_ARRAY(M);
DATA_INTEGER(minAgeS);
DATA_INTEGER(maxAgeS);
DATA_INTEGER(minYearS);
DATA_INTEGER(maxYearS);
DATA_SCALAR(surveyTime);
DATA_ARRAY(Q1);
PARAMETER_VECTOR(logN1Y);
PARAMETER_VECTOR(logN1A);
PARAMETER_VECTOR(logFY);
PARAMETER_VECTOR(logFA);
PARAMETER_VECTOR(logVarLogCatch);
PARAMETER_VECTOR(logQ);
PARAMETER(logVarLogSurvey);
int na=maxAge-minAge+1;
int ny=maxYear-minYear+1;
int nas=maxAgeS-minAgeS+1;
int nys=maxYearS-minYearS+1;
// setup F
matrix<Type> F(ny,na);
for(int y=0; y<ny; ++y){
for(int a=0; a<na; ++a){
F(y,a)=exp(logFY(y))*exp(logFA(a));
}
}
// setup logN
matrix<Type> logN(ny,na);
for(int a=0; a<na; ++a){
logN(0,a)=logN1Y(a);
}
for(int y=1; y<ny; ++y){
logN(y,0)=logN1A(y-1);
for(int a=1; a<na; ++a){
logN(y,a)=logN(y-1,a-1)-F(y-1,a-1)-M(y-1,a-1);
if(a==(na-1)){
logN(y,a)=log(exp(logN(y,a))+exp(logN(y,a-1)-F(y-1,a)-M(y-1,a)));
}
}
}
matrix<Type> predLogC(ny,na);
for(int y=0; y<ny; ++y){
for(int a=0; a<na; ++a){
predLogC(y,a)=log(F(y,a))-log(F(y,a)+M(y,a))+log(Type(1.0)-exp(-F(y,a)-M(y,a)))+logN(y,a);
}
}
Type ans=0;
for(int y=0; y<ny; ++y){
for(int a=0; a<na; ++a){
if(a==0){
ans+= -dnorm(log(catchNo(y,a)),predLogC(y,a),exp(Type(0.5)*logVarLogCatch(0)),true);
}else{
ans+= -dnorm(log(catchNo(y,a)),predLogC(y,a),exp(Type(0.5)*logVarLogCatch(1)),true);
}
}
}
matrix<Type> predLogS(nys,nas);
for(int y=0; y<nys; ++y){
for(int a=0; a<nas; ++a){
int sa = a+(minAgeS-minAge);
int sy = y+(minYearS-minYear);
predLogS(y,a) = logQ(a)-(F(sy,sa)+M(sy,sa))*surveyTime+logN(sy,sa);
ans += -dnorm(log(Q1(y,a)),predLogS(y,a),exp(Type(0.5)*logVarLogSurvey),true);
}
}
vector<Type> ssb(ny);
ssb.setZero();
for(int y=0; y<=ny; ++y){
for(int a=0; a<na; ++a){
std::cout<<y<<" "<<a<<" "<<"\n";
ssb(y)+=exp(logN(y,a))*stockMeanWeight(y,a)*propMature(y,a);
}
}
ADREPORT(ssb);
return ans;
}
开发者ID:DanOvando,项目名称:Feb2016,代码行数:91,代码来源:poll.cpp
示例11: T
void T(void) {
affiche_balise_ouvrante(__func__, TRACE_XML);
F();
Tprime();
affiche_balise_fermante(__func__, TRACE_XML);
}
开发者ID:mschimek,项目名称:cours-compilation,代码行数:6,代码来源:analyseur_syntaxique_mini.c
示例12: ANSI_KEYMAP
* ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
* │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│END │
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│
* └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
*/
/* 0: ANSI qwerty */
[_BL] = ANSI_KEYMAP(
F(4), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \
F(2), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT),
/* 1: Locking arrow keys to WASD for when you need dedicated arrow keys
* ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
* │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │ │ │ Up │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ │ │
开发者ID:npoirey,项目名称:qmk_firmware,代码行数:31,代码来源:keymap.c
示例13: sendHandshake
void SocketIOClient::sendHandshake(char hostname[]) {
client.println(F("GET /socket.io/1/ HTTP/1.1"));
client.print(F("Host: "));
client.println(hostname);
client.println(F("Origin: Arduino\r\n"));
}
开发者ID:ApioLab,项目名称:Objects,代码行数:6,代码来源:SocketIOClient.cpp
示例14: PushCallStack
inline void
TrtrsmLLN
( UnitOrNonUnit diag, F alpha, const Matrix<F>& L, Matrix<F>& X,
bool checkIfSingular )
{
#ifndef RELEASE
PushCallStack("internal::TrtrsmLLN");
#endif
// Matrix views
Matrix<F>
LTL, LTR, L00, L01, L02,
LBL, LBR, L10, L11, L12,
L20, L21, L22;
Matrix<F>
XTL, XTR, X00, X01, X02,
XBL, XBR, X10, X11, X12,
X20, X21, X22;
Matrix<F> Z11;
// Start the algorithm
ScaleTrapezoid( alpha, LEFT, LOWER, 0, X );
LockedPartitionDownDiagonal
( L, LTL, LTR,
LBL, LBR, 0 );
PartitionDownDiagonal
( X, XTL, XTR,
XBL, XBR, 0 );
while( XBR.Height() > 0 )
{
LockedRepartitionDownDiagonal
( LTL, /**/ LTR, L00, /**/ L01, L02,
/*************/ /******************/
/**/ L10, /**/ L11, L12,
LBL, /**/ LBR, L20, /**/ L21, L22 );
RepartitionDownDiagonal
( XTL, /**/ XTR, X00, /**/ X01, X02,
/*************/ /******************/
/**/ X10, /**/ X11, X12,
XBL, /**/ XBR, X20, /**/ X21, X22 );
//--------------------------------------------------------------------//
Trsm( LEFT, LOWER, NORMAL, diag, F(1), L11, X10, checkIfSingular );
TrtrsmLLNUnb( diag, F(1), L11, X11 );
Gemm( NORMAL, NORMAL, F(-1), L21, X10, F(1), X20 );
Z11 = X11;
MakeTrapezoidal( LEFT, LOWER, 0, Z11 );
Gemm( NORMAL, NORMAL, F(-1), L21, Z11, F(1), X21 );
//--------------------------------------------------------------------//
SlideLockedPartitionDownDiagonal
( LTL, /**/ LTR, L00, L01, /**/ L02,
/**/ L10, L11, /**/ L12,
/*************/ /******************/
LBL, /**/ LBR, L20, L21, /**/ L22 );
SlidePartitionDownDiagonal
( XTL, /**/ XTR, X00, X01, /**/ X02,
/**/ X10, X11, /**/ X12,
/*************/ /******************/
XBL, /**/ XBR, X20, X21, /**/ X22 );
}
#ifndef RELEASE
PopCallStack();
#endif
}
开发者ID:jimgoo,项目名称:Elemental,代码行数:67,代码来源:LLN.hpp
示例15: readln
/*
* Read one null terminated line from file to buff
*
* Returns line length, NULL on failure
*/
int SimpleConfig::readln(char *buff, int maxlen)
{
mlog.WARNING(F("SimpleConfig::base class called"));
buff[0] = '\0';
return NULL;
}
开发者ID:digitalfotografen,项目名称:Arduino-Thingspeak,代码行数:11,代码来源:SimpleConfig.cpp
示例16: main
int main(int argc, char **argv)
{
int i, j, k, step=0, newlim;
int runnum, detnum, regions, deg1, deg2, deg, limit1, limit2;
double pol1[MAXDEG], pol2[MAXDEG], x1, x2, x3, f1, f2, t;
char outfile[20];
FILE *fi;
FILE *fo;
if (argc < 2) {
printf("\nPINT v1.4 (Jan 2014) - ERROR: .mcal file required as argument:\n\n");
exit(0);
}
fi=fopen(argv[1], "r");
sprintf(outfile, "pint_%s", argv[1]);
fo=fopen(outfile, "wt");
/// version 1.3
int reg=0;
int maxdeg[10]; //max 10 columns(regions)
for (j=0; j<10; j++) maxdeg[j]=0;
readMaxDeg(fi, maxdeg);
fclose(fi);
///
for (j=0; j<MAXDEG; j++) { pol1[j]=0; pol2[j]=0; }
fi=fopen(argv[1], "r");
while (fscanf (fi, "%d %d %d %d", &runnum, &detnum, ®ions, °1)==4) {
reg=0;
fprintf(fo, "%5d%5d%3d%5d", runnum, detnum, regions, deg1);
for (k=0; k<deg1; k++) {
fscanf (fi, "%lf", &pol1[k]);
if (k==0) fprintf(fo, "%9.3f", pol1[k]);
else if (k==1) fprintf(fo, "%10.6f", pol1[k]);
else fprintf(fo, "%15.6E", pol1[k]);
if (k==deg1-1)
{
while(k+1<maxdeg[reg]) { fprintf(fo, " "); k++;} //v1.3
break;
}
}
fscanf (fi, "%d", &limit1);
reg++;
for (i=0; i<regions-1; i++) {
fscanf (fi, "%d", °2);
for (k=0; k<deg2; k++) fscanf (fi, "%lf", &pol2[k]);
fscanf (fi, "%d", &limit2);
x1=limit1-RANGE;
x2=limit1+RANGE;
if (deg1>deg2) deg=deg1;
else deg=deg2;
int control=0;
do { // Secant method
f1=F(x1, deg, pol1, pol2);
f2=F(x2, deg, pol1, pol2);
x3=x2-((f2*(x2-x1))/(f2-f1));
x1=x2;
x2=x3;
if(f2<0) t=fabs(f2);
else t=f2;
control++; //version 1.4
if (control>10000000) {printf("Warning! Detector #%02d Regions %d-%d: Functions do not intersect.\n", detnum, i, i+1); break;}
} while(t>EPS);
newlim=(x3+0.5);
///////////// v1.2 update
if (newlim<0)
{
newlim=0;
printf("\nWarning! Detector #%02d: First limit is %0.2lf. Returned 0 in the .mcal file", detnum, x3);
}
/////////////
fprintf(fo, "%6d%5d", newlim, deg2); //x3 is the new limit
limit1=limit2;
deg1=deg2;
for (j=0; j<MAXDEG; j++) pol1[j]=0;
for (k=0; k<deg2; k++) {
pol1[k]=pol2[k];
if (k==0) fprintf(fo, "%9.3f", pol2[k]);
else if (k==1) fprintf(fo, "%10.6f", pol2[k]);
else fprintf(fo, "%15.6E", pol2[k]);
//.........这里部分代码省略.........
开发者ID:pgramage,项目名称:gaspware,代码行数:101,代码来源:pint4.c
示例17: available
/*
* Test if more characters are available
*/
boolean SimpleConfig::available()
{
mlog.WARNING(F("SimpleConfig::base class called"));
return false;
}
开发者ID:digitalfotografen,项目名称:Arduino-Thingspeak,代码行数:8,代码来源:SimpleConfig.cpp
示例18: __do_cpuid_ent
static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
u32 index, int *nent, int maxnent)
{
int r;
unsigned f_nx = is_efer_nx() ? F(NX) : 0;
#ifdef CONFIG_X86_64
unsigned f_gbpages = (kvm_x86_ops->get_lpage_level() == PT_PDPE_LEVEL)
? F(GBPAGES) : 0;
unsigned f_lm = F(LM);
#else
unsigned f_gbpages = 0;
unsigned f_lm = 0;
#endif
unsigned f_rdtscp = kvm_x86_ops->rdtscp_supported() ? F(RDTSCP) : 0;
unsigned f_invpcid = kvm_x86_ops->invpcid_supported() ? F(INVPCID) : 0;
unsigned f_mpx = kvm_x86_ops->mpx_supported() ? F(MPX) : 0;
/* cpuid 1.edx */
const u32 kvm_supported_word0_x86_features =
F(FPU) | F(VME) | F(DE) | F(PSE) |
F(TSC) | F(MSR) | F(PAE) | F(MCE) |
F(CX8) | F(APIC) | 0 /* Reserved */ | F(SEP) |
F(MTRR) | F(PGE) | F(MCA) | F(CMOV) |
F(PAT) | F(PSE36) | 0 /* PSN */ | F(CLFLUSH) |
0 /* Reserved, DS, ACPI */ | F(MMX) |
F(FXSR) | F(XMM) | F(XMM2) | F(SELFSNOOP) |
0 /* HTT, TM, Reserved, PBE */;
/* cpuid 0x80000001.edx */
const u32 kvm_supported_word1_x86_features =
F(FPU) | F(VME) | F(DE) | F(PSE) |
F(TSC) | F(MSR) | F(PAE) | F(MCE) |
F(CX8) | F(APIC) | 0 /* Reserved */ | F(SYSCALL) |
F(MTRR) | F(PGE) | F(MCA) | F(CMOV) |
F(PAT) | F(PSE36) | 0 /* Reserved */ |
f_nx | 0 /* Reserved */ | F(MMXEXT) | F(MMX) |
F(FXSR) | F(FXSR_OPT) | f_gbpages | f_rdtscp |
0 /* Reserved */ | f_lm | F(3DNOWEXT) | F(3DNOW);
/* cpuid 1.ecx */
const u32 kvm_supported_word4_x86_features =
/* NOTE: MONITOR (and MWAIT) are emulated as NOP,
* but *not* advertised to guests via CPUID ! */
F(XMM3) | F(PCLMULQDQ) | 0 /* DTES64, MONITOR */ |
0 /* DS-CPL, VMX, SMX, EST */ |
0 /* TM2 */ | F(SSSE3) | 0 /* CNXT-ID */ | 0 /* Reserved */ |
F(FMA) | F(CX16) | 0 /* xTPR Update, PDCM */ |
F(PCID) | 0 /* Reserved, DCA */ | F(XMM4_1) |
F(XMM4_2) | F(X2APIC) | F(MOVBE) | F(POPCNT) |
0 /* Reserved*/ | F(AES) | F(XSAVE) | 0 /* OSXSAVE */ | F(AVX) |
F(F16C) | F(RDRAND);
/* cpuid 0x80000001.ecx */
const u32 kvm_supported_word6_x86_features =
F(LAHF_LM) | F(CMP_LEGACY) | 0 /*SVM*/ | 0 /* ExtApicSpace */ |
F(CR8_LEGACY) | F(ABM) | F(SSE4A) | F(MISALIGNSSE) |
F(3DNOWPREFETCH) | F(OSVW) | 0 /* IBS */ | F(XOP) |
0 /* SKINIT, WDT, LWP */ | F(FMA4) | F(TBM);
/* cpuid 0xC0000001.edx */
const u32 kvm_supported_word5_x86_features =
F(XSTORE) | F(XSTORE_EN) | F(XCRYPT) | F(XCRYPT_EN) |
F(ACE2) | F(ACE2_EN) | F(PHE) | F(PHE_EN) |
F(PMM) | F(PMM_EN);
/* cpuid 7.0.ebx */
const u32 kvm_supported_word9_x86_features =
F(FSGSBASE) | F(BMI1) | F(HLE) | F(AVX2) | F(SMEP) |
F(BMI2) | F(ERMS) | f_invpcid | F(RTM) | f_mpx | F(RDSEED) |
F(ADX) | F(SMAP);
/* all calls to cpuid_count() should be made on the same cpu */
get_cpu();
r = -E2BIG;
if (*nent >= maxnent)
goto out;
do_cpuid_1_ent(entry, function, index);
++*nent;
switch (function) {
case 0:
entry->eax = min(entry->eax, (u32)0xd);
break;
case 1:
entry->edx &= kvm_supported_word0_x86_features;
cpuid_mask(&entry->edx, 0);
entry->ecx &= kvm_supported_word4_x86_features;
cpuid_mask(&entry->ecx, 4);
/* we support x2apic emulation even if host does not support
* it since we emulate x2apic in software */
entry->ecx |= F(X2APIC);
break;
/* function 2 entries are STATEFUL. That is, repeated cpuid commands
* may return different values. This forces us to get_cpu() before
* issuing the first command, and also to emulate this annoying behavior
* in kvm_emulate_cpuid() using KVM_CPUID_FLAG_STATE_READ_NEXT */
case 2: {
int t, times = entry->eax & 0xff;
entry->flags |= KVM_CPUID_FLAG_STATEFUL_FUNC;
//.........这里部分代码省略.........
开发者ID:1800alex,项目名称:linux,代码行数:101,代码来源:cpuid.c
示例19: writeln
int SimpleConfig::writeln(const char *buff, int maxlen){
mlog.WARNING(F("SimpleConfig::base class called"));
return 0;
}
开发者ID:digitalfotografen,项目名称:Arduino-Thingspeak,代码行数:4,代码来源:SimpleConfig.cpp
示例20: debugDefaultKey
void SimpleConfig::debugDefaultKey(const char *key, const char* group){
mlog.DEBUG(F("Default config key:"));
mlog.DEBUG(key, false);
mlog.DEBUG(F(" group:"), false);
mlog.DEBUG(group, false);
}
开发者ID:digitalfotografen,项目名称:Arduino-Thingspeak,代码行数:6,代码来源:SimpleConfig.cpp
注:本文中的F函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论