BeBOP Optimized Sparse Kernel Interface Library  1.0.1h
Data Structures | Defines | Typedefs | Functions
scalinfo.h File Reference

Define the scalar types available to the library. More...

Go to the source code of this file.

Data Structures

struct  tagComplex_t
 Single precision complex data type. More...
struct  tagDoublecomplex_t
 Double precision complex data type. More...
struct  tagBebop_scalinfo_t
 Information about an available scalar type. More...

Defines

#define INC_OSKI_SCALINFO_H
 oski/scalinfo.h has been included.
#define OSKI_SCALIND(macro_tag, conc_typ, name, tag)   { OSKI_SCALIND_##macro_tag, name, tag, sizeof(conc_typ) }
 Macro used to define a new scalar index type.
#define OSKI_SCALIND_END   INVALID_ID
 NULL (end) record.
#define OSKI_SCALIND_END_REC   OSKI_SCALIND(END, char, "", (char)NULL)
 END descriptor.
#define OSKI_SCALVAL(macro_tag, conc_typ, name, tag)   { OSKI_SCALVAL_##macro_tag, name, tag, sizeof(conc_typ) }
 Macro used to define a new scalar non-zero value type.
#define OSKI_SCALVAL_END   INVALID_ID
 NULL (end) record.
#define OSKI_SCALVAL_END_REC   OSKI_SCALVAL(END, char, "", (char)NULL)
 END descriptor.
Available integer index types.

To make a new integer index type available to the system, define a record here.

By default, we predefine types for integers and long-integers.

#define OSKI_SCALIND_INT   1
 INT -- Equivalent C type: int.
#define OSKI_SCALIND_INT_REC   OSKI_SCALIND(INT, int, "integer", 'i')
 INT descriptor.
#define OSKI_SCALIND_LONG   2
 LONG -- Equivalent C type: long.
#define OSKI_SCALIND_LONG_REC   OSKI_SCALIND(LONG, long, "long", 'l')
 LONG descriptor.
Available non-zero value types.

To make a new integer index type available to the system, define a record here.

By default, we predefine types for {single, double}-precision x {real, complex} types.

Note:
Developers who add additional complex types should modify the corresponding macro, IS_VAL_COMPLEX (mangle.h).
#define OSKI_SCALVAL_SINGLE   1
 SINGLE -- Equivalent C type: float.
#define OSKI_SCALVAL_SINGLE_REC   OSKI_SCALVAL(SINGLE, float, "single", 's')
 SINGLE descriptor.
#define OSKI_SCALVAL_DOUBLE   2
 DOUBLE -- Equivalent C type: double.
#define OSKI_SCALVAL_DOUBLE_REC   OSKI_SCALVAL(DOUBLE, double, "double", 'd')
 DOUBLE descriptor.
#define OSKI_SCALVAL_COMPLEX   3
 COMPLEX -- Equivalent C++ type: complex<float>
#define OSKI_SCALVAL_COMPLEX_REC   OSKI_SCALVAL(COMPLEX, complex_t, "complex", 'c')
 COMPLEX descriptor.
#define OSKI_SCALVAL_DOUBLECOMPLEX   4
 DOUBLECOMPLEX -- Equivalent C++ type: complex<double>
#define OSKI_SCALVAL_DOUBLECOMPLEX_REC   OSKI_SCALVAL(DOUBLECOMPLEX, doublecomplex_t, "double_complex", 'z')
 DOUBLECOMPLEX descriptor.

Typedefs

typedef struct tagBebop_scalinfo_t oski_scalinfo_t
 Information about an available scalar type.

Functions

size_t oski_GetNumScalarIndexTypes (void)
 Returns 1 iff the given scalar type is a complex type.
const oski_scalinfo_toski_LookupScalarIndexInfo (oski_id_t id)
 Lookup information about a scalar integer index type.
const char * oski_GetScalarIndexName (oski_id_t id)
 Lookup the string name of a given scalar integer index type.
char oski_GetScalarIndexTag (oski_id_t id)
 Lookup the abbreviated name of a given scalar integer index type.
size_t oski_GetNumScalarValueTypes (void)
 Returns the number of registered non-zero value types.
const oski_scalinfo_toski_LookupScalarValueInfo (oski_id_t id)
 Lookup information about a scalar non-zero value type.
const char * oski_GetScalarValueName (oski_id_t id)
 Lookup the string name of a given scalar non-zero value type.
char oski_GetScalarValueTag (oski_id_t id)
 Lookup the abbreviated name of a given scalar non-zero value type.

Complex-valued data types.

#define _COMPLEX   complex_t
 Synonym for single precision complex type.
#define _DOUBLE_COMPLEX   double_complex_t
 Synonym for double precision complex type.
#define _RE(x)   (x).real
 Macro to extract the real part of a complex number.
#define _IM(x)   (x).imag
 Macro to extract the imaginary part of a complex number.
typedef struct tagComplex_t complex_t
 Single precision complex data type.
typedef struct tagDoublecomplex_t doublecomplex_t
 Double precision complex data type.

Detailed Description

Define the scalar types available to the library.

