⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ocn_s.h

📁 图像处理的压缩算法
💻 H
📖 第 1 页 / 共 5 页
字号:

*/
double		nag_bessel_i1(
		double x, // the argument x of the function.
		NagError *fail = NULL
);

/**	s18ccc
		returns a value of the scaled modified Bessel function exK0(x).
		
Example:
	The following program reads values of the argument x from a file, 
	evaluates the function at each value of x and prints the results.
	
void test_nag_bessel_k0_scaled()
{
	double y;
	double x[] ={0.4, 0.6, 1.4, 2.5, 10.0, 1000.0};		
	printf("   x		  y\n");
	for(int i = 0; i < 6; i++)
	{
		y=nag_bessel_k0_scaled(x[i]);
		printf("%12.3e%12.3e\n", x[i], y);
	}		
}


	The output is following:
	
		x 		y
	
	4.000e-01 1.663e+00
	6.000e-01 1.417e+00
	1.400e+00 9.881e-01
	2.500e+00 7.595e-01
	1.000e+01 3.916e-01
	1.000e+03 3.963e-02
	
Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	6: On entry, x must not be less than or equal to 0.0: x = _value_.  K0 is undefined and the function returns zero.

	successfully call of the nag_bessel_k0_scaled function.

*/
double 	nag_bessel_k0_scaled(
	   double x, // the argument x of the function.
	   NagError *fail = NULL
);

/**	s18cdc
		returns a value of the scaled modified Bessel function exK1(x).
		
Example:
	The following program reads values of the argument x from a file, 
	evaluates the function at each value of x and prints the results.
	
void test_nag_bessel_k1_scaled()
{
	double y;
	double x[] ={0.4, 0.6, 1.4, 2.5, 10.0, 1000.0};		
	printf("   x		  y\n");
	for(int i = 0; i < 6; i++)
	{
		y=nag_bessel_k1_scaled(x[i]);
		printf("%12.3e%12.3e\n", x[i], y);
	}		
}


	The output is following:
	
		x 		y
		
	4.000e-01 3.259e+00
	6.000e-01 2.374e+00
	1.400e+00 1.301e+00
	2.500e+00 9.002e-01
	1.000e+01 4.108e-01
	1.000e+03 3.965e-02

Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	6: On entry, x must not be less than or equal to 0.0: x = _value_.  K1 is undefined and the function returns zero.
	692: On entry, x must be greater than _value_ : x = _value_.  The function returns the value of the function at the smallest permitted value of the argument.

	successfully call of the nag_bessel_k1_scaled.
	
*/
double	 nag_bessel_k1_scaled(
		double x, // the argument x of the function.
		NagError *fail = NULL
);

/**	s18cec
		returns a value of the scaled modified Bessel function e-|x|I0(x).
		
Example:
	The following program reads values of the argument x from a file, 
	evaluates the function at each value of x and prints the results.
	
void test_nag_bessel_i0_scaled()
{
	double y;
	double x[] ={0.0, 0.5, 1.0, 3.0, 6.0, 10.0, 1000.0, -1.0};		
	printf("   x		  y\n");
	for(int i = 0; i < 8; i++)
	{
		y=nag_bessel_i0_scaled(x[i]);
		printf("%12.3e%12.3e\n", x[i], y);
	}	
}


	The output is following:
	
		x 			y
		
	0.000e+00 	1.000e+00
	5.000e-01 	6.450e-01
	1.000e+00 	4.658e-01
	3.000e+00 	2.430e-01
	6.000e+00 	1.667e-01
	1.000e+01 	1.278e-01
	1.000e+03 	1.262e-02
	-1.000e+00 	4.658e-01

Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	successfully call of the nag_bessel_i0_scaled.

*/
double		nag_bessel_i0_scaled(
		double x // the argument x of the function.
);

