/* -------------------------------------------------------------

This file is a component of SDPA
Copyright (C) 2004 SDPA Project

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA

------------------------------------------------------------- */
/* The beginning of the ``example1-2.cpp''. */
/* $Id: example1-2.cpp,v 1.2 2004/09/01 06:34:12 makoto Exp $ */
#include <stdio.h>
#include <stdlib.h>

#include "sdpa-lib.hpp"
#include "sdpa-lib2.hpp"

int main (int argc, char *argv[])
{
	if (argc != 4)
	{
		fprintf(stderr, "%s [Input] [Output] [InitialPoint]\n", argv[0]);
		exit(EXIT_FAILURE);
	}

	SDPA	Problem1;

	Problem1.CheckMatrix     = false;
        Problem1.Method          = KSH;
	
	strcpy(Problem1.ParameterFileName, "param.sdpa");
	Problem1.ParameterFile = fopen(Problem1.ParameterFileName, "r");
	
	Problem1.InitialPoint = true;		/* If one want to set an initial point */

	strcpy(Problem1.InputFileName, argv[1]);
	Problem1.InputFile = fopen(Problem1.InputFileName,"r");
	strcpy(Problem1.OutputFileName, argv[2]);
	Problem1.OutputFile = fopen(Problem1.OutputFileName,"w");
	strcpy(Problem1.InitialFileName, argv[3]);
	Problem1.InitialFile = fopen(Problem1.InitialFileName,"r");

	Problem1.DisplayInformation = stdout;
	
	SDPA_initialize(Problem1);
	SDPA_Solve(Problem1);

	fclose(Problem1.InputFile);
	fclose(Problem1.OutputFile);
	
	Problem1.Delete();

	exit(0);
};	
/* The end of the ``example1-2.cpp''. */