This module (see also: scalinfo.c) defines all possible scalar types that may be used to create a sparse matrix. Among other reasons, the library needs this information to create fully-qualified dynamic library names for the matrix type-specific kernel implementations.

Users who wish to make alternative scalar types available for use as indices or non-zero values should add their definitions here. In addition, we advise these users to modify the corresponding test program (see "tests" subdirectory, 'info' test) to check for any such new scalar types.


Define Documentation

#define _COMPLEX   complex_t

Synonym for single precision complex type.

#define _DOUBLE_COMPLEX   double_complex_t

Synonym for double precision complex type.

#define _IM (   x)    (x).imag
#define _RE (   x)    (x).real

oski/scalinfo.h has been included.

#define OSKI_SCALIND (   macro_tag,
  conc_typ,
  name,
  tag 
)    { OSKI_SCALIND_##macro_tag, name, tag, sizeof(conc_typ) }

Macro used to define a new scalar index type.

Parameters:
macro_tagSuffix for constant macro defining the type's unique id number.
conc_typCorresponding concrete C type.
nameString name used to identify this type.
tagUnique one character identifier.
Returns:
Defines an initialization record for oski_scalinfo_t type.

NULL (end) record.

Referenced by oski_LookupScalarIndexInfo().

#define OSKI_SCALIND_INT   1

INT -- Equivalent C type: int.

#define OSKI_SCALIND_INT_REC   OSKI_SCALIND(INT, int, "integer", 'i')

INT descriptor.

#define OSKI_SCALIND_LONG   2

LONG -- Equivalent C type: long.

#define OSKI_SCALIND_LONG_REC   OSKI_SCALIND(LONG, long, "long", 'l')

LONG descriptor.

#define OSKI_SCALVAL (   macro_tag,
  conc_typ,
  name,
  tag 
)    { OSKI_SCALVAL_##macro_tag, name, tag, sizeof(conc_typ) }

Macro used to define a new scalar non-zero value type.

Parameters:
macro_tagSuffix for constant macro defining the type's unique id number.
conc_typCorresponding concrete C type.
nameString name used to identify this type.
tagUnique one character identifier.
Returns:
Defines an initialization record for oski_scalinfo_t type.
#define OSKI_SCALVAL_COMPLEX_REC   OSKI_SCALVAL(COMPLEX, complex_t, "complex", 'c')

COMPLEX descriptor.

#define OSKI_SCALVAL_DOUBLE   2

DOUBLE -- Equivalent C type: double.

#define OSKI_SCALVAL_DOUBLE_REC   OSKI_SCALVAL(DOUBLE, double, "double", 'd')

DOUBLE descriptor.

#define OSKI_SCALVAL_DOUBLECOMPLEX_REC   OSKI_SCALVAL(DOUBLECOMPLEX, doublecomplex_t, "double_complex", 'z')

DOUBLECOMPLEX descriptor.

NULL (end) record.

Referenced by oski_LookupScalarValueInfo().

#define OSKI_SCALVAL_SINGLE   1

SINGLE -- Equivalent C type: float.

#define OSKI_SCALVAL_SINGLE_REC   OSKI_SCALVAL(SINGLE, float, "single", 's')

SINGLE descriptor.


Function Documentation

size_t oski_GetNumScalarIndexTypes ( void  )

Returns 1 iff the given scalar type is a complex type.

Returns the number of registered scalar index types.

References INVALID_ID, and oski_GetNumScalarIndexTypes().

Referenced by oski_GetNumScalarIndexTypes().

const char* oski_GetScalarIndexName ( oski_id_t  id)

Lookup the string name of a given scalar integer index type.

Parameters:
[in]idType id.
Returns:
The scalar integer index type name, or "[unknown]".

References tagBebop_scalinfo_t::name, oski_GetScalarIndexName(), and oski_LookupScalarIndexInfo().

Referenced by MakeLuaConvMethodName(), oski_GetScalarIndexName(), and oski_MakeModuleDesc().

Lookup the abbreviated name of a given scalar integer index type.

Parameters:
[in]idType id.
Returns:
The scalar integer index abbreviated name (tag), or NULL on error (e.g., the id could not be found).

References oski_GetScalarIndexTag(), oski_LookupScalarIndexInfo(), and tagBebop_scalinfo_t::tag.

Referenced by oski_GetScalarIndexTag(), and oski_MakeModuleName().

const char* oski_GetScalarValueName ( oski_id_t  id)

Lookup the string name of a given scalar non-zero value type.

Parameters:
[in]idType id.
Returns:
The scalar integer index type name, or "[unknown]".

References tagBebop_scalinfo_t::name, oski_GetScalarValueName(), and oski_LookupScalarValueInfo().

Referenced by MakeLuaConvMethodName(), oski_GetScalarValueName(), and oski_MakeModuleDesc().

Lookup the abbreviated name of a given scalar non-zero value type.

Parameters:
[in]idType id.
Returns:
The scalar integer index abbreviated name (tag), or NULL on error (e.g., the id could not be found).

References oski_GetScalarValueTag(), oski_LookupScalarValueInfo(), and tagBebop_scalinfo_t::tag.

Referenced by oski_GetScalarValueTag(), and oski_MakeModuleName().