Package org.robwork.sdurw
Class RWVectord
- java.lang.Object
-
- org.robwork.sdurw.RWVectord
-
public class RWVectord extends java.lang.ObjectConfiguration vector
-
-
Constructor Summary
Constructors Constructor Description RWVectord()Default constructor.
The vector will be of dimension zero.RWVectord(long dim)A configuration of vector of length dim.RWVectord(long cPtr, boolean cMemoryOwn)RWVectord(long n, double value)Creates a Vector of length n and initialize all values in Vector to value
RWVectord(long n, 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 RWVectordadd(RWVectord b)Vector addition.voiddelete()RWVectorddivide(double s)Scalar division.EigenVectorXde()Accessor for the internal Eigen vector state.booleanempty()True if the configuration is of dimension zero.doubleget(long i)static longgetCPtr(RWVectord obj)RWVectordgetSubPart(long start, long cnt)Extracts a sub part (range) of this Vector.booleanleessThan(RWVectord q)Compares whether this is less than q
The less operator is defined such that the first index is the most significant.RWVectordmultiply(double s)Scalar multiplication.RWVectordnegate()Unary minus.doublenorm1()Returns the Manhatten norm (1-norm) of the configurationdoublenorm2()Returns the Euclidean norm (2-norm) of the configurationdoublenormInf()Returns the infinte norm ( \inf -norm) of the configurationvoidset(long i, double d)voidsetSubPart(long index, RWVectord part)Set a part of the vector.longsize()The dimension of the configuration vector.RWVectordsubtract(RWVectord b)Vector subtraction.java.lang.StringtoString()static RWVectordzero(int n)Returns Vector of length n initialized with 0's
-
-
-
Constructor Detail
-
RWVectord
public RWVectord(long cPtr, boolean cMemoryOwn)
-
RWVectord
public RWVectord(long dim)
A configuration of vector of length dim.
-
RWVectord
public RWVectord()
Default constructor.
The vector will be of dimension zero.
-
RWVectord
public RWVectord(long n, 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
-
RWVectord
public RWVectord(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(RWVectord obj)
-
delete
public void delete()
-
zero
public static RWVectord 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 EigenVectorXd e()
Accessor for the internal Eigen vector state.
-
getSubPart
public RWVectord getSubPart(long start, long cnt)
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, RWVectord 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
-
divide
public RWVectord divide(double s)
Scalar division.
-
multiply
public RWVectord multiply(double s)
Scalar multiplication.
-
negate
public RWVectord negate()
Unary minus.
-
leessThan
public boolean leessThan(RWVectord 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.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
get
public double get(long i)
-
set
public void set(long i, double d)
-
-