/*! \file

  \brief This file is for testing all pieces and all steps

  \authors Boyana Norris, Beata Winnicka, Paul Hovland
  \version $Id$

  Copyright (c) 2006, Argonne National Laboratory <br>
  All rights reserved. <br>
  See $ADIC_DIR/share/ADIC_Copyright.txt for details. <br>

*/

#ifndef __AD_TYPES_H
#define __AD_TYPES_H

#ifdef ADIC_DENSE
#include "adic_gradvec_length.h"
#endif

#ifdef ADIC_DENSE_SEED
#include "adic_gradvec_length_seed.h"
#endif

#   if defined(__cplusplus)
        extern "C" {
#   endif

/*
 * An ultra-simple adic header file for a static-memory vector gradient type.
 */

typedef struct {
	double val;
	double grad[ADIC_GRADVEC_LENGTH];
} DERIV_TYPE;

#define DERIV_val(a)      (a).val
#define DERIV_grad(a)     (a).grad
#define DERIV_gradref(a)  &((a).grad)
#define DERIV_TYPE_ref(a) &(a)

/* Include the first-derivative macros and functions header */
#include "ad_grad.h"

#   if defined(__cplusplus)
}
#   endif

DERIV_TYPE*** ADIC_Create3DimArray(int size_dim0, int size_dim1, int size_dim2) ;
DERIV_TYPE** ADIC_Create2DimArray(int size_dim0, int size_dim1) ;
DERIV_TYPE* ADIC_Create1DimArray(int size_dim0);

#include <stdio.h>

void ADIC_GetSeedMatrixFromFile(const char *filename, double ***seedmatrix, int *row_count,  int *column_count);
void ADIC_SetIndepArrayFromSeed(DERIV_TYPE *ad_x, double **seedmatrix, int row_count,  int column_count);
void ADIC_ReadPatternFromFile(const char * filename, int ***lsi_SparsityPattern);
void ADIC_ReadVertexColorsFromFile(const char *filename, int **vi_RightVertexColors);
void ADIC_RecoverFullJacobian(DERIV_TYPE* ad_x, double** dp2_fullMatrix, int **lsi_SparsityPattern, int lsi_SparsityPattern_row_count, int *vi_RightVertexColors); 

#endif  /* #ifndef __AD_TYPES_H */
