#ifndef BSON_2_WMIS_QUBO_H
|
|
#define BSON_2_WMIS_QUBO_H
|
|
|
|
#include "bsoncxx/document/view.hpp"
|
|
#include "bsoncxx/array/view.hpp"
|
|
#include "bsoncxx/types.hpp"
|
|
|
|
#include "util/convert.h"
|
|
|
|
#include <iostream>
|
|
#include "bsoncxx/json.hpp"
|
|
|
|
#include <map>
|
|
#include <unordered_map>
|
|
|
|
#include <tuple>
|
|
|
|
#include "util/wmis_qubo.h"
|
|
#include "util/bson_2_qubo_coupler.h"
|
|
namespace satlab
|
|
{
|
|
|
|
namespace types
|
|
{
|
|
|
|
template<typename = wmis_qubo, typename = bsoncxx::document::view>
|
|
void convert(wmis_qubo& qubo, const bsoncxx::document::view& docView)
|
|
{
|
|
qubo = wmis_qubo();
|
|
|
|
for(auto& entry : docView["qubo"].get_array().value)
|
|
{
|
|
|
|
wmis_qubo::COUPLER coupler;
|
|
|
|
convert(coupler, entry.get_array().value);
|
|
|
|
qubo.add(coupler);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif // BSON_2_WMIS_QUBO_H
|