#include "itkParticleSwarmOptimizerSAXReader.h"
#include "itkParticleSwarmOptimizerSAXWriter.h"
#include "itkParticleSwarmOptimizerDOMReader.h"
#include "itkParticleSwarmOptimizerDOMWriter.h"
#include <iostream>
int
main(int argc, char * argv[])
{
if (argc < 4)
{
std::cerr
<< "arguments expected: test-input.pso.xml test-output-DOM.pso.xml "
"test-output-SAX.pso.xml"
<< std::endl;
return EXIT_FAILURE;
}
try
{
{
reader->SetFileName(argv[1]);
reader->Update();
optimizer = reader->GetOutput();
writer->SetInput(optimizer);
writer->SetFileName(argv[2]);
writer->Update();
}
{
reader->SetOutputObject(
optimizer);
reader->SetFilename(argv[1]);
reader->ReadFile();
writer->SetObject(optimizer);
writer->SetFilename(argv[3]);
writer->WriteFile();
}
}
{
return EXIT_FAILURE;
}
catch (...)
{
std::cerr << "Unknown exception caught!" << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}