org.mklab.nfc.matrix
クラス AbstractMatrix<M extends Matrix>

java.lang.Object
  上位を拡張 org.mklab.nfc.matrix.AbstractGrid<M>
      上位を拡張 org.mklab.nfc.matrix.AbstractFundamentalMatrix<M>
          上位を拡張 org.mklab.nfc.matrix.AbstractMatrix<M>
型パラメータ:
M - 実際の行列の型
すべての実装されたインタフェース:
Serializable, Cloneable, FundamentalMatrix, Grid, Matrix, MatrixElementWiseOperator
直系の既知のサブクラス:
BaseMatrix, DoubleMatrix, IntMatrix

public abstract class AbstractMatrix<M extends Matrix>
extends AbstractFundamentalMatrix<M>
implements Matrix

行列を統一的に扱うためのクラスです。

バージョン:
$Revision: 1.66 $
作成者:
koga
関連項目:
直列化された形式

コンストラクタの概要
protected AbstractMatrix()
          子クラスから呼ばれ0*0の行列を生成します。
protected AbstractMatrix(int rowSize, int columnSize)
          子クラスから呼ばれ rowSize * columnSize の行列を生成します。
 
メソッドの概要
 Matrix add(Matrix value)
          valueとの和を返します。
 Matrix covariance(Matrix value)
          opponentとの共分散行列を返します。
 M createOnes()
          同サイズの全成分が1である行列を生成します。
 M createOnes(int size)
          size*sizeの全成分が1である行列を生成します。
 M createOnes(int rowNumber, int columnNumber, Grid block)
          行列blockrowNumber*columnNumber 倍の全成分が1である行列を生成します。
 M createUnit()
          同サイズの単位行列を生成します。
 M createUnit(int size)
          size*sizeの単位行列を生成します。
 M createUnit(int rowNumber, int columnNumber, Grid block)
          行列blockrowNumber*columnNumber 倍の単位行列を生成します。
 M createZero()
          同サイズの零行列を生成します。
 M createZero(int size)
          size*sizeの零行列を生成します。
 M createZero(int rowNumber, int columnNumber, Grid block)
          行列blockrowNumber*columnNumber 倍の零行列を生成します。
 Matrix divide(Matrix value)
          行列valueの逆行列との積(this*value -1 )を返します。
 Matrix divideElementWise(Matrix value)
          valueとの成分毎の商を成分にもつ行列を返します。
 boolean isTransformableFrom(Matrix value)
          引数で与えられた型から、この型へ変換可能か判定します。
 boolean isTransformableTo(Matrix value)
          この型から引数で与えられた型へ変換可能か判定します。
 boolean isUnit()
          単位行列であるか判定します。
 boolean isZero()
          零行列(全ての成分がデフォルトの初期値)であるか判定します。
 Matrix leftDivide(double value)
          逆行列と実数valueの積(this -1 *value)を返します。
 Matrix leftDivide(int value)
          逆行列と整数valueの積(this -1 *value)を返します。
 Matrix leftDivide(Matrix value)
          逆行列と行列valueの積(this -1 *value)を返します。
 Matrix leftDivide(Scalar<?> value)
          逆行列とスカラーvalueの積(this -1 *value)を返します。
 Matrix leftDivideElementWise(Matrix value)
          valueとの成分毎の左からの商を成分にもつ行列を返します。
 Matrix multiply(Matrix value)
          行列valueとの積(this*value)を返します。
 Matrix multiplyElementWise(Matrix value)
          valueとの成分毎の積を成分にもつ行列を返します。
 Matrix power(int order)
          整数order乗(this order )を返します。
 Matrix powerElementWise(Matrix order)
          成分毎に累乗します。
 M roundToZeroElementWise()
          絶対値が小さい成分を0に丸めます。
 M shiftLeft(int number)
          全ての成分を左方向へシフトします。
 M shiftUp(int number)
          全ての成分を上方向へシフトします。
 Matrix subtract(Matrix value)
          valueとの差を返します。
 Matrix transformFrom(Matrix value)
          引数で与えられた型からこの型へ変換します。
 Matrix transformTo(Matrix value)
          この型から引数で与えられた型へ変換します。
protected static Matrix[] transformToSameClass(Matrix m1, Matrix m2)
          2個の行列を同じ型の行列に変換します。
 
クラス org.mklab.nfc.matrix.AbstractFundamentalMatrix から継承されたメソッド
appendDown, appendRight, flipLeftRight, flipUpDown, getColumnVector, getColumnVectors, getColumnVectors, getRowVector, getRowVectors, getRowVectors, getSubMatrix, getSubMatrix, getSubMatrix, getSubVector, getSubVector, rotateLeft, rotateUp, setColumnVector, setColumnVectors, setColumnVectors, setRowVector, setRowVectors, setRowVectors, setSubMatrix, setSubMatrix, setSubMatrix, setSubVector
 
クラス org.mklab.nfc.matrix.AbstractGrid から継承されたメソッド
clone, count, getColumnSize, getDefaultElementAlignment, getDefaultElementFormat, getElementAlignment, getElementFormat, getGridClassName, getPrintingElementsString, getPrintingString, getRowSize, hashCode, hasSameColumnSize, hasSameRowSize, isEmpty, isSameSize, isSquare, length, print, print, print, removeColumnVector, removeRowVector, setColumnSize, setDefaultElementAlignment, setDefaultElementFormat, setElementAlignment, setElementFormat, setRowSize, toString
 
クラス java.lang.Object から継承されたメソッド
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
インタフェース org.mklab.nfc.matrix.Matrix から継承されたメソッド
conjugate, conjugateTranspose, createOnes, createUnit, createZero, cumulativeProduct, cumulativeProductColumnWise, cumulativeProductRowWise, cumulativeSum, cumulativeSumColumnWise, cumulativeSumRowWise, divide, divide, divide, getImaginaryPart, getRealPart, inverse, inverse, isComplex, isReal, isUnit, isZero, meanColumnWise, meanRowWise, multiply, multiply, multiply, productColumnWise, productRowWise, setImaginaryPart, setImaginaryPart, setImaginaryPart, setImaginaryPart, setRealPart, setRealPart, setRealPart, setRealPart, sumColumnWise, sumRowWise, toComplex, unaryMinus
 
インタフェース org.mklab.nfc.matrix.FundamentalMatrix から継承されたメソッド
appendDown, appendRight, compareElementWise, copy, diagonalToVector, equals, flipLeftRight, flipUpDown, getColumnVector, getColumnVectors, getColumnVectors, getRowVector, getRowVectors, getRowVectors, getSubMatrix, getSubMatrix, getSubMatrix, getSubMatrix, getSubMatrix, getSubMatrix, getSubMatrix, getSubVector, getSubVector, getSubVector, reshape, resize, rotateLeft, rotateUp, setColumnVector, setColumnVectors, setColumnVectors, setRowVector, setRowVectors, setRowVectors, setSubMatrix, setSubMatrix, setSubMatrix, setSubMatrix, setSubMatrix, setSubMatrix, setSubMatrix, setSubVector, setSubVector, setSubVector, transpose, vectorToDiagonal
 
インタフェース org.mklab.nfc.matrix.Grid から継承されたメソッド
clone, count, exchangeColumn, exchangeRow, getColumnSize, getElementAlignment, getElementFormat, getPrintingElementsString, getPrintingString, getRowSize, hasSameColumnSize, hasSameRowSize, isEmpty, isSameSize, isSquare, length, print, print, print, printElements, printElements, removeColumnVector, removeColumnVectors, removeColumnVectors, removeRowVector, removeRowVectors, removeRowVectors, setElementAlignment, setElementFormat
 
インタフェース org.mklab.nfc.matrix.MatrixElementWiseOperator から継承されたメソッド
addElementWise, addElementWise, addElementWise, ceilElementWise, compareElementWise, compareElementWise, compareElementWise, fixElementWise, floorElementWise, inverseElementWise, isFiniteElementWise, isInfiniteElementWise, isNanElementWise, powerElementWise, powerElementWise, roundElementWise, roundToZeroElementWise, subtractElementWise, subtractElementWise, subtractElementWise
 

コンストラクタの詳細

AbstractMatrix

protected AbstractMatrix()
子クラスから呼ばれ0*0の行列を生成します。

実際には作成されずに、成分数を0*0にするだけです。


AbstractMatrix

protected AbstractMatrix(int rowSize,
                         int columnSize)
子クラスから呼ばれ rowSize * columnSize の行列を生成します。

(実際には作成されずに、成分数を rowSize * columnSize にするだけです。)

パラメータ:
rowSize - 行の数
columnSize - 列の数
メソッドの詳細

isZero

public boolean isZero()
インタフェース Grid の記述:
零行列(全ての成分がデフォルトの初期値)であるか判定します。

定義:
インタフェース Grid 内の isZero
戻り値:
零行列(全ての成分がデフォルトの初期値)ならばtrue、そうでなければfalse
関連項目:
Grid.isZero()

isUnit

public boolean isUnit()
インタフェース Matrix の記述:
単位行列であるか判定します。

定義:
インタフェース Matrix 内の isUnit
戻り値:
単位行列ならばtrue、そうでなければfalse
関連項目:
Matrix.isUnit()

createZero

public M createZero()
インタフェース Matrix の記述:
同サイズの零行列を生成します。

定義:
インタフェース Matrix 内の createZero
戻り値:
零行列
関連項目:
Matrix.createZero()

createZero

public M createZero(int size)
インタフェース Matrix の記述:
size*sizeの零行列を生成します。

定義:
インタフェース Matrix 内の createZero
パラメータ:
size - サイズ指定
戻り値:
size*sizeの零行列
関連項目:
Matrix.createZero(int)

createZero

public M createZero(int rowNumber,
                    int columnNumber,
                    Grid block)
インタフェース Matrix の記述:
行列blockrowNumber*columnNumber 倍の零行列を生成します。

定義:
インタフェース Matrix 内の createZero
パラメータ:
rowNumber - 行方向の倍数
columnNumber - 列方向の倍数
block - 基本となる行列
戻り値:
blockrowNumber* columnNumber倍の零行列
関連項目:
Matrix.createZero(int, int, org.mklab.nfc.matrix.Grid)

createUnit

public M createUnit()
インタフェース Matrix の記述:
同サイズの単位行列を生成します。

定義:
インタフェース Matrix 内の createUnit
戻り値:
単位行列
関連項目:
Matrix.createUnit()

createUnit

public M createUnit(int size)
インタフェース Matrix の記述:
size*sizeの単位行列を生成します。

定義:
インタフェース Matrix 内の createUnit
パラメータ:
size - サイズ指定
戻り値:
size*sizeの単位行列
関連項目:
Matrix.createUnit(int)

createUnit

public M createUnit(int rowNumber,
                    int columnNumber,
                    Grid block)
インタフェース Matrix の記述:
行列blockrowNumber*columnNumber 倍の単位行列を生成します。

定義:
インタフェース Matrix 内の createUnit
パラメータ:
rowNumber - 行方向の倍数
columnNumber - 列方向の倍数
block - 基本となる行列
戻り値:
blockrowNumber* columnNumber倍の単位行列
関連項目:
Matrix.createUnit(int, int, org.mklab.nfc.matrix.Grid)

createOnes

public M createOnes()
インタフェース Matrix の記述:
同サイズの全成分が1である行列を生成します。

定義:
インタフェース Matrix 内の createOnes
戻り値:
全成分が1である行列
関連項目:
Matrix.createOnes()

createOnes

public M createOnes(int size)
インタフェース Matrix の記述:
size*sizeの全成分が1である行列を生成します。

定義:
インタフェース Matrix 内の createOnes
パラメータ:
size - サイズ指定
戻り値:
size*sizeの全成分が1である行列
関連項目:
Matrix.createOnes(int)

createOnes

public M createOnes(int rowNumber,
                    int columnNumber,
                    Grid block)
インタフェース Matrix の記述:
行列blockrowNumber*columnNumber 倍の全成分が1である行列を生成します。

定義:
インタフェース Matrix 内の createOnes
パラメータ:
rowNumber - 行方向の倍数
columnNumber - 列方向の倍数
block - 基本となる行列
戻り値:
blockrowNumber* columnNumber倍の全成分が1である行列
関連項目:
Matrix.createOnes(int, int, org.mklab.nfc.matrix.Grid)

shiftUp

public M shiftUp(int number)
インタフェース Matrix の記述:
全ての成分を上方向へシフトします。 上側には零が代入されます。numberが負の場合、下方向へシフトします。

定義:
インタフェース Matrix 内の shiftUp
パラメータ:
number - シフトで進む数
戻り値:
全ての成分を上方向へシフトした行列
関連項目:
Matrix.shiftUp(int)

shiftLeft

public M shiftLeft(int number)
インタフェース Matrix の記述:
全ての成分を左方向へシフトします。 右側には零が代入されます。numberが負の場合、右方向へシフトします。

定義:
インタフェース Matrix 内の shiftLeft
パラメータ:
number - シフトで進む数
戻り値:
全ての成分を左方向へシフトした行列
関連項目:
Matrix.shiftLeft(int)

roundToZeroElementWise

public M roundToZeroElementWise()
インタフェース MatrixElementWiseOperator の記述:
絶対値が小さい成分を0に丸めます。

定義:
インタフェース MatrixElementWiseOperator 内の roundToZeroElementWise
戻り値:
丸められた結果
関連項目:
MatrixElementWiseOperator.roundToZeroElementWise()

leftDivide

public Matrix leftDivide(int value)
インタフェース Matrix の記述:
逆行列と整数valueの積(this -1 *value)を返します。

定義:
インタフェース Matrix 内の leftDivide
パラメータ:
value - 割る整数
戻り値:
逆行列とvalueとの積
関連項目:
Matrix.leftDivide(int)

leftDivide

public Matrix leftDivide(double value)
インタフェース Matrix の記述:
逆行列と実数valueの積(this -1 *value)を返します。

定義:
インタフェース Matrix 内の leftDivide
パラメータ:
value - 割る実数
戻り値:
逆行列とvalueとの積
関連項目:
Matrix.leftDivide(double)

leftDivide

public Matrix leftDivide(Scalar<?> value)
インタフェース Matrix の記述:
逆行列とスカラーvalueの積(this -1 *value)を返します。

定義:
インタフェース Matrix 内の leftDivide
パラメータ:
value - スカラー
戻り値:
逆行列とvalueの積
関連項目:
Matrix.leftDivide(org.mklab.nfc.scalar.Scalar)

power

public Matrix power(int order)
インタフェース Matrix の記述:
整数order乗(this order )を返します。

定義:
インタフェース Matrix 内の power
パラメータ:
order - 指数
戻り値:
order乗
関連項目:
Matrix.power(int)

isTransformableTo

public boolean isTransformableTo(Matrix value)
インタフェース Matrix の記述:
この型から引数で与えられた型へ変換可能か判定します。

定義:
インタフェース Matrix 内の isTransformableTo
パラメータ:
value - 変換先
戻り値:
変換可能ならtrue、そうでなければfalse
関連項目:
Matrix.isTransformableTo(org.mklab.nfc.matrix.Matrix)

transformTo

public Matrix transformTo(Matrix value)
インタフェース Matrix の記述:
この型から引数で与えられた型へ変換します。

定義:
インタフェース Matrix 内の transformTo
パラメータ:
value - 変換先
戻り値:
変換で生成された値
関連項目:
Matrix.transformTo(org.mklab.nfc.matrix.Matrix)

isTransformableFrom

public boolean isTransformableFrom(Matrix value)
インタフェース Matrix の記述:
引数で与えられた型から、この型へ変換可能か判定します。

定義:
インタフェース Matrix 内の isTransformableFrom
パラメータ:
value - 変換元
戻り値:
変換可能ならtrue、そうでなければfalse
関連項目:
Matrix.isTransformableFrom(org.mklab.nfc.matrix.Matrix)

transformFrom

public Matrix transformFrom(Matrix value)
インタフェース Matrix の記述:
引数で与えられた型からこの型へ変換します。

定義:
インタフェース Matrix 内の transformFrom
パラメータ:
value - 変換元
戻り値:
変換で生成された値
関連項目:
Matrix.transformFrom(org.mklab.nfc.matrix.Matrix)

leftDivideElementWise

public Matrix leftDivideElementWise(Matrix value)
インタフェース MatrixElementWiseOperator の記述:
valueとの成分毎の左からの商を成分にもつ行列を返します。

定義:
インタフェース MatrixElementWiseOperator 内の leftDivideElementWise
パラメータ:
value - 割られる行列
戻り値:
割り算の結果
関連項目:
MatrixElementWiseOperator.leftDivideElementWise(org.mklab.nfc.matrix.Matrix)

powerElementWise

public Matrix powerElementWise(Matrix order)
インタフェース MatrixElementWiseOperator の記述:
成分毎に累乗します。

定義:
インタフェース MatrixElementWiseOperator 内の powerElementWise
パラメータ:
order - 累乗の指数を成分とする行列
戻り値:
累乗の結果
関連項目:
MatrixElementWiseOperator.powerElementWise(org.mklab.nfc.matrix.Matrix)

add

public Matrix add(Matrix value)
インタフェース Matrix の記述:
valueとの和を返します。

定義:
インタフェース Matrix 内の add
パラメータ:
value - 行列
戻り値:
valueとの和
関連項目:
Matrix.add(org.mklab.nfc.matrix.Matrix)

subtract

public Matrix subtract(Matrix value)
インタフェース Matrix の記述:
valueとの差を返します。

定義:
インタフェース Matrix 内の subtract
パラメータ:
value - 引く行列
戻り値:
valueとの差
関連項目:
Matrix.subtract(org.mklab.nfc.matrix.Matrix)

multiply

public Matrix multiply(Matrix value)
インタフェース Matrix の記述:
行列valueとの積(this*value)を返します。

定義:
インタフェース Matrix 内の multiply
パラメータ:
value - 行列
戻り値:
valueとの積
関連項目:
Matrix.multiply(org.mklab.nfc.matrix.Matrix)

divide

public Matrix divide(Matrix value)
インタフェース Matrix の記述:
行列valueの逆行列との積(this*value -1 )を返します。

定義:
インタフェース Matrix 内の divide
パラメータ:
value - 割る行列
戻り値:
valueの逆行列との積
関連項目:
Matrix.divide(org.mklab.nfc.matrix.Matrix)

leftDivide

public Matrix leftDivide(Matrix value)
インタフェース Matrix の記述:
逆行列と行列valueの積(this -1 *value)を返します。

定義:
インタフェース Matrix 内の leftDivide
パラメータ:
value - 割る行列
戻り値:
逆行列とvalueとの積
関連項目:
Matrix.leftDivide(org.mklab.nfc.matrix.Matrix)

multiplyElementWise

public Matrix multiplyElementWise(Matrix value)
インタフェース MatrixElementWiseOperator の記述:
valueとの成分毎の積を成分にもつ行列を返します。

定義:
インタフェース MatrixElementWiseOperator 内の multiplyElementWise
パラメータ:
value - 乗じる行列
戻り値:
乗算の結果
関連項目:
MatrixElementWiseOperator.multiplyElementWise(org.mklab.nfc.matrix.Matrix)

divideElementWise

public Matrix divideElementWise(Matrix value)
インタフェース MatrixElementWiseOperator の記述:
valueとの成分毎の商を成分にもつ行列を返します。

定義:
インタフェース MatrixElementWiseOperator 内の divideElementWise
パラメータ:
value - 割る行列
戻り値:
割り算の結果
関連項目:
MatrixElementWiseOperator.divideElementWise(org.mklab.nfc.matrix.Matrix)

covariance

public Matrix covariance(Matrix value)
インタフェース Matrix の記述:
opponentとの共分散行列を返します。

定義:
インタフェース Matrix 内の covariance
パラメータ:
value - 対となるベクトル
戻り値:
共分散行列 (Covariance)
関連項目:
Matrix.covariance(org.mklab.nfc.matrix.Matrix)

transformToSameClass

protected static Matrix[] transformToSameClass(Matrix m1,
                                               Matrix m2)
2個の行列を同じ型の行列に変換します。

パラメータ:
m1 - 行列1
m2 - 行列2
戻り値:
同じ型の行列を成分とする配列