Vec_d (struct)¶
The Vec_d represents a dense vector.
/*
** Example: Vec_d
*/
// create a 7-element vector
Vec_d vec(7);
Methods¶
Vec_d ( in Integer size ) | |
Vec_d ( in Vec_d that ) | |
Vec_d () | |
Boolean | almostEqual ? ( in Vec_d other ) |
Boolean | almostEqual ? ( in Vec_d that, in Float64 precision ) |
appendDesc ? ( io String string ) | |
Vec_d | clamp ? ( in Vec_d min, in Vec_d max ) |
Vec_d | clone ? () |
Float64 | dot ? ( in Vec_d that ) |
Boolean | equal ? ( in Vec_d that ) |
Float64 | get ? ( in Integer ind ) |
UInt32 | hash ? () |
Vec_d | head ? ( in Integer n ) |
Float64 | length ? () |
Float64 | lengthSquared ? () |
Vec_d | linearInterpolate ? ( in Vec_d that, in Float64 t ) |
normalize ! () | |
resize ! ( in Integer newSize ) | |
set ! ( in Integer ind, in Float64 val ) | |
setAll ! ( in Float64 val ) | |
setNull ! () | |
Float64 | setUnit ! () |
Integer | size ? () |
String | sizeDesc ? () |
Vec_d | sub ? ( in Integer s, in Integer e ) |
Vec_d | unit ? () |
Integer | validateSize ? ( in Vec_d that, in String desc ) |
Methods in detail¶
Vec_d ( in Integer size )
Construct a vector with size
elements
Construct a vector from the vector that
Vec_d ()
default constructor
Boolean Vec_d.almostEqual? ( in Vec_d other )
Returns true if this vector is almost the same as another one (using a default precision)
Boolean Vec_d.almostEqual? ( in Vec_d that, in Float64 precision )
Returns true if this vector is almost the same as another one (using a default precision)
Vec_d.appendDesc? ( io String string )
Append a String description of this vector’s size and contents
to the io variable string
Vec_d Vec_d.clamp? ( in Vec_d min, in Vec_d max )
Clamps this vector per component by a min and max vector
clone method
Float64 Vec_d.dot? ( in Vec_d that )
Boolean Vec_d.equal? ( in Vec_d that )
Returns true if this vector is the same as another one
Float64 Vec_d.get? ( in Integer ind )
Get value of the vector element at the ind
position
Hash for this matrix
Vec_d Vec_d.head? ( in Integer n )
Return the length of the vector
Float64 Vec_d.lengthSquared? ()
Vec_d Vec_d.linearInterpolate? ( in Vec_d that, in Float64 t )
Linearly interpolates this vector with another one based on a scalar blend value (0.0 to 1.0)
Vec_d.normalize! ()
Vec_d.resize! ( in Integer newSize )
Change the number of elements in the vector to newSize
Vec_d.set! ( in Integer ind, in Float64 val )
Set the value of element ind
to val
Vec_d.setAll! ( in Float64 val )
Set the value of all vector elements to val
Vec_d.setNull! ()
Set the value of all vector elements to zero
Sets this vector to its unit vector and returns its previous length
Integer Vec_d.size? ()
Get the size of the vector
Return a String description of this vector and its size
Vec_d Vec_d.sub? ( in Integer s, in Integer e )
Returns the unit vector of this one, throws and exception if almost zero length
Integer Vec_d.validateSize? ( in Vec_d that, in String desc )
In Fabric guarded mode this method throws an exception if the size
of the current vector differs from the size of the that
vector