Package org.robwork.sdurw_math
Class Vector
- java.lang.Object
-
- org.robwork.sdurw_math.Vector
-
public class Vector extends java.lang.Object
Configuration vector
-
-
Constructor Summary
Constructors Constructor Description Vector()
Default constructor.
The vector will be of dimension zero.Vector(long dim)
A configuration of vector of length dim.Vector(long cPtr, boolean cMemoryOwn)
Vector(long n, double value)
Creates a Vector of length n and initialize all values in Vector to value
Vector(long n, SWIGTYPE_p_double values)
Creates a Vector of length n and initialized with values from values
The method reads n values from values and do not check whether reading out of bounds.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector
add(Vector b)
Vector addition.Vector
addAssign(Vector v)
Vector addition.void
delete()
Vector
devideAssign(double s)
Scalar division.Vector
divide(double s)
Scalar division.SWIGTYPE_p_Eigen__MatrixT_double_Eigen__Dynamic_1_t
e()
Accessor for the internal Eigen vector state.boolean
empty()
True if the configuration is of dimension zero.double
get(long i)
static long
getCPtr(Vector obj)
Vector
getSubPart(long start, long cnt)
Start of sequence iterator.
End of sequence iterator.
Start of sequence iterator.
End of sequence iterator.
Extracts a sub part (range) of this Vector.boolean
leessThan(Vector q)
Compares whether this is less than q
The less operator is defined such that the first index is the most significant.Vector
multiply(double s)
Scalar multiplication.Vector
multiplyAssign(double s)
Scalar multiplication.Vector
negate()
Unary minus.double
norm1()
Returns the Manhatten norm (1-norm) of the configurationdouble
norm2()
Returns the Euclidean norm (2-norm) of the configurationdouble
normInf()
Returns the infinte norm ( \inf-norm) of the configurationvoid
set(long i, double d)
void
setSubPart(long index, Vector part)
Set a part of the vector.long
size()
The dimension of the configuration vector.Vector
subtract(Vector b)
Vector subtraction.Vector
subtractAssign(Vector v)
Vector subtraction.static Vector
zero(int n)
Returns Vector of length n initialized with 0's
-
-
-
Constructor Detail
-
Vector
public Vector(long cPtr, boolean cMemoryOwn)
-
Vector
public Vector(long dim)
A configuration of vector of length dim.
-
Vector
public Vector()
Default constructor.
The vector will be of dimension zero.
-
Vector
public Vector(long n, SWIGTYPE_p_double values)
Creates a Vector of length n and initialized with values from values
The method reads n values from values and do not check whether reading out of bounds.
- Parameters:
n
- [in] Length of q.values
- [in] Values to initialize with
-
Vector
public Vector(long n, double value)
Creates a Vector of length n and initialize all values in Vector to value
- Parameters:
n
- [in] Length of q.value
- [in] Value to initialize
-
-
Method Detail
-
getCPtr
public static long getCPtr(Vector obj)
-
delete
public void delete()
-
zero
public static Vector zero(int n)
Returns Vector of length n initialized with 0's
-
size
public long size()
The dimension of the configuration vector.
-
empty
public boolean empty()
True if the configuration is of dimension zero.
-
e
public SWIGTYPE_p_Eigen__MatrixT_double_Eigen__Dynamic_1_t e()
Accessor for the internal Eigen vector state.
-
getSubPart
public Vector getSubPart(long start, long cnt)
Start of sequence iterator.
End of sequence iterator.
Start of sequence iterator.
End of sequence iterator.
Extracts a sub part (range) of this Vector.- Parameters:
start
- [in] Start indexcnt
- [in] the number of elements to include- Returns:
-
setSubPart
public void setSubPart(long index, Vector part)
Set a part of the vector.- Parameters:
index
- [in] first index.part
- [in] the subpart to set.
-
norm2
public double norm2()
Returns the Euclidean norm (2-norm) of the configuration- Returns:
- the norm
-
norm1
public double norm1()
Returns the Manhatten norm (1-norm) of the configuration- Returns:
- the norm
-
normInf
public double normInf()
Returns the infinte norm ( \inf-norm) of the configuration- Returns:
- the norm
-
get
public double get(long i)
-
set
public void set(long i, double d)
-
divide
public Vector divide(double s)
Scalar division.
-
multiply
public Vector multiply(double s)
Scalar multiplication.
-
multiplyAssign
public Vector multiplyAssign(double s)
Scalar multiplication.
-
devideAssign
public Vector devideAssign(double s)
Scalar division.
-
negate
public Vector negate()
Unary minus.
-
leessThan
public boolean leessThan(Vector q)
Compares whether this is less than q
The less operator is defined such that the first index is the most significant. That is
if (*this)[0] < q[0] then true is returned. If (*this)[0] > q[0] false is returned and
only if (*this)[0] == q[0] is the next index considered.
-
-