#include <string>
#include <vector>
#include "data.h"
#include "global.h"
#include "mtl/Vec.h"
Go to the source code of this file.
template<typename T >
std::vector<T> Utils::convertVecDataToVector |
( |
T * |
data, |
|
|
int |
size |
|
) |
| |
Converts given data and size, a NSPACE::vec to a std::vector.
- Parameters
-
| data | The data pointer |
[in] | size | The size |
- Template Parameters
-
- Returns
- The resultant vector
template<typename T >
vec<T> Utils::convertVectorToVec |
( |
std::vector< T > |
inputs | ) |
|
Converts a std::vector to a NSPACE::vec.
- Parameters
-
[in] | inputs | The input vector |
- Template Parameters
-
- Returns
- The resultant vec
template<typename T >
std::vector<T> Utils::convertVecToVector |
( |
vec< T > |
inputs | ) |
|
Converts a NSPACE::vec to a std::vector.
- Parameters
-
- Template Parameters
-
- Returns
- The resultant vector
template<typename T >
std::vector<T> Utils::flattenVector |
( |
std::vector< std::vector< T >> |
inputs | ) |
|
Converts a two dimensional vector to a one dimensional vector.
This is done by concatenating all the rows.
- Parameters
-
[in] | inputs | The input vector |
- Template Parameters
-
- Returns
- The resultant vector
template<typename T >
std::vector<T> Utils::flattenVector |
( |
std::vector< std::vector< std::vector< T >>> |
inputs | ) |
|
Converts a three dimensional vector to a one dimensional vector.
This is done by concatenating all the rows.
- Parameters
-
[in] | inputs | The input vector |
- Template Parameters
-
- Returns
- The resultant vector
std::string Utils::getFieldName |
( |
FieldType |
fieldType, |
|
|
int |
index, |
|
|
Data & |
data |
|
) |
| |
Gets the field name in the Data of a given FieldType at a given index.
- Parameters
-
[in] | fieldType | The FieldType member |
[in] | index | The index |
| data | The Data object |
- Returns
- The field name as a string
std::string Utils::getFieldTypeName |
( |
FieldType |
fieldType | ) |
|
Gets the field type name as a string.
For example, the name of FieldType::instructor is "Instructor".
- Parameters
-
[in] | fieldType | The FieldType member |
- Returns
- The field type name.
Gets the predefined constraint name as a string.
For example, the name of PredefinedClauses::instructorSingleCourseAtATime is "instructorSingleCourseAtATime".
- Parameters
-
[in] | clauseType | The PredefinedClauses member |
- Returns
- The predefined constraint name.