-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' of https://github.com/GOMC-WSU/GOMC into M…
…EMC_Liq
- Loading branch information
Showing
227 changed files
with
22,959 additions
and
24,995 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,44 @@ | ||
#include "AlphaNum.h" | ||
|
||
AlphaNum::AlphaNum(){} | ||
AlphaNum::AlphaNum() {} | ||
|
||
/* Alpha numberic A, B, ... Z, AA, AB, ... AZ, */ | ||
/* Index from 0 to A */ | ||
// return true if s1 comes before s2 | ||
|
||
// compare character case-insensitive | ||
|
||
std::string AlphaNum::uint2String(uint stringSuffix) { | ||
|
||
std::stringstream ss; | ||
char charSuffix; | ||
int intermediate = stringSuffix; | ||
int remainder = 0; | ||
do { | ||
charSuffix = 'A'; | ||
remainder = intermediate % 26; | ||
/* Increment Char A until reach suffix or 27 which will be Z. */ | ||
for (int j = 0; j < remainder; j++) { | ||
charSuffix++; | ||
} | ||
ss << charSuffix; | ||
intermediate /= 26; | ||
intermediate--; | ||
} while (intermediate >= 0); | ||
|
||
std::string backwards = ss.str(); | ||
std::string forwards; | ||
|
||
std::string AlphaNum::uint2String(uint stringSuffix){ | ||
|
||
std::stringstream ss; | ||
char charSuffix; | ||
int intermediate = stringSuffix; | ||
int remainder = 0; | ||
do { | ||
charSuffix = 'A'; | ||
remainder = intermediate % 26; | ||
/* Increment Char A until reach suffix or 27 which will be Z. */ | ||
for (int j = 0; j < remainder; j++){ | ||
charSuffix++; | ||
} | ||
ss << charSuffix; | ||
intermediate /= 26; | ||
intermediate--; | ||
} while (intermediate >= 0); | ||
|
||
std::string backwards = ss.str(); | ||
std::string forwards; | ||
|
||
return forwards.assign(backwards.rbegin(), backwards.rend()); | ||
return forwards.assign(backwards.rbegin(), backwards.rend()); | ||
} | ||
|
||
uint AlphaNum::string2Uint(std::string stringSuffix){ | ||
uint AlphaNum::string2Uint(std::string stringSuffix) { | ||
|
||
char* char_arr = &stringSuffix[0]; | ||
char charSuffix = 'A'; | ||
uint index = 0; | ||
for (int i = 0; i < stringSuffix.length(); ++i){ | ||
index += 26 * i + (char_arr[i] - charSuffix); | ||
} | ||
return index; | ||
char *char_arr = &stringSuffix[0]; | ||
char charSuffix = 'A'; | ||
uint index = 0; | ||
for (int i = 0; i < stringSuffix.length(); ++i) { | ||
index += 26 * i + (char_arr[i] - charSuffix); | ||
} | ||
return index; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.