HLIBpro 3.1
Loading...
Searching...
No Matches
C Bindings

𝖧𝖫𝖨𝖡𝗉𝗋𝗈 offers bindings for the C language, with most, albeit not all of the functionality implemented that is available in the standard C++ interface.

As 𝖧𝖫𝖨𝖡𝗉𝗋𝗈 supports single and double precision computation, the floating point precision needs to be chosen apriori. All types and functions in the C interface with are specific to a floating point format have a unique prefix:

Datatype Prefix
float hpro_s
double hpro_d
float complex hpro_c
double complex hpro_z

All other types and functions only use the prefix hpro .

To make the C functions available in your program, you can either include all via

#include <hpro-c.h>

or the header file for a particular value type, e.g.,

#include <hpro-c-d.h>

for real valued, double precision computations.

The following example programs have been converted from their C++ versions:

Compatibility Layer

For compatibility with 𝖧𝖫𝖨𝖡𝗉𝗋𝗈 v2.x wrapper functions are implemented using the old function names, e.g.,

hlib_ complex_t hlib_ complex(const hlib_ real_t re, const hlib_ real_t im)
Definition hpro-c-compat.h:2880

for real valued matrix-vector multiplication and

for the complex valued version.

By default, these wrapper functions map to the double precision functions of 𝖧𝖫𝖨𝖡𝗉𝗋𝗈, i.e., to

and

for the above matrix-vector computation.

This can be changed with

which activate single or double precision computations for all subsequent function calls.