The Tiny HTM Library
Data Structures | Defines | Enumerations | Functions
Utilities

Data Structures

struct  htm_range
 Represents a range of integers. More...

Defines

#define HTM_DEG_PER_RAD   57.2957795130823208767981548141
 Degrees per radian.
#define HTM_RAD_PER_DEG   0.0174532925199432957692369076849
 Radians per degree.
#define HTM_ARCSEC_PER_DEG   3600.0
 Arcseconds per degree.

Enumerations

enum  htm_errcode {
  HTM_OK = 0, HTM_ENOMEM, HTM_ENULLPTR, HTM_ENANINF,
  HTM_EZERONORM, HTM_ELAT, HTM_EANG, HTM_EHEMIS,
  HTM_ELEN, HTM_EDEGEN, HTM_EID, HTM_ELEVEL,
  HTM_EIO, HTM_EMMAN, HTM_EINV, HTM_ETREE,
  HTM_NUM_CODES
}
 Library error codes. More...

Functions

HTM_INLINE int htm_popcount (uint64_t x)
 Counts the number of 1 bits in a 64 bit integer.
const char * htm_errmsg (enum htm_errcode err)
 Returns an error message for the given error code.
HTM_INLINE double htm_angred (double angle_deg)
 Returns the given angle, range-reduced to lie in [0, 360) degrees.
HTM_INLINE double htm_clamp (double x, double min, double max)
 Returns the value of x clamped to [min, max].

Define Documentation

#define HTM_ARCSEC_PER_DEG   3600.0

Arcseconds per degree.

Definition at line 129 of file common.h.

#define HTM_DEG_PER_RAD   57.2957795130823208767981548141

Degrees per radian.

Definition at line 123 of file common.h.

Referenced by htm_sc_angsep(), htm_v3_angsep(), htm_v3_angsepu(), htm_v3_tanrot(), and htm_v3_tosc().

#define HTM_RAD_PER_DEG   0.0174532925199432957692369076849

Enumeration Type Documentation

Library error codes.

Enumerator:
HTM_OK 

Success.

HTM_ENOMEM 

Memory (re)allocation failed.

HTM_ENULLPTR 

NULL pointer argument.

HTM_ENANINF 

NaN or +/-Inf argument.

HTM_EZERONORM 

Input vector has zero norm.

HTM_ELAT 

Latitude angle out-of-bounds.

HTM_EANG 

Invalid radius, width, or height (angle)

HTM_EHEMIS 

Input vertices are non-hemispherical.

HTM_ELEN 

Too many/too few array elements.

HTM_EDEGEN 

Degenerate vertices.

HTM_EID 

Invalid HTM ID.

HTM_ELEVEL 

Invalid HTM subdivision level.

HTM_EIO 

IO operation failed.

HTM_EMMAN 

Failed to mmap(), madvise() or mlock()

HTM_EINV 

Invalid argument.

HTM_ETREE 

Invalid HTM tree file, or tree/data file mismatch.

Definition at line 95 of file common.h.


Function Documentation

const char* htm_errmsg ( enum htm_errcode  err)

Returns an error message for the given error code.

The memory for this error message must never be freed.

Definition at line 35 of file common.c.