d9r7.txt

来自「解具有导数的多元函数的无约束极小值点或具有导数的非线性方程组的近似解」· 文本 代码 · 共 36 行

TXT
36
字号
import java.text.*;
public class d9r7
{
	public static void main (String[] args)
	{
        //program d9r7
        //driver for routine fleg
		int nval = 5;
        double x, dx = 0.2;
        int i, j, npoly = 5;
        double afunc[] = new double[6];
        d9r7F g = new d9r7F();
        DecimalFormat form = new DecimalFormat("0.0000");
		System.out.println("Legendre polynomials");
        System.out.println("  n = 1    n = 2    n = 3    n = 4    n = 5");
        for (i = 1; i <= nval; i++)
		{
            x = i * dx;
            g.fleg(x, afunc, npoly);
            System.out.print(" x = " +  " ");
            System.out.println(x);
            for (j = 1; j <= npoly; j++)
			{
                System.out.print(form.format(afunc[j]) + "   ");
            }
            System.out.println("   routine fleg");
            for (j = 1; j <= npoly; j++)
			{
                System.out.print(form.format(g.plgndr(j - 1, 0, x)) + "   ");
            }
            System.out.println("   routine plgndr");
            System.out.println();
		}
	}
}

⌨️ 快捷键说明

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