Rate This Document
Findability
Accuracy
Completeness
Readability

KmlAmgSolverCreate

Create an iterative solver handle.

Interface Definition

C interface: KmlAmgStatus KmlAmgSolverCreate(KmlAmgSolverH* solver, const KmlAmgSolverOptions* options);

Parameters

Parameter

Type

Description

Input/Output

solver

KmlAmgSolverH*

Solver handle. handle cannot be a null pointer.

Input/Output

options

const KmlAmgSolverOptions*

Solver configuration.

Input

Return Value

Return Value

Type

Description

KMLAMG_SUCCESS

int

Successful execution.

KMLAMG_ERR_INVALID_PARAM

int

Invalid parameter.

KMLAMG_ERR_UNSUPPORTED

int

Unsupported feature.

KMLAMG_ERR_NULL_POINTER

int

Null pointer

KMLAMG_ERR_NO_REQUIRED_FIELD

int

Required field not set.

KMLAMG_ERR_NO_MEMORY

int

Memory allocation failed.

KMLAMG_ERR_UNKNOWN_TYPE

int

Unknown type.

KMLAMG_ERR_UNEXPECTED_CALL_ORDER

int

Unexpected call order.

KMLAMG_ERR_NO_RESOURCE

int

Resources not ready.

KMLAMG_ERR_INCONSISTENT

int

Inconsistent information transferred in different phases.

KMLAMG_ERR_UNKNOWN_ERROR

int

Unknown error.

Structure Description

The table below describes the KmlAmgSolverOptions structure.

Field

Type

Description

fieldMask

uint64_t

Mask that determines to which fields the configuration is applied. If a bit is set to 1, its corresponding field uses a specified value. If a bit is set to 0, its corresponding field uses the default value. See the individual field description for configurable mask bits.

valueType

KmlAmgValueType

Matrix value type used by the solver. The options are as follows:

  • KMLAMG_VALUE_FP32: float
  • KMLAMG_VALUE_FP64: double

Mask bit: KMLAMG_SOLVER_OPTIONS_VALUE_TYPE

indexType

KmlAmgIndexType

Matrix index type used by the solver. The options are as follows:

  • KMLAMG_INDEX_INT32: int32_t
  • KMLAMG_INDEX_INT64: int64_t (not supported currently)

Mask bit: KMLAMG_SOLVER_OPTIONS_INDEX_TYPE

solverType

KmlAmgSolverType

Algorithm type used by the solver. The options are as follows:

  • KMLAMG_SOLVER_NONE: No iteration method is used.
  • KMLAMG_SOLVER_CG: CG algorithm (default value)
  • KMLAMG_SOLVER_BICGSTAB: Bicgstab algorithm
  • KMLAMG_SOLVER_GMRES: GMRES algorithm

Mask bit: KMLAMG_SOLVER_OPTIONS_TYPE

numThreads

int32_t

Number of threads. The default value is 1.

Mask bit: KMLAMG_SOLVER_OPTIONS_NUM_THREADS

Dependencies

#include "amg4c.h"