Sie sind auf Seite 1von 19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

Overview Package Class Use Tree Deprecated Index Help


PREVCLASSNEXTCLASS
SUMMARY:NESTED|FIELD|CONSTR|METHOD

ParallelColt0.7.2

FRAMESNOFRAMESAllClasses
DETAIL:FIELD|CONSTR|METHOD

ClassDoubleAlgebra
cern.colt.matrix.tdouble.algo

java.lang.Object
cern.colt.PersistentObject
cern.colt.matrix.tdouble.algo.DoubleAlgebra

AllImplementedInterfaces:
Serializable,Cloneable
public class DoubleAlgebra
extends PersistentObject

LinearalgebraicmatrixoperationsoperatingonDoubleMatrix2Dconcentratesmostfunctionalityofthispackage.
Version:
1.0,09/24/99,1.110/20/2007
Author:
wolfgang.hoschek@cern.ch,PiotrWendykier(piotr.wendykier@gmail.com)
SeeAlso:
SerializedForm

FieldSummary
staticDoubleAlgebra DEFAULT

AdefaultAlgebraobjecthasDoubleProperty.DEFAULTattachedfortolerance.
staticDoubleAlgebra ZERO

AdefaultAlgebraobjecthasDoubleProperty.ZEROattachedfortolerance.

ConstructorSummary
DoubleAlgebra()

ConstructsanewinstancewithanequalitytolerancegivenbyProperty.DEFAULT.tolerance().
DoubleAlgebra(doubletolerance)

Constructsanewinstancewiththegivenequalitytolerance.

MethodSummary
DoubleMatrix1D backwardSolve(DoubleMatrix2DU, DoubleMatrix1Db)

DoubleCholeskyDecomposition chol(DoubleMatrix2Dmatrix)

Constructsandreturnsthecholeskydecompositionofthegiven
matrix.
Object clone()

Returnsacopyofthereceiver.
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.DoubleMa

1/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

double cond(DoubleMatrix2DA)

ReturnstheconditionofmatrixA,whichistheratiooflargestto
smallestsingularvalue.
double det(DoubleMatrix2DA)

ReturnsthedeterminantofmatrixA.
DoubleEigenvalueDecomposition eig(DoubleMatrix2Dmatrix)

ConstructsandreturnstheEigenvaluedecompositionofthegiven
matrix.
DoubleMatrix1D forwardSolve(DoubleMatrix2DL, DoubleMatrix1Db)

staticdouble hypot(doublea, doubleb)

Returnssqrt(a^2+b^2)withoutunder/overflow.
staticDoubleDoubleFunction hypotFunction()

Returnssqrt(a^2+b^2)withoutunder/overflow.
DoubleMatrix2D inverse(DoubleMatrix2DA)

ReturnstheinverseorpseudoinverseofmatrixA.
DComplexMatrix1D kron(DComplexMatrix1Dx, DComplexMatrix1Dy)

ComputestheKroneckerproductoftwocomplexmatrices.
DoubleMatrix1D kron(double[]A, double[]B)

ComputestheKroneckerproductoftwoarrays.
DoubleMatrix1D kron(DoubleMatrix1Dx, DoubleMatrix1Dy)

ComputestheKroneckerproductoftworealmatrices.
DoubleLUDecomposition lu(DoubleMatrix2Dmatrix)

ConstructsandreturnstheLUdecompositionofthegivenmatrix.
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 norm(DoubleMatrix1Dx, Normtype)

double norm(DoubleMatrix2DA, Normtype)

double norm1(DoubleMatrix1Dx)

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

ReturnstheonenormofmatrixA,whichisthemaximumabsolute
columnsum.
double norm2(DoubleMatrix1Dx)

Returnsthetwonorm(akaeuclideannorm)ofvectorxequivalent
toSqrt(mult(x,x)).
double norm2(DoubleMatrix2DA)

ReturnsthetwonormofmatrixA,whichisthemaximumsingular
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.DoubleMa

2/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

valueobtainedfromSVD.
double normF(DComplexMatrix2DA)

ReturnstheFrobeniusnormofmatrixA,whichis
Sqrt(Sum(A[i,j]2)).
double normF(DoubleMatrix1DA)

ReturnstheFrobeniusnormofmatrixA,whichis
Sqrt(Sum(A[i]2)).
double normF(DoubleMatrix2DA)

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

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

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

