Muller
sample Muller's potential
Defines | Variables
potential.c File Reference

Muller's potential function. More...

#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <math.h>
#include <assert.h>
#include <jwsc/base/error.h>
#include <jwsc/matrix/matrix.h>
#include "potential.h"

Go to the source code of this file.

Defines

#define ERR_BUF_LEN   256

Functions

mullers_potential

Computes Muller's potential.

Errormullers_potential_f (float *V_out, float x, float y)
 Calculates Muller's potential with single precision.
Errormullers_potential_d (double *V_out, double x, double y)
 Calculates Muller's potential with double precision.
grad_mullers_potential

Calculates the gradient of Muller's potential.

Errorgrad_mullers_potential_f (float *dx_V_out, float *dy_V_out, float x, float y)
 Calculates the gradient of Muller's potential with single precision.
Errorgrad_mullers_potential_d (double *dx_V_out, double *dy_V_out, double x, double y)
 Calculates the gradient of Muller's potential with double precision.
grad_matrix_mullers_potential

Calculates the gradient matrix of Muller's potential.

Errorgrad_matrix_mullers_potential_d (Matrix_d **gg_out, double x, double y)
 Calculates the gradient matrix of Muller's potential.
hessian_mullers_potential

Calculates the Hessian matrix of Muller's potential.

Errorhessian_mullers_potential_f (Matrix_f **H_V_out, float x, float y)
 Calculates the Hessian matrix of Muller's potential with single precision.
Errorhessian_mullers_potential_d (Matrix_d **H_V_out, double x, double y)
 Calculates the Hessian matrix of Muller's potential with single precision.

Variables

static const float A [4] = {-200.0f, -100.0f, -170.0f, 15.0f}
 Constant A in Muller's potential function.
static const float a [4] = {-1.0f, -1.0f, -6.5f, 0.7f}
 Constant a in Muller's potential function.
static const float b [4] = {0.0f, 0.0f, 11.0f, 0.6f}
 Constant b in Muller's potential function.
static const float c [4] = {-10.0f, -10.0f, -6.5f, 0.7f}
 Constant c in Muller's potential function.
static const float X [4] = {1.0f, 0.0f, -0.5f, -1.0f}
 Constant X in Muller's potential function.
static const float Y [4] = {0.0f, 0.5f, 1.5f, 1.0f}
 Constant Y in Muller's potential function.
static char err_buf [ERR_BUF_LEN] = {0}
 Error buffer.

Detailed Description

Muller's potential function.

Author:
Joseph Schlecht
License:
Creative Commons BY-NC-SA 3.0

Definition in file potential.c.


Define Documentation

#define ERR_BUF_LEN   256

Definition at line 60 of file potential.c.


Function Documentation

Error* mullers_potential_f ( float *  V_out,
float  x,
float  y 
)

Calculates Muller's potential with single precision.

Parameters:
V_outResult parameter. Muller's potential evaluated at x,y.
xInput to evaluate Muller's potential at.
yInput to evaluate Muller's potential at.
Returns:
On success, NULL is returned. On error, an Error is returned.
  • Error_types::ERROR_INV_RESULT Precision error.

Definition at line 106 of file potential.c.

Error* mullers_potential_d ( double *  V_out,
double  x,
double  y 
)

Calculates Muller's potential with double precision.

Parameters:
V_outResult parameter. Muller's potential evaluated at x,y.
xInput to evaluate Muller's potential at.
yInput to evaluate Muller's potential at.
Returns:
On success, NULL is returned. On error, an Error is returned.
  • Error_types::ERROR_INV_RESULT Precision error.

Definition at line 144 of file potential.c.

Error* grad_mullers_potential_f ( float *  dx_V_out,
float *  dy_V_out,
float  x,
float  y 
)

Calculates the gradient of Muller's potential with single precision.

