---
name: "lqr_carver_set_gradient_function"
section: "3"
platform: "linux"
package: "liblqr-1-0-dev"
version: "0.4.1-2"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/lqr_carver_set_gradient_function"
---

# lqr\_carver\_set\_gradient\_function(3)

set the gradient function for an LqrCarver object

## NAME

lqr\_carver\_set\_gradient\_function - set the gradient function for an LqrCarver object

## SYNOPSIS

```
#include <lqr.h>
```

**void lqr\_carver\_set\_gradient\_function(LqrCarver\*** *carver***, LqrGradFuncType** *gf\_ind***);**

## DESCRIPTION

The function **lqr\_carver\_set\_gradient\_function** is deprecated and should not be used in newly written code. The function **lqr\_carver\_set\_energy\_function\_builtin**(3) should be used instead.

The function **lqr\_carver\_set\_gradient\_function** is still maintained for backwards compatibility reasons; its result is equivalent to calling **lqr\_carver\_set\_energy\_function\_builtin**, with the following mapping between the argument *gs\_ind* of the former and the argument *ef\_ind* of the latter:

| | |
| --- | --- |
| **LqrGradFuncType** | **LqrEnergyFuncBuiltinType** |
| LQR\_GF\_XABS | LQR\_EF\_GRAD\_XABS |
| LQR\_GF\_SUMABS | LQR\_EF\_GRAD\_SUMABS |
| LQR\_GF\_NORM | LQR\_EF\_GRAD\_NORM |
| LQR\_GF\_NULL | LQR\_EF\_NULL |

## SEE ALSO

**lqr\_carver\_set\_energy\_function\_builtin**(3), **lqr\_carver\_set\_energy\_function**(3)

## COPYRIGHT

Copyright © 2007-2009 Carlo Baldassi\