ModifiesthegivenvectorAsuchthatitispermutedasspecified
Usefulforpivoting.
DoubleMatrix2D permute(DoubleMatrix2DA, int[]rowIndexes,

int[]columnIndexes)

Constructsandreturnsanewrowandcolumnpermutedselection
viewofmatrixAequivalentto
DoubleMatrix2D.viewSelection(int[],int[]).
DoubleMatrix2D permuteColumns(DoubleMatrix2DA, int[]indexes, int[]work)

ModifiesthegivenmatrixAsuchthatit'scolumnsarepermutedas
specifiedUsefulforpivoting.
DoubleMatrix2D permuteRows(DoubleMatrix2DA, int[]indexes, int[]work)

ModifiesthegivenmatrixAsuchthatit'srowsarepermutedas
specifiedUsefulforpivoting.
DoubleMatrix2D pow(DoubleMatrix2DA, intp)

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


DoubleProperty property()

ReturnsthepropertyobjectattachedtothisAlgebra,defining
tolerance.
DoubleQRDecomposition qr(DoubleMatrix2Dmatrix)

ConstructsandreturnstheQRdecompositionofthegivenmatrix.
int rank(DoubleMatrix2DA)

ReturnstheeffectivenumericalrankofmatrixA,obtainedfrom
SingularValueDecomposition.
void setProperty(DoublePropertyproperty)

AttachesthegivenpropertyobjecttothisAlgebra,defining
tolerance.
DoubleMatrix1D solve(DoubleMatrix2DA, DoubleMatrix1Db)

SolvesA*x=b.
DoubleMatrix2D solve(DoubleMatrix2DA, DoubleMatrix2DB)

DoubleMatrix2D solveTranspose(DoubleMatrix2DA, DoubleMatrix2DB)

SolvesX*A=B,whichisalsoA'*X'=B'.
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.DoubleMa

3/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

DoubleMatrix2D subMatrix(DoubleMatrix2DA, int[]rowIndexes, intcolumnFrom,

intcolumnTo)

Copiesthecolumnsoftheindicatedrowsintoanewsubmatrix.
DoubleMatrix2D subMatrix(DoubleMatrix2DA, introwFrom, introwTo,

int[]columnIndexes)

Copiestherowsoftheindicatedcolumnsintoanewsubmatrix.
DoubleMatrix2D subMatrix(DoubleMatrix2DA, intfromRow, inttoRow,

intfromColumn, inttoColumn)

Constructsandreturnsanewsubrangeviewwhichisthesub
matrixA[fromRow..toRow,fromColumn..toColumn].
DoubleSingularValueDecomposition svd(DoubleMatrix2Dmatrix)

ConstructsandreturnstheSingularValuedecompositionofthe
givenmatrix.
DoubleSingularValueDecompositionDC svdDC(DoubleMatrix2Dmatrix)

ConstructsandreturnstheSingularValuedecompositionofthe
givenmatrix.
String toString(DoubleMatrix2Dmatrix)

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

ReturnstheresultsoftoString(A)andadditionallytheresultsofall
sortsofdecompositionsappliedtothegivenmatrix.
double trace(DoubleMatrix2DA)

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

Constructsandreturnsanewviewwhichisthetranspositionofthe
givenmatrixA.
DoubleMatrix2D trapezoidalLower(DoubleMatrix2DA)

Modifiesthematrixtobealowertrapezoidalmatrix.
double vectorNorm2(DoubleMatrix2DX)

Returnsthetwonorm(akaeuclideannorm)ofvector
X.vectorize()
double vectorNorm2(DoubleMatrix3DX)

Returnsthetwonorm(akaeuclideannorm)ofvector
X.vectorize()
DoubleMatrix2D xmultOuter(DoubleMatrix1Dx, DoubleMatrix1Dy)

OuterproductoftwovectorsReturnsamatrixwithA[i,j] = x[i]
* y[j].
DoubleMatrix2D xpowSlow(DoubleMatrix2DA, intk)

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

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

FieldDetail
DEFAULT
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.DoubleMa

4/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

public static final DoubleAlgebra DEFAULT

AdefaultAlgebraobjecthasDoubleProperty.DEFAULTattachedfortolerance.Allowsommitingtoconstruct
anAlgebraobjecttimeandagain.NotethatthisAlgebraobjectisimmutable.Anyattempttoassignanew
Propertyobjecttoit(viamethodsetProperty),ortoalterthetoleranceofitspropertyobject(via
property().setTolerance(...))willthrowanexception.

ZERO
public static final DoubleAlgebra ZERO

AdefaultAlgebraobjecthasDoubleProperty.ZEROattachedfortolerance.Allowsommitingtoconstructan
Algebraobjecttimeandagain.NotethatthisAlgebraobjectisimmutable.Anyattempttoassignanew
Propertyobjecttoit(viamethodsetProperty),ortoalterthetoleranceofitspropertyobject(via
property().setTolerance(...))willthrowanexception.

ConstructorDetail
DoubleAlgebra
public DoubleAlgebra()

ConstructsanewinstancewithanequalitytolerancegivenbyProperty.DEFAULT.tolerance().

DoubleAlgebra
public DoubleAlgebra(doubletolerance)

Constructsanewinstancewiththegivenequalitytolerance.
Parameters:
tolerancethetolerancetobeusedforequalityoperations.

MethodDetail
chol
public DoubleCholeskyDecomposition chol(DoubleMatrix2Dmatrix)

Constructsandreturnsthecholeskydecompositionofthegivenmatrix.

clone
public Object clone()

Returnsacopyofthereceiver.Theattachedpropertyobjectisalsocopied.Hence,thepropertyobjectofthe
copyismutable.
Overrides:
cloneinclassPersistentObject

Returns:
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.DoubleMa

5/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

acopyofthereceiver.

cond
public double cond(DoubleMatrix2DA)

ReturnstheconditionofmatrixA,whichistheratiooflargesttosmallestsingularvalue.

det
public double det(DoubleMatrix2DA)

ReturnsthedeterminantofmatrixA.
Returns:
thedeterminant.

eig
public DoubleEigenvalueDecomposition eig(DoubleMatrix2Dmatrix)

ConstructsandreturnstheEigenvaluedecompositionofthegivenmatrix.

hypot
public static double hypot(doublea,
doubleb)

Returnssqrt(a^2+b^2)withoutunder/overflow.

hypotFunction
public static DoubleDoubleFunction hypotFunction()

Returnssqrt(a^2+b^2)withoutunder/overflow.

inverse
public DoubleMatrix2D inverse(DoubleMatrix2DA)

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

lu
public DoubleLUDecomposition lu(DoubleMatrix2Dmatrix)

http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.DoubleMa

6/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

ConstructsandreturnstheLUdecompositionofthegivenmatrix.

kron
public DComplexMatrix1D kron(DComplexMatrix1Dx,
DComplexMatrix1Dy)

ComputestheKroneckerproductoftwocomplexmatrices.
Parameters:
x
y
Returns:
theKroneckerproductoftwocomplexmatrices

kron
public DoubleMatrix1D kron(double[]A,
double[]B)

ComputestheKroneckerproductoftwoarrays.
Parameters:
A
B
Returns:
theKroneckerproductoftwoarrays

kron
public DoubleMatrix1D kron(DoubleMatrix1Dx,
DoubleMatrix1Dy)

ComputestheKroneckerproductoftworealmatrices.
Parameters:
x
y
Returns:
theKroneckerproductoftworealmatrices

mult
public double mult(DoubleMatrix1Dx,
DoubleMatrix1Dy)

InnerproductoftwovectorsSum(x[i] * y[i]).Alsoknownasdotproduct.
Equivalenttox.zDotProduct(y).
Parameters:
xthefirstsourcevector.
ythesecondsourcematrix.
Returns:
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.DoubleMa

7/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

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().

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.Setthisparametertonulltoindicatethatanewresultmatrixshallbe
constructed.
Returns:
A(forconvenienceonly).
Throws:
IllegalArgumentExceptionifA.rows() != x.size() || A.columns() != y.size().
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.DoubleMa

8/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

norm1
public double norm1(DoubleMatrix1Dx)

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

norm1
public double norm1(DoubleMatrix2DA)

ReturnstheonenormofmatrixA,whichisthemaximumabsolutecolumnsum.

norm2
public double norm2(DoubleMatrix1Dx)

Returnsthetwonorm(akaeuclideannorm)ofvectorxequivalenttoSqrt(mult(x,x)).

vectorNorm2
public double vectorNorm2(DoubleMatrix2DX)

Returnsthetwonorm(akaeuclideannorm)ofvectorX.vectorize()

vectorNorm2
public double vectorNorm2(DoubleMatrix3DX)

