Class Matrix
-
- All Implemented Interfaces:
public final class Matrix表示一个 m*n 的矩阵
在该类中, 所有的乘法操作都是左乘
Zoyn
-
-
Method Summary
Modifier and Type Method Description final IntegergetRow()final IntegergetColumn()final Array<DoubleArray>getAsArray()final Doubleget(Integer row, Integer column)final Matrixset(Integer row, Integer column, Double value)通过给定的值设定矩阵内对应的数值 final Matrixfill(Integer row, Double value)填充矩阵的某一行为同一实数 final DoubleArraygetRowAsArray(Integer row)取出矩阵中单独的一行 final DoubleArraygetColumnAsArray(Integer column)取矩阵中单独的一列 final BooleanisSameRow(Matrix matrix)final BooleanisSameColumn(Matrix matrix)final BooleanisSameRowAndColumn(Matrix matrix)final Matrixinvert()将该矩阵进行转置变换 final Matrixplus(Matrix matrix)将两个矩阵相加注意: 本矩阵的大小要等于另一矩阵的大小 final Matrixmultiply(Double value)将该矩阵乘以一个实数 final Matrixmultiply(Matrix matrix)将该矩阵乘以另一个矩阵注意: 本矩阵的列数要等于另外一个矩阵的行数 final UnitprettyPrinting()将矩阵漂亮的打印出来 final LocationapplyLocation(Location location)将本矩阵的变换作用至给定的坐标上 final VectorapplyVector(Vector vector)将本矩阵的变换作用至给定的向量上 -
-
Constructor Detail
-
Matrix
Matrix(Array<DoubleArray> m)
-
Matrix
Matrix(Matrix matrix)
-
-
Method Detail
-
getAsArray
final Array<DoubleArray> getAsArray()
-
set
final Matrix set(Integer row, Integer column, Double value)
通过给定的值设定矩阵内对应的数值
- Parameters:
row- 行数column- 列数value- 数值- Returns:
-
fill
final Matrix fill(Integer row, Double value)
填充矩阵的某一行为同一实数
- Parameters:
row- 行数value- 实数- Returns:
-
getRowAsArray
final DoubleArray getRowAsArray(Integer row)
取出矩阵中单独的一行
- Parameters:
row- 行数- Returns:
对应行所成的数组
-
getColumnAsArray
final DoubleArray getColumnAsArray(Integer column)
取矩阵中单独的一列
- Parameters:
column- 列数- Returns:
列所成的数组
-
isSameColumn
final Boolean isSameColumn(Matrix matrix)
-
isSameRowAndColumn
final Boolean isSameRowAndColumn(Matrix matrix)
-
plus
final Matrix plus(Matrix matrix)
将两个矩阵相加
注意: 本矩阵的大小要等于另一矩阵的大小
- Parameters:
matrix- 给定的矩阵- Returns:
-
multiply
final Matrix multiply(Matrix matrix)
将该矩阵乘以另一个矩阵
注意: 本矩阵的列数要等于另外一个矩阵的行数
- Parameters:
matrix- 给定的另一矩阵- Returns:
-
prettyPrinting
final Unit prettyPrinting()
将矩阵漂亮的打印出来
-
applyLocation
final Location applyLocation(Location location)
将本矩阵的变换作用至给定的坐标上
- Parameters:
location- 给定的坐标- Returns:
Location
-
applyVector
final Vector applyVector(Vector vector)
将本矩阵的变换作用至给定的向量上
- Parameters:
vector- 给定的向量- Returns:
Location
-
-
-
-