亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? matrix.java

?? Java游戲高級編程!!很不錯的!!!Java游戲高級編程!!很不錯的
?? JAVA
字號:
     package com.croftsoft.core.math;

     /*********************************************************************
     *
     * A mathematical matrix class.
     *
     * @version
     *   1998-12-27
     * @author
     *   <A HREF="http://www.alumni.caltech.edu/~croft/">David W. Croft</A>
     *********************************************************************/

     public class  Matrix
     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////
     {

     public int             rows;
     public int             cols;
     public double [ ] [ ]  data;

     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////

     /*********************************************************************
     * Test/demo method.
     *********************************************************************/
     public static void  main ( )
     //////////////////////////////////////////////////////////////////////
     {
       Matrix  left  = new Matrix ( 2, 3 );
       Matrix  right = new Matrix ( 3, 4 );

       for ( int index_row = 0; index_row < left.rows; index_row++ )
       for ( int index_col = 0; index_col < left.cols; index_col++ )
       {
         left.data [ index_row ] [ index_col ] = index_row + index_col;
       }

       for ( int index_row = 0; index_row < right.rows; index_row++ )
       for ( int index_col = 0; index_col < right.cols; index_col++ )
       {
         right.data [ index_row ] [ index_col ] = index_row + index_col;
       }

       left.display ( );
       System.out.println ( "" );
       right.display ( );
       System.out.println ( "" );
       Matrix  product = multiply ( left, right );
       product.display ( );
       System.out.println ( "" );
       Matrix  transposed = product.transpose ( );
       transposed.display ( );
       System.out.println ( "" );
       Matrix  sigmoided = transposed.sigmoid ( );
       sigmoided.display ( );
     }

     //////////////////////////////////////////////////////////////////////
     // Static methods
     //////////////////////////////////////////////////////////////////////

     /*********************************************************************
     * Returns a square matrix with the diagonal values set to 1.0 and
     * all others set to 0.0.
     *
     * @param rows_cols
     *   The number of rows and columns on a side.
     *********************************************************************/
     public static Matrix  identity ( int  rows_cols )
     //////////////////////////////////////////////////////////////////////
     {
       Matrix  m = new Matrix ( rows_cols, rows_cols );

       for ( int  i = 0; i < rows_cols; i++ )
       {
         m.data [ i ] [ i ] = 1.0;
       }

       return m;
     }

     public static Matrix  multiply ( Matrix  left, Matrix  right )
     //////////////////////////////////////////////////////////////////////
     {
       if ( left.cols != right.rows )
       {
         throw new ArrayIndexOutOfBoundsException (
           "Matrix.multiply:  left.cols != right.rows" );
       }

       Matrix  product = new Matrix ( left.rows, right.cols );

       for ( int index_row = 0; index_row < product.rows; index_row++ )
       for ( int index_col = 0; index_col < product.cols; index_col++ )
       {
         product.data [ index_row ] [ index_col ] = 0.0;
         for ( int index = 0; index < left.cols; index++ )
         {
           product.data [ index_row ] [ index_col ]
             += left.data [ index_row ] [ index ]
             * right.data [ index ] [ index_col ];
         }
       }

       return product;
     }

     public static Matrix  multiplyPairwise ( Matrix  a, Matrix  b )
     //////////////////////////////////////////////////////////////////////
     {
       if ( ( a.rows != b.rows ) || ( a.cols != b.cols ) )
       {
         throw new ArrayIndexOutOfBoundsException (
           "Matrix.multiply_pairwise:  rows or columns not equal" );
       }

       Matrix  product = new Matrix ( a.rows, a.cols );

       for ( int index_row = 0; index_row < a.rows; index_row++ )
       for ( int index_col = 0; index_col < a.cols; index_col++ )
       {
         product.data [ index_row ] [ index_col ]
           = a.data [ index_row ] [ index_col ]
           * b.data [ index_row ] [ index_col ];
       }

       return product;
     }

     //////////////////////////////////////////////////////////////////////
     // Constructor methods
     //////////////////////////////////////////////////////////////////////

     /*********************************************************************
     * Constructs a Matrix with all of the element values set to zero.
     *********************************************************************/
     public  Matrix ( int  rows, int  cols )
     //////////////////////////////////////////////////////////////////////
     {
       this.rows = rows;
       this.cols = cols;
       this.data = new double [ rows ] [ cols ];
     }

     /*********************************************************************
     * Constructs a Matrix with all of the element values set to a
     * specified constant.
     *
     * @param value
     *   All of the element values will be set to this constant.
     *********************************************************************/
     public  Matrix ( int  rows, int  cols, double  value )
     //////////////////////////////////////////////////////////////////////
     {
       this ( rows, cols );

       for ( int  row = 0; row < rows; row++ )
       for ( int  col = 0; col < cols; col++ )
       {
         data [ row ] [ col ] = value;
       }
     }

     public Matrix ( Matrix  old )
     //////////////////////////////////////////////////////////////////////
     {
       this ( old.rows, old.cols );
       for ( int index_row = 0; index_row < this.rows; index_row++ )
       for ( int index_col = 0; index_col < this.cols; index_col++ )
       {
         this.data [ index_row ] [ index_col ]
           = old.data [ index_row ] [ index_col ];
       }
     }

     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////

     public Matrix  add ( double  addend )
     //////////////////////////////////////////////////////////////////////
     {
       Matrix  new_Matrix = new Matrix ( this );

       for ( int index_row = 0; index_row < this.rows; index_row++ )
       for ( int index_col = 0; index_col < this.cols; index_col++ )
       {
         new_Matrix.data [ index_row ] [ index_col ] += addend;
       }
       return new_Matrix;
     }

     public Matrix  add ( Matrix  addend )
     //////////////////////////////////////////////////////////////////////
     {
       if ( ( this.rows!= addend.rows    )
         || ( this.cols != addend.cols ) )
       {
         throw new ArrayIndexOutOfBoundsException (
           "Matrix.add ( Matrix ):  columns and rows not equal" );
       }

       Matrix  new_Matrix = new Matrix ( this );

       for ( int index_row = 0; index_row < this.rows; index_row++ )
       for ( int index_col = 0; index_col < this.cols; index_col++ )
       {
         new_Matrix.data [ index_row ] [ index_col ]
           += addend.data [ index_row ] [ index_col ];
       }
       return new_Matrix;
     }

     public Matrix  clip ( double  min, double  max )
     //////////////////////////////////////////////////////////////////////
     {
       Matrix  new_Matrix = new Matrix ( this );

       for ( int index_row = 0; index_row < this.rows; index_row++ )
       for ( int index_col = 0; index_col < this.cols; index_col++ )
       {
         if ( this.data [ index_row ] [ index_col ] < min )
           new_Matrix.data [ index_row ] [ index_col ] = min;
         else if ( this.data [ index_row ] [ index_col ] > max )
           new_Matrix.data [ index_row ] [ index_col ] = max;
       }
       return new_Matrix;
     }

     public void  display ( )
     //////////////////////////////////////////////////////////////////////
     {
       for ( int index_row = 0; index_row < this.rows; index_row++ )
       {
         String  line_String = "";
         for ( int index_col = 0; index_col < this.cols; index_col++ )
         {
           line_String += this.data [ index_row ] [ index_col ] + " ";
         }
         System.out.println ( line_String );
       }
     }

     public Matrix  multiply ( double  factor )
     //////////////////////////////////////////////////////////////////////
     {
       Matrix  new_Matrix = new Matrix ( this );

       for ( int index_row = 0; index_row < this.rows; index_row++ )
       for ( int index_col = 0; index_col < this.cols; index_col++ )
       {
         new_Matrix.data [ index_row ] [ index_col ] *= factor;
       }

       return new_Matrix;
     }

     public Matrix  multiply ( Matrix  right )
     //////////////////////////////////////////////////////////////////////
     {
       return multiply ( this, right );
     }

     public Matrix  randomizeUniform ( double  min, double  max )
     //////////////////////////////////////////////////////////////////////
     {
       Matrix  new_Matrix = new Matrix ( this.rows, this.cols );

       for ( int index_row = 0; index_row < this.rows; index_row++ )
       for ( int index_col = 0; index_col < this.cols; index_col++ )
       {
         new_Matrix.data [ index_row ] [ index_col ]
           = RandomLib.uniform ( min, max );
       }

       return new_Matrix;
     }

     public Matrix  sigmoid ( )
     //////////////////////////////////////////////////////////////////////
     {
       Matrix  new_Matrix = new Matrix ( this.rows, this.cols );

       for ( int index_row = 0; index_row < this.rows; index_row++ )
       for ( int index_col = 0; index_col < this.cols; index_col++ )
       {
         new_Matrix.data [ index_row ] [ index_col ]
           = MathLib.sigmoid ( this.data [ index_row ] [ index_col ] );
       }

       return new_Matrix;
     }

     public Matrix  sigmoidDerivative ( )
     //////////////////////////////////////////////////////////////////////
     {
       Matrix  new_Matrix = new Matrix ( this.rows, this.cols );

       for ( int index_row = 0; index_row < this.rows; index_row++ )
       for ( int index_col = 0; index_col < this.cols; index_col++ )
       {
         new_Matrix.data [ index_row ] [ index_col ]
           = MathLib.sigmoidDerivative
           ( this.data [ index_row ] [ index_col ] );
       }

       return new_Matrix;
     }

     public Matrix  submatrix (
       int  row_start, int  row_end,
       int  col_start, int  col_end )
     //////////////////////////////////////////////////////////////////////
     //  Note that the first row is row 0.
     //////////////////////////////////////////////////////////////////////
     {
       Matrix  sub
         = new Matrix ( row_end - row_start + 1, col_end - col_start + 1 );
       for ( int index_row = 0; index_row < sub.rows; index_row++ )
       for ( int index_col = 0; index_col < sub.cols; index_col++ )
       {
         sub.data [ index_row ] [ index_col ]
           = this.data [ index_row + row_start ] [ index_col + col_start ];
       }

       return sub;
     }

     public Matrix  subtract ( Matrix  subtractor )
     //////////////////////////////////////////////////////////////////////
     {
       if ( ( this.rows    != subtractor.rows    )
         || ( this.cols != subtractor.cols ) )
       {
         throw new ArrayIndexOutOfBoundsException (
           "Matrix.subtract ( Matrix ):  columns and rows not equal" );
       }

       Matrix  new_Matrix = new Matrix ( this );

       for ( int index_row = 0; index_row < this.rows; index_row++ )
       for ( int index_col = 0; index_col < this.cols; index_col++ )
       {
         new_Matrix.data [ index_row ] [ index_col ]
           -= subtractor.data [ index_row ] [ index_col ];
       }

       return new_Matrix;
     }

     public double  sum ( )
     //////////////////////////////////////////////////////////////////////
     {
       double  temp = 0.0;

       for ( int index_row = 0; index_row < this.rows; index_row++ )
       for ( int index_col = 0; index_col < this.cols; index_col++ )
       {
         temp += this.data [ index_row ] [ index_col ];
       }

       return temp;
     }

     public Matrix  transpose ( )
     //////////////////////////////////////////////////////////////////////
     {
       Matrix  transposed = new Matrix ( this.cols, this.rows );

       for ( int index_row = 0;
                 index_row < transposed.rows;
                 index_row++ )
       for ( int index_col = 0;
                 index_col < transposed.cols;
                 index_col++ )
       {
         transposed.data [ index_row ] [ index_col ]
           = this.data [ index_col ] [ index_row ];
       }

       return transposed;
     }

     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////
     }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品在线看| 成人av电影在线观看| 国产成人精品免费看| 日本乱人伦aⅴ精品| 精品国产乱码久久久久久蜜臀 | 色婷婷激情久久| 久久久久久一二三区| 成人午夜视频在线| youjizz久久| 欧美成人欧美edvon| 日韩免费视频一区| 一区二区三区蜜桃| 久久精品视频网| 精品精品国产高清a毛片牛牛| 日韩一区欧美小说| 欧美自拍偷拍午夜视频| 国产一区二区三区免费看| 国产清纯在线一区二区www| 欧美三级在线播放| 成人18视频日本| 九色综合狠狠综合久久| 亚洲色欲色欲www| 国产色产综合产在线视频 | 99久久精品情趣| 国产欧美日韩另类一区| 精品久久久三级丝袜| 激情亚洲综合在线| 久久精品99久久久| 欧美乱妇15p| 欧美日韩国产一二三| 1024亚洲合集| 成+人+亚洲+综合天堂| 久久精品日韩一区二区三区| 精品综合久久久久久8888| 日韩一区二区在线观看视频| 日韩av中文字幕一区二区| 欧美日韩美女一区二区| 午夜视黄欧洲亚洲| 91精品一区二区三区久久久久久| 色狠狠色噜噜噜综合网| 国产精品第13页| 色女孩综合影院| 亚洲视频每日更新| 欧美男男青年gay1069videost| 日韩一区二区电影| 激情小说亚洲一区| 国产精品美女久久久久aⅴ| 丁香婷婷综合五月| 一区二区三区.www| 欧美日韩国产一二三| av一区二区不卡| 欧美xxxxx牲另类人与| 欧美不卡激情三级在线观看| 久久一留热品黄| 亚洲欧美二区三区| 天堂av在线一区| 久久爱www久久做| 欧洲激情一区二区| 精品欧美一区二区久久| 久久精品一区四区| 亚洲人成影院在线观看| 亚洲女同一区二区| 欧美一区二区三区啪啪| 国产一区二区三区蝌蚪| 国产精品麻豆欧美日韩ww| 欧美日韩亚洲高清一区二区| 黄页网站大全一区二区| 一区二区三区欧美在线观看| 日韩一卡二卡三卡四卡| 91欧美一区二区| 日韩国产欧美在线播放| 国产农村妇女毛片精品久久麻豆| 依依成人综合视频| 日韩免费福利电影在线观看| 99精品国产视频| 日韩电影免费在线观看网站| 国产精品国产三级国产有无不卡 | 日本亚洲免费观看| 国产日韩精品久久久| 欧美日韩亚洲综合在线| 国产精选一区二区三区| 亚洲一区二区av电影| 国产精品青草综合久久久久99| 国产成人啪免费观看软件| 天堂一区二区在线免费观看| 国产精品成人一区二区三区夜夜夜| 日本91福利区| 国产精品传媒在线| 久久日韩粉嫩一区二区三区| 欧美三级电影精品| 97久久久精品综合88久久| 久久av中文字幕片| 日日摸夜夜添夜夜添国产精品 | 欧美日产国产精品| 欧美精品在线一区二区三区| 日韩激情中文字幕| 91麻豆免费在线观看| 亚洲在线免费播放| 色成年激情久久综合| 欧美福利视频导航| 亚洲午夜电影网| 国产欧美va欧美不卡在线| 色哟哟精品一区| 国产精品影视在线| 亚洲午夜视频在线| 国产精品乱码人人做人人爱| 精品国产乱码91久久久久久网站| 精品三级av在线| 一本到三区不卡视频| 国产精品996| 美国精品在线观看| 国产综合成人久久大片91| 无码av免费一区二区三区试看| 欧美性色综合网| 日韩电影在线观看电影| 久久综合999| 欧美亚洲一区二区在线| 欧美激情在线一区二区三区| 久久电影网站中文字幕| 亚洲欧美日韩精品久久久久| 日本一区二区视频在线| 久久精品一区蜜桃臀影院| 国产偷国产偷精品高清尤物| 久久久五月婷婷| 欧美激情在线一区二区三区| 成人欧美一区二区三区黑人麻豆 | 国产99一区视频免费 | 日本精品视频一区二区| 91福利国产成人精品照片| 欧美日韩免费观看一区三区| 欧美日韩www| 日韩欧美卡一卡二| 欧美精品一区二| 欧美国产精品一区二区三区| 中文字幕一区二区三区不卡| 亚洲综合久久av| 久久av中文字幕片| 91视频国产资源| 91精品国产综合久久精品麻豆| 94-欧美-setu| 欧美精品自拍偷拍动漫精品| 精品少妇一区二区三区日产乱码 | 奇米四色…亚洲| 久久99精品国产91久久来源 | 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 亚洲桃色在线一区| 一区二区三区四区亚洲| 麻豆成人av在线| 国产成人免费视频一区| 色八戒一区二区三区| 日韩美女在线视频| 综合欧美亚洲日本| 日本亚洲欧美天堂免费| 99久久国产综合精品色伊| 欧美日韩一区二区三区免费看| 成人黄动漫网站免费app| 9191成人精品久久| 中文字幕一区在线观看视频| 亚洲 欧美综合在线网络| 国产一区二区三区在线观看免费视频| 麻豆中文一区二区| 99久久国产免费看| 精品1区2区在线观看| 亚洲精品亚洲人成人网| 国产成人超碰人人澡人人澡| 91精品久久久久久久99蜜桃| 国产精品每日更新| 蜜臀av性久久久久av蜜臀妖精| 免费日韩伦理电影| 欧美午夜电影一区| 国产欧美日韩在线看| 免费在线视频一区| 91成人看片片| 中文字幕五月欧美| 国产乱码精品一品二品| 8v天堂国产在线一区二区| 中文字幕在线观看不卡| 国产在线不卡一区| 日韩欧美一二区| 亚洲国产sm捆绑调教视频| 成人午夜视频在线| 欧美videofree性高清杂交| 日韩电影在线一区二区三区| 在线观看区一区二| 亚洲精品国产成人久久av盗摄| 亚洲一区二区三区四区在线观看 | 9久草视频在线视频精品| 91精品国产免费| 天天综合日日夜夜精品| 欧洲一区二区av| 亚洲最大成人网4388xx| 91猫先生在线| 亚洲精品国产品国语在线app| 青青青爽久久午夜综合久久午夜| 激情五月婷婷综合| 精品国产乱子伦一区| 久久国产综合精品| 日韩欧美一区二区不卡| 毛片av一区二区三区| 精品成人a区在线观看|