Está en la página 1de 14

3/31/2015

Algebra (Colt 1.2.0 - API Specification)

Overview Package Class Use Tree Deprecated Index Help


PREVCLASSNEXTCLASS
SUMMARY:NESTED|FIELD|CONSTR|METHOD

Colt1.2.0

FRAMESNOFRAMESAllClasses
DETAIL:FIELD|CONSTR|METHOD

ClassAlgebra
cern.colt.matrix.linalg

java.lang.Object
cern.colt.PersistentObject
cern.colt.matrix.linalg.Algebra

AllImplementedInterfaces:
Cloneable,Serializable
publicclassAlgebra
extendsPersistentObject
LinearalgebraicmatrixoperationsoperatingonDoubleMatrix2Dconcentratesmostfunctionalityofthis
package.
Version:
1.0,09/24/99
SeeAlso:
SerializedForm

FieldSummary
staticAlgebra DEFAULT

AdefaultAlgebraobjecthasProperty.DEFAULTattachedfortolerance.
staticAlgebra ZERO

AdefaultAlgebraobjecthasProperty.ZEROattachedfortolerance.

Fieldsinheritedfromclasscern.colt.PersistentObject
serialVersionUID

ConstructorSummary
Algebra()

ConstructsanewinstancewithanequalitytolerancegivenbyProperty.DEFAULT.tolerance().
Algebra(doubletolerance)

Constructsanewinstancewiththegivenequalitytolerance.

MethodSummary
Object clone()
https://dst.lbl.gov/ACSSoftware/colt/api/cern/colt/matrix/linalg/Algebra.html

1/14

3/31/2015

Algebra (Colt 1.2.0 - API Specification)

Returnsacopyofthereceiver.
double cond(DoubleMatrix2DA)

ReturnstheconditionofmatrixA,whichistheratiooflargesttosmallest
singularvalue.
double det(DoubleMatrix2DA)

ReturnsthedeterminantofmatrixA.
DoubleMatrix2D inverse(DoubleMatrix2DA)

ReturnstheinverseorpseudoinverseofmatrixA.
double mult(DoubleMatrix1Dx, DoubleMatrix1Dy)

InnerproductoftwovectorsSum(x[i] * y[i]).
DoubleMatrix1D mult(DoubleMatrix2DA, DoubleMatrix1Dy)

Linearalgebraicmatrixvectormultiplicationz = A * y.
DoubleMatrix2D mult(DoubleMatrix2DA, DoubleMatrix2DB)

LinearalgebraicmatrixmatrixmultiplicationC = A x B.
DoubleMatrix2D multOuter(DoubleMatrix1Dx, DoubleMatrix1Dy, DoubleMatrix2DA)

OuterproductoftwovectorsSetsA[i,j] = x[i] * y[j].


double norm1(DoubleMatrix1Dx)

Returnstheonenormofvectorx,whichisSum(abs(x[i])).
double norm1(DoubleMatrix2DA)

ReturnstheonenormofmatrixA,whichisthemaximumabsolutecolumnsum.
double norm2(DoubleMatrix1Dx)

Returnsthetwonorm(akaeuclideannorm)ofvectorxequivalentto
mult(x,x).
double norm2(DoubleMatrix2DA)

ReturnsthetwonormofmatrixA,whichisthemaximumsingularvalue
obtainedfromSVD.
double normF(DoubleMatrix2DA)

ReturnstheFrobeniusnormofmatrixA,whichisSqrt(Sum(A[i,j]2)).
double normInfinity(DoubleMatrix1Dx)

Returnstheinfinitynormofvectorx,whichisMax(abs(x[i])).
double normInfinity(DoubleMatrix2DA)

ReturnstheinfinitynormofmatrixA,whichisthemaximumabsoluterowsum.
DoubleMatrix1D permute(DoubleMatrix1DA, int[]indexes, double[]work)

ModifiesthegivenvectorAsuchthatitispermutedasspecifiedUsefulfor
pivoting.
DoubleMatrix2D permute(DoubleMatrix2DA, int[]rowIndexes, int[]columnIndexes)

Constructsandreturnsanewrowandcolumnpermutedselectionviewof
matrixAequivalenttoDoubleMatrix2D.viewSelection(int[],int[]).
DoubleMatrix2D permuteColumns(DoubleMatrix2DA, int[]indexes, int[]work)

ModifiesthegivenmatrixAsuchthatit'scolumnsarepermutedasspecified
Usefulforpivoting.
DoubleMatrix2D permuteRows(DoubleMatrix2DA, int[]indexes, int[]work)

ModifiesthegivenmatrixAsuchthatit'srowsarepermutedasspecified
https://dst.lbl.gov/ACSSoftware/colt/api/cern/colt/matrix/linalg/Algebra.html

2/14

3/31/2015

Algebra (Colt 1.2.0 - API Specification)

Usefulforpivoting.
DoubleMatrix2D pow(DoubleMatrix2DA, intp)

LinearalgebraicmatrixpowerB = Ak <==> B = A*A*...*A.


Property property()

ReturnsthepropertyobjectattachedtothisAlgebra,definingtolerance.
int rank(DoubleMatrix2DA)

ReturnstheeffectivenumericalrankofmatrixA,obtainedfromSingularValue
Decomposition.
void setProperty(Propertyproperty)

AttachesthegivenpropertyobjecttothisAlgebra,definingtolerance.
DoubleMatrix2D solve(DoubleMatrix2DA, DoubleMatrix2DB)

SolvesA*X=B.
DoubleMatrix2D solveTranspose(DoubleMatrix2DA, DoubleMatrix2DB)

SolvesX*A=B,whichisalsoA'*X'=B'.
DoubleMatrix2D subMatrix(DoubleMatrix2DA, intfromRow, inttoRow, intfromColumn,

inttoColumn)

Constructsandreturnsanewsubrangeviewwhichisthesubmatrix
A[fromRow..toRow,fromColumn..toColumn].
String toString(DoubleMatrix2Dmatrix)

ReturnsaStringwith(propertyName,propertyValue)pairs.
String toVerboseString(DoubleMatrix2Dmatrix)

ReturnstheresultsoftoString(A)andadditionallytheresultsofallsortsof
decompositionsappliedtothegivenmatrix.
double trace(DoubleMatrix2DA)

ReturnsthesumofthediagonalelementsofmatrixASum(A[i,i]).
DoubleMatrix2D transpose(DoubleMatrix2DA)

Constructsandreturnsanewviewwhichisthetranspositionofthegivenmatrix
A.

Methodsinheritedfromclassjava.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

FieldDetail
DEFAULT
public static final Algebra DEFAULT

AdefaultAlgebraobjecthasProperty.DEFAULTattachedfortolerance.Allowsommitingto
constructanAlgebraobjecttimeandagain.NotethatthisAlgebraobjectisimmutable.Any
attempttoassignanewPropertyobjecttoit(viamethodsetProperty),ortoalterthetoleranceof
itspropertyobject(viaproperty().setTolerance(...))willthrowanexception.
https://dst.lbl.gov/ACSSoftware/colt/api/cern/colt/matrix/linalg/Algebra.html

3/14

3/31/2015

Algebra (Colt 1.2.0 - API Specification)

ZERO
public static final Algebra ZERO

AdefaultAlgebraobjecthasProperty.ZEROattachedfortolerance.Allowsommitingtoconstruct
anAlgebraobjecttimeandagain.NotethatthisAlgebraobjectisimmutable.Anyattempttoassign
anewPropertyobjecttoit(viamethodsetProperty),ortoalterthetoleranceofitspropertyobject
(viaproperty().setTolerance(...))willthrowanexception.

ConstructorDetail
Algebra
public Algebra()

ConstructsanewinstancewithanequalitytolerancegivenbyProperty.DEFAULT.tolerance().

Algebra
public Algebra(doubletolerance)

Constructsanewinstancewiththegivenequalitytolerance.
Parameters:
tolerancethetolerancetobeusedforequalityoperations.

MethodDetail
clone
public Object clone()

Returnsacopyofthereceiver.Theattachedpropertyobjectisalsocopied.Hence,theproperty
objectofthecopyismutable.
Overrides:
cloneinclassPersistentObject

Returns:
acopyofthereceiver.

cond
public double cond(DoubleMatrix2DA)

ReturnstheconditionofmatrixA,whichistheratiooflargesttosmallestsingularvalue.
https://dst.lbl.gov/ACSSoftware/colt/api/cern/colt/matrix/linalg/Algebra.html

4/14

3/31/2015

Algebra (Colt 1.2.0 - API Specification)

det
public double det(DoubleMatrix2DA)

ReturnsthedeterminantofmatrixA.
Returns:
thedeterminant.

inverse
public DoubleMatrix2D inverse(DoubleMatrix2DA)

ReturnstheinverseorpseudoinverseofmatrixA.
Returns:
anewindependentmatrixinverse(matrix)ifthematrixissquare,pseudoinverseotherwise.

mult
public double mult(DoubleMatrix1Dx,
DoubleMatrix1Dy)

InnerproductoftwovectorsSum(x[i] * y[i]).Alsoknownasdotproduct.
Equivalenttox.zDotProduct(y).
Parameters:
xthefirstsourcevector.
ythesecondsourcematrix.
Returns:
theinnerproduct.
Throws:
IllegalArgumentExceptionifx.size() != y.size().

mult
public DoubleMatrix1D mult(DoubleMatrix2DA,
DoubleMatrix1Dy)

Linearalgebraicmatrixvectormultiplicationz = A * y.z[i] = Sum(A[i,j] * y[j]),


i=0..A.rows()-1, j=0..y.size()-1.
Parameters:
Athesourcematrix.
ythesourcevector.
Returns:
zanewvectorwithz.size()==A.rows().
Throws:
IllegalArgumentExceptionifA.columns() != y.size().
https://dst.lbl.gov/ACSSoftware/colt/api/cern/colt/matrix/linalg/Algebra.html

5/14

3/31/2015

Algebra (Colt 1.2.0 - API Specification)

mult
public DoubleMatrix2D mult(DoubleMatrix2DA,
DoubleMatrix2DB)

LinearalgebraicmatrixmatrixmultiplicationC = A x B.C[i,j] = Sum(A[i,k] * B[k,j]),


k=0..n-1.
Matrixshapes:A(m x n), B(n x p), C(m x p).
Parameters:
Athefirstsourcematrix.
Bthesecondsourcematrix.
Returns:
Canewmatrixholdingtheresults,withC.rows()=A.rows(),
C.columns()==B.columns().
Throws:
IllegalArgumentExceptionifB.rows() != A.columns().

multOuter
public DoubleMatrix2D multOuter(DoubleMatrix1Dx,
DoubleMatrix1Dy,
DoubleMatrix2DA)

OuterproductoftwovectorsSetsA[i,j] = x[i] * y[j].


Parameters:
xthefirstsourcevector.
ythesecondsourcevector.
Athematrixtoholdtheresults.Setthisparametertonulltoindicatethatanewresult
matrixshallbeconstructed.
Returns:
A(forconvenienceonly).
Throws:
IllegalArgumentExceptionifA.rows() != x.size() || A.columns() != y.size().

norm1
public double norm1(DoubleMatrix1Dx)

Returnstheonenormofvectorx,whichisSum(abs(x[i])).

norm1
public double norm1(DoubleMatrix2DA)

ReturnstheonenormofmatrixA,whichisthemaximumabsolutecolumnsum.
https://dst.lbl.gov/ACSSoftware/colt/api/cern/colt/matrix/linalg/Algebra.html

6/14

3/31/2015

Algebra (Colt 1.2.0 - API Specification)

norm2
public double norm2(DoubleMatrix1Dx)

Returnsthetwonorm(akaeuclideannorm)ofvectorxequivalenttomult(x,x).

norm2
public double norm2(DoubleMatrix2DA)

ReturnsthetwonormofmatrixA,whichisthemaximumsingularvalueobtainedfromSVD.

normF
public double normF(DoubleMatrix2DA)

ReturnstheFrobeniusnormofmatrixA,whichisSqrt(Sum(A[i,j]2)).

normInfinity
public double normInfinity(DoubleMatrix1Dx)

Returnstheinfinitynormofvectorx,whichisMax(abs(x[i])).

normInfinity
public double normInfinity(DoubleMatrix2DA)

ReturnstheinfinitynormofmatrixA,whichisthemaximumabsoluterowsum.

permute
public DoubleMatrix1D permute(DoubleMatrix1DA,
int[]indexes,
double[]work)

ModifiesthegivenvectorAsuchthatitispermutedasspecifiedUsefulforpivoting.CellA[i]will
gointocellA[indexes[i]].
Example:
Reordering
[A,B,C,D,E] with indexes [0,4,2,3,1] yields
[A,E,C,D,B]
In other words A[0]<--A[0], A[1]<--A[4], A[2]<--A[2], A[3]<--A[3], A[4]<--A[1].
https://dst.lbl.gov/ACSSoftware/colt/api/cern/colt/matrix/linalg/Algebra.html

7/14

3/31/2015

Algebra (Colt 1.2.0 - API Specification)

Reordering
[A,B,C,D,E] with indexes [0,4,1,2,3] yields
[A,E,B,C,D]
In other words A[0]<--A[0], A[1]<--A[4], A[2]<--A[1], A[3]<--A[2], A[4]<--A[3].

