アットウィキロゴ

産業連関8

package io25;
 
 
public class pro {
 
  double[] y=new double[100];
 double[][] a=new double[100][100];
 double[][] io=new double[100][100];
    int number;
 
    double[] d=new double[100];
      double[] ys=new double[100];
 
       double[] im=new double[300];
  double[] ex=new double[300];
   double[]inv_p=new double[300];
    double[] inv_g=new double[300];
   double[] c_p=new double[300];
    double[] c_p2=new double[300];
    double[] c_g=new double[300];
    double[] good=new double[300];
     double[] c_g2=new double[300];
 
 
    public static void main(String[] args) {
        pro test=new pro(); 
    }
 
    pro(){
 
 
        number=25;
 
        catchdata sub2=new catchdata();
        sub2.makedata();
        a=sub2.a;
        y=sub2.y;
        c_p=sub2.c_p;
        c_g=sub2.c_g;
        c_p2=sub2.c_p2;
        c_g2=sub2.c_g2;
        inv_p=sub2.inv_p;
        inv_g=sub2.inv_g;
        ex=sub2.ex;
        im=sub2.im;
        good=sub2.good;
        int s;
 
 
 
    for(s=1;s<number+1;s++){   
    d[s]=c_p[s]+inv_p[s]+ex[s]-im[s]+good[s]+inv_g[s]+c_g[s]+c_g2[s]+c_p2[s];
    }
 
 
 
 
    iox sub=new iox();
    sub.number=number;
    sub.a=a;
    sub.y=y;
    sub.d=d;
    sub.makedata();
    ys=sub.ys;
 
    for(s=1;s<number+1;s++){   
    System.out.println(y[s]-ys[s]);
    }
 
 
 
 
 
    }
 
 
 
}
 
 
 
 
 
package io25;
 
import Jama.*; 
 
public class iox{
 
 double[] y=new double[100];
 double[][] a=new double[100][100];
 double[][] io=new double[100][100];
 double[] v=new double[100];
 double[] d=new double[100];
  int number;
     double[] ys=new double[100];
 
 
    void makedata(){
 
 
 
 
 
        int s,sx;
 
        for(s=1;s<number+1;s++){
        for(sx=1;sx<number+1;sx++){    
        io[s][sx]=a[s][sx]/y[sx];
        }}
 
 
 
 
double[][] beta=new double[number][1];
double[][] alpha=new double[number][number];
double[][] ra=new double[500][500];
double[][] i=new double[500][500];
 
 
for(s=0;s<number;s++){
for(sx=0;sx<number;sx++){
i[s][sx]=0;    
}}
 
for(s=0;s<number;s++){
i[s][s]=1;
}
 
for(s=0;s<number;s++){
for(sx=0;sx<number;sx++){
alpha[s][sx]=i[s][sx]-io[s+1][sx+1];
}    
}  
 
  for(s=0;s<number;s++){
  beta[s][0]=d[s+1];
  }
 
Matrix Ma = new Matrix(alpha);
 
Matrix Mb=new Matrix(beta);
 
Matrix x = Ma.solve(Mb);
 
for(s=0;s<number;s++){
ys[s+1]=x.get(s, 0);
}
 
 
 
 
 
 
 
    }
 
 
 
}
 
 
package io25;
 
 
import tool.*;
 
public class catchdata{
 
    double[][] a=new double[300][300];
 
    double[] y=new double[300];
     double[][] beta=new double[300][300];
 
 
 
     double[] im=new double[300];
  double[] ex=new double[300];
   double[]inv_p=new double[300];
    double[] inv_g=new double[300];
   double[] c_p=new double[300];
    double[] c_p2=new double[300];
    double[] c_g=new double[300];
    double[] good=new double[300];
     double[] c_g2=new double[300];
 
 
 
   int number;
   String[] data=new String[50000];
int s,sx,datanumber,tx;
 
