Streamlined verification

This commit is contained in:
jpekkila
2020-08-21 20:11:25 +03:00
parent b847b67805
commit 764e4dda69
6 changed files with 122 additions and 234 deletions

View File

@@ -31,11 +31,7 @@ extern "C" {
#include <stdbool.h>
#define ERROR_LABEL_LENGTH 30
typedef struct {
char label[ERROR_LABEL_LENGTH];
VertexBufferHandle handle;
AcReal model;
AcReal candidate;
long double abs_error;
@@ -45,42 +41,9 @@ typedef struct {
AcReal minimum_magnitude;
} Error;
typedef struct {
char label[ERROR_LABEL_LENGTH];
VertexBufferHandle vtxbuf;
ReductionType rtype;
AcReal candidate;
} AcScalReductionTestCase;
typedef struct {
char label[ERROR_LABEL_LENGTH];
VertexBufferHandle a;
VertexBufferHandle b;
VertexBufferHandle c;
ReductionType rtype;
AcReal candidate;
} AcVecReductionTestCase;
/** TODO comment */
Error acGetError(AcReal model, AcReal candidate);
/** TODO comment */
bool printErrorToScreen(const Error error);
/** Loads data from the config file */
AcResult acLoadConfig(const char* config_path, AcMeshInfo* config);
/** */
AcScalReductionTestCase acCreateScalReductionTestCase(const char* label,
const VertexBufferHandle vtxbuf,
const ReductionType rtype);
/** */
AcVecReductionTestCase acCreateVecReductionTestCase(const char* label, const VertexBufferHandle a,
const VertexBufferHandle b,
const VertexBufferHandle c,
const ReductionType rtype);
/** */
AcResult acMeshSet(const AcReal value, AcMesh* mesh);
@@ -96,23 +59,18 @@ AcResult acMeshClear(AcMesh* mesh);
/** */
AcResult acModelIntegrateStep(AcMesh mesh, const AcReal dt);
/** TODO */
/** */
AcReal acModelReduceScal(const AcMesh mesh, const ReductionType rtype, const VertexBufferHandle a);
/** TODO */
/** */
AcReal acModelReduceVec(const AcMesh mesh, const ReductionType rtype, const VertexBufferHandle a,
const VertexBufferHandle b, const VertexBufferHandle c);
/** */
AcResult acVerifyMesh(const AcMesh model, const AcMesh candidate);
Error acGetError(const AcReal model, const AcReal candidate);
/** */
AcResult acVerifyScalReductions(const AcMesh model, const AcScalReductionTestCase* testCases,
const size_t numCases);
bool acEvalError(const char* label, const Error error);
/** */
AcResult acVerifyVecReductions(const AcMesh model, const AcVecReductionTestCase* testCases,
const size_t numCases);
AcResult acVerifyMesh(const char* label, const AcMesh model, const AcMesh candidate);
#ifdef __cplusplus
} // extern "C"