Encode for base64 export.
Static class to provide functionality to encode any type of vector into an ascii string (uncompressed) and its inverse operation.
|
template<typename OutputType > |
static std::vector< OutputType > | Decode (const std::string &base64string) |
| Reading a B64 string, transforming it into a vector of a specific type. More...
|
|
template<typename ScalarType > |
static void | DecodeIntoGsType (const std::string &base64_string, const std::string &base_type_flag_, gsMatrix< ScalarType > &result) |
| Decode a string and copy into requested gismo Type. More...
|
|
template<typename ScalarType > |
static void | DecodeIntoGsType (const std::string &base64_string, const std::string &base_type_flag_, std::vector< ScalarType > &result) |
| Decode a string and copy into requested gismo Type. More...
|
|
template<typename BaseType > |
static std::string | Encode (const std::vector< BaseType > &data_vector) |
| Helper routine for std::vector data. More...
|
|
template<typename BaseType > |
static std::string | Encode (const gsMatrix< BaseType > &data_vector, const bool &row_wise=true) |
| Helper routine for gsMatrix Types (non-sparse) More...
|
|
|
static unsigned | char_decode_table (const unsigned &index) |
| Lookup Table for Decoding B64 string.
|
|
static char | char_encode_table (const unsigned &index) |
| Look up table.
|
|
template<typename BaseType , typename TargetType > |
static void | CopyIntoGsMatrix (const std::vector< BaseType > &base_vector, gsMatrix< TargetType > &result) |
| Copy a read vector of type BaseType into a gsMatrix with ScalarType TargetType. More...
|
|
template<typename BaseType , typename TargetType > |
static void | CopyIntoVector (const std::vector< BaseType > &base_vector, std::vector< TargetType > &result) |
| Cast a vector of a base type into a vector of TargetType. More...
|
|
static std::string | Encode_ (const ByteRepresentation *byte_vector_ptr, const std::size_t &minimum_n_bytes_required) |
| Actual encoding routine where byte-stream is transformed and encoded. More...
|
|
static const std::array
< unsigned, 256 > | ReverseCharEncodeTable_ () |
| Reverse the encoding table in an array. More...
|
|
static std::string | trimWhitespaces (const std::string &s) |
| Trim trailing and preceding whitespaces. More...
|
|
static void CopyIntoGsMatrix |
( |
const std::vector< BaseType > & |
base_vector, |
|
|
gsMatrix< TargetType > & |
result |
|
) |
| |
|
inlinestaticprivate |
Copy a read vector of type BaseType into a gsMatrix with ScalarType TargetType.
This is required as they might differ from each other, e.g., double into float, uint into int, etc.. Further, most matrices in Gismo (like coefficients) are stored in a different order (colwise) than the input stream, which prohibits the use of writing directly on the pointer
- Template Parameters
-
BaseType | Type as encoded into the input file |
TargetType | Type as requested from target |
- Parameters
-
base_vector | decoded std::vector with base type |
result | gsMatrix passed as reference |