#include <structures.h>
Public Member Functions | |
| ExclusionSignature () | |
| ExclusionSignature (const ExclusionSignature &sig) | |
| ~ExclusionSignature () | |
| ExclusionSignature & | operator= (const ExclusionSignature &sig) |
| int | operator== (const ExclusionSignature &sig) const |
| void | setOffsets (vector< int > &fullVec, vector< int > &modVec) |
| void | removeEmptyOffset () |
| int | findOffset (int offset, int *fullOrMod) |
| void | pack (MOStream *msg) |
| void | unpack (MIStream *msg) |
Public Attributes | |
| int | fullExclCnt |
| int * | fullOffset |
| int | modExclCnt |
| int * | modOffset |
|
|
Definition at line 405 of file structures.h. 00405 {
00406 fullExclCnt = modExclCnt = 0;
00407 fullOffset = modOffset = NULL;
00408 }
|
|
|
Definition at line 409 of file structures.h. References fullExclCnt, fullOffset, modExclCnt, and modOffset. 00409 {
00410 fullOffset = modOffset = NULL;
00411 fullExclCnt = sig.fullExclCnt;
00412 if(fullExclCnt>0){
00413 fullOffset = new int[fullExclCnt];
00414 for(int i=0; i<fullExclCnt; i++)
00415 fullOffset[i] = sig.fullOffset[i];
00416 }
00417
00418 modExclCnt = sig.modExclCnt;
00419 if(modExclCnt>0){
00420 modOffset = new int[modExclCnt];
00421 for(int i=0; i<modExclCnt; i++)
00422 modOffset[i] = sig.modOffset[i];
00423 }
00424 }
|
|
|
Definition at line 425 of file structures.h. 00425 {
00426 if(fullOffset) delete [] fullOffset;
00427 if(modOffset) delete [] modOffset;
00428 }
|
|
||||||||||||
|
Definition at line 8492 of file Molecule.C. References fullOffset, and modOffset. 08492 {
08493 //assuming all offsets have been sorted increasingly
08494 //so that binary search could be used
08495 int retidx = -1;
08496
08497 *fullOrMod = 0;
08498 int low = 0;
08499 int high = fullExclCnt-1;
08500 int mid = (low+high)/2;
08501 while(low<=high){
08502 if(offset<fullOffset[mid]){
08503 high = mid-1;
08504 mid = (high+low)/2;
08505 }else if(offset>fullOffset[mid]){
08506 low = mid+1;
08507 mid = (high+low)/2;
08508 }else{
08509 retidx = mid;
08510 break;
08511 }
08512 }
08513 if(retidx!=-1) return retidx;
08514
08515 *fullOrMod = 1;
08516 low = 0;
08517 high = modExclCnt-1;
08518 mid = (low+high)/2;
08519 while(low<=high){
08520 if(offset<modOffset[mid]){
08521 high = mid-1;
08522 mid = (high+low)/2;
08523 }else if(offset>modOffset[mid]){
08524 low = mid+1;
08525 mid = (high+low)/2;
08526 }else{
08527 retidx = mid;
08528 break;
08529 }
08530 }
08531 return retidx;
08532 }
|
|
|
Definition at line 430 of file structures.h. References fullExclCnt, fullOffset, modExclCnt, and modOffset. 00430 {
00431 fullExclCnt = sig.fullExclCnt;
00432 if(fullOffset) delete [] fullOffset;
00433 if(fullExclCnt>0){
00434 fullOffset = new int[fullExclCnt];
00435 for(int i=0; i<fullExclCnt; i++)
00436 fullOffset[i] = sig.fullOffset[i];
00437 }else
00438 fullOffset = NULL;
00439
00440 modExclCnt = sig.modExclCnt;
00441 if(modOffset) delete [] modOffset;
00442 if(modExclCnt>0){
00443 modOffset = new int[modExclCnt];
00444 for(int i=0; i<modExclCnt; i++)
00445 modOffset[i] = sig.modOffset[i];
00446 }else
00447 modOffset = NULL;
00448
00449 return *this;
00450 }
|
|
|
Definition at line 451 of file structures.h. References fullExclCnt, fullOffset, modExclCnt, and modOffset. 00451 {
00452 if(fullExclCnt!=sig.fullExclCnt) return 0;
00453 if(modExclCnt!=sig.modExclCnt) return 0;
00454
00455 for(int i=0; i<fullExclCnt; i++){
00456 if(fullOffset[i]!=sig.fullOffset[i]) return 0;
00457 }
00458 for(int i=0; i<modExclCnt; i++){
00459 if(modOffset[i]!=sig.modOffset[i]) return 0;
00460 }
00461 return 1;
00462 }
|
|
|
Definition at line 8534 of file Molecule.C. References fullOffset, modOffset, and MOStream::put(). 08534 {
08535 msg->put(fullExclCnt);
08536 msg->put(fullExclCnt, fullOffset);
08537 msg->put(modExclCnt);
08538 msg->put(modExclCnt, modOffset);
08539 }
|
|
|
Definition at line 8441 of file Molecule.C. References fullOffset, and modOffset. 08441 {
08442 int newCnt=0;
08443 for(int i=0; i<fullExclCnt; i++){
08444 if(fullOffset[i]==0) continue;
08445 newCnt++;
08446 }
08447 if(newCnt==0){
08448 fullExclCnt = 0;
08449 delete [] fullOffset;
08450 fullOffset = NULL;
08451 }else if(newCnt!=fullExclCnt){
08452 int *tmpOffset = new int[newCnt];
08453 newCnt=0;
08454 for(int i=0; i<fullExclCnt; i++){
08455 if(fullOffset[i]==0) continue;
08456 tmpOffset[newCnt] = fullOffset[i];
08457 newCnt++;
08458 }
08459 delete [] fullOffset;
08460 fullOffset = tmpOffset;
08461 fullExclCnt = newCnt;
08462 }
08463
08464
08465 newCnt=0;
08466 for(int i=0; i<modExclCnt; i++){
08467 if(modOffset[i]==0) continue;
08468 newCnt++;
08469 }
08470 if(newCnt==0){
08471 modExclCnt = 0;
08472 delete [] modOffset;
08473 modOffset = NULL;
08474 }else if(newCnt!=modExclCnt){
08475 int *tmpOffset = new int[newCnt];
08476 newCnt=0;
08477 for(int i=0; i<modExclCnt; i++){
08478 if(modOffset[i]==0) continue;
08479 tmpOffset[newCnt] = modOffset[i];
08480 newCnt++;
08481 }
08482 delete [] modOffset;
08483 modOffset = tmpOffset;
08484 modExclCnt = newCnt;
08485 }
08486 }
|
|
||||||||||||
|
Definition at line 464 of file structures.h. 00464 {
00465 fullExclCnt = fullVec.size();
00466 modExclCnt = modVec.size();
00467 if(fullExclCnt>0) {
00468 fullOffset = new int[fullExclCnt];
00469 for(int i=0; i<fullExclCnt; i++)
00470 fullOffset[i] = fullVec[i];
00471 }
00472
00473 if(modExclCnt>0) {
00474 modOffset = new int[modExclCnt];
00475 for(int i=0; i<modExclCnt; i++)
00476 modOffset[i] = modVec[i];
00477 }
00478 }
|
|
|
Definition at line 8541 of file Molecule.C. References fullOffset, MIStream::get(), and modOffset. 08541 {
08542 msg->get(fullExclCnt);
08543 delete [] fullOffset;
08544 fullOffset = new int[fullExclCnt];
08545 msg->get(fullExclCnt*sizeof(int), (char *)fullOffset);
08546 msg->get(modExclCnt);
08547 delete [] modOffset;
08548 modOffset = new int[modExclCnt];
08549 msg->get(modExclCnt*sizeof(int), (char *)modOffset);
08550 }
|
|
|
Definition at line 400 of file structures.h. Referenced by ExclusionSignature(), operator=(), and operator==(). |
|
|
Definition at line 401 of file structures.h. Referenced by ExclusionSignature(), findOffset(), operator=(), operator==(), pack(), removeEmptyOffset(), and unpack(). |
|
|
Definition at line 402 of file structures.h. Referenced by ExclusionSignature(), operator=(), and operator==(). |
|
|
Definition at line 403 of file structures.h. Referenced by ExclusionSignature(), findOffset(), operator=(), operator==(), pack(), removeEmptyOffset(), and unpack(). |
1.3.9.1