Converts an array. More...

array as (dtype type) const
 
array asfloat () const
 Convert array to a floating point type(if not already). More...
 

Detailed Description

Converts an array.

Converts an array from one type to another.

Function Documentation

array as ( dtype  type) const

array a( seq(1, 0.5, 2) ); // a=[1.0 1.5 2.0]
array b = a.as(u32); // b=[1 1 2]
See Also
asfloat
Examples:
examples/machine_learning/kmeans.cpp.
array asfloat ( ) const

Convert array to a floating point type(if not already).

This function will only perform an operation on b8, s32, u32). No effect on f32, f64, c32, c64

Returns
A converted array.