HLIBpro  3.0
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_matrix_mulvec( ... )

for real valued matrix-vector multiplication and

hlib_matrix_cmulvec( ... )

for the complex valued version.

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

hpro_d_matrix_mulvec( ... )


hpro_z_matrix_mulvec( ... )

for the above matrix-vector computation.

This can be changed with


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