#ifndef VARIABLES
#define VARIABLES

#include "initials.h"
#include "exit-codes.h"

// phi, rho_g, Ug, Ul
typedef struct {
  double p1, p2, p3, p4;
} PrimitiveVars;

// phi*rho_g, phi*rho_g*Ug, (1-phi)*rgo_l, (1-phi)*rho_l*Ul
typedef struct {
  double u1, u2, u3, u4;
} ConservVars;

// type conversions
ConservVars primitive2conserv (PrimitiveVars pv);
PrimitiveVars conserv2primitive (ConservVars cv);
PrimitiveVars num2primitive (double num);
ConservVars num2conserv (double num);

// output
int sprintf_PrimitiveVars (char* str, PrimitiveVars vars);
int sprintf_ConservVars (char* str, ConservVars vars);

// PrimiriveVars operator overloading
const PrimitiveVars operator+ (PrimitiveVars v1, PrimitiveVars v2);
const PrimitiveVars operator- (PrimitiveVars v1, PrimitiveVars v2);
const PrimitiveVars operator* (PrimitiveVars v1, PrimitiveVars v2);
const PrimitiveVars operator/ (PrimitiveVars v1, PrimitiveVars v2);
// Primitive-Number operator overloading
const PrimitiveVars operator+ (PrimitiveVars vars, double num);
const PrimitiveVars operator+ (double num, PrimitiveVars vars);
const PrimitiveVars operator- (PrimitiveVars vars, double num);
const PrimitiveVars operator- (double num, PrimitiveVars vars);
const PrimitiveVars operator* (PrimitiveVars vars, double num);
const PrimitiveVars operator* (double num, PrimitiveVars vars);
const PrimitiveVars operator/ (PrimitiveVars vars, double num);
const PrimitiveVars operator/ (double num, PrimitiveVars vars);

// ConservVars operator overloading
const ConservVars operator+ (ConservVars v1, ConservVars v2);
const ConservVars operator- (ConservVars v1, ConservVars v2);
const ConservVars operator* (ConservVars v1, ConservVars v2);
const ConservVars operator/ (ConservVars v1, ConservVars v2);
// Conserv-Number operator overloading
const ConservVars operator+ (ConservVars vars, double num);
const ConservVars operator+ (double num, ConservVars vars);
const ConservVars operator- (ConservVars vars, double num);
const ConservVars operator- (double num, ConservVars vars);
const ConservVars operator* (ConservVars vars, double num);
const ConservVars operator* (double num, ConservVars vars);
const ConservVars operator/ (ConservVars vars, double num);
const ConservVars operator/ (double num, ConservVars vars);

#endif // VARIABLES