Class Pow
- java.lang.Object
-
- dev.nm.algebra.linear.matrix.doubles.matrixtype.dense.DenseMatrix
-
- dev.nm.algebra.linear.matrix.doubles.operation.Pow
-
- All Implemented Interfaces:
Matrix
,MatrixAccess
,MatrixRing
,MatrixTable
,Densifiable
,AbelianGroup<Matrix>
,Monoid<Matrix>
,Ring<Matrix>
,Table
,DeepCopyable
public class Pow extends DenseMatrix
This is a square matrix A to the power of an integer n, An. To avoid overflow ofdouble
precision, we represent the result as a product ofAn = basescale * B;
E.g.,An = 1e100scale * B = 10100 * scale * B
All entries in B can be represented indouble
precision.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableMatrix
B()
Get the double precision matrix.double
base()
Get the radix or base of the coefficient.int
scale()
Get the exponential of the coefficient.-
Methods inherited from class dev.nm.algebra.linear.matrix.doubles.matrixtype.dense.DenseMatrix
add, deepCopy, equals, get, getColumn, getColumn, getRow, getRow, hashCode, minus, multiply, multiply, nCols, nRows, ONE, opposite, scaled, set, setColumn, setRow, t, toDense, toString, ZERO
-
-
-
-
Constructor Detail
-
Pow
public Pow(Matrix A, int n, double base)
Construct the power matrix An so thatAn = basescale * B
- Parameters:
A
- a matrixn
- a positive integer exponentbase
- the base to scale down the product to avoid overflow
-
Pow
public Pow(Matrix A, int n)
Construct the power matrix An so thatAn = (1e100)scale * B
- Parameters:
A
- a matrixn
- a positive integer exponent
-
-
Method Detail
-
base
public double base()
Get the radix or base of the coefficient.- Returns:
- the base
- See Also:
- Wikipedia: Radix
-
scale
public int scale()
Get the exponential of the coefficient.- Returns:
- the exponential of the coefficient
-
B
public ImmutableMatrix B()
Get the double precision matrix.- Returns:
- the double precision matrix
-
-