class VEC < $VEC{FLT,VEC,FLT}
****
Concrete instantiation of a standard vector


Ancestors
$VEC{_,_,_} $VEC{_,_} VEC_LENGTH_MIXIN{_,_}



Public


Constants
const element_one:FLT := 1.0;
const element_zero:FLT := 0.0;
const length_one:FLT := 1.0;
const length_zero:FLT := 0.0;

Features
aclear .. Included as aclear
**** Set each element of self to nil. Built-in.
acopy(beg,num,srcbeg:INT, src:SAME) .. Included as acopy
**** Copy `num' elements from `src' to self starting at index `beg' of self and index `srcbeg' of `src'. Built-in.
acopy(beg,num:INT, src:SAME) .. Included as acopy
**** Copy `num' elements from `src' to self starting at index `beg' of self.
acopy(beg:INT, src:SAME) .. Included as acopy
**** Copy as many elements from `src' to self as will fit when starting at index `beg' of self.
acopy(src:SAME) .. Included as acopy
**** Copy as many elements from `src' to self as will fit. Built-in.
aget(ind:INT):T .. Included as aget
**** The element of self with index `ind'. Built-in.
angle_with(arg:SAME):ET .. Included as angle_with
array:ARRAY{ET} .. Included as array
array_ptr:C_PTR .. Included as array_ptr
aset(ind:INT, val:T) .. Included as aset
**** Set the element of self with index `ind' to `val'. Built-in.
asize:INT .. Included as asize
**** The number of elements in self. Classes which inherit this may replace this by a constant to get constant sized objects (and the compiler may optimize certain operations in this case). Built-in.
bounded_distance_to_squared(arg:SAME,sbnd:ET):ET .. Included as bounded_distance_to_squared
copy:SAME .. Included as copy
cosine_angle_with(arg:SAME):ET .. Included as cosine_angle_with
**** cos theta = a dot b / |a|*|b|
create(arg:ARRAY{ET}):SAME .. Included as create
create(sz:INT):SAME .. Included as create
create(arg:SAME):SAME .. Included as create
dim:INT .. Included as dim
distance_to(arg:SAME):ET .. Included as distance_to
distance_to_squared(arg:SAME):ET .. Included as distance_to_squared
**** we could implement in terms of other functions but I will hand-write for speed.
dot(arg:SAME):ET .. Included as dot
inplace_arg_minus_arg(arg1,arg2:SAME) .. Included as inplace_arg_minus_arg
inplace_arg_plus_arg(arg1,arg2:SAME) .. Included as inplace_arg_plus_arg
inplace_arg_plus_scaled_arg(arg1:SAME,s:ET,arg2:SAME) .. Included as inplace_arg_plus_scaled_arg
inplace_contents(arg:SAME) .. Included as inplace_contents
inplace_contents_from_function(function:ROUT{INT}:ET) .. Included as inplace_contents_from_function
inplace_contents_subspace(destbeg,n,srcbeg:INT,arg:SAME) .. Included as inplace_contents_subspace
inplace_elements(arg:ET) .. Included as inplace_elements
inplace_minus_arg(arg:SAME) .. Included as inplace_minus_arg
inplace_normalized .. Included as inplace_normalized
inplace_plus_arg(arg:SAME) .. Included as inplace_plus_arg
inplace_plus_scaled_arg(s:ET,arg:SAME) .. Included as inplace_plus_scaled_arg
inplace_scaled_by(s:ET) .. Included as inplace_scaled_by
inplace_swapped(arg:SAME) .. Included as inplace_swapped
inplace_unit_vector(i:INT) .. Included as inplace_unit_vector
is_eq(arg:SAME):BOOL .. Included as is_eq
length:ET .. Included as length
length_squared:ET .. Included as length_squared
max_value: FLT
minus(arg:SAME):SAME .. Included as minus
minus_arg(arg:SAME):SAME .. Included as minus_arg
plus(arg:SAME):SAME .. Included as plus
plus_arg(arg:SAME):SAME .. Included as plus_arg
plus_scaled_arg(s:ET,arg:SAME):SAME .. Included as plus_scaled_arg
same_size(arg:SAME):BOOL .. Included as same_size
scaled_by(s:ET):SAME .. Included as scaled_by
str:STR .. Included as str
**** Return a string representing the vector Eg. |0,1|
times(s:ET):SAME .. Included as times

Iters
aelt!(once beg:INT):T .. Included as aelt!
**** Yield each element of self starting at `beg'. Built-in.
aelt!(once beg,once num:INT):T .. Included as aelt!
**** Yield `num' successive elements of self starting at index `beg'. Built-in.
aelt!(once beg,once num,once step:INT):T .. Included as aelt!
**** Yield `num' elements of self starting at `beg' and stepping by `step' which must not be zero. Built-in.
aelt!:T .. Included as aelt!
**** Yield each element of self in order. Built-in.
aind!:INT .. Included as aind!
**** Yield the indices of self in order.
aset!(val:T) .. Included as aset!
**** Set successive elements of self to the values `val'. Built-in.
aset!(once beg:INT,val:T) .. Included as aset!
**** Set successive elements of self starting at `beg' to the values `val'.
aset!(once beg,once num:INT,val:T) .. Included as aset!
**** Set `num' successive elements of self starting at `beg' to the values `val'.
aset!(once beg,once num,once step:INT, val:T) .. Included as aset!
**** Set `num' elements of self starting at `beg' stepping by `step' to the values `val'. `step' must not be zero.


Private

is_legal_aelts_arg( beg, num, step:INT) :BOOL .. Included as is_legal_aelts_arg
**** True if the arguments are legal values for `aelts'.

The Sather Home Page