|
JScience v3.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavolution.context.RealtimeObject
org.jscience.mathematics.vectors.Vector<Measure<?>>
org.jscience.physics.measures.MeasureVector<Q>
public class MeasureVector<Q extends Quantity>
This class represents a measurement vector for which all components are of the same type.
Measure vectors are typically 2 or 3 dimensional. For example:
class Velocity2D extends MeasureVector<Velocity> { ... }
MeasureVector<Length> xyz = MeasureVector.valueOf(METER, 2.0, -4.0, 3.0);
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javolution.context.RealtimeObject |
|---|
RealtimeObject.Factory<T extends RealtimeObject> |
| Nested classes/interfaces inherited from interface javolution.context.Realtime |
|---|
Realtime.ObjectSpace |
| Constructor Summary | |
|---|---|
MeasureVector(Measure<Q>... elements)
Creates a measurement vector holding the specified elements. |
|
| Method Summary | ||
|---|---|---|
Measure<Q> |
get(int i)
Returns a single element from this vector. |
|
int |
getDimension()
Returns the number of elements held by this vector. |
|
Measure<Q> |
norm()
Returns the Euclidian norm of this vector (square root of the dot product of this vector and itself). |
|
MeasureVector<Q> |
opposite()
Returns the negation of this vector. |
|
MeasureVector<Q> |
plus(Vector<Measure<?>> that)
Returns the sum of this vector with the one specified. |
|
static void |
recycle(MeasureVector vector)
Recycles the specified vector immediately. |
|
MeasureVector<? extends Quantity> |
times(Measure k)
Returns the product of this vector with the specified coefficient. |
|
Measure<?> |
times(Vector<Measure<?>> that)
Returns the dot product of this vector with the one specified. |
|
|
to(Unit<R> unit)
Returns the measurement vector equivalent to this vector but stated in the specified unit. |
|
static
|
valueOf(Measure<Q>... elements)
Returns a new measurement vector (potentially recycled)
holding the specified elements. |
|
static
|
valueOf(Unit<Q> unit,
double... values)
Returns the approximate measurement vector holding the specified values stated in the specified unit. |
|
static
|
valueOf(Unit<Q> unit,
long... values)
Returns the exact measurement vector holding the specified values stated in the specified unit. |
|
static
|
valueOf(Unit<Q> unit,
Vector<Measure<?>> that)
Returns a MeasureVector stated in the specified unit equivalent
to the specified vector |
|
| Methods inherited from class org.jscience.mathematics.vectors.Vector |
|---|
cross, equals, equals, hashCode, minus, toText, valueOf, valueOf |
| Methods inherited from class javolution.context.RealtimeObject |
|---|
export, isLocal, move, moveHeap, preserve, toString, unpreserve |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javolution.context.Realtime |
|---|
move, toText |
| Constructor Detail |
|---|
public MeasureVector(Measure<Q>... elements)
elements - the vector elements.| Method Detail |
|---|
public static <Q extends Quantity> MeasureVector<Q> valueOf(Measure<Q>... elements)
recycled)
holding the specified elements.
elements - the vector elements.
DimensionException - if the rows do not have the same length.ObjectFactory.object()
public static <Q extends Quantity> MeasureVector<Q> valueOf(Unit<Q> unit,
Vector<Measure<?>> that)
MeasureVector stated in the specified unit equivalent
to the specified vector
unit - the unit in which the measurements are stated.that - the vector to convert.
that or new equivalent dense vector.
public static <Q extends Quantity> MeasureVector<Q> valueOf(Unit<Q> unit,
long... values)
unit - the unit in which the measurements are stated.values - the exact values stated in the specified unit.
public static <Q extends Quantity> MeasureVector<Q> valueOf(Unit<Q> unit,
double... values)
unit - the unit in which the measurements are stated.values - the approximate values stated in the specified unit.
public static void recycle(MeasureVector vector)
vector - the vector being recycled.ObjectFactory.recycle(Object)public Measure<Q> norm()
norm in interface VectorSpaceNormed<Vector<Measure<?>>,Measure<?>>sqrt(this · this).public <R extends Quantity> MeasureVector<R> to(Unit<R> unit)
unit - the unit of the measurements to be returned.
ConversionException - if the current model does not allows for
conversion to the specified unit.public final int getDimension()
Vector
getDimension in class Vector<Measure<?>>public final Measure<Q> get(int i)
Vector
get in class Vector<Measure<?>>i - the element index (range [0..n[).
i.public MeasureVector<Q> opposite()
Vector
opposite in interface GroupAdditive<Vector<Measure<?>>>opposite in class Vector<Measure<?>>-this.public MeasureVector<Q> plus(Vector<Measure<?>> that)
Vector
plus in interface GroupAdditive<Vector<Measure<?>>>plus in class Vector<Measure<?>>that - the vector to be added.
this + that.public MeasureVector<? extends Quantity> times(Measure k)
Vector
times in interface VectorSpace<Vector<Measure<?>>,Measure<?>>times in class Vector<Measure<?>>k - the coefficient multiplier.
this · kpublic Measure<?> times(Vector<Measure<?>> that)
Vector
times in class Vector<Measure<?>>that - the vector multiplier.
this · that
|
JScience v3.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||