 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
9 #define BVERSION "2.0.7-20200917"
39 #include <dispatch/dispatch.h>
45 #define MAXLINELEN 1024 // Maximum length of line for input
46 #define SMALLFLOAT 1e-30 // Threshold for considering a number to be zero
47 #define MIN_SIZE_FOR_THREADING 100000
48 #define TRIGPRECISION 1e-30
51 #define PLANCK 6.626070E-34 // Js
52 #define ECHARGE 1.602177E-19 // C
53 #define EMASS 9.109384E-31 // kg
54 #define LIGHTSPEED 299792458 // m/s
55 #define AVOGADRO 6.02214076e23 // Entities per mole
63 #define M_PI 3.14159265358979323846264338327950288
66 #define M_PI_2 1.57079632679489661923132169163975144
69 #define M_PI_4 0.785398163397448309615660845819875721
72 #define TWOPI 6.28318530717958647692528676655900576
75 #define MIN2PI -6.28318530717958647692528676655900576
85 #define GOLDEN 1.61803398874989484820458683436563811772
95 #define RHO 0.81 // Protein density in Da/A3
109 #define VERB_RESULT 1
111 #define VERB_PROCESS 4
115 #define VERB_MEMORY 64
116 #define VERB_DEBUG 128
117 #define VERB_DEBUG_STAR 256
118 #define VERB_DEBUG_XML 512
119 #define VERB_DEBUG_DM 1024
177 #define FILL_AVERAGE 1
178 #define FILL_BACKGROUND 2
187 ostream &
tab(ostream &out);
188 int cmd_line(
int argc,
char **argv);
192 void usage(
const char**
use,
int all);
197 int bexit(
int value);
204 void swapbytes(
unsigned char* v,
size_t n);
205 void swapbytes(
size_t size,
unsigned char* v,
size_t n);
212 int error_show(
string message,
string file,
int line);
void vax2ieee(unsigned char *v, int sb)
Converts VAX floating point format to IEEE floating point format.
size_t get_chunk_size(size_t datasize)
Returns the chunk size per thread.
size_t system_processors()
Returns the number of processors.
SysType systype(int show)
Finds the system type - mostly just for byte order.
int get_integer(char *ptr, int len)
Converts a defined length string into an integer.
int bexit(int value)
Exit function for cleanup and debugging.
DataType getdatatype(char letter)
Get the data type indicated by a single letter code.
int error_show(string message, string file, int line)
Displays the error with file and line reference.
double angle_set_negPI_to_PI(double angle)
Returns an angle between -PI and PI.
int memory_check(long mem_required)
Checking if there is enough memory, abort if not.
Bstring command_line()
Returns the command line.
Bstring command_line_time()
Returns the command line and time in a string.
void swapbytes(unsigned char *v, size_t n)
Swaps bytes.
Header file for the string class.
ostream & tab(ostream &out)
long system_memory()
Returns system memory size.
float get_float(char *ptr, int len)
Converts a defined length string into a floating point number.
void usage(const char **use, int all)
Prints usage information.
DataType
Base data type specifier.
int cmd_line(int argc, char **argv)
Reconstructs the command line as a global string.
int select_numbers(Bstring &string, int n, int *numsel)
Converts a string with a selection specification into an integer array.
int findNextPowerOf(int startNumber, int powerOf)
Finds the next greatest number that is a power of a given number.
float remove_negative_zeros(float value0, float threshold)
Prevent a negative sign from being placed in front of zero value in a text file.
string get_user_name()
Returns the user name.