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