Contains standard fundamental data structures for representing space used throughout DHARTAPI.
More...
|
enum | STEP {
NOT_CONNECTED = 0
, NONE = 1
, UP = 2
, DOWN = 3
,
OVER = 4
} |
| Describes the type of step an edge connects to. More...
|
|
enum class | COST_AGGREGATE : int { SUM = 0
, AVERAGE = 1
, COUNT = 2
} |
| Methods of aggregating the costs for edges for each node in the graph. More...
|
|
enum class | Direction : int { INCOMING = 0
, OUTGOING = 1
, BOTH = 2
} |
| Node to use for calculating the cost of an edge when converting node attributes to edge costs. More...
|
|
enum | NODE_TYPE { GRAPH = 0
, POI = 1
, OTHER = 2
} |
| The type of node this is. More...
|
|
|
template<typename desired_type , typename numeric_type > |
constexpr desired_type | DivideBy1 (numeric_type n) |
| Cast a value to the specific type and divide 1 by it. More...
|
|
float | roundhf (float f, float p=FLOAT_PRECISION, float r=ROUNDING_PRECISION) |
| Round a float to the nearest precision defined globally. The global values can be overridden with optional parameters p and r. If r is 0.01, p must be 100.0, meaning there should be one more 0 between the decimal. More...
|
|
float | trunchf (float f, float p=1000.0, float r=0.001) |
| Truncate a float to the nearest precision defined globally. The global values can be overridden with optional parameters p and r. If r is 0.01, p must be 100.0, meaning there should be one more 0 between the decimal. More...
|
|
template<typename numeric_type > |
numeric_type | roundhf_tail (numeric_type f, int precision) |
| round a number twice, once at the precision+1, and again at the precision This method is to fix cases in which the precision to round to is 4, and the following number is 9. More...
|
|
template<typename numeric_type > |
constexpr numeric_type | roundhf_tmp (numeric_type f, numeric_type p, numeric_type r) |
| round a number to the nearest precision defined globally. The global values can be overridden with optional parameters p and r. If r is 0.01, p must be 100.0, meaning there should be one more 0 between the decimal. More...
|
|
template<typename desired_type , typename numeric_type > |
constexpr desired_type | roundhf_tmp (numeric_type f, numeric_type p) |
| Round a number to the nearest value to itself at a specific precision. More...
|
|
template<typename desired_type , typename numeric_type > |
constexpr desired_type | roundhf_tmp (numeric_type f) |
| Round a number to the global rounding precision. More...
|
|
template<typename numeric_type > |
constexpr numeric_type | trunchf_tmp (numeric_type f, numeric_type p, numeric_type r) |
| truncate a number to the nearest precision defined globally. The global values can be overridden with optional parameters p and r. If r is 0.01, p must be 100.0, meaning there should be one more 0 between the decimal. More...
|
|
template<typename desired_type , typename numeric_type > |
constexpr desired_type | trunchf_tmp (numeric_type f, numeric_type p) |
| Truncate a number to the nearest value not greater than itself at a specific precision. More...
|
|
template<typename desired_type , typename numeric_type > |
constexpr desired_type | trunchf_tmp (numeric_type f) |
| Truncate a number to the nearest value not greater than itself at a specific precision. More...
|
|
void | Normalize (std::array< float, 3 > &vector) |
|
Contains standard fundamental data structures for representing space used throughout DHARTAPI.
template<typename numeric_type >
numeric_type HF::SpatialStructures::roundhf_tail |
( |
numeric_type |
f, |
|
|
int |
precision |
|
) |
| |
round a number twice, once at the precision+1, and again at the precision This method is to fix cases in which the precision to round to is 4, and the following number is 9.
\notes It may also be more simply solved by adding some small epsilon before rounding
- Template Parameters
-
return_type | Type of number to round. Can be float, double, or long double. |
- Parameters
-
f | Value to round. |
precision | Number of digits to round to |
Definition at line 89 of file Constants.h.
template<typename desired_type , typename numeric_type >
constexpr desired_type HF::SpatialStructures::roundhf_tmp |
( |
numeric_type |
f | ) |
|
|
inlineconstexpr |
Round a number to the global rounding precision.
- Template Parameters
-
desired_type | Type to use and be returned by this calculation .All values will be converted to this type before any operations are performed. |
numeric_type | Type of number to truncate. Can be float, double, or long double. |
- Parameters
-
- Returns
f
rounded at ROUNDING_PRECISION.
Definition at line 148 of file Constants.h.
References roundhf_tmp(), and ROUNDING_PRECISION.
template<typename desired_type , typename numeric_type >
constexpr desired_type HF::SpatialStructures::roundhf_tmp |
( |
numeric_type |
f, |
|
|
numeric_type |
p |
|
) |
| |
|
inlineconstexpr |
Round a number to the nearest value to itself at a specific precision.
- Template Parameters
-
desired_type | Type to use and be returned by this calculation. All values will be converted to this type before any operations are performed. |
numeric_type | Type of number to round. Can be float, double, or long double. |
- Parameters
-
f | The number to round. |
r | Precision to round to I.E. 0.0001 will round up to the 4th decimal place |
- Returns
f
rounded to the nearest point specified in r.
Definition at line 133 of file Constants.h.
References roundhf_tmp().
template<typename numeric_type >
constexpr numeric_type HF::SpatialStructures::roundhf_tmp |
( |
numeric_type |
f, |
|
|
numeric_type |
p, |
|
|
numeric_type |
r |
|
) |
| |
|
inlineconstexpr |
round a number to the nearest precision defined globally. The global values can be overridden with optional parameters p and r. If r is 0.01, p must be 100.0, meaning there should be one more 0 between the decimal.
- Template Parameters
-
numeric_type | Type of number to round. Can be float, double, or long double. |
- Parameters
-
f | The desired value to round. |
p | The unit precision to round (e.g, 1000.0f) |
r | The override of the conversion back (e.g., 0.001f) |
- Returns
- F rounded to the specified precision.
Definition at line 114 of file Constants.h.
References roundhf_tmp().
Referenced by roundhf_tmp().
template<typename desired_type , typename numeric_type >
constexpr desired_type HF::SpatialStructures::trunchf_tmp |
( |
numeric_type |
f | ) |
|
|
inlineconstexpr |
Truncate a number to the nearest value not greater than itself at a specific precision.
- Template Parameters
-
desired_type | Type to useand be returned by this calculation.All values will be converted to this type before any operations are performed. |
numeric_type | Type of number to truncate.Can be float, double, or long double. |
- Parameters
-
- Returns
f
truncated at ROUNDING_PRECISION.
Definition at line 204 of file Constants.h.
References ROUNDING_PRECISION, and trunchf_tmp().
template<typename desired_type , typename numeric_type >
constexpr desired_type HF::SpatialStructures::trunchf_tmp |
( |
numeric_type |
f, |
|
|
numeric_type |
p |
|
) |
| |
|
inlineconstexpr |
Truncate a number to the nearest value not greater than itself at a specific precision.
- Template Parameters
-
desired_type | Type to useand be returned by this calculation.All values will be converted to this type before any operations are performed. |
numeric_type | Type of number to truncate. Can be float, double, or long double. |
- Parameters
-
f | The number to truncate. |
r | Precision to truncate at I.E. 0.0001 will discard all values past the 4th decimal place |
- Returns
f
truncated at the point specified in r.
Definition at line 189 of file Constants.h.
References trunchf_tmp().
template<typename numeric_type >
constexpr numeric_type HF::SpatialStructures::trunchf_tmp |
( |
numeric_type |
f, |
|
|
numeric_type |
p, |
|
|
numeric_type |
r |
|
) |
| |
|
inlineconstexpr |
truncate a number to the nearest precision defined globally. The global values can be overridden with optional parameters p and r. If r is 0.01, p must be 100.0, meaning there should be one more 0 between the decimal.
- Template Parameters
-
numeric_type | Type of number to truncate. Can be float, double, or long double. |
- Parameters
-
f | The desired float to truncate. |
p | The unit precision to truncate (Default, 1000.0f) |
r | The override of the conversion back (e.g., 0.001f) |
- Returns
- f truncated to the nearest rounding_precision.
Definition at line 170 of file Constants.h.
References trunchf_tmp().
Referenced by trunchf_tmp().