Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

×îС¶þ³Ë·¨JAVA´úÂë

ÔÚÍøÉÏÕÒµ½µÄ´úÂëÊÇ´íµÄ£¬×Ô¼ºÐ´ÁËÒ»¸ö
×îС¶þ³Ë·¨µÄ´úÂ룬¶þ¸ö¹¹Ôì·½·¨£¬Ò»¸öÊDz»´øȨµÄ£¬Ò»¸öÊÇ´øȨµÄ
/**
* ×îС¶þ³Ë·¨¼ÆËãÀà
*
* @author Administrator
*
*/
public class LeastSquareMethod {
private double[] x;
private double[] y;
private double[] weight;
private int m;
private double[] coefficient;
public LeastSquareMethod(double[] x, double[] y, int m) {
if (x == null || y == null || x.length < 2 || x.length != y.length
|| m < 2)
throw new IllegalArgumentException("ÎÞЧµÄ²ÎÊý");
this.x = x;
this.y = y;
this.m = m;
weight = new double[x.length];
for (int i = 0; i < x.length; i++) {
weight[i] = 1;
}
}
public LeastSquareMethod(double[] x, double[] y, double[] weight, int m) {
if (x == null || y == null || weight == null || x.length < 2
|| x.length != y.length || x.length != weight.length || m < 2)
throw new IllegalArgumentException("ÎÞЧµÄ²ÎÊý");
this.x = x;
this.y = y;
this.m = m;
this.weight = weight;
}
public double[] getCoefficient() {
if (coefficient == null)
compute();
return coefficient;
}
public double fit(double v) {
if (coefficient == null)
compute();
if (coefficient == null)
return 0;
double sum = 0;
for (int i = 0; i < coefficient.length; i++) {
sum += Math.pow(v, i) * coefficient[i];
}
return sum;
}
private void compute() {
if (x == null || y == null || x.length <= 1 || x.length != y.length
|| x.length < m || m < 2)
return;
double[] s = new double[(m - 1) * 2 + 1];
for (int i = 0; i < s.length; i++) {
for (int j = 0; j < x.length; j++)
s[i] += Math.pow(x[j], i) * weight[j];
}
double[] f = new double[m];
for (int i = 0; i < f.length; i++) {
for (int j = 0; j < x.length; j++)
f[i] += Math.pow(x[j], i) * y[j] * weight[j];
}
double[][] a = new double[m][m];
for (int i = 0; i < m; i++) {
for (int j = 0; j < m; j++) {
a[i


Ïà¹ØÎĵµ£º

JAVA ÄÚ²¿ÀàµÄ¼òµ¥×ܽá

¶¨ÒåÔÚÒ»¸öÀàÄÚ²¿µÄÀà½ÐÄÚ²¿À࣬°üº¬ÄÚ²¿ÀàµÄÀà³ÆΪÍⲿÀà¡£ÄÚ²¿Àà¿ÉÒÔÉùÃ÷public¡¢protected¡¢privateµÈ·ÃÎÊÏÞÖÆ£¬¿ÉÒÔÉùÃ÷ΪabstractµÄ¹©ÆäËûÄÚ²¿Àà»òÍⲿÀà¼Ì³ÐÓëÀ©Õ¹£¬»òÕßÉùÃ÷Ϊstatic¡¢finalµÄ£¬Ò²¿ÉÒÔʵÏÖÌض¨µÄ½Ó¿Ú¡£staticµÄÄÚ²¿ÀàÐÐΪÉÏÏóÒ»¸ö¶ÀÁ¢µÄÀ࣬·ÇstaticÔÚÐÐΪÉÏÀàËÆÀàµÄÊôÐÔ»ò·½·¨ÇÒ½ûÖ¹ÉùÃ÷staticµÄ·½· ......

Java Web Service Apache CXF ѧϰ

    ÏîÄ¿ÖÐÓõ½web service£¬ÓÚÊÇÑо¿Á˶þÌ죬ÏÂÃæ¸ù¾ÝÕâ¶þÌìÓõ½µÄ×ܽáһϣ¬µ±È»×î¶àµÄ»¹ÊǸù¾Ýapache cxf¹ÙÍøÎĵµhttp://cxf.apache.org ¿´Îĵµ£¬µ±È»Ò²²»ÊǶ¼¿´£¬Ö»¿´ÁË×Ô¼ºÐèÒªµÄ¡£
»ù´¡ÖªÊ¶Ñ§Ï°—— Hello Demo
    Hello Demo¿ªÊ¼ÁË£¡
µÚÒ»£¬Ð½¨HelloDemo Web ÏîÄ ......

Java»ù´¡Ð¡½á(ÊýÖµÀàÐÍת»»¹æÔò)

Java»ù´¡Ð¡½á(ÊýÖµÀàÐÍת»»¹æÔò)
Ò»¡¡ÊýÖµÀàÐÍת»»¹æÔò
ÊýÖµÐÍÊý¾Ý½øÐÐÔËËãʱ£¬Èç¹û²Ù×÷ÊýµÄÀàÐͲ»Í¬»ò²Ù×÷ÊýµÄÀàÐ;ùµÍÓÚintÐÍ£¬Ôò
»á½øÐÐ×Ô¶¯ÀàÐÍת»»´¦Àí£¬¾ßÌå¹æÔòÈçÏ£º
1)Èç¹ûÁ½¸ö²Ù×÷ÊýÖÐÓÐÒ»¸öÊÇdoubleÐÍ£¬ÔòϵͳÏȽ«ÁíÒ»¸ö²Ù×÷ÊýµÄֵת»»Îªdouble
ÐÍ£¬È»ºóÔÙ½øÐÐÔËË㣬·ñÔò
2)Èç¹ûÁ½¸ö²Ù×÷ÊýÖÐÓÐÒ»¸öÊÇfloat ......

JavaʵÓþ­Ñé×ܽá Swingƪ


Ç°ÑÔ
±¾ÎÄÇ°ÑÔ²¿·ÖΪÎÒµÄһЩ¸ÐÏ룬Èç¹ûÄãÖ»¶Ô±¾ÎĽéÉܵÄJavaʵÓü¼ÇɸÐÐËȤ£¬¿ÉÒÔÌø¹ýÇ°ÑÔÖ±½Ó¿´ÕýÎĵÄÄÚÈÝ¡£
±¾ÎĵÄд×÷¶¯»úÀ´Ô´ÓÚ×î½ü½Ó¸øÈ˼ҰïæдµÄÒ»¸öС³ÌÐò£¬Ö÷ÒªÓÃÓÚ¹ÜÀí·ÖÆÚ¸¶¿îµÄ»õ¿îµÄһϵÁйÜÀí£¬°üÀ¨¹ýÆÚ¿îµÄ¼Í¼£¬¹ýÆÚ¿îÀûÏ¢µÄ¼ÆË㣬ΪÌáÇ°¸¶¿îµÄÓû§ÌṩһЩ·µ¿î½±ÀøµÈµÈ£¬ÕâЩÓë±¾ÎÄÎÞ¹Ø×Ô²»±Øϸ˵¡£ ......

Javaµ÷ÓÃϵͳÃüÁîѧϰ£¨Ò»£©

ºÇºÇ¡£¡£
import java.io.*;
class Exec{
public static void main(String []args)throws IOException{
//LinuxϵͳÃüÁls £­l
String command = "ls -l";
//»ñÈ¡µ±Ç°ÏµÍ³µÄ»·¾³¡£
Runtime rt = Runtime.getRuntime();
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