Parameters:
dx_V_outResult parameter. Partial derivative of Muller's potential w.r.t. x.
dy_V_outResult parameter. Partial derivative of Muller's potential w.r.t. y.
xInput to evaluate the partial derivative of Muller's potential w.r.t. x at.
yInput to evaluate the partial derivative of Muller's potential w.r.t. y at.
Returns:
On success, NULL is returned. On error, an Error is returned.
  • Error_types::ERROR_INV_RESULT Precision error.

Definition at line 199 of file potential.c.

Error* grad_mullers_potential_d ( double *  dx_V_out,
double *  dy_V_out,
double  x,
double  y 
)

Calculates the gradient of Muller's potential with double precision.

Parameters:
dx_V_outResult parameter. Partial derivative of Muller's potential w.r.t. x.
dy_V_outResult parameter. Partial derivative of Muller's potential w.r.t. y.
xInput to evaluate the partial derivative of Muller's potential w.r.t. x at.
yInput to evaluate the partial derivative of Muller's potential w.r.t. y at.
Returns:
On success, NULL is returned. On error, an Error is returned.
  • Error_types::ERROR_INV_RESULT Precision error.

Definition at line 259 of file potential.c.

Error* grad_matrix_mullers_potential_d ( Matrix_d **  gg_out,
double  x,
double  y 
)

Calculates the gradient matrix of Muller's potential.

Parameters:
gg_outResult parameter. Partial derivatives of Muller's potential in a matrix.
xInput to evaluate the partial derivative of Muller's potential w.r.t. x at.
yInput to evaluate the partial derivative of Muller's potential w.r.t. y at.
Returns:
On success, NULL is returned. On error, an Error is returned.
  • Error_types::ERROR_INV_RESULT Precision error.

Definition at line 333 of file potential.c.

Error* hessian_mullers_potential_f ( Matrix_f **  H_V_out,
float  x,
float  y 
)

Calculates the Hessian matrix of Muller's potential with single precision.

Parameters:
H_V_outResult parameter. Hessian matrix: second order partial derivatives of Muller's potential.
xInput to evaluate the partial derivative of Muller's potential w.r.t. x at.
yInput to evaluate the partial derivative of Muller's potential w.r.t. y at.
Returns:
On success, NULL is returned. On error, an Error is returned.
  • Error_types::ERROR_INV_RESULT Precision error.

Definition at line 393 of file potential.c.

Error* hessian_mullers_potential_d ( Matrix_d **  H_V_out,
double  x,
double  y 
)

Calculates the Hessian matrix of Muller's potential with single precision.

Parameters:
H_V_outResult parameter. Hessian matrix: second order partial derivatives of Muller's potential.
xInput to evaluate the partial derivative of Muller's potential w.r.t. x at.
yInput to evaluate the partial derivative of Muller's potential w.r.t. y at.
Returns:
On success, NULL is returned. On error, an Error is returned.
  • Error_types::ERROR_INV_RESULT Precision error.

Definition at line 473 of file potential.c.


Variable Documentation

const float A[4] = {-200.0f, -100.0f, -170.0f, 15.0f} [static]

Constant A in Muller's potential function.

Definition at line 64 of file potential.c.

const float a[4] = {-1.0f, -1.0f, -6.5f, 0.7f} [static]

Constant a in Muller's potential function.

Definition at line 68 of file potential.c.

const float b[4] = {0.0f, 0.0f, 11.0f, 0.6f} [static]

Constant b in Muller's potential function.

Definition at line 72 of file potential.c.

const float c[4] = {-10.0f, -10.0f, -6.5f, 0.7f} [static]

Constant c in Muller's potential function.

Definition at line 76 of file potential.c.

const float X[4] = {1.0f, 0.0f, -0.5f, -1.0f} [static]

Constant X in Muller's potential function.

Definition at line 80 of file potential.c.

const float Y[4] = {0.0f, 0.5f, 1.5f, 1.0f} [static]

Constant Y in Muller's potential function.

Definition at line 84 of file potential.c.

char err_buf[ERR_BUF_LEN] = {0} [static]

Error buffer.

Definition at line 88 of file potential.c.