FNRationalSetNumerator — SLEPc 3.24.3 documentation

Skip to main content
`Ctrl`+`K`

# FNRationalSetNumerator

Sets the parameters defining the numerator of the rational function.

## Synopsis

    #include "slepcfn.h"
    PetscErrorCode FNRationalSetNumerator(FN fn,PetscInt np,PetscScalar pcoeff[])

Logically Collective

## Input Parameters

- fn - the math function context

- np - number of coefficients

- pcoeff - coefficients (array of scalar values)

## Notes

Let the rational function be \(f(x) = p(x)/q(x)\), where \(p(x)\) and \(q(x)\) are polynomials. This function provides the coefficients of the numerator \(p(x)\). Hence, \(p(x)\) is of degree `np-1`. If `np` is zero, or this function is not called, then the numerator is assumed to be \(p(x)=1\).

In polynomials, high order coefficients are stored in the first positions of the array, e.g., to represent \(x^2-3\) use `{1,0,-3}`.

## See Also

FN: Mathematical Functions, `FNRATIONAL`, `FNRationalSetDenominator()`, `FNRationalGetNumerator()`

## Level

intermediate

## Location

src/sys/classes/fn/impls/rational/fnrational.c

## Examples

src/nep/tutorials/ex27f.F90
src/nep/tutorials/ex22.c
src/mfn/tutorials/ex39.c
src/nep/tutorials/ex27.c
src/nep/tutorials/ex42.c
src/nep/tutorials/ex22f.F90

## Implementations

FNRationalSetNumerator_Rational() in src/sys/classes/fn/impls/rational/fnrational.c

Index of all FN routines Table of Contents for all manual pages Index of all manual pages