  String[] code_index=new String[50000];
String[] code_credit=new String[50000];
String[] index=new String[50000];
String[] credit=new String[50000];
 double[] v=new double[30000];
int number_index,number_credit;
 String[] dic_index=new String[500];
String[] dic_credit=new String[500];
 
String[] name_index=new String[500];
String[] name_credit=new String[500];
 double[] w=new double[300];
double[] de=new double[300];
double[] tax=new double[300];
 double[] r=new double[300];
 
 
    void makedata(){
 
        readfile sub7=new readfile();
    sub7.makedata("ren.txt", "UTF-8");
    data=sub7.data;
    datanumber=sub7.datanumber;
 
    String str;
 
        for(s=1;s<datanumber+1;s++){
 
        catchword sub8=new catchword();
        code_index[s]=sub8.makedata(data[s],"code_index");
        code_credit[s]=sub8.makedata(data[s],"code_credit");
        index[s]=sub8.makedata(data[s],"index");
        credit[s]=sub8.makedata(data[s],"credit");
        str=sub8.makedata(data[s],"value");
        v[s]=Double.parseDouble(str);
        }
 
         for(s=1;s<datanumber+1;s++){
         code_index[s]=code_index[s].replace(" ","");
         code_credit[s]=code_credit[s].replace(" ","");
         }
 
        number_index=0;
        number_credit=0;
        int h;
 
        for(s=1;s<datanumber+1;s++){
       h=0;
       for(sx=1;sx<number_index+1;sx++){
       if(code_index[s].equals(dic_index[sx]))h=100;
        }
       if(h<50)number_index=number_index+1;
       if(h<50)dic_index[number_index]=code_index[s];
       if(h<50)name_index[number_index]=index[s];
        }
 
 
 
 
 
        for(s=1;s<datanumber+1;s++){
       h=0;
       for(sx=1;sx<number_credit+1;sx++){
       if(code_credit[s].equals(dic_credit[sx]))h=100;
       }
       if(h<50)number_credit=number_credit+1;
       if(h<50)dic_credit[number_credit]=code_credit[s];
        if(h<50)name_credit[number_credit]=credit[s];
        }
 
 
 
 
 
 
 
 
 
      for(s=1;s<26;s++){
      for(sx=1;sx<26;sx++){
      for(tx=1;tx<datanumber+1;tx++){
       h=0; 
      if(code_index[tx].equals(dic_index[s]))h=h+1;
      if(code_credit[tx].equals(dic_credit[sx]))h=h+1;
      if(h==2)a[s][sx]=v[tx];
      }}}
 
 
 
      for(s=1;s<26;s++){
      for(tx=1;tx<datanumber+1;tx++){
      h=0; 
      if(code_index[tx].equals(dic_index[32]))h=h+1;
      if(code_credit[tx].equals(dic_credit[s]))h=h+1;
      if(h==2)y[s]=v[tx];
      }}
 
      for(s=1;s<26;s++){
      for(tx=1;tx<datanumber+1;tx++){
      h=0; 
      if(code_index[tx].equals(dic_index[29]))h=h+1;
      if(code_credit[tx].equals(dic_credit[s]))h=h+1;
      if(h==2)w[s]=v[tx];
      }}
 
 
      for(s=1;s<26;s++){
      for(tx=1;tx<datanumber+1;tx++){
      h=0; 
      if(code_index[tx].equals(dic_index[30]))h=h+1;
      if(code_credit[tx].equals(dic_credit[s]))h=h+1;
      if(h==2)r[s]=v[tx];
      }}
 
       for(s=1;s<26;s++){
      for(tx=1;tx<datanumber+1;tx++){
      h=0; 
      if(code_index[tx].equals(dic_index[27]))h=h+1;
      if(code_credit[tx].equals(dic_credit[s]))h=h+1;
      if(h==2)de[s]=v[tx];
      }}
 
 
      for(s=1;s<26;s++){
      for(tx=1;tx<datanumber+1;tx++){
      h=0; 
      if(code_index[tx].equals(dic_index[28]))h=h+1;
      if(code_credit[tx].equals(dic_credit[s]))h=h+1;
      if(h==2)tax[s]=v[tx];
      }}
 
 
 
        for(s=1;s<26;s++){
      for(tx=1;tx<datanumber+1;tx++){
      h=0; 
      if(code_index[tx].equals(dic_index[s]))h=h+1;
      if(code_credit[tx].equals(dic_credit[27]))h=h+1;
      if(h==2)c_g[s]=v[tx];
      }}
 
 
       for(s=1;s<26;s++){
      for(tx=1;tx<datanumber+1;tx++){
      h=0; 
      if(code_index[tx].equals(dic_index[s]))h=h+1;
      if(code_credit[tx].equals(dic_credit[30]))h=h+1;
      if(h==2)c_g2[s]=v[tx];
      }}
 
 
        for(s=1;s<26;s++){
      for(tx=1;tx<datanumber+1;tx++){
      h=0; 
      if(code_index[tx].equals(dic_index[s]))h=h+1;
      if(code_credit[tx].equals(dic_credit[31]))h=h+1;
      if(h==2)good[s]=v[tx];
      }}
 
          for(s=1;s<26;s++){
      for(tx=1;tx<datanumber+1;tx++){
      h=0; 
      if(code_index[tx].equals(dic_index[s]))h=h+1;
      if(code_credit[tx].equals(dic_credit[33]))h=h+1;
      if(h==2)inv_p[s]=v[tx];
      }}
 
 
 
        for(s=1;s<26;s++){
      for(tx=1;tx<datanumber+1;tx++){
      h=0; 
      if(code_index[tx].equals(dic_index[s]))h=h+1;
      if(code_credit[tx].equals(dic_credit[32]))h=h+1;
      if(h==2)inv_g[s]=v[tx];
      }}
 
 
 
 
       for(s=1;s<26;s++){
      for(tx=1;tx<datanumber+1;tx++){
      h=0; 
      if(code_index[tx].equals(dic_index[s]))h=h+1;
      if(code_credit[tx].equals(dic_credit[34]))h=h+1;
      if(h==2)ex[s]=v[tx];
      }}
 
 
 
      for(s=1;s<26;s++){
      for(tx=1;tx<datanumber+1;tx++){
      h=0; 
      if(code_index[tx].equals(dic_index[s]))h=h+1;
      if(code_credit[tx].equals(dic_credit[35]))h=h+1;
      if(h==2)im[s]=-v[tx];
      }}
 
       for(s=1;s<26;s++){
      for(tx=1;tx<datanumber+1;tx++){
      h=0; 
      if(code_index[tx].equals(dic_index[s]))h=h+1;
      if(code_credit[tx].equals(dic_credit[28]))h=h+1;
      if(h==2)c_p[s]=v[tx];
      }}
 
         for(s=1;s<26;s++){
      for(tx=1;tx<datanumber+1;tx++){
      h=0; 
      if(code_index[tx].equals(dic_index[s]))h=h+1;
      if(code_credit[tx].equals(dic_credit[29]))h=h+1;
      if(h==2)c_p2[s]=v[tx];
      }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
    number=25;
 
 
 
 
 
 
}}
 
最終更新:2015年03月17日 03:42