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

📄 ocn_s.h

📁 图像处理的压缩算法
💻 H
📖 第 1 页 / 共 5 页
字号:
{
	double y;
	double x[] ={0.0, 0.5, 1.0, 3.0, 6.0, 8.0, 10.0, -1.0, 1000.0}
	printf("   x		  y\n");
	for(int i = 0; i < 9; i++)
	{
		y= nag_bessel_j1(x[i]);
		printf("%12.3e%12.3e\n", x[i], y);
	}
}




	The output is following:
	
		x 			y
		
	0.000e+00 	0.000e+00
	5.000e-01 	2.423e-01
	1.000e+00 	4.401e-01
	3.000e+00 	3.391e-01
	6.000e+00  -2.767e-01
	8.000e+00	2.346e-01
	1.000e+01 	4.347e-02
	-1.000e+00 -4.401e-01
	1.000e+03 	4.728e-03
	
Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	7: On entry, x must not be greater than _value_: x = _value_.  x is too large. The function returns the amplitude of the J1 oscillation, _2/p|x|.

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

/**	s17agc
		returns a value for the Airy function Ai(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_airy_ai()
{
	double y;
	double x[] ={-10.0, -1.0, 0.0, 1.0, 5.0, 10.0, 20.0};
	
	printf("   x		  y\n");
	for(int i = 0; i < 7; i++)
	{
		y= nag_airy_ai(x[i]);
		printf("%12.3e%12.3e\n", x[i], y);
	}	
}



	The output is following:
	
		x 				y
		
	-1.000e+01 		4.024e-02
	-1.000e+00 		5.356e-01
	 0.000e+00 		3.550e-01
	 1.000e+00 		1.353e-01
	 5.000e+00 		1.083e-04
	 1.000e+01 		1.105e-10
	 2.000e+01 	  	1.692e-27
	 
Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	7: On entry, x must not be greater than _value_: x = _value_.  x is too large and positive. The function returns zero.
	5: On entry, x must not be less than _value_: x = _value_.  x is too large and negative. The function returns zero.
		
	successfully call of the nag_airy_bi function.

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

/**	s17ahc
		returns a value of the Airy function Bi(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_airy_bi()
{
	double y;
	double x[] ={-10.0, -1.0, 0.0, 1.0, 5.0, 10.0, 20.0};
	
	printf("   x		  y\n");
	for(int i = 0; i < 7; i++)
	{
		y= nag_airy_bi(x[i]);
		printf("%12.3e%12.3e\n", x[i], y);
	}	
}




	The output is following:
	
		x 			y
	
	-1.000e+01 	-3.147e-01
	-1.000e+00 	 1.040e-01
	 0.000e+00   6.149e-01
	 1.000e+00 	 1.207e+00
	 5.000e+00 	 6.578e+02
	 1.000e+01 	 4.556e+08
	 2.000e+01 	 2.104e+25
	 
Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	7: On entry, x must not be greater than _value_: x = _value_.  x is too large and positive. The function returns zero.
	5: On entry, x must not be less than _value_: x = _value_.  x is too large and negative. The function returns zero.

	successfully call of the nag_airy_bi function.

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

/**	s17ajc
		returns a value of the derivative of the Airy function Ai(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_airy_ai_deriv()
{	
	double y;
	double x[] ={-10.0, -1.0, 0.0, 1.0, 5.0, 10.0, 20.0};
		
	printf("   x		  y\n");
	for(int i = 0; i < 7; i++)
	{
		y= nag_airy_ai_deriv(x[i]);
		printf("%12.3e%12.3e\n", x[i], y);
	}	
}


	The output is following:
	
		x 			y
		
	-1.000e+01 	 9.963e-01
	-1.000e+00 	-1.016e-02
	 0.000e+00 	-2.588e-01
	 1.000e+00 	-1.591e-01
	 5.000e+00 	-2.474e-04
	 1.000e+01 	-3.521e-10
	 2.000e+01 	-7.586e-27
	 
Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	7: On entry, x must not be greater than _value_: x = _value_.  x is too large and positive. The function returns zero.
	5: On entry, x must not be less than _value_: x = _value_.  x is too large and negative. The function returns zero.
	
	successfully call of the nag_airy_ai_deriv function.

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

/**	s17akc
		returns a value of the derivative of the Airy function Bi(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_bi_deriv()
{
	double y;
	double x[] ={-10.0, -1.0, 0.0, 1.0, 5.0, 10.0, 20.0};
		
	printf("   x		  y\n");
	for(int i = 0; i < 7; i++)
	{
		y= nag_airy_bi_deriv(x[i]);
		printf("%12.3e%12.3e\n", x[i], y);
	}		
}



	The output is following:
	
		x 			y
	
	-1.000e+01 	1.194e-01
	-1.000e+00 	5.924e-01
	 0.000e+00  4.483e-01
	 1.000e+00  9.324e-01
	 5.000e+00  1.436e+03
	 1.000e+01  1.429e+09
	 2.000e+01  9.382e+25
	 
Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	7: On entry, x must not be greater than _value_: x = _value_.  x is too large and positive. The function returns zero.
	5: On entry, x must not be less than _value_: x = _value_.  x is too large and negative. The function returns zero.

	successfully call of the nag_airy_bi_deriv function.

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

/**	s17alc
		determines the leading N zeros of one of the Bessel functions Ja(x), 
		Ya(x), J'a(x), Y'a(x) for real x and non-nagative a (alpha).

Example:

	to determine the leading five positive zeros of the Bessel function j0(x)

void test_nag_bessel_zeros()
{

	double a = 0.0;
	int n = 5;
	int mode = 1;
	double rel = 1.1e-8;
	double x[100];
	nag_bessel_zeros(a, n, mode, rel, x);
	printf(" a,       n,   mode,      rel\n");
	printf("                     (machine-dependent)\n");
	printf("%4.1f   %3ld %6ld        %9.1e\n\n", a, n, mode, rel);

	if(mode == 1)
		printf("Leading N positive zeros of J\n");
	if(mode == 2)
		printf("Leading N positive zeros of Y \n");
	if(mode == 3)
	{
		if(a == 0)
			printf("Leading N non_negative zeros of J'\n");
		else 
			printf("Leading N positive zeros of J'\n");
	}
	if(mode == 4)
		printf("Leading N positive zeros of Y'\n\n");
	
	for(int i = 0; i <= n - 1; i++)
		printf("x = %12.4e\n", x[i]);
	printf("\n");		

}	



	The output is following:
	
	a 		n		mode			rel
								(machine-dependent)
	0.0		5		1				1.1e-08
	
	Leading N positive zeros of J
	
	x = 2.4048 e+00
	x = 5.5201e+00
	x = 8.6537e+00
	x = 1.1792e+01
	x = 1.4931e+01			

Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	90: On entry, n = <value>.  Constraint: n >= 1.  On entry, mode = <value>.  Constraint: 1<= mode <= 4.
	96: On entry, a = <value>.  Constraint: 0.0 <= a <= 100000.0.  On entry, rel = <value>.  Constraint: rel > 0.0
	74: An internal error has occurred 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_zeros function.
							
*/
int 	nag_bessel_zeros(
	double a, // the order alpha of fuction.
	int n, 	  // the number n of zeros required.
	int mode, // specifies the form of the function whose zeros are required. 
	double rel, // the relative accuracy to which the zeros are required.
	double x[], // the n required zeros of the function specified by mode.
	NagError *fail = NULL
);

