楼主: zhukovasky
2768 2

[程序分享] java版本的矩阵计算基础类 [推广有奖]

marshal

教授

61%

还不是VIP/贵宾

-

威望
0
论坛币
551 个
通用积分
5.3790
学术水平
46 点
热心指数
49 点
信用等级
30 点
经验
18744 点
帖子
1113
精华
0
在线时间
1805 小时
注册时间
2008-7-27
最后登录
2022-6-18

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
  1. /**
  2. * java的矩阵类以及相关性质
  3. * */
  4. import java.util.Arrays;

  5. public final class Matrix {
  6.         private int rownums;
  7.         private int colnums;
  8.         private Vector[] vectorArrays=null;
  9. //        private double MatrixElements;
  10.        
  11.         /***
  12.          * basic initialization...
  13.          * */
  14.         public Matrix(){}
  15.         /**
  16.          * initialization....
  17.          * */
  18.         public Matrix(int rownums,int colnums){
  19.                 if(isInit(rownums,colnums)){       
  20.                         this.rownums=rownums;
  21.                         this.colnums=colnums;
  22.                         vectorArrays=new Vector[rownums];
  23.                         init();
  24.                         System.out.println(" Matrix initilized succeed!");
  25.                 }else{
  26.                         try{
  27.                                 throw new Exception("Error,please check this matrix");
  28.                         }catch(Exception e){
  29.                                 e.printStackTrace();
  30.                         }
  31.                 }
  32.         }
  33.        
  34.         /**
  35.          * initializing the value of specified position in this matrix...
  36.          * */
  37.         public double setMatrixValue(int rows,int cols,double MatrixElements){

  38.                 if(isOutofBounds(rows,cols)){
  39.                         try{
  40.                                 throw new Exception("Error,please check the Matrix");
  41.                         }catch(Exception e){
  42.                                 e.printStackTrace();
  43.                         }
  44.                 }
  45.        
  46.                 return        setValue(rows,cols,MatrixElements);
  47.                        
  48.                
  49.         }
  50.         /**
  51.          * get the specified position of the matrix
  52.          * */
  53.         public double getMatrixValue(int rows,int cols){
  54.                 if(isOutofBounds(rows,cols)){
  55.                         try{
  56.                                 throw new Exception("Error,please check the Matrix");
  57.                         }catch(Exception e){
  58.                                 e.printStackTrace();
  59.                         }
  60.                 }
  61.                 return vectorArrays[rows-1].peek(cols-1);
  62.                
  63.         }
  64.         /**
  65.          * construct the Matrix contains the value
  66.          * */
  67.         private double setValue(int rows,int cols,double MatrixElements){       
  68.                 return vectorArrays[rows-1].add(cols-1,MatrixElements);
  69.         }
  70.         /**
  71.          * the default value in each cell of this Matrix is 0;
  72.          * */
  73.         public Vector[] init(){
  74.                 for(int i=1;i<=this.rownums;i++){
  75.                         vectorArrays[i-1]=new Vector(colnums);
  76.                         for(int j=1;j<=this.colnums;j++){
  77.                                 vectorArrays[i-1].add(j-1, 0);
  78.                         }
  79.                 }
  80.                 return vectorArrays ;
  81.         }
  82.         /**
  83.          * toString
  84.          * */
  85.         public String toString(){

  86.                 return Arrays.toString(vectorArrays);
  87.         }

  88.         public boolean isInit(int rows,int cols){
  89.                 if(rows*cols<=0){
  90.                         return false;
  91.                 }else{
  92.                         return true;
  93.                 }
  94.         }
  95.         public boolean isOutofBounds(int rows,int cols){
  96.                 if(rows<=0||rows>this.rownums&&cols<=0||cols>this.colnums){
  97.                         return true;
  98.                 }else{
  99.                         return false;
  100.                 }
  101.                        
  102.         }
  103.        
  104.         /**
  105.          * transpose the matrix
  106.          * */
  107.         public Matrix tranposeMatrix(){
  108.                 int rowsT=colnums;
  109.                 int colsT=rownums;
  110.                 Matrix matrixTranspose=new Matrix(rowsT,colsT);
  111.                 for(int i=1;i<=rowsT;i++){
  112.                         for(int j=1;j<=colsT;j++){
  113.                                 matrixTranspose.setMatrixValue(i, j, getMatrixValue(j,i));
  114.                         }
  115.                 }
  116.                 return matrixTranspose;
  117.         }
  118.         /**
  119.          * the multiple of the matrix
  120.          * */
  121.         public Matrix mutiple(Matrix matrix){
  122.                 int rows=matrix.getRownums();
  123.                 int cols=matrix.getColnums();
  124.                 Matrix matrixA=null;
  125.                 if(this.colnums==rows){
  126. //                        matrixA.setRownums(rownums);
  127. //                        matrixA.setColnums(cols);
  128.                         matrixA=new Matrix(rownums,cols);
  129.                         for(int i=1;i<=rownums;i++){
  130.                                 double d=0;
  131.                                 for(int j=1;j<=colnums;j++){
  132.                                         d+=this.getMatrixValue(i, j)*matrix.getMatrixValue(j, i);
  133.                                 }
  134.                                 for(int j=1;j<=cols;j++){
  135.                                         matrixA.setMatrixValue(i, j, d);
  136.                                 }               
  137.                         }
  138.                 }else{
  139.                         try{
  140.                                 throw new Exception("计算失败,请确认该矩阵是否正确");
  141.                         }catch(Exception e){
  142.                                 e.printStackTrace();
  143.                         }
  144.                 }
  145.                 return matrixA;
  146.         }
  147. //        /**
  148. //         * two matrix multiply
  149. //         * */
  150. //        public Matrix mutiple(Matrix matrixA,Matrix matrixB){
  151. //                Matrix matrix=null;
  152. //                if(isMultiple(matrixA,matrixB)){
  153. //                        matrix=new Matrix(matrixA.getRownums(),matrixB.getColnums());
  154. //                        for(int i=1;i<=matrixA.getRownums();i++){
  155. //                                double d=0;
  156. //                                for(int j=1;j<=matrixA.getColnums();j++){
  157. //                                        d+=matrixA.getMatrixValue(i, j)*matrixB.getMatrixValue(j, i);
  158. //                                }
  159. //                                for(int j=1;j<=matrixB.getColnums();j++){
  160. //                                        matrix.setMatrixValue(i, j, d);
  161. //                                }
  162. //                        }
  163. //                }else{
  164. //                        try{
  165. //                                throw new Exception("计算失败,请确认矩阵是否正确");
  166. //                        }catch(Exception e){
  167. //                                e.printStackTrace();
  168. //                        }
  169. //                }
  170. //                return matrix;
  171. //        }
  172.         /**
  173.          * the matrix equals
  174.          * @param precisions
  175.          * */
  176.         public boolean isEqual(Matrix matrix,double eps){
  177.                 if(this.rownums==matrix.getRownums()&&this.colnums==matrix.getColnums()){
  178.                         for(int i=1;i<=rownums;i++){
  179.                                 for(int j=1;j<=colnums;j++){
  180.                                         if((this.getMatrixValue(i, j)-matrix.getMatrixValue(i, j))<=eps){
  181.                                                 return true;
  182.                                         }else{
  183.                                                 return false;
  184.                                         }
  185.                                 }
  186.                         }
  187.                 }
  188.                 return false;
  189.         }
  190.         /**
  191.          * the plus of matrix
  192.          *
  193.          * */
  194.         public Matrix plusMatrix(Matrix matrix){
  195.                 Matrix matrixSum=new Matrix(this.rownums,this.colnums);
  196.                 if(this.rownums==matrix.rownums&&this.colnums==matrix.colnums){
  197.                         for(int i=1;i<=this.rownums;i++){
  198.                                 for(int j=1;j<this.colnums;j++){
  199.                                         matrixSum.setMatrixValue(i, j, this.getMatrixValue(i, j)+matrix.getMatrixValue(i, j));
  200.                                 }
  201.                         }       
  202.                 }else{
  203.                         try{
  204.                                 throw new Exception("请注意,该矩阵无法相加");
  205.                         }catch(Exception e){
  206.                                 e.printStackTrace();
  207.                         }
  208.                 }
  209.                 return matrixSum;
  210.         }
  211.         public Matrix minusMatrix(Matrix matrix){
  212.                 Matrix matrixminus=new Matrix(this.rownums,this.colnums);
  213.                 if(this.rownums==matrix.rownums&&this.colnums==matrix.colnums){
  214.                         for(int i=1;i<=this.rownums;i++){
  215.                                 for(int j=1;j<this.colnums;j++){
  216.                                         matrixminus.setMatrixValue(i, j, this.getMatrixValue(i, j)-matrix.getMatrixValue(i, j));
  217.                                 }
  218.                         }       
  219.                 }else{
  220.                         try{
  221.                                 throw new Exception("请注意,该矩阵无法相加");
  222.                         }catch(Exception e){
  223.                                 e.printStackTrace();
  224.                         }
  225.                 }
  226.                 return matrixminus;
  227.         }

  228. //        /***
  229. //         * @param eps the precisions
  230. //         * */
  231. //        public boolean isEqual(Matrix matrixA,Matrix matrixB,double eps){
  232. //                if(matrixA.isEqual(matrixB, eps)){
  233. //                        return true;
  234. //                }else{
  235. //                        return false;
  236. //                }
  237. //               
  238. //        }
  239.         /**
  240.          * return the boolean of two matrix,multiply by each matrix
  241.          * */
  242.         private boolean isMultiple(Matrix matrix){
  243.                 int rows=matrix.getRownums();
  244.                 int cols=matrix.getColnums();
  245.                 if(this.colnums==rows){
  246.                         return true;
  247.                 }else{
  248.                         return false;
  249.                 }
  250.         }
  251. //        private boolean isMultiple(Matrix matrixA,Matrix matrixB){
  252. //                if(matrixA.isMultiple(matrixB)){
  253. //                        return true;
  254. //                }else{
  255. //                        return false;
  256. //                }
  257. //        }
  258.         /**
  259.          * multiple the constant
  260.          * */
  261.         public Matrix multipleConstant(double K){
  262.                 for(int i=1;i<=this.rownums;i++){
  263.                         for(int j=1;j<=this.colnums;j++){
  264.                                 double d=this.getMatrixValue(i, j)*K;
  265.                                 this.setMatrixValue(i, j, d);
  266.                         }
  267.                 }
  268.                 return this;
  269.         }
  270.         /**
  271.          * vector mutiple by the constant
  272.          * */
  273.         public Vector mutipleConstantV(double K,int cols){
  274.                 if(cols>colnums||cols<=0){
  275.                         try{
  276.                                 throw new Exception("请确认是否有误");
  277.                         }catch(Exception e){
  278.                                 e.printStackTrace();
  279.                         }
  280.                 }
  281.                 for(int i=1;i<=rownums;i++){
  282.                         this.setMatrixValue(i, cols, K*this.getMatrixValue(i, cols));
  283.                 }
  284.                 return this.getVerticalVector(cols);
  285.         }
  286.         /**
  287.          * vector mutiple by the constant
  288.          * */
  289.         public Vector mutipleConstantH(double K,int rows){
  290.                 if(rows>rownums||rows<=0){
  291.                         try{
  292.                                 throw new Exception("请确认是否有误");
  293.                         }catch(Exception e){
  294.                                 e.printStackTrace();
  295.                         }
  296.                 }
  297.                 for(int i=1;i<=colnums;i++){
  298.                         this.setMatrixValue(rows, i, K*this.getMatrixValue(rows, i));
  299.                 }
  300.                 return this.getHorizontalVector(rows);
  301.         }
  302.         /**
  303.          * get the egenValue of this Matrix
  304.          * how? Gaussian 消元法
  305.          * */
  306.         public double egenValue(){
  307.                 double value=1;
  308.                
  309.                 if(this.rownums==this.colnums){
  310.                         for(int j=1;j<=colnums;j++){
  311.                                 double max=this.getMaxAllRowValue(j);
  312.                                 if(Math.abs(max)!=0){
  313.                                         int rows=this.getMaxValueRow(max, j);
  314.                                         for(int i=1;i<this.getRownums();i++){
  315.                                                 this.SwapMatrixValue(i, j, rows, j);
  316.                                                 Vector vector=this.getHorizontalVector(i+1);
  317.                                                 Vector vectorH=mutipleConstantH((1/max),i);                //归一化
  318.                                                 Vector vectorU=vector.vecMinus(vectorH.vecMutipleConstant(vectorH.peek(j-1)));
  319.                                                 this.setMatrixHVector(i, vectorU);
  320.                                         }
  321.                                 }
  322.                         }
  323.                         for(int i=1;i<=rownums;i++){
  324.                                 value*=this.getMatrixValue(i, i);
  325.                         }

  326.                 }else{
  327.                         try{
  328.                                 throw new Exception("不是行列式,请确认");
  329.                         }catch(Exception e){
  330.                                 e.printStackTrace();
  331.                         }
  332.                 }
  333.                 return value;

  334.         }
  335.         /**
  336.          * return the max of the specified cols given the rows
  337.          *
  338.          * @param cols指定列的所有行的最大值
  339.          * */
  340.        
  341.         public double getMaxAllRowValue(int cols){
  342.                 double max=this.getMatrixValue(1, cols);
  343.                 for(int i=1;i<=this.rownums;i++){
  344.                         if(this.getMatrixValue(i, cols)>max){
  345.                                 max=this.getMatrixValue(i, cols);
  346.                         }
  347.                 }
  348.                
  349.                 return max;
  350.         }
  351.         /**
  352.          * 获取指定列最大值的行值
  353.          * */
  354.         public int getMaxValueRow(double max,int cols){
  355.                 int positions=1;
  356.                 for(int i=1;i<=this.rownums;i++){
  357.                         if(this.getMatrixValue(i, cols)==max){
  358.                                 positions=i;
  359.                                 break;
  360.                         }
  361.                 }
  362.                 return positions;
  363.         }
  364.         /**
  365.          *the following method is to Swap the values of the specified positions
  366.          * */
  367.         public Matrix SwapMatrixValue(int rows1,int cols1,int row2,int cols2){
  368.                 double a=this.getMatrixValue(rows1, cols1);
  369.                 double b=this.getMatrixValue(row2, cols2);
  370.                 this.setMatrixValue(rows1, cols1, b);
  371.                 this.setMatrixValue(row2, cols2, a);
  372.                 return this;
  373.         }
  374.         /**
  375.          * the following method is to get the horizontal vectors;
  376.          * */
  377.         public Vector getHorizontalVector(int rows){
  378.                 Vector vector=new Vector(this.colnums);
  379.                 for(int i=1;i<=vector.length();i++){
  380.                         vector.add(i-1, this.getMatrixValue(rows, i));
  381.                 }
  382.                 return vector;
  383.         }
  384.         public Vector getVerticalVector(int cols){
  385.                 Vector vector=new Vector(this.rownums);
  386.                 for(int i=1;i<=vector.length();i++){
  387.                         vector.add(i-1, this.getMatrixValue(i, cols));
  388.                 }
  389.                 return vector;
  390.         }
  391.         /**
  392.          * 以下设置矩阵列向量
  393.          * */
  394.         public Matrix setMatrixVVector(int cols,Vector vector){
  395.                 if(cols>colnums||vector.length()>rownums){
  396.                         try{
  397.                                 throw new Exception("请确认该向量");
  398.                         }catch(Exception e){
  399.                                 e.printStackTrace();
  400.                         }
  401.                 }
  402.                 for(int i=0;i<vector.length();i++){
  403.                         this.setMatrixValue(i+1, cols, vector.peek(i));
  404.                 }
  405.                 return this;
  406.         }
  407.         /**
  408.          * 以下设置矩阵行向量
  409.          * @param rows 指定行
  410.          * */
  411.         public Matrix setMatrixHVector(int rows,Vector vector){
  412.                 if(rows>rownums||vector.length()>colnums){
  413.                         try{
  414.                                 throw new Exception("请确认该向量");
  415.                         }catch(Exception e){
  416.                                 e.printStackTrace();
  417.                         }
  418.                 }
  419.                 for(int i=0;i<vector.length();i++){
  420.                         this.setMatrixValue(rows, i+1, vector.peek(i));
  421.                 }
  422.                 return this;
  423.         }
  424.         public int getRownums() {
  425.                 return rownums;
  426.         }
  427.         public void setRownums(int rownums) {
  428.                 this.rownums = rownums;
  429.         }
  430.         public int getColnums() {
  431.                 return colnums;
  432.         }
  433.         public void setColnums(int colnums) {
  434.                 this.colnums = colnums;
  435.         }
  436. }
