public class Vector1 extends DenseVector implements Vector1D
DenseVector
.Vector.IndexValueConsumer, Vector.IndexValueTransform
VectorSpace.Entry
DEFAULT_DELIMITER
Constructor and Description |
---|
Vector1()
Creates a new instance of Vector1 that is all zeros.
|
Vector1(double x)
Creates a new instance of Vector1 with the given value.
|
Vector1(Vector other)
Creates a new instance of Vector1 with values copied from the given
vector.
|
Vector1(Vector1D other)
Creates a new instance of Vector1 with values copied from the given
vector.
|
Modifier and Type | Method and Description |
---|---|
Vector1 |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
int |
getDimensionality()
Returns the number of elements in the Vector
|
double |
getX()
Gets the value of the first (and only) dimension (x).
|
void |
setX(double x)
Sets the value of the first (and only) dimension (x).
|
java.lang.String |
toString()
The String representation of the Vector2, which is "<x>".
|
countNonZeros, equals, euclideanDistanceSquared, forEachElement, forEachEntry, forEachNonZero, get, getArray, getElement, getEntryCount, getMaxValue, getMinValue, getVectorFactory, isSparse, outerProduct, set, setElement, setInternalVector, setInternalVector, stack, subVector, sum, transformEquals, transformEquals, transformNonZerosEquals, transformNonZerosEquals
dotProduct, dotProduct, dotTimesEquals, getInternalVector, increment, iterator, minusEquals, minusEquals, norm2, norm2Squared, outerProduct, plusEquals, plusEquals, scaledMinusEquals, scaledPlusEquals, scaledPlusEquals, scaleEquals, times, times, zero
assertDimensionalityEquals, assertEqualDimensionality, assertSameDimensionality, checkSameDimensionality, convertFromVector, convertToVector, decrement, decrement, dotDivide, dotDivideEquals, equals, hashCode, increment, toArray, toString, toString, transform, transform, transformNonZeros, transformNonZeros, valuesAsList
angle, cosine, dot, euclideanDistance, isUnitVector, isUnitVector, isZero, norm, norm1, normInfinity, unitVector, unitVectorEquals
dotTimes, isZero, minus, negative, negativeEquals, plus, scale, scaledMinus, scaledMinusEquals, scaledPlus
finalize, getClass, notify, notifyAll, wait, wait, wait
assertDimensionalityEquals, assertSameDimensionality, checkSameDimensionality, countNonZeros, decrement, decrement, dotDivide, dotDivideEquals, forEachElement, forEachEntry, forEachNonZero, get, getElement, getEntryCount, getVectorFactory, increment, increment, isSparse, outerProduct, set, setElement, stack, subVector, times, toArray, toString, toString, transform, transform, transformEquals, transformEquals, transformNonZeros, transformNonZeros, transformNonZerosEquals, transformNonZerosEquals, valuesAsList
angle, cosine, dot, dotProduct, euclideanDistance, euclideanDistanceSquared, getMaxValue, getMinValue, isUnitVector, isUnitVector, norm, norm1, norm2, norm2Squared, normInfinity, sum, unitVector, unitVectorEquals
dotTimes, dotTimesEquals, equals, equals, isZero, isZero, minus, minusEquals, negative, negativeEquals, plus, plusEquals, scale, scaledMinus, scaledMinusEquals, scaledPlus, scaledPlusEquals, scaleEquals, zero
convertFromVector, convertToVector
public Vector1()
public Vector1(double x)
x
- The x-coordinate.public Vector1(Vector other)
other
- The other vector to copy.public Vector1(Vector1D other)
other
- The other vector to copy.public Vector1 clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface Vector
clone
in interface Vectorizable
clone
in interface Ring<Vector>
clone
in interface CloneableSerializable
clone
in class AbstractMTJVector
public int getDimensionality()
Vector
getDimensionality
in interface Vector
getDimensionality
in class DenseVector
public double getX()
Vector1D
public void setX(double x)
Vector1D
public java.lang.String toString()
toString
in interface Vector
toString
in class AbstractVector