Parameters:
Athevectortopermute.
indexesthepermutationindexes,mustsatisfyindexes.length==A.size() &&
indexes[i] >= 0 && indexes[i] < A.size()
worktheworkingstorage,mustsatisfywork.length >= A.size()setwork==nullifyou
don'tcareaboutperformance.
Returns:
themodifiedA(forconvenienceonly).
Throws:
IndexOutOfBoundsExceptionifindexes.length != A.size().

permute
public DoubleMatrix2D permute(DoubleMatrix2DA,
int[]rowIndexes,
int[]columnIndexes)

ConstructsandreturnsanewrowandcolumnpermutedselectionviewofmatrixAequivalentto
DoubleMatrix2D.viewSelection(int[],int[]).Thereturnedmatrixisbackedbythismatrix,so
changesinthereturnedmatrixarereflectedinthismatrix,andviceversa.Useidiomslikeresult
= permute(...).copy()togenerateanindependentsubmatrix.
Returns:
thenewpermutedselectionview.

permuteColumns
public DoubleMatrix2D permuteColumns(DoubleMatrix2DA,
int[]indexes,
int[]work)

ModifiesthegivenmatrixAsuchthatit'scolumnsarepermutedasspecifiedUsefulforpivoting.
ColumnA[i]willgointocolumnA[indexes[i]].EquivalenttopermuteRows(transpose(A),
indexes, work).
Parameters:
Athematrixtopermute.
indexesthepermutationindexes,mustsatisfyindexes.length==A.columns() &&
indexes[i] >= 0 && indexes[i] < A.columns()
worktheworkingstorage,mustsatisfywork.length >= A.columns()setwork==nullif
youdon'tcareaboutperformance.
Returns:
themodifiedA(forconvenienceonly).
Throws:
IndexOutOfBoundsExceptionifindexes.length != A.columns().
https://dst.lbl.gov/ACSSoftware/colt/api/cern/colt/matrix/linalg/Algebra.html

8/14

3/31/2015

Algebra (Colt 1.2.0 - API Specification)

permuteRows
public DoubleMatrix2D permuteRows(DoubleMatrix2DA,
int[]indexes,
int[]work)

ModifiesthegivenmatrixAsuchthatit'srowsarepermutedasspecifiedUsefulforpivoting.Row
A[i]willgointorowA[indexes[i]].
Example:
Reordering
[A,B,C,D,E] with indexes [0,4,2,3,1] yields
[A,E,C,D,B]
In other words A[0]<--A[0], A[1]<--A[4], A[2]<--A[2], A[3]<--A[3], A[4]<--A[1].
Reordering
[A,B,C,D,E] with indexes [0,4,1,2,3] yields
[A,E,B,C,D]
In other words A[0]<--A[0], A[1]<--A[4], A[2]<--A[1], A[3]<--A[2], A[4]<--A[3].

Parameters:
Athematrixtopermute.
indexesthepermutationindexes,mustsatisfyindexes.length==A.rows() &&
indexes[i] >= 0 && indexes[i] < A.rows()
worktheworkingstorage,mustsatisfywork.length >= A.rows()setwork==nullifyou
don'tcareaboutperformance.
Returns:
themodifiedA(forconvenienceonly).
Throws:
IndexOutOfBoundsExceptionifindexes.length != A.rows().

pow
public DoubleMatrix2D pow(DoubleMatrix2DA,
intp)

LinearalgebraicmatrixpowerB = Ak <==> B = A*A*...*A.


p >= 1: B = A*A*...*A.
p == 0: B = identity matrix.
p < 0: B = pow(inverse(A),-p).

Implementation:Basedonlogarithmsof2,memoryusageminimized.
Parameters:
Athesourcematrixmustbesquarestaysunaffectedbythisoperation.
ptheexponent,canbeanynumber.
Returns:
B,anewlyconstructedresultmatrixstorageindependentofA.
Throws:
https://dst.lbl.gov/ACSSoftware/colt/api/cern/colt/matrix/linalg/Algebra.html

9/14

3/31/2015

Algebra (Colt 1.2.0 - API Specification)

IllegalArgumentExceptionif!property().isSquare(A).

property
public Property property()

ReturnsthepropertyobjectattachedtothisAlgebra,definingtolerance.
Returns:
thePropertyobject.
SeeAlso:
setProperty(Property)

rank
public int rank(DoubleMatrix2DA)

ReturnstheeffectivenumericalrankofmatrixA,obtainedfromSingularValueDecomposition.

setProperty
public void setProperty(Propertyproperty)

AttachesthegivenpropertyobjecttothisAlgebra,definingtolerance.
Throws:
UnsupportedOperationExceptionifthis==DEFAULT && property!=this.property()

TheDEFAULTAlgebraobjectisimmutable.
UnsupportedOperationExceptionifthis==ZERO && property!=this.property()The
ZEROAlgebraobjectisimmutable.
SeeAlso:
property()

solve
public DoubleMatrix2D solve(DoubleMatrix2DA,
DoubleMatrix2DB)

SolvesA*X=B.
Returns:
XanewindependentmatrixsolutionifAissquare,leastsquaressolutionotherwise.

solveTranspose
public DoubleMatrix2D solveTranspose(DoubleMatrix2DA,
DoubleMatrix2DB)
https://dst.lbl.gov/ACSSoftware/colt/api/cern/colt/matrix/linalg/Algebra.html

10/14

3/31/2015

Algebra (Colt 1.2.0 - API Specification)

SolvesX*A=B,whichisalsoA'*X'=B'.
Returns:
XanewindependentmatrixsolutionifAissquare,leastsquaressolutionotherwise.

subMatrix
public DoubleMatrix2D subMatrix(DoubleMatrix2DA,
intfromRow,
inttoRow,
intfromColumn,
inttoColumn)

Constructsandreturnsanewsubrangeviewwhichisthesubmatrix
A[fromRow..toRow,fromColumn..toColumn].Thereturnedmatrixisbackedbythismatrix,so
changesinthereturnedmatrixarereflectedinthismatrix,andviceversa.Useidiomslikeresult
= subMatrix(...).copy()togenerateanindependentsubmatrix.
Parameters:
Athesourcematrix.
fromRowTheindexofthefirstrow(inclusive).
toRowTheindexofthelastrow(inclusive).
fromColumnTheindexofthefirstcolumn(inclusive).
toColumnTheindexofthelastcolumn(inclusive).
Returns:
anewsubrangeview.
Throws:
IndexOutOfBoundsExceptioniffromColumn<0 || toColumn-fromColumn+1<0 ||
toColumn>=A.columns() || fromRow<0 || toRow-fromRow+1<0 || toRow>=A.rows()

toString
public String toString(DoubleMatrix2Dmatrix)

ReturnsaStringwith(propertyName,propertyValue)pairs.Usefulfordebuggingortoquicklyget
theroughpicture.Forexample,
cond
det
norm1
norm2
normF
normInfinity
rank
trace

: 14.073264490042144
: Illegal operation or error: Matrix must be square.
: 0.9620244354009628
: 3.0
: 1.304841791648992
: 1.5406551198102534
:3
:0

toVerboseString
public String toVerboseString(DoubleMatrix2Dmatrix)

https://dst.lbl.gov/ACSSoftware/colt/api/cern/colt/matrix/linalg/Algebra.html

11/14

3/31/2015

Algebra (Colt 1.2.0 - API Specification)

ReturnstheresultsoftoString(A)andadditionallytheresultsofallsortsofdecompositions
appliedtothegivenmatrix.Usefulfordebuggingortoquicklygettheroughpicture.Forexample,
A = 3 x 3 matrix
249 66 68
104 214 108
144 146 293
cond
: 3.931600417472078
det
: 9638870.0
norm1
: 497.0
norm2
: 473.34508217011404
normF
: 516.873292016525
normInfinity : 583.0
rank
:3
trace
: 756.0
density
: 1.0
isDiagonal
: false
isDiagonallyDominantByColumn : true
isDiagonallyDominantByRow
: true
isIdentity
: false
isLowerBidiagonal
: false
isLowerTriangular
: false
isNonNegative
: true
isOrthogonal
: false
isPositive
: true
isSingular
: false
isSkewSymmetric
: false
isSquare
: true
isStrictlyLowerTriangular
: false
isStrictlyTriangular
: false
isStrictlyUpperTriangular
: false
isSymmetric
: false
isTriangular
: false
isTridiagonal
: false
isUnitTriangular
: false
isUpperBidiagonal
: false
isUpperTriangular
: false
isZero
: false
lowerBandwidth
:2
semiBandwidth
:3
upperBandwidth
:2
----------------------------------------------------------------------------LUDecompositionQuick(A) --> isNonSingular(A), det(A), pivot, L, U, inverse(A)
----------------------------------------------------------------------------isNonSingular = true
det = 9638870.0
pivot = [0, 1, 2]
L = 3 x 3 matrix
1
0
0
0.417671 1
0
0.578313 0.57839 1
U = 3 x 3 matrix
249 66
68
0 186.433735 79.598394
0 0
207.635819
https://dst.lbl.gov/ACSSoftware/colt/api/cern/colt/matrix/linalg/Algebra.html

