# dcgmrhs_init

Initializes the RCI CG solver with MHRS.

## Syntax

dcgmrhs_init(n, x, nrhs, b, method, RCI_request, ipar, dpar, tmp)

## Description

The routine dcgmrhs_init initializes the solver. After initialization all subsequent invocations of the Intel MKL RCI CG with multiple right hand sides (MRHS) routines use the values of all parameters that are returned by dcgmrhs_init. Advanced users may skip this step and set the values to these parameters directly in the corresponding routines.

### Warning

Users can modify the contents of these arrays after they are passed to the solver routine only if they are sure that the values are correct and consistent. Basic check for correctness and consistency can be done by calling the dcgmrhs_check routine, but it does not guarantee that the method will work correctly.

### Note

To use this routine with the name dcg_init, switch on the compiler preprocessor and include the files mkl_solver.h for C/C++, or mkl_solver.f77 for FORTRAN.

## Input Parameters

n

  INTEGER. Contains the size of the problem, and the sizes of arrays x and b.

x

  DOUBLE PRECISION matrix of size n-by-nrhs. Contains the initial approximation to the solution vectors. Normally it is equal to 0 or to b.

nrhs

  INTEGER. This parameter sets the number of right-hand sides.

b

  DOUBLE PRECISION matrix of size `(nrhs, n)`. Contains the right-hand side vectors.

method

  INTEGER. Specifies the method of solution:

  1 - CG with multiple right hand sides; default value

  2 - Block-CG (not supported now).

## Output Parameters

RCI_request

  INTEGER. Informs about result of work of the routine.

ipar

  INTEGER array of size (128+2*nrhs). Refer to the CG Common Parameters.

dpar

  DOUBLE PRECISION array of size (128+2*nrhs). Refer to the CG Common Parameters.

tmp

  DOUBLE PRECISION array of size `(n, 3+nrhs)`. Refer to the CG Common Parameters.

## Return Values

RCI_request= 0

  The routine completes task normally.

RCI_request= -10000

  The routine fails to complete the task.

Parent topic: Iterative Sparse Solvers based on Reverse Communication Interface (RCI ISS)