/**	s18acc
		returns the value of the modified Bessel function K0(x).

Example:
	The following program reads values of the argument x from a .le, evaluates the function at each
	value of x and prints the results.

void test_nag_bessel_k0()
{
	double y;
	double x[] ={0.4, 0.6, 1.4, 1.6, 2.5, 3.5, 6.0, 8.0, 10.0, 1000.0};		
	printf("   x		  y\n");
	for(int i = 0; i < 10; i++)
	{
		y=nag_bessel_k0(x[i]);
		printf("%12.3e%12.3e\n", x[i], y);
	}	
}


	The output is following:
	
		x 			y
		
	4.000e-01 	1.115e+00
	6.000e-01 	7.775e-01
	1.400e+00 	2.437e-01
	1.600e+00 	1.880e-01
	2.500e+00 	6.235e-02
	3.500e+00 	1.960e-02
	6.000e+00 	1.244e-03
	8.000e+00 	1.465e-04
	1.000e+01 	1.778e-05
	1.000e+03 	0.000e+00
	
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 function.


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

/**	s18adc
		returns the value of the modified Bessel function, K1(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()
{
	double y;
	double x[] ={0.4, 0.6, 1.4, 1.6, 2.5, 3.5, 6.0, 8.0, 10.0, 1000.0};		
	printf("   x		  y\n");
	for(int i = 0; i < 10; i++)
	{
		y=nag_bessel_k1(x[i]);
		printf("%12.3e%12.3e\n", x[i], y);
	}	
}

	The output is following:
	
		x 			y
		
	4.000e-01 	2.184e+00
	6.000e-01 	1.303e+00
	1.400e+00 	3.208e-01
	1.600e+00 	2.406e-01
	2.500e+00 	7.389e-02
	3.500e+00 	2.224e-02
	6.000e+00 	1.344e-03
	8.000e+00 	1.554e-04
	1.000e+01 	1.865e-05
	1.000e+03 	0.000e+00

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.
	692: On entry, x must be greater than _value_: x = _value_.  x is too small, there is a danger of over.ow and the function returns approximately the largest representable value.
	
	successfully call of the the nag_bessel_k1 function.
*/
double		nag_bessel_k1(
		double x, // the argument x of the function.
		NagError *fail = NULL
);