12/14

3/31/2015

Algebra (Colt 1.2.0 - API Specification)

inverse(A) = 3 x 3 matrix
0.004869 -0.000976 -0.00077
-0.001548 0.006553 -0.002056
-0.001622 -0.002786 0.004816
----------------------------------------------------------------QRDecomposition(A) --> hasFullRank(A), H, Q, R, pseudo inverse(A)
----------------------------------------------------------------hasFullRank = true
H = 3 x 3 matrix
1.814086 0
0
0.34002 1.903675 0
0.470797 0.428218 2
Q = 3 x 3 matrix
-0.814086 0.508871 0.279845
-0.34002 -0.808296 0.48067
-0.470797 -0.296154 -0.831049
R = 3 x 3 matrix
-305.864349 -195.230337 -230.023539
0
-182.628353 467.703164
0
0
-309.13388
pseudo inverse(A) = 3 x 3 matrix
0.006601 0.001998 -0.005912
-0.005105 0.000444 0.008506
-0.000905 -0.001555 0.002688
-------------------------------------------------------------------------CholeskyDecomposition(A) --> isSymmetricPositiveDefinite(A), L, inverse(A)
-------------------------------------------------------------------------isSymmetricPositiveDefinite = false
L = 3 x 3 matrix
15.779734 0
0
6.590732 13.059948 0
9.125629 6.573948 12.903724
inverse(A) = Illegal operation or error: Matrix is not symmetric positive definite.
--------------------------------------------------------------------EigenvalueDecomposition(A) --> D, V, realEigenvalues, imagEigenvalues
--------------------------------------------------------------------realEigenvalues = 1 x 3 matrix
462.796507 172.382058 120.821435
imagEigenvalues = 1 x 3 matrix
000
D = 3 x 3 matrix
462.796507 0
0
0
172.382058 0
0
0
120.821435
V = 3 x 3 matrix
-0.398877 -0.778282 0.094294
-0.500327 0.217793 -0.806319
-0.768485 0.66553 0.604862
--------------------------------------------------------------------https://dst.lbl.gov/ACSSoftware/colt/api/cern/colt/matrix/linalg/Algebra.html

13/14

3/31/2015

Algebra (Colt 1.2.0 - API Specification)

SingularValueDecomposition(A) --> cond(A), rank(A), norm2(A), U, S, V


--------------------------------------------------------------------cond = 3.931600417472078
rank = 3
norm2 = 473.34508217011404
U = 3 x 3 matrix
0.46657 -0.877519 0.110777
0.50486 0.161382 -0.847982
0.726243 0.45157 0.51832
S = 3 x 3 matrix
473.345082 0
0
0
169.137441 0
0
0
120.395013
V = 3 x 3 matrix
0.577296 -0.808174 0.116546
0.517308 0.251562 -0.817991
0.631761 0.532513 0.563301

trace
public double trace(DoubleMatrix2DA)

ReturnsthesumofthediagonalelementsofmatrixASum(A[i,i]).

transpose
public DoubleMatrix2D transpose(DoubleMatrix2DA)

ConstructsandreturnsanewviewwhichisthetranspositionofthegivenmatrixA.Equivalentto
A.viewDice().Thisisazerocopytransposition,takingO(1),i.e.constanttime.Thereturnedview
isbackedbythismatrix,sochangesinthereturnedviewarereflectedinthismatrix,andviceversa.
Useidiomslikeresult = transpose(A).copy()togenerateanindependentmatrix.
Example:
2x3matrix:
3x2matrix:
2x3matrix:
1,2,3
1,4
1,2,3
transpose==>
transpose==>
4,5,6
2,5
4,5,6
3,6
Returns:
anewtransposedview.
Overview Package Class Use Tree Deprecated Index Help
PREVCLASSNEXTCLASS
SUMMARY:NESTED|FIELD|CONSTR|METHOD

Colt1.2.0

FRAMESNOFRAMESAllClasses
DETAIL:FIELD|CONSTR|METHOD

JumptotheColtHomepage
https://dst.lbl.gov/ACSSoftware/colt/api/cern/colt/matrix/linalg/Algebra.html

14/14

También podría gustarte