Package org.robwork.sdurw_math
Class Vectorf
- java.lang.Object
-
- org.robwork.sdurw_math.Vectorf
-
public class Vectorf extends java.lang.Object
Configuration vector
-
-
Constructor Summary
Constructors Constructor Description Vectorf()
Default constructor.
The vector will be of dimension zero.Vectorf(long dim)
A configuration of vector of length dim.Vectorf(long cPtr, boolean cMemoryOwn)
Vectorf(long n, float value)
Creates a Vector of length n and initialize all values in Vector to value
Vectorf(long n, SWIGTYPE_p_float 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 Vectorf
add(Vectorf b)
Vector addition.Vectorf
addAssign(Vectorf v)
Vector addition.void
delete()
Vectorf
devideAssign(float s)
Scalar division.Vectorf
divide(float s)
Scalar division.SWIGTYPE_p_Eigen__MatrixT_float_Eigen__Dynamic_1_t
e()
Accessor for the internal Eigen vector state.boolean
empty()
True if the configuration is of dimension zero.float
get(long i)
static long
getCPtr(Vectorf obj)
Vectorf
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(Vectorf q)
Compares whether this is less than q
The less operator is defined such that the first index is the most significant.Vectorf
multiply(float s)
Scalar multiplication.Vectorf
multiplyAssign(float s)
Scalar multiplication.Vectorf
negate()
Unary minus.float
norm1()
Returns the Manhatten norm (1-norm) of the configurationfloat
norm2()
Returns the Euclidean norm (2-norm) of the configurationfloat
normInf()
Returns the infinte norm ( \inf-norm) of the configurationvoid
set(long i, float d)
void
setSubPart(long index, Vectorf part)
Set a part of the vector.long
size()
The dimension of the configuration vector.Vectorf
subtract(Vectorf b)
Vector subtraction.Vectorf
subtractAssign(Vectorf v)
Vector subtraction.static Vectorf
zero(int n)
Returns Vector of length n initialized with 0's
-
-
-
Constructor Detail
-
Vectorf
public Vectorf(long cPtr, boolean cMemoryOwn)
-
Vectorf
public Vectorf(long dim)
A configuration of vector of length dim.
-
Vectorf
public Vectorf()
Default constructor.
The vector will be of dimension zero.
-
Vectorf
public Vectorf(long n, SWIGTYPE_p_float 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
-
Vectorf
public Vectorf(long n, float 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(Vectorf obj)
-
delete
public void delete()
-
zero
public static Vectorf 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_float_Eigen__Dynamic_1_t e()
Accessor for the internal Eigen vector state.
-
getSubPart
public Vectorf 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, Vectorf part)
Set a part of the vector.- Parameters:
index
- [in] first index.part
- [in] the subpart to set.
-
norm2
public float norm2()
Returns the Euclidean norm (2-norm) of the configuration- Returns:
- the norm
-
norm1
public float norm1()
Returns the Manhatten norm (1-norm) of the configuration- Returns:
- the norm
-
normInf
public float normInf()
Returns the infinte norm ( \inf-norm) of the configuration- Returns:
- the norm
-
get
public float get(long i)
-
set
public void set(long i, float d)
-
divide
public Vectorf divide(float s)
Scalar division.
-
multiply
public Vectorf multiply(float s)
Scalar multiplication.
-
multiplyAssign
public Vectorf multiplyAssign(float s)
Scalar multiplication.
-
devideAssign
public Vectorf devideAssign(float s)
Scalar division.
-
negate
public Vectorf negate()
Unary minus.
-
leessThan
public boolean leessThan(Vectorf 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.
-
-