/**	s18cfc
		returns a value of the scaled modified Bessel function e-|x|I1(x).
		
Example:
	The following program reads values of the argument x from a file, 
	evaluates the function at each value of x and prints the results.
	
void test_nag_bessel_i1_scaled()
{
	double y;
	double x[] ={0.0, 0.5, 1.0, 3.0, 6.0, 10.0, 1000.0, -1.0};		
	printf("   x		  y\n");
	for(int i = 0; i < 8; i++)
	{
		y=nag_bessel_i1_scaled(x[i]);
		printf("%12.3e%12.3e\n", x[i], y);
	}	
}


	The output is following:
	
		x			y
		
	0.000e+00 	1.000e+00
	5.000e-01 	1.564e-01
	1.000e+00 	2.079e-01
	3.000e+00 	1.968e-01
	6.000e+00 	1.521e-01
	1.000e+01 	1.213e-01
	1.000e+03 	1.261e-02
	-1.000e+00 	-2.079e-01

Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	successfully call of the nag_bessel_i1_scaled function.

*/

double 	nag_bessel_i1_scaled(
	   double x // the argument x of the function.
);

/**	s18ecc
		returns the value of the scaled modified Bessel function (e^-x)I_nu/4(x).

Example:
	The example program reads values of the arguments x and v from a file, 
	evaluates the function and prints the results
	
void test_nag_bessel_i_nu_scaled()
{
	double x[] = {3.9, 1.4, 8.2, 6.7, 0.5, 2.3};
	int nu[] = {-3, -2, -1, 1, 2, 3};
	printf("   x	   nu	 y\n");
	for(int i = 0; i < 6; i++)
	{
		double y = nag_bessel_i_nu_scaled(x[i], nu[i]);
		printf("%4.1f %6ld %12.4e\n", x[i], nu[i],  y);
	}	
}


	The output is following:
	
	x		nu			y
	
	3.9		-3		1.9272e-01
	1.4		-2		3.5767e-01
	8.2		-1		1.4103e-01
	6.7		 1		1.5649e-01
	0.5		 2		3.5664e-01
	2.3		 3		2.3748e-01


Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	118: On entry, x = <value>, nu = <value>.  Constraint: x > 0.0 when nu < 0.  On entry, x = <value>, nu = <value>.  Constraint: x >= 0 when nu > 0 .
	90: On entry, nu = <value>.  Constraint: 1<= abs(nu) <=3.
	695: The evaluation has been abandoned due to the likelihood of overflow.  The result is returned as zero.
	696: The evaluation has been completed but some precision has been lost.
	697: The evaluation has been abandoned due to total loss of precision.  The result is returned as zero.
	698: The evaluation has been abandoned due to failure to satisfy the termination condition.  The result is returned as zero.
	74: An internal error has occured in this function.  Check the function call and any array sizes.  If the call is correct then please consult NAG for assistance.
	
	successfully call of the nag_bessel_i_nu_scaled function.			


*/

double		nag_bessel_i_nu_scaled(
		double x, // the argument x of the function.
		int nu,  // the argument nu of the function.
		NagError *fail = NULL
);

/**	s18edc
		returns the value of the scaled modified Bessel function (e^x)K_nu/4(x) for real x > 0.

Example:
	The example program reads values of the arguments x and v from a file, 
	evaluates the function and prints the results.
	 
void test_nag_bessel_k_nu_scaled()
{
	double x[] = {3.9, 1.4, 8.2, 6.7, 0.5, 2.3};
	int nu[] = {-3, -2, -1, 1, 2, 3};
	printf("   x	   nu	 y\n");
	for(int i = 0; i < 6; i++)
	{
		double y = nag_bessel_k_nu_scaled(x[i], nu[i]);
		printf("%4.1f %6ld %12.4e\n", x[i], nu[i],  y);
	}	
}


	The output is following:
	
	x		nu			y
		
	3.9		-3		6.5781e-01
	1.4		-2		1.0592e+00
	8.2		-1		4.3297e-01
	6.7		 1		4.7791e-01
	0.5		 2		1.7725e+00
	2.3		 3		8.7497e-01


Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	96: On entry, nu = <value>.  Constraint: 1 <= abs(nu) <= 3.
	90: On entry, nu = <value>.  Constraint: 1<= abs(nu) <=3.
	695: The evaluation has been abandoned due to the likelihood of overflow.  The result is returned as zero.
	696: The evaluation has been completed but some precision has been lost.
	697: The evaluation has been abandoned due to total loss of precision.  The result is returned as zero.
	698: The evaluation has been abandoned due to failure to satisfy the termination condition.  The result is returned as zero.
	74: An internal error has occured in this function.  Check the function call and any array sizes.  If the call is correct then please consult NAG for assistance.
		
	successfully call of the nag_bessel_k_nu_scaled function.
*/

double		nag_bessel_k_nu_scaled(
		double x, // the argument x of the function.
		int nu,  // the argument nu of the function.
		NagError *fail = NULL
);

/**	s18eec
		returns the value of the modified Bessel function I_nu/4(x) for real x > 0.

Example:
	The example program reads values of the arguments x and v from a file, 
	evaluats the function and prints the results.
	
void test_nag_bessel_i_nu()
{
	double x[] = {3.9, 1.4, 8.2, 6.7, 0.5, 2.3};
	int nu[] = {-3, -2, -1, 1, 2, 3};
	printf("   x	   nu	 y\n");
	for(int i = 0; i < 6; i++)
	{
		double y = nag_bessel_i_nu(x[i], nu[i]);
		printf("%4.1f %6ld %12.4e\n", x[i], nu[i],  y);
	}	
}


	The output is following:

	x		nu			y
		
	3.9		-3		9.5207e+00
	1.4		-2		1.4504e+00
	8.2		-1		5.1349e+02
	6.7		 1		1.2714e+02
	0.5		 2		5.8799e-01
	2.3		 3		2.3687e+00	


Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	118: On entry, x = <value>, nu = <value>.  Constraint: x > 0 when nu < 0.  On entry, x = <value>, nu = <value>.  Constraint: 1 <= abs(nu) <= 3.
	90: On entry, nu = <value>.  Constraint: 1<= abs(nu) <=3.
	695: The evaluation has been abandoned due to the likelihood of overflow.  The result is returned as zero.
	696: The evaluation has been completed but some precision has been lost.
	697: The evaluation has been abandoned due to total loss of precision.  The result is returned as zero.
	698: The evaluation has been abandoned due to failure to satisfy the termination condition.  The result is returned as zero.
	74: An internal error has occured in this function.  Check the function call and any array sizes.  If the call is correct then please consult NAG for assistance.
	
	successfully call of the nag_bessel_i_nu function.
	

*/

double 	nag_bessel_i_nu(
		double x, // the argument x of the function.
		int nu,  // the argument nu of the function.
		NagError *fail = NULL
);

/**	s18efc
		returns the value of the modified Bessel function K_nu/4(x) for real x > 0.
	
Example:
	The example program reads values of the arguments x and v from a file, 
	evaluates the function and prints the results.
	
void test_nag_bessel_k_nu()
{
	double x[] = {3.9, 1.4, 8.2, 6.7, 0.5, 2.3};
	int nu[] = {-3, -2, -1, 1, 2, 3};
	printf("   x	   nu	 y\n");
	for(int i = 0; i < 6; i++)
	{
		double y = nag_bessel_k_nu(x[i], nu[i]);
		printf("%4.1f %6ld %12.4e\n", x[i], nu[i],  y);
	}	
}


	The output is following:

	x		nu			y
		
	3.9		-3		1.3315e-02
	1.4		-2		2.6121e-01
	8.2		-1		1.1892e-04
	6.7		 1		5.8826e-04
	0.5		 2		1.0750e+00
	2.3		 3		8.7724e-02	

Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	96: On entry, nu = <value>.  Constraint: 1 <= abs(nu) <= 3.
	90: On entry, nu = <value>.  Constraint: 1<= abs(nu) <=3.
	695: The evaluation has been abandoned due to the likelihood of overflow.  The result is returned as zero.
	696: The evaluation has been completed but some precision has been lost.
	697: The evaluation has been abandoned due to total loss of precision.  The result is returned as zero.
	698: The evaluation has been abandoned due to failure to satisfy the termination condition.  The result is returned as zero.
	74: An internal error has occured in this function.  Check the function call and any array sizes.  If the call is correct then please consult NAG for assistance.
	
	successfully call of the nag_bessel_k_nu function.
	
*/