Returnsthetwonorm(akaeuclideannorm)ofvectorX.vectorize()

norm
public double norm(DoubleMatrix2DA,
Normtype)

norm
public double norm(DoubleMatrix1Dx,
Normtype)

norm2
public double norm2(DoubleMatrix2DA)

ReturnsthetwonormofmatrixA,whichisthemaximumsingularvalueobtainedfromSVD.

normF
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.DoubleMa

9/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

public double normF(DoubleMatrix2DA)

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

normF
public double normF(DoubleMatrix1DA)

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

normF
public double normF(DComplexMatrix2DA)

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]willgointo
cellA[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:
Athevectortopermute.
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.Double

10/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

indexesthepermutationindexes,mustsatisfyindexes.length==A.size() && indexes[i] >= 0 &&


indexes[i] < A.size()
worktheworkingstorage,mustsatisfywork.length >= A.size()setwork==nullifyoudon'tcare

aboutperformance.
Returns:
themodifiedA(forconvenienceonly).
Throws:
IndexOutOfBoundsExceptionifindexes.length != A.size().

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

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

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

ModifiesthegivenmatrixAsuchthatit'scolumnsarepermutedasspecifiedUsefulforpivoting.Column
A[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==nullifyoudon't
careaboutperformance.
Returns:
themodifiedA(forconvenienceonly).
Throws:
IndexOutOfBoundsExceptionifindexes.length != A.columns().

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

ModifiesthegivenmatrixAsuchthatit'srowsarepermutedasspecifiedUsefulforpivoting.RowA[i]will
gointorowA[indexes[i]].
Example:
Reordering
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.Double

11/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

[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==nullifyoudon'tcare
aboutperformance.
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:
IllegalArgumentExceptionif!property().isSquare(A).

property
public DoubleProperty property()

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

qr
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.Double

12/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

public DoubleQRDecomposition qr(DoubleMatrix2Dmatrix)

ConstructsandreturnstheQRdecompositionofthegivenmatrix.

rank
public int rank(DoubleMatrix2DA)

ReturnstheeffectivenumericalrankofmatrixA,obtainedfromSingularValueDecomposition.

setProperty
public void setProperty(DoublePropertyproperty)

AttachesthegivenpropertyobjecttothisAlgebra,definingtolerance.
Parameters:
propertythePropertyobjecttobeattached.

Throws:
UnsupportedOperationExceptionifthis==DEFAULT && property!=this.property()The

DEFAULTAlgebraobjectisimmutable.
UnsupportedOperationExceptionifthis==ZERO && property!=this.property()TheZERO
Algebraobjectisimmutable.
SeeAlso:
property

backwardSolve
public DoubleMatrix1D backwardSolve(DoubleMatrix2DU,
DoubleMatrix1Db)

forwardSolve
public DoubleMatrix1D forwardSolve(DoubleMatrix2DL,
DoubleMatrix1Db)

solve
public DoubleMatrix1D solve(DoubleMatrix2DA,
DoubleMatrix1Db)

SolvesA*x=b.
Returns:
xanewindependentmatrixsolutionifAissquare,leastsquaressolutionotherwise.

solve
public DoubleMatrix2D solve(DoubleMatrix2DA,
DoubleMatrix2DB)
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.Double

13/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

Returns:
XanewindependentmatrixsolutionifAissquare,leastsquaressolutionotherwise.

solveTranspose
public DoubleMatrix2D solveTranspose(DoubleMatrix2DA,
DoubleMatrix2DB)

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

subMatrix
public DoubleMatrix2D subMatrix(DoubleMatrix2DA,
int[]rowIndexes,
intcolumnFrom,
intcolumnTo)

Copiesthecolumnsoftheindicatedrowsintoanewsubmatrix.sub[0..rowIndexes.length1,0..columnTo-columnFrom] = A[rowIndexes(:),columnFrom..columnTo]Thereturnedmatrixisnot
backedbythismatrix,sochangesinthereturnedmatrixarenotreflectedinthismatrix,andviceversa.
Parameters:
Athesourcematrixtocopyfrom.
rowIndexestheindexesoftherowstocopy.Maybeunsorted.
columnFromtheindexofthefirstcolumntocopy(inclusive).
columnTotheindexofthelastcolumntocopy(inclusive).
Returns:
anewsubmatrixwithsub.rows()==rowIndexes.length; sub.columns()==columnTocolumnFrom+1.
Throws:
IndexOutOfBoundsExceptionifcolumnFrom<0 || columnTo-columnFrom+1<0 ||
columnTo+1>matrix.columns() || for any row=rowIndexes[i]: row < 0 || row >=
matrix.rows().

subMatrix
public DoubleMatrix2D subMatrix(DoubleMatrix2DA,
introwFrom,
introwTo,
int[]columnIndexes)

Copiestherowsoftheindicatedcolumnsintoanewsubmatrix.sub[0..rowTorowFrom,0..columnIndexes.length-1] = A[rowFrom..rowTo,columnIndexes(:)]Thereturnedmatrixis

notbackedbythismatrix,sochangesinthereturnedmatrixarenotreflectedinthismatrix,andviceversa.
Parameters:
Athesourcematrixtocopyfrom.
rowFromtheindexofthefirstrowtocopy(inclusive).
rowTotheindexofthelastrowtocopy(inclusive).
columnIndexestheindexesofthecolumnstocopy.Maybeunsorted.
Returns:
anewsubmatrixwithsub.rows()==rowTo-rowFrom+1; sub.columns()==columnIndexes.length.
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.Double

14/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

Throws:
IndexOutOfBoundsExceptionifrowFrom<0 || rowTo-rowFrom+1<0 || rowTo+1>matrix.rows()
|| for any col=columnIndexes[i]: col < 0 || col >= matrix.columns().

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

Constructsandreturnsanewsubrangeviewwhichisthesubmatrix
A[fromRow..toRow,fromColumn..toColumn].Thereturnedmatrixisbackedbythismatrix,sochangesinthe
returnedmatrixarereflectedinthismatrix,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()

svd
public DoubleSingularValueDecomposition svd(DoubleMatrix2Dmatrix)

ConstructsandreturnstheSingularValuedecompositionofthegivenmatrix.

svdDC
public DoubleSingularValueDecompositionDC svdDC(DoubleMatrix2Dmatrix)

ConstructsandreturnstheSingularValuedecompositionofthegivenmatrix.Thisisadivideandconquer
version.

toString
public String toString(DoubleMatrix2Dmatrix)

ReturnsaStringwith(propertyName,propertyValue)pairs.Usefulfordebuggingortoquicklygettherough
picture.Forexample,
cond
det
norm1
norm2
normF

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

http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.Double

15/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

normInfinity : 1.5406551198102534
rank
:3
trace
:0

toVerboseString
public String toVerboseString(DoubleMatrix2Dmatrix)

ReturnstheresultsoftoString(A)andadditionallytheresultsofallsortsofdecompositionsappliedtothe
givenmatrix.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
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.Double

16/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

U = 3 x 3 matrix
249 66
68
0 186.433735 79.598394
0 0
207.635819
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
--------------------------------------------------------------------http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.Double

17/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - 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.Thereturnedviewisbacked
bythismatrix,sochangesinthereturnedviewarereflectedinthismatrix,andviceversa.Useidiomslike
result = 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.

trapezoidalLower
public DoubleMatrix2D trapezoidalLower(DoubleMatrix2DA)

Modifiesthematrixtobealowertrapezoidalmatrix.
Returns:
A(forconvenienceonly).
http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.Double

18/19

1/31/2016

DoubleAlgebra (Parallel Colt 0.7.2 - API Specification)

xmultOuter
public DoubleMatrix2D xmultOuter(DoubleMatrix1Dx,
DoubleMatrix1Dy)

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


Parameters:
xthefirstsourcevector.
ythesecondsourcevector.
Returns:
theouterproductA.

xpowSlow
public DoubleMatrix2D xpowSlow(DoubleMatrix2DA,
intk)

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


Parameters:
Athesourcematrixmustbesquare.
ktheexponent,canbeanynumber.
Returns:
anewresultmatrix.
Throws:
IllegalArgumentExceptionif!Testing.isSquare(A).
Overview Package Class Use Tree Deprecated Index Help
PREVCLASSNEXTCLASS
SUMMARY:NESTED|FIELD|CONSTR|METHOD

ParallelColt0.7.2

FRAMESNOFRAMESAllClasses
DETAIL:FIELD|CONSTR|METHOD

JumptotheParallelColtHomepage

http://incanter.org/docs/parallelcolt/api/cern/colt/matrix/tdouble/algo/DoubleAlgebra.html#mult(cern.colt.matrix.tdouble.Double

19/19

Das könnte Ihnen auch gefallen