/**	s18aec
		returns the value of the modified Bessel function 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()
{
	double y;
	double x[] ={0.0, 0.5, 1.0, 3.0, 6.0, 8.0, 10.0, 15.0, 20.0, -1.0};		
	printf("   x		  y\n");
	for(int i = 0; i < 10; i++)
	{
		y=nag_bessel_i0(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.063e+00
	1.000e+00 	1.266e+00
	3.000e+00 	4.881e+00
	6.000e+00 	6.723e+01
	8.000e+00 	4.276e+02
	1.000e+01 	2.816e+03
	1.500e+01 	3.396e+05
	2.000e+01 	4.356e+07
	-1.000e+00 	1.266e+00
	
Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	7: On entry, |x| must not be greater than _value_: x = _value_.  |x| is too large and the function returns the approximate value of I0(x) at the nearest valid argument.
		
	successfully call of the nag_bessel_i1 function.

*/

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

/** s18afc
		returns a value for the modified Bessel function 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()
{
	double y;
	double x[] ={0.0, 0.5, 1.0, 3.0, 6.0, 8.0, 10.0, 15.0, 20.0, -1.0};		
	printf("   x		  y\n");
	for(int i = 0; i < 10; i++)
	{
		y=nag_bessel_i1(x[i]);
		printf("%12.3e%12.3e\n", x[i], y);
	}		
}


	The output is following:
	
		x 			y
		
	0.000e+00 	0.000e+00
	5.000e-01 	2.579e-01
	1.000e+00 	5.652e-01
	3.000e+00 	3.953e+00
	6.000e+00 	6.134e+01
	8.000e+00 	3.999e+02
	1.000e+01 	2.671e+03
	1.500e+01 	3.281e+05
	2.000e+01 	4.245e+07
	-1.000e+00 -5.652e-01

Parameters:

Return:
	This function returns NAG error code, 0 if no error.
	
	7: On entry, |x| must not be greater than _value_: x = _value_.  |x| is too large and the function returns the approximate value of I0(x) at the nearest valid argument.
	
	successfully call of the nag_bessel_i1 function.

⌨️ 快捷键说明

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