class Matrix extends Object
{
	function Matrix()
	{
	$this->Object();
	$this->addAction($this->MatrixAction(),"act");
	$this->compire();
	}
	function MatrixAction()
	{
	$act = new SWFAction
	("
		var id = 0;
		var init = 0;
		var matrix;
		var max;
		var col;

		matrix = new Array(0,0,0,0,0
		         	  ,0,0,0,0,0
				  ,0,0,0,0,0
				  ,0,0,0,0,0);
		max=4;col=4;

		//二次元配列
		this.isLoad = function(){
		return 1;
		};
		this.setArray = function(data_){
		matrix = _data;
		};

		this.getData = function(i,j){
		return matrix[4*i+j];
		};
		this.setData = function(i,j,num){
		matrix[4*i+j] = num;
		};

		//行列
		this.newMatrix =function(name){
		A = null;
		A = _root.attachmovie('matrix',name,0);
		return A;
		};

		this.newMatrix = function(){
		return  _root.attachmovie('matrix','matrix'+_root.Matrix.id,id++);
		};
		//掛け算
		this.multiplication= function(A,B)
		{
		this.nextFrame();
		temp = 0;
	      for(m = 0;m<4;m++)
		for(i=0;i<4;i++){
		  for(j=0;j<4;j++){
			temp += A.getData(m,j)*B.getData(j,i);  
		  }
			setData(m,i,temp);temp=0;
			}
		};
		//表示
		this.printMatrix = function(){
			string = '';
			for(i=0;i<4;i++){
				string+='\n';
		 	  for(j=0;j<4;j++){
				string +=getData(i,j)+' '; 
		  			}}
			_root.print.text.text = string;
		};
	");
	return $act;
	}
}

Gポイントポイ活 Amazon Yahoo 楽天

無料ホームページ 楽天モバイル[UNLIMITが今なら1円] 海外格安航空券 海外旅行保険が無料!