lasd/librerie/exercise5/zmytest/test.hpp

108 lines
2.0 KiB
C++
Raw Normal View History

#ifndef MYTEST_HPP
#define MYTEST_HPP
2021-06-04 22:16:34 +02:00
#include"../matrix/matrix.hpp"
#include"../matrix/csr/matrixcsr.hpp"
#include"../matrix/vec/matrixvec.hpp"
#include "../zlasdtest/test.hpp"
using namespace std;
using namespace lasd;
enum class DataType{integer,ffloat,sstring};
enum class Implementation{vector,yale};
2021-06-02 10:02:21 +02:00
void menu();
2021-06-09 08:13:58 +02:00
DataType ChooseDataType(); //choose data type
Implementation ChooseImplementation();
/* ----- integer functions ----- */
2021-06-04 22:16:34 +02:00
template <typename T>
void IntegerFunctions(T&);
2021-06-09 08:13:58 +02:00
2021-06-04 22:16:34 +02:00
template <typename T>
void ProductsElementsLessThan(T&);
2021-06-09 08:13:58 +02:00
2021-06-04 22:16:34 +02:00
void AccumulateProduct(const int&, const void*, void*);
2021-06-09 08:13:58 +02:00
2021-06-04 22:16:34 +02:00
template <typename T>
void Double(T&);
2021-06-09 08:13:58 +02:00
2021-06-04 22:16:34 +02:00
void MultiplyAnElement(int&, void*);
2021-06-09 08:13:58 +02:00
/* ----- float functions ----- */
2021-06-04 23:58:17 +02:00
template <typename T>
void FloatFunctions(T&);
2021-06-09 08:13:58 +02:00
2021-06-04 23:58:17 +02:00
template <typename T>
void SumElementsGreaterThan(T&);
2021-06-09 08:13:58 +02:00
2021-06-04 23:58:17 +02:00
void AccumulateSum(const float&, const void*, void*);
2021-06-09 08:13:58 +02:00
2021-06-04 23:58:17 +02:00
template <typename T>
void CubeElements(T&);
2021-06-09 08:13:58 +02:00
2021-06-04 23:58:17 +02:00
void Exponentiation(float&, void*);
2021-06-09 08:13:58 +02:00
/* ----- string functions ----- */
2021-06-04 23:58:17 +02:00
template <typename T>
void StringFunctions(T&);
2021-06-09 08:13:58 +02:00
2021-06-04 23:58:17 +02:00
template <typename T>
void ConcatLessThan(T&);
2021-06-09 08:13:58 +02:00
2021-06-04 23:58:17 +02:00
void ConcatAString(const string&, const void*, void*);
2021-06-09 08:13:58 +02:00
2021-06-04 23:58:17 +02:00
template <typename T>
void HeadConcat(T&);
2021-06-09 08:13:58 +02:00
2021-06-04 23:58:17 +02:00
void HeadConcatMapAux(string&, void*);
2021-06-04 22:16:34 +02:00
2021-06-09 08:13:58 +02:00
/* ----- shared functions ----- */
template <typename T>
void Print(T&);
template <template <typename...> class Matrix, typename Data>
void PrintElements(Matrix<Data>& mtx);
template <typename Data>
void PrintSingleElement(Data&, void*);
template <typename T>
void CheckExistenceOfCell(T&);
2021-06-09 08:13:58 +02:00
template <template <typename...> class Matrix, typename Data>
void CheckExistenceOfElement(Matrix<Data>&);
2021-06-09 08:13:58 +02:00
template <typename T>
void Insert(T&);
template <typename T>
void Read(const T&);
template <typename T>
void Resize(T& mtx);
2021-06-04 22:16:34 +02:00
/* ----- generator functions ----- */
2021-06-09 08:13:58 +02:00
2021-06-04 22:16:34 +02:00
void UseChosenType(Implementation, DataType);
2021-06-09 08:13:58 +02:00
2021-06-04 22:16:34 +02:00
template <typename T>
T GenerateIntegerMat(T&);
2021-06-09 08:13:58 +02:00
2021-06-04 22:16:34 +02:00
template <typename T>
T GenerateFloatMat(T&);
2021-06-09 08:13:58 +02:00
2021-06-04 22:16:34 +02:00
template <typename T>
T GenerateStringsMat(T&);
2021-06-09 08:13:58 +02:00
2021-06-04 22:16:34 +02:00
std::string generateRandomString(ulong);
#endif