12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- Includes ordering:
- Mcell3 if under extern "C"
- C++
- MCell
- Naming is inspired by Halide and PIP3
- class names (only class, not struct), including typedef over containers or other STL code: UpperCamelCase
- namespaces: UpperCamelCase
- method names: lower_underscore_case
- local variable names: lower_underscore_case
- base types (type that maps to int, float, long, vec3, ..., structs as well): lower_underscore_case_t (followed by _t)
- constants: CONSTANT_CASE
- Preactially everything except for vec3_t is a class, therefore in UpperCamelCase.
- Can we get rid of the _t? _t as type, everything else is a class
- Naming:
- molecule, mol, m
- volume molecule, vm
- reaction, rx
- index, indices - not abbreviated as idx
- id
- partition, p for variables
- subpartition, subpart - not sp
- species
- displacement
- interation
- pos, not position
- rx_radius
- len - distance, not length
- ind, ind2 - local; indent - in parameter
- rel - relative
- llf - low, left, front
- urb - up, right, back
- rcp - reciprocal ( = 1/x)
- no spaces like this: < a >, use this <a> instead
- comments start with lowercase except for /* ... */ spanning multiple lines
- using namespace std; - in all C++ files where needed, not in headers
- Parameters:
- outputs are always as the last arguments (unless there are some that really need to have default values)
- order
- world
- parition
- vm
- ...
- contants
- ...
- rng
- ...
- outputs
- use const whenever possible to explicitly specify that it is an input
- blocks are marked like this:
- // ---------------------------------- dumping methods ----------------------------------
- there are two newlines between functions
- dump methods are always at the end of a file
- Includes:
- system, mcell3, mcell4
- Optimization notes:
- diffuse - make some of the methods static?
|