A high-performance general-purpose compute library

Print the array to a string instead of the screen. More...

Functions

AFAPI void toString (char **output, const char *exp, const array &arr, const int precision=4, const bool transpose=true)
 
AFAPI const char * toString (const char *exp, const array &arr, const int precision=4, const bool transpose=true)
 
AFAPI af_err af_array_to_string (char **output, const char *exp, const af_array arr, const int precision, const bool transpose)
 

Detailed Description

Print the array to a string instead of the screen.

This function is similar to af::print, except that it prints to a string rather than to screen.


Function Documentation

◆ af_array_to_string()

AFAPI af_err af_array_to_string ( char **  output,
const char *  exp,
const af_array  arr,
const int  precision,
const bool  transpose 
)
Parameters
[out]outputis the pointer to the c-string that will hold the data. The memory for output is allocated by the function. The user is responsible for deleting the memory.
[in]expis an expression, generally the name of the array
[in]arris the input array
[in]precisionis the precision length for display
[in]transposedetermines whether or not to transpose the array before storing it in the string

◆ toString() [1/2]

AFAPI void toString ( char **  output,
const char *  exp,
const array arr,
const int  precision = 4,
const bool  transpose = true 
)
Parameters
[out]outputis the pointer to the c-string that will hold the data. The memory for output is allocated by the function. The user is responsible for deleting the memory using af::freeHost() or af_free_host().
[in]expis an expression, generally the name of the array
[in]arris the input array
[in]precisionis the precision length for display
[in]transposedetermines whether or not to transpose the array before storing it in the string

◆ toString() [2/2]

AFAPI const char * toString ( const char *  exp,
const array arr,
const int  precision = 4,
const bool  transpose = true 
)
Parameters
[in]expis an expression, generally the name of the array
[in]arris the input array
[in]precisionis the precision length for display
[in]transposedetermines whether or not to transpose the array before storing it in the string
Returns
output is the pointer to the c-string that will hold the data. The memory for output is allocated by the function. The user is responsible for deleting the memory using af::freeHost() or af_free_host().