复制代码
以下代码是向量类的代码
  1. import java.util.Arrays;
  2. import java.util.HashMap;
  3. import java.util.Map;

  4. public class Vector {
  5.         private int MaxSize;
  6.         private double[] vectorArray;
  7.         private int cursor;
  8.         public Vector(int MaxSize){
  9.                 this.MaxSize=MaxSize;
  10.                 vectorArray=new double[this.MaxSize];
  11.                 this.cursor=-1;
  12.         }
  13.         public double[] add(double s){
  14.                 vectorArray[++cursor]=s;
  15.                 return vectorArray;
  16.         }
  17.         public double add(int cursors,double s){
  18.                 return vectorArray[cursors]=s;
  19.         }
  20.         public double peek(int cursor){
  21.                 return vectorArray[cursor];
  22.         }
  23.         public double[] remove(double s){
  24.                 Map<Double,Integer> map=new HashMap<Double,Integer>();
  25.                 for(int i=0;i<vectorArray.length;i++){
  26.                         int count=0;
  27.                         for(int j=0;j<vectorArray.length;j++){
  28.                                 if(vectorArray[j]==s){
  29.                                         map.put((double)i, count++);
  30.                                 }
  31.                         }
  32.                 }
  33.                 for(int i=0;i<vectorArray.length;i++){
  34.                         for(int j=0;j<i;j++){
  35.                                 if(vectorArray[j]==s){
  36.                                         double temp=vectorArray[i];
  37.                                         vectorArray[i]=vectorArray[j];
  38.                                         vectorArray[j]=temp;
  39.                                 }
  40.                         }
  41.                 }
  42.                 double[] newvectorArray=new double[map.size()];
  43.                 System.out.println(map.size());
  44.                 for(int i=0;i<newvectorArray.length;i++){
  45.                         newvectorArray[i]=vectorArray[i];
  46.                 }
  47.                 System.out.println(Arrays.toString(vectorArray));
  48.                 return newvectorArray;
  49.         }
  50.         public Vector vecAdd(Vector vector){
  51.                 Vector newVector=new Vector(this.length());
  52.                 if(this.length()==vector.length()){
  53.                         for(int i=0;i<vector.length();i++){
  54.                                 newVector.add(i, (this.peek(i)+vector.peek(i)));
  55.                         }
  56.                 }else{
  57.                         try{
  58.                                 throw new Exception("请确认该向量的长度");
  59.                         }catch(Exception e){
  60.                                 e.printStackTrace();
  61.                         }
  62.                 }
  63.                 return newVector;
  64.         }
  65.         public Vector vecMinus(Vector vector){
  66.                 Vector newVector=new Vector(this.length());
  67.                 if(this.length()==vector.length()){
  68.                         for(int i=0;i<vector.length();i++){
  69.                                 newVector.add(i, (this.peek(i)-vector.peek(i)));
  70.                         }
  71.                 }else{
  72.                         try{
  73.                                 throw new Exception("请确认该向量的长度");
  74.                         }catch(Exception e){
  75.                                 e.printStackTrace();
  76.                         }
  77.                 }
  78.                 return newVector;
  79.         }
  80.         /**
  81.          * mutiple
  82.          * */
  83.         public Vector vecMutipleConstant(double K){
  84.                 Vector vector=new Vector(this.length());
  85.                 for(int i=0;i<this.length();i++){
  86.                         vector.add(i, this.peek(i));
  87.                 }
  88.                 return vector;
  89.         }
  90.         /**
  91.          * mutiple by vector
  92.          * */
  93.         public double vecMutipleVector(Vector vector){
  94.                 double d=0;
  95.                 if(this.length()==vector.length()){
  96.                         for(int i=0;i<this.length();i++){
  97.                                 d+=this.peek(i)*vector.peek(i);
  98.                         }
  99.                 }
  100.                 return d;
  101.         }
  102.         public boolean isFull(){
  103.                 return (MaxSize==cursor);
  104.         }
  105.         public boolean isEmpty(){
  106.                 return (cursor==-1);
  107.         }
  108.         public String toString(){
  109.                 return Arrays.toString(vectorArray)+"\n";
  110.         }
  111.         public int length(){
  112.                 return vectorArray.length;
  113.         }
  114. }
复制代码
本程序计算行列式值采用高斯消元法还有些问题,不管咋样,先发上来,
有人做了向量机。我也来写。后面发。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Java jav exception specified Elements private Vector public Matrix double

已有 1 人评分经验 论坛币 学术水平 收起 理由
Xaero + 60 + 60 + 1 精彩帖子

总评分: 经验 + 60  论坛币 + 60  学术水平 + 1   查看全部评分

za rujina!
沙发
zhukovasky 发表于 2013-12-2 22:14:36 |只看作者 |坛友微信交流群
感谢版主大神的加分,这个Matrix的求逆方法有些问题,所以重新补上新的用高斯消元法求解。
这段代码来自于VB版本,本人加工成java版本。
代码如下:
  1.         public Matrix getAdverMatrix(){
  2.                 int[] A=new int[this.rownums];
  3.                 int[] B=new int[this.colnums];
  4.                 int i,j,k,N;
  5.                 double D;
  6.                 if(this.rownums!=this.colnums){
  7.                         try{
  8.                                 throw new Exception("请确认该矩阵是否为行列式");
  9.                         }catch(Exception e){
  10.                                 e.printStackTrace();
  11.                         }
  12.                 }
  13.                 N=rownums;
  14.                 for(k=1;k<=N;k++){
  15.                         D=0;
  16.                         for(i=k;i<=N;i++){
  17.                                 for(j=k;j<=N;j++){
  18.                                         if(Math.abs(this.getMatrixValue(i, j))>D){
  19.                                                 D=Math.abs(this.getMatrixValue(i, j));
  20.                                                 A[k-1]=i;
  21.                                                 B[k-1]=j;
  22.                                         }
  23.                                 }
  24.                         }
  25.                         if(D+1==1){
  26.                                 System.out.println("该矩阵不可逆");
  27.                                 break;
  28.                         }

  29.                         if(A[k-1]!=k){
  30.                                 for(j=1;j<=N;j++){
  31.                                         this.SwapMatrixValue(k, j, A[k-1], j);
  32.                                 }
  33.                         }

  34.                         if(B[k-1]!=k){
  35.                                 for(i=1;i<=N;i++){
  36.                                         this.SwapMatrixValue(i, k, i, B[k-1]);
  37.                                 }
  38.                         }
  39.        
  40.                         double f=this.getMatrixValue(k, k);
  41.                         this.setMatrixValue(k, k, (1/f));
  42.                         for(j=1;j<=N;j++){
  43.                                 if(j!=k){
  44.                                         double d1=this.getMatrixValue(k, j);
  45.                                         double d2=this.getMatrixValue(k, k);
  46.                                         this.setMatrixValue(k, j, d1*d2);
  47.                                 }
  48.                         }

  49.                         for(i=1;i<=N;i++){

  50.                                 if(i!=k){
  51.                                         for(j=1;j<=N;j++){
  52.                                                 if(j!=k){

  53.                                                         double d=this.getMaxValueRow(i, j);

  54.                                                         double d1=this.getMatrixValue(i, k);

  55.                                                         double d2=this.getMatrixValue(k, j);
  56.                                                         this.setMatrixValue(i, j, d-d1*d2);
  57.                                                 }
  58.                                         }
  59.                                 }
  60.                         }

  61.                         for(i=1;i<=N;i++){
  62.                                 if(i!=k){
  63.                                         double d1=this.getMatrixValue(i, k);
  64.                                         double d2=this.getMatrixValue(k, k);
  65.                                         this.setMatrixValue(i, k, -1*d1*d2);
  66.                                 }
  67.                         }

  68.                 }

  69.                 for(k=N;k>=1;k--){
  70.                         if(B[k-1]!=k){
  71.                                 for(j=1;j<=N;j++){
  72.                                         this.SwapMatrixValue(k, j, B[k-1], j);
  73.                                 }
  74.                         }
  75.                         if(A[k-1]!=k){
  76.                                 for(i=1;i<=N;i++){
  77.                                         this.SwapMatrixValue(i, k, i, A[k-1]);
  78.                                 }
  79.                         }
  80.                 }
  81.                 return this;
  82.         }
复制代码
za rujina!

使用道具

藤椅
zhukovasky 发表于 2013-12-2 22:16:03 |只看作者 |坛友微信交流群
经过实地检测本代码最能够支持到2560*2560矩阵的计算,包括求逆。乐观的估计,本周末,本人发上java版本的向量机基础类,
之前有个台湾人已经写了,没测,不想看。
za rujina!

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-27 14:38