slepc-3.18.2 2023-01-26
Report Typos and Errors

# DSNEPSetComputeMatrixFunction

Sets a user-provided subroutine to compute the matrices T(lambda) or T'(lambda).

### Synopsis

    #include "slepcds.h"
    PetscErrorCode DSNEPSetComputeMatrixFunction(DS ds,PetscErrorCode (*fun)(DS,PetscScalar,PetscBool,DSMatType,void*),void *ctx)

Logically Collective on ds

### Input Parameters

| ds | - the direct solver context
| fun | - a pointer to the user function
| ctx | - a context pointer (the last parameter to the user function)

### Calling Sequence of fun

      fun(DS ds,PetscScalar lambda,PetscBool deriv,DSMatType mat,void *ctx)

| ds | - the direct solver object
| lambda | - point where T(lambda) or T'(lambda) must be evaluated
| deriv | - if true compute T'(lambda), otherwise compute T(lambda)
| mat | - the DS matrix where the result must be stored
| ctx | - optional context, as set by DSNEPSetComputeMatrixFunction()

### Note

The result is computed as T(lambda) = sum_i E_i*f_i(lambda), and similarly for the derivative.

### See Also

DSNEPGetComputeMatrixFunction()

### Level

developer

### Location

src/sys/classes/ds/impls/nep/dsnep.c
Index of all DS routines
Table of Contents for all manual pages
Index of all manual pages