|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.sandia.cognition.util.AbstractCloneableSerializable
gov.sandia.cognition.math.AbstractRing<VectorType>
gov.sandia.cognition.math.matrix.AbstractVectorSpace<Vector,VectorEntry>
gov.sandia.cognition.math.matrix.AbstractVector
gov.sandia.cognition.math.matrix.mtj.AbstractMTJVector
gov.sandia.cognition.math.matrix.mtj.DenseVector
@CodeReview(reviewer="Jonathan McClain", date="2006-05-19", changesNeeded=true, comments="Comments marked with / / /", response=@CodeReviewResponse(respondent="Kevin R. Dixon",date="2006-05-22",moreChangesNeeded=false,comments="Fixed comments for writeObject() and readObject()")) @PublicationReference(author="Bjorn-Ove Heimsund", title="MTJ DenseVector javadoc", type=WebPage, year=2006, url="http://ressim.berlios.de/doc/no/uib/cipr/matrix/DenseVector.html") public class DenseVector
A generally useful vector representation that allocates a fixed-size underlying vector, based on MTJ's DenseVector
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface gov.sandia.cognition.math.matrix.VectorSpace |
---|
VectorSpace.Entry |
Field Summary |
---|
Fields inherited from class gov.sandia.cognition.math.matrix.AbstractVector |
---|
DEFAULT_DELIMITER |
Constructor Summary | |
---|---|
protected |
DenseVector(AbstractMTJVector vector)
Copy constructor |
protected |
DenseVector(DenseVector vector)
Creates a new instance of DenseVector |
protected |
DenseVector(no.uib.cipr.matrix.DenseVector internalVector)
Creates a new instance of DenseVector |
protected |
DenseVector(double[] values)
Creates a new instance of DenseVector |
protected |
DenseVector(int numDimensions)
Creates a new instance of DenseVector |
protected |
DenseVector(Vector vector)
Copy constructor for DenseVector |
protected |
DenseVector(VectorReader reader)
Creates a new instance of DenseVector |
Method Summary | |
---|---|
boolean |
equals(Vector other,
double effectiveZero)
Determines if two RingType objects are effectively equal |
double |
euclideanDistanceSquared(Vector other)
Squared Euclidean distance between this and
other , which is the 2-norm between the difference of the
Vectors |
double[] |
getArray()
Returns the underlying double array for this DenseVector |
boolean |
isSparse()
Returns true if this vector has a potentially sparse underlying structure. |
DenseMatrix |
outerProduct(AbstractMTJVector other)
Computes the outer matrix product between the two vectors |
protected void |
setInternalVector(no.uib.cipr.matrix.DenseVector internalVector)
Sets the internalVector using MTJ's DenseVector |
DenseVector |
stack(Vector other)
Stacks "other" below "this" and returns the stacked Vector |
DenseVector |
subVector(int minIndex,
int maxIndex)
Gets a subvector of "this", specified by the inclusive indices |
Methods inherited from class gov.sandia.cognition.math.matrix.mtj.AbstractMTJVector |
---|
clone, dotProduct, dotProduct, dotTimesEquals, getDimensionality, getElement, getInternalVector, iterator, minusEquals, minusEquals, norm2, norm2Squared, outerProduct, plusEquals, plusEquals, scaledMinusEquals, scaledPlusEquals, scaledPlusEquals, scaleEquals, setElement, setInternalVector, times, times, zero |
Methods inherited from class gov.sandia.cognition.math.matrix.AbstractVector |
---|
assertDimensionalityEquals, assertEqualDimensionality, assertSameDimensionality, checkSameDimensionality, convertFromVector, convertToVector, dotDivide, dotDivideEquals, equals, hashCode, toArray, toString, toString, toString, transform, transformEquals, transformNonZeros, transformNonZerosEquals |
Methods inherited from class gov.sandia.cognition.math.matrix.AbstractVectorSpace |
---|
angle, cosine, euclideanDistance, isUnitVector, isUnitVector, isZero, norm, norm1, normInfinity, sum, unitVector, unitVectorEquals |
Methods inherited from class gov.sandia.cognition.math.AbstractRing |
---|
dotTimes, isZero, minus, negative, negativeEquals, plus, scale, scaledMinus, scaledMinusEquals, scaledPlus |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface gov.sandia.cognition.math.matrix.VectorSpace |
---|
angle, cosine, euclideanDistance, isUnitVector, isUnitVector, norm, norm1, normInfinity, sum, unitVector, unitVectorEquals |
Methods inherited from interface gov.sandia.cognition.math.Ring |
---|
dotTimes, isZero, isZero, minus, negative, negativeEquals, plus, scale, scaledMinus, scaledMinusEquals, scaledPlus |
Constructor Detail |
---|
protected DenseVector(int numDimensions)
numDimensions
- Number of dimensions in the Vectorprotected DenseVector(DenseVector vector)
vector
- Vector from which to populate the elements of this, will not be modifiedprotected DenseVector(Vector vector)
vector
- Vector from which to populate the elements of this, will not be modifiedprotected DenseVector(AbstractMTJVector vector)
vector
- Vector to copyprotected DenseVector(double[] values)
values
- The array of values to give the vectorprotected DenseVector(no.uib.cipr.matrix.DenseVector internalVector)
internalVector
- Internal MTJ-based vector that does the heavy liftingprotected DenseVector(VectorReader reader) throws IOException
reader
- takes in information from a java stream
IOException
- if the stream is invalidMethod Detail |
---|
protected void setInternalVector(no.uib.cipr.matrix.DenseVector internalVector)
internalVector
- internal MTJ-based DenseVectorpublic boolean equals(Vector other, double effectiveZero)
Ring
equals
in interface Ring<Vector>
equals
in class AbstractVector
other
- RingType to compare against this
effectiveZero
- tolerance threshold for element-wise equality
public double euclideanDistanceSquared(Vector other)
VectorSpace
this
and
other
, which is the 2-norm between the difference of the
Vectors
euclideanDistanceSquared
in interface VectorSpace<Vector,VectorEntry>
other
- Vector to which to compute the squared distance, must be the
same dimension as this
public DenseMatrix outerProduct(AbstractMTJVector other)
AbstractMTJVector
outerProduct
in class AbstractMTJVector
other
- post-multiplied Vector with which to compute the outer product
public DenseVector stack(Vector other)
Vector
stack
in interface Vector
other
- Vector to stack below "this"
public DenseVector subVector(int minIndex, int maxIndex)
subVector
in interface Vector
minIndex
- minimum index to get (inclusive)maxIndex
- maximum index to get (inclusive)
public double[] getArray()
public boolean isSparse()
Vector
isSparse
in interface Vector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |