本文整理汇总了C++中LL函数的典型用法代码示例。如果您正苦于以下问题:C++ LL函数的具体用法?C++ LL怎么用?C++ LL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void World::RenderGroup(SceneGroup *i, mat4 t)
{
int ii, time = 0;
// sphere vars
double r;
MaterialInfo m;
// light vars
LightInfo l;
// camera vars
CameraInfo f;
// if this is a terminal node
if (i->getChildCount() == 0) {
// if this node is a sphere
if (i->computeSphere(r,m,time)) {
_spheres.push_back(Sphere(vec4(0,0,0,1), r, m, t));
} else if (i->computeLight(l)) {
if (l.type == LIGHT_POINT) {
_lights[l.type].push_back(Light(vec3(t*vec4(0,0,0,1),VW),0, l));
}else if (l.type == LIGHT_DIRECTIONAL){
_lights[l.type].push_back(Light(0,vec3(t*vec4(0,0,-1,0),VW), l));
}else if (l.type == LIGHT_AMBIENT)
_ambientLight = l.color;
} else if (i->computeCamera(f)) {
vec4 eye(0.0, 0.0, 0.0, 1.0);
vec4 LL(f.sides[FRUS_LEFT], f.sides[FRUS_BOTTOM], -1*f.sides[FRUS_NEAR], 1.0);
vec4 UL(f.sides[FRUS_LEFT], f.sides[FRUS_TOP], -1*f.sides[FRUS_NEAR], 1.0);
vec4 LR(f.sides[FRUS_RIGHT], f.sides[FRUS_BOTTOM], -1*f.sides[FRUS_NEAR], 1.0);
vec4 UR(f.sides[FRUS_RIGHT], f.sides[FRUS_TOP], -1*f.sides[FRUS_NEAR], 1.0);
_view = Viewport(eye, LL, UL, LR, UR, IMAGE_WIDTH, IMAGE_HEIGHT);
}
} else {
// expand and traverse this node
for(ii=0; ii<i->getChildCount();ii++)
RenderInstance(i->getChild(ii), t);
}
}
示例2: qindex_push_index
/* push index */
int qindex_push_index(QINDEX *qindex, int64_t key, IBDATA *block)
{
DOCHEADER *docheader = NULL;
XPACKET *xpackets = NULL;
int mid = 0, old = 0;
if(qindex && block->ndata > 0 && (docheader = (DOCHEADER *)block->data))
{
MUTEX_LOCK(qindex->mutex);
if(docheader->size == block->ndata && (xpackets = (XPACKET *)(qindex->xpacketio.map))
&& (mid = mmtree64_try_insert(qindex->idmap, qindex->state->rootid,
key, (qindex->state->id_max+1), &old)) > 0)
{
if(old > 0) mid = old;
else mid = ++(qindex->state->id_max);
db_set_data(PDB(qindex->db), mid, block->data, block->ndata);
if(mid <= qindex->state->xpackettotal)
{
if(xpackets[mid].crc != docheader->crc)
qindex_update(qindex, mid, 1);
else
qindex_update(qindex, mid, 0);
xpackets[mid].status = docheader->status;
xpackets[mid].crc = docheader->crc;
ACCESS_LOGGER(qindex->logger, "update-index{gloablid:%lld mid:%d total:%d}", LL(docheader->globalid), mid, qindex->state->xpackettotal);
}
else
{
qindex->state->xpackettotal = mid;
CHECK_XPACKETIO(qindex);
if((xpackets = (XPACKET *)(qindex->xpacketio.map)))
{
xpackets[mid].status = docheader->status;
xpackets[mid].crc = docheader->crc;
ACCESS_LOGGER(qindex->logger, "new-index{gloablid:%lld mid:%d}", LL(docheader->globalid), mid);
}
}
}
else
{
FATAL_LOGGER(qindex->logger, "Invalid document size:%d ndata:%d id:%lld crc:%d", docheader->size, block->ndata, LL(docheader->globalid), docheader->crc);
_exit(-1);
}
MUTEX_UNLOCK(qindex->mutex);
}
return mid;
}
示例3: f12h_mc0_mce
static bool f12h_mc0_mce(u16 ec, u8 xec)
{
bool ret = false;
if (MEM_ERROR(ec)) {
u8 ll = LL(ec);
ret = true;
if (ll == LL_L2)
pr_cont("during L1 linefill from L2.\n");
else if (ll == LL_L1)
pr_cont("Data/Tag %s error.\n", R4_MSG(ec));
else
ret = false;
}
return ret;
}
示例4: session_malloc
session *
session_malloc (void)
{
session *s = (session *) malloc (sizeof (session));
if (!s)
{
LL ();
fprintf (stderr, "%s: session malloc() failed: %s (%i)\n", progname,
strerror (errno), errno);
exit (EXIT_FAILURE);
}
else
memset (s, '\0', sizeof (session));
return s;
}
示例5: Run
bool Run(string &buf)
{
bool bResult;
float outRT;
LeptLog LL("c:/recogText.log");
LeptTextRecognition LTR(LL);
//LTR.TrainingFromPath("C:/recog/GOSTdigits", 0);
LTR.TrainingFromPath("../../../TestImage/TEXT/GOSTfont");
bResult = LTR.FileRecognition("../../../TestImage/TEXT/Picture11.tif", buf, outRT);
//bResult = LTR.FileRecognition("C:/test2/Image 3.tif", buf, outRT);
//pixDisplay(pixdb, 800, 800);
//pixDisplay(pixat->pix[2], 800, 800);
return bResult;
}
示例6: result
Direction DumbDirectionSolver::tryToMove(Point pt) {
int count = 0;
int newX = pt.getX();
int newY = pt.getY();
Direction result(LL("NULL"));
bool again = false;
do {
result = whereICanGoFrom(pt);
if (result.isNull()) {
return result;
}
newX = result.changeX(pt.getX());
newY = result.changeY(pt.getY());
bool bombAtWay = (!bomb.isNull()) && (bomb == Point(newX, newY));
bool barrierAtWay = board.isBarrierAt(newX, newY);
auto futBla = board.getFutureBlasts();
bool blastAtWay = (std::find(futBla.begin(), futBla.end(), Point(newX, newY)) != futBla.end());
bool meatChopperNearWay = board.isNear(newX, newY, Element(LL("MEAT_CHOPPER")));
if (blastAtWay &&
board.countNear(pt.getX(), pt.getY(), Element(LL("SPACE"))) == 1 &&
!board.isAt(pt.getX(), pt.getY(), Element(LL("BOMB_BOMBERMAN")))) {
result = Direction(LL("STOP"));
return result;
}
again = bombAtWay || barrierAtWay || meatChopperNearWay;
bool deadEndAtWay = (board.countNear(newX, newY, Element(LL("SPACE"))) == 0 && !bomb.isNull());
if (deadEndAtWay) {
bomb.setNull(true);
}
if (result == Direction(LL("NULL"))) {
again == true;
}
} while (count++ < 20 && again);
if (count >= 20) {
result = Direction(LL("ACT"));
}
return result;
}
示例7: f14h_mc1_mce
static bool f14h_mc1_mce(u16 ec, u8 xec)
{
u8 r4 = R4(ec);
bool ret = true;
if (MEM_ERROR(ec)) {
if (TT(ec) != 0 || LL(ec) != 1)
ret = false;
if (r4 == R4_IRD)
pr_cont("Data/tag array parity error for a tag hit.\n");
else if (r4 == R4_SNOOP)
pr_cont("Tag error during snoop/victimization.\n");
else
ret = false;
}
return ret;
}
示例8: caldate_frommjd
void caldate_frommjd(struct caldate *cd, int64_t day, int *pwday, int *pyday)
{
long year;
long month;
int yday;
year = (long)(day / LL(146097));
day %= LL(146097);
day += LL(678881);
while (day >= LL(146097)) { day -= LL(146097); ++year; }
/* year * 146097 + day - 678881 is MJD; 0 <= day < 146097 */
/* 2000-03-01, MJD 51604, is year 5, day 0 */
if (pwday) *pwday = (int)((day + 3) % 7);
year *= 4;
if (day == LL(146096)) { year += 3; day = 36524L; }
else { year += (long)(day / LL(36524)); day %= LL(36524); }
year *= 25;
year += (long)(day / 1461);
day %= 1461;
year *= 4;
yday = (day < 306);
if (day == 1460) { year += 3; day = 365; }
else { year += (long)(day / 365); day %= 365; }
yday += (int)day;
day *= 10;
month = (long)((day + 5) / 306);
day = (day + 5) % 306;
day /= 10;
if (month >= 10) { yday -= 306; ++year; month -= 10; }
else { yday += 59; month += 2; }
cd->year = year;
cd->month = (int)month + 1;
cd->day = (int)(day + 1);
if (pyday) *pyday = yday;
}
示例9: NodeInsert
Node NodeInsert(Node rootnode , int data){
if (rootnode == NULL){
rootnode = CreatNode(NULL , NULL , data);
return rootnode;
}
if (data == rootnode -> data){
printf("Insert Node %d Failed !\n" , data);
}
if (data < rootnode -> data){
rootnode -> left = NodeInsert(rootnode -> left , data);
rootnode -> height = MAX(Height(rootnode -> left) , Height(rootnode -> right)) + 1;
//lose balance
int rightheight = 0;
if (rootnode -> right != NULL){
rightheight = rootnode -> right ->height;
}
if (Height(rootnode -> left) >= rightheight + 2){
if (data < rootnode -> left -> data){
rootnode = LL(rootnode);
}else{
rootnode = LR(rootnode);
}
}
}else{
if (data > rootnode -> data){
rootnode -> right = NodeInsert(rootnode -> right , data);
rootnode -> height = MAX(Height(rootnode -> left) , Height(rootnode -> right)) + 1;
//lose balance
int leftheight = 0;
if (rootnode -> left != NULL){
leftheight = rootnode -> left -> height;
}
if (Height(rootnode -> right) >= leftheight + 2){
if (data > rootnode -> right -> data){
rootnode = RR(rootnode);
}else{
rootnode = RL(rootnode);
}
}
}
}
rootnode -> height = MAX(Height(rootnode -> left) , Height(rootnode -> right)) + 1;
return rootnode;
}
示例10: diff2PDF_u_tCopula_new
void diff2PDF_u_tCopula_new(double* u, double* v, int* n, double* param, int* copula, double* out)
{
double x1, x2;
int j=0, k=1;
double t1, t2, t4, t5, t6, t7, t8, t9, t11, t12, t13, M, c=0, diffPDF=0, diff_dt2=0;
double t14, t15, t16;
double rho = param[0];
double nu = param[1];
t1=nu+2.0;
t14=rho*rho;
t4=1.0-t14;
for(j=0;j<*n;j++)
{
LL(copula, &k, &u[j], &v[j], &rho, &nu, &c);
c=exp(c);
x1=qt(u[j],nu,1,0);
x2=qt(v[j],nu,1,0);
t15=x1*x1;
t16=x2*x2;
M = ( nu*t4 + t15 + t16 - 2.0*rho*x1*x2 );
t2=dt(x1,nu,0);
diffPDF_u_tCopula_new(&u[j], &v[j], &k, param, copula, &diffPDF);
diff_dt_u(&x1, &nu, &diff_dt2);
t7=x1-rho*x2;
t5=-diffPDF/t2 + diff_dt2/t2/t2*c;
t6=t1*t7/M + diff_dt2;
t11=c/t2;
t8=1.0/t2;
t9=t1/M - 2.0*t1*t7*t7/M/M;
t13=1.0+t15/nu;
t12=t8*( -(nu+1.0)/(nu+t15) + 2.0*t15* (nu+1.0)/nu/nu / t13/t13);
out[j]=t5*t6 - t11*(t8*t9 + t12);
}
}
示例11: diffPDF_nu_tCopula_new
void diffPDF_nu_tCopula_new(double* u, double* v, int* n, double* param, int* copula, double* out)
{
double out1=0, out2=0, x1, x2;
int j=0, k=1;
double t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, M, c;
double rho = param[0];
double nu = param[1];
t1=digamma((nu+1.0)/2.0);
t2=digamma(nu/2.0);
t14=rho*rho;
t3=0.5*log(1.0-t14);
t4=(nu-2.0)/(2.0*nu);
t5=0.5*log(nu);
t6=-t1+t2+t3-t4-t5;
t10=(nu+2.0)/2.0;
for(j=0;j<*n;j++)
{
LL(copula, &k, &u[j], &v[j], &rho, &nu, &c);
c=exp(c);
x1=qt(u[j],nu,1,0);
x2=qt(v[j],nu,1,0);
diffX_nu_tCopula(&x1, param, &out1);
diffX_nu_tCopula(&x2, param, &out2);
t7=1.0+2.0*x1*out1;
t8=1.0+2.0*x2*out2;
t15=x2*x2;
t16=x1*x1;
t9=(nu+1.0)/2.0*( t7/(nu+x1*x1) + t8/(nu+t15) );
M=nu*(1.0-t14) + t16 + t15 - 2.0*rho*x1*x2;
t11=1.0 - t14 + 2.0*x1*out1 + 2.0*x2*out2 - 2.0*rho*(x1*out2+x2*out1);
t12=0.5*log((nu+t16)*(nu+t15));
t13=0.5*log(M);
out[j]=c*(t6 + t9 + t12 - t10*t11/M - t13);
}
}
示例12: Node
Node* AvlTree::nodeInsert(Node* &rootNode , int data){
if (rootNode == NULL){
rootNode = new Node(NULL, NULL, data);
return rootNode;
}
if (data == rootNode->data){
return NULL;
}
if (data < rootNode -> data){
rootNode -> left = nodeInsert(rootNode->left, data);
rootNode -> height = MAX(Height(rootNode->left) , Height(rootNode -> right)) + 1;
int rightHeight = 0;
if (rootNode -> right != NULL){
rightHeight = rootNode -> right -> height;
}
if (Height(rootNode -> left) >= rightHeight + 2){
if (data < rootNode -> left -> data){
rootNode = LL(rootNode);
}else{
rootNode = LR(rootNode);
}
}
}else{
if (data > rootNode -> data){
rootNode -> right = nodeInsert(rootNode -> right, data);
rootNode -> height = 1 + MAX(Height(rootNode -> left) , Height(rootNode -> right));
int leftHeight = 0;
if (rootNode -> left != NULL){
leftHeight = rootNode -> left -> height;
}
if (Height(rootNode -> right) >= leftHeight + 2){
if (data > rootNode -> right -> data){
rootNode = RR(rootNode);
}else{
rootNode = RL(rootNode);
}
}
}
}
rootNode -> height = MAX(Height(rootNode -> left) , Height(rootNode -> right)) + 1;
return rootNode;
}
示例13: getNVector
float Plane::angle(const Line &L)
{// the return value should be between 0 and 90, if -1, means error.
Vector v1 = getNVector();
Vector v2;
fPoint p;
Line LL(L);
LL.getPara(p,v2);
float t1 = v1.length(), t2 = v2.length();
if ((fabs(t1-0)<ZERO) ||(fabs(t2-0)<ZERO)){
printf("\n Error: Plane::angle(Line)");
return -1.0f;
}
float alpha = v1.dotProduct(v2)/t1/t2;
//alpha = facos (fabs(alpha));
alpha = acos (fabs(alpha));
return alpha;
}
示例14: if
static TLDNode *balance(TLDNode *node) {
int nodeDiff;
nodeDiff=checkDiff(node);
if (nodeDiff>1){
int checkLeft=checkDiff(node->left);
if (checkLeft>0){
node=LL(node);
}else{
node=LR(node);
}
}else if(nodeDiff<-1){
int checkRight=checkDiff(node->right);
if (checkRight>0){
node=RL(node);
}else{
node=RR(node);
}
};
return node;
}
示例15: transid_store_packed
uint transid_store_packed(MARIA_HA *info, uchar *to, ulonglong trid)
{
uchar *start;
uint length;
uchar buff[8];
DBUG_ASSERT(trid < (LL(1) << (MARIA_MAX_PACK_TRANSID_SIZE*8)));
DBUG_ASSERT(trid >= info->s->state.create_trid);
trid= (trid - info->s->state.create_trid) << 1;
/* Mark that key contains transid */
to[-1]|= 1;
if (trid < MARIA_MIN_TRANSID_PACK_OFFSET)
{
to[0]= (uchar) trid;
return 1;
}
start= to;
/* store things in low-byte-first-order in buff */
to= buff;
do
{
*to++= (uchar) trid;
trid= trid>>8;
} while (trid);
length= (uint) (to - buff);
/* Store length prefix */
start[0]= (uchar) (length + MARIA_TRANSID_PACK_OFFSET);
start++;
/* Copy things in high-byte-first order to output buffer */
do
{
*start++= *--to;
} while (to != buff);
return length+1;
}