double 	nag_bessel_k_nu(
	   double x, // the argument x of the function.
	   int nu,  // the argument nu of the function.
	   NagError *fail = NULL
);

/**	s18egc
		returns a sequence of values for the modified Bessel functions K_alpha+n(x) 
		for real x > 0, selected values of apha >= 0 and n = 0, 1, 2, ..., N.

Example:
	The example program evaluates k0(x), k1(x), k2(x) and k3(x) 
	at x = 0.5 and prints the results.

void test_nag_bessel_k_alpha()
{
	double b[101];
	double x = 0.5;
	int ia = 0;
	int ja = 1;
	int nl = 3;
	printf("x = %4.1f ia = %6ld ja = %6ld nl = %6ld\n\n",x, ia, ja, nl);
	int success;
	nag_bessel_k_alpha(x, ia, ja, nl, b);
	if(success == 0)
	{
		printf("Requested values of K_alpha(X)\n\n");
		double alpha = 1.0 * ia / ja;
		printf("	alpha		K_alpha(X)\n");
		for(int i = 0; i <= nl; i++, alpha+=1.0)
			printf("%12.4e %12.4e \n",alpha, b[i]);
	}
	else 
		printf("nag_bessel_k_alpha has some problem");
}

	The output is following:
	
	x		ia		ja		nl
	
	0.5		0		1		3
	
	Requested values of K_alpha(x)
	
	alpha			K_alpha(x)
	
	0.0000e+00		9.2552e-01
	1.0000e+00		1.6554e+00
	2.0000e+00		7.5502e+00
	3.0000e+00		6.2058e+01
	

Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	96: On entry, nu = <value>.  Constraint: 1 <= abs(nu) <= 3.
	90: On entry, nl = <value>.  Constraint: 0<= abs(nl) <= 100.
	91: On entry, ia = <value>, ja = <value>.  Constraint: ia and ja must constitue a valid pair (ia, ja).
	695: The evaluation has been abandoned due to the likelihood of overflow.  
	696: The evaluation has been completed but some precision has been lost.
	697: The evaluation has been abandoned due to total loss of precision.  .
	698: The evaluation has been abandoned due to failure to satisfy the termination condition.  
	74: An internal error has occured in this function.  Check the function call and any array sizes.  If the call is correct then please consult NAG for assistance.
	
	successfully call of the nag_bessel_k_alpha function.


*/

int 	nag_bessel_k_alpha(
	double x, // the argument x of the function.
	int ia, 
	int ja, // the numerator i and denominator j, respectively, of the order alpha = i/j of the first member in the rquered sequence of function values.  Only the following combinations of pairs of values of i and j are allowed: (ia,ja) = (0,1), (1,2), (1,3), (1,4), (2,3) or (3,4).
	int nl, // the value of N.  Note that the order of the last member in the required sequence of function values is given by alpha + N.
	double b[] // with fail.code = NE_NOERROR or fail.code = NW_SOME_PRECISION_LOSS, the required sequence of function values: b(n) contains K_alpha+n(x) n = 0, 1, ..., N.

);

/**	s18ehc
		eturns a sequence of values for the modified Bessel functions (e^x)K_alpha+n(x) 
		for real x > 0, selected values of apha >= 0 and n = 0, 1, 2, ..., N.


Example:
	The example program evaluates e^xk0(x), e^xk1(x),e^xk2(x) and e^xk3(x) 
	at x = 0.5 and prints the results.

void test_nag_bessel_kalpha_scaled()
{
	double b[101];
	double x = 0.5;
	int ia = 0;
	int ja = 1;
	int nl = 3;
	printf("x = %4.1f ia = %6ld ja = %6ld nl = %6ld\n\n",x, ia, ja, nl);
	int success;
	success = nag_bessel_kalpha_scaled(x, ia, ja, nl, b);
	if(success == 0)
	{
		printf("Requested values of K_alpha(X)\n\n");
		double alpha = 1.0 * ia / ja;
		printf("	alpha		K_alpha(X)\n");
		for(int i = 0; i <= nl; i++, alpha+=1.0)
			printf("%12.4e %12.4e \n",alpha, b[i]);
	}
	else 
		printf("nag_bessel_k_alpha has some problem");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -