id
int64 0
877k
| file_name
stringlengths 3
109
| file_path
stringlengths 13
185
| content
stringlengths 31
9.38M
| size
int64 31
9.38M
| language
stringclasses 1
value | extension
stringclasses 11
values | total_lines
int64 1
340k
| avg_line_length
float64 2.18
149k
| max_line_length
int64 7
2.22M
| alphanum_fraction
float64 0
1
| repo_name
stringlengths 6
66
| repo_stars
int64 94
47.3k
| repo_forks
int64 0
12k
| repo_open_issues
int64 0
3.4k
| repo_license
stringclasses 11
values | repo_extraction_date
stringclasses 197
values | exact_duplicates_redpajama
bool 2
classes | near_duplicates_redpajama
bool 2
classes | exact_duplicates_githubcode
bool 2
classes | exact_duplicates_stackv2
bool 1
class | exact_duplicates_stackv1
bool 2
classes | near_duplicates_githubcode
bool 2
classes | near_duplicates_stackv1
bool 2
classes | near_duplicates_stackv2
bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1,536,619
|
RoomMemberEntry.h
|
kovidomi_BBCF-Improvement-Mod/src/Game/Room/RoomMemberEntry.h
|
#pragma once
#include <cstdint>
#pragma pack(push, 1) // Prevent padding by compiler
class RoomMemberEntry
{
public:
uint8_t memberIndex; //0x0000
uint8_t N00009344; //0x0001
uint8_t N00009342; //0x0002
uint8_t N00009340; //0x0003
uint64_t steamId; //0x0004
char pad_000C[36]; //0x000C
uint32_t matchId; //0x0030
uint8_t matchPlayerIndex; //0x0034
uint8_t N00009349; //0x0035
uint8_t N0000934C; //0x0036
uint8_t N0000934A; //0x0037
char pad_0038[64]; //0x0038
uint64_t N0000914B; //0x0078
char pad_0080[24]; //0x0080
}; //Size: 0x0098
#pragma pack(pop)
| 570
|
C++
|
.h
| 22
| 24.136364
| 52
| 0.748624
|
kovidomi/BBCF-Improvement-Mod
| 32
| 12
| 1
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,620
|
Room.h
|
kovidomi_BBCF-Improvement-Mod/src/Game/Room/Room.h
|
#pragma once
#include "RoomMemberEntry.h"
#include <cstdint>
enum RoomStatus
{
RoomStatus_Unavailable,
RoomStatus_Initializing,
RoomStatus_Functional,
RoomStatus_Terminating
};
// Seems like a bitfield
enum RoomType : uint8_t
{
RoomType_Ranked = 0x10,
RoomType_MatchSpectate = 0x11,
RoomType_Lobby = 0x12,
RoomType_FFA = 0x21,
RoomType_Training = 0x31,
RoomType_Replay = 0x41
};
class Room
{
public:
RoomStatus roomStatus; //0x0000
uint8_t capacity; //0x0004
uint8_t invitation; //0x0005
uint8_t N000090AF; //0x0006
uint8_t N000090AD; //0x0007
wchar_t roomName[16]; //0x0008
char pad_0028[8]; //0x0028
RoomType roomType; //0x0030
uint8_t N0001167D; //0x0031
uint8_t N00011681; //0x0032
uint8_t N0001167E; //0x0033
uint8_t roundsToWinPlusMatchLimitBitfield; //0x0034
uint8_t roundTime; //0x0035
uint8_t skipTimeLimit; //0x0036
uint8_t N00009510; //0x0037
uint8_t memberCount; //0x0038
uint8_t N0000910B; //0x0039
uint8_t N0000910E; //0x003A
uint8_t N0000910C; //0x003B
uint32_t secondsElapsed; //0x003C
char pad_0040[8]; //0x0040
RoomMemberEntry member1; //0x0048
RoomMemberEntry member2; //0x00E0
RoomMemberEntry member3; //0x0178
RoomMemberEntry member4; //0x0210
RoomMemberEntry member5; //0x02A8
RoomMemberEntry member6; //0x0340
RoomMemberEntry member7; //0x03D8
RoomMemberEntry member8; //0x0470
}; //Size: 0x0508
| 1,362
|
C++
|
.h
| 53
| 23.886792
| 52
| 0.782375
|
kovidomi/BBCF-Improvement-Mod
| 32
| 12
| 1
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,624
|
d3d9.h
|
kovidomi_BBCF-Improvement-Mod/src/D3D9EXWrapper/d3d9.h
|
#pragma once
#pragma comment(lib,"d3d9.lib")
#pragma comment(lib,"d3dx9.lib")
#include <d3d9.h>
#include <d3dx9.h>
| 118
|
C++
|
.h
| 5
| 22
| 33
| 0.725664
|
kovidomi/BBCF-Improvement-Mod
| 32
| 12
| 1
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,627
|
info.h
|
kovidomi_BBCF-Improvement-Mod/src/Core/info.h
|
#pragma once
#define MOD_VERSION_NUM "v3.00"
#define MOD_WINDOW_TITLE "BBCF Improvement Mod"
#define MOD_FORCE_DISABLE_UPDATE_CHECK 0
// Links
#define MOD_LINK_DISCORD L"https://discord.gg/j2mCX9s"
#define MOD_LINK_FORUM L"https://steamcommunity.com/app/586140/discussions/0/1291817208497395528/"
#define MOD_LINK_GITHUB L"https://github.com/kovidomi/BBCF-Improvement-Mod"
| 376
|
C++
|
.h
| 8
| 45.625
| 98
| 0.8
|
kovidomi/BBCF-Improvement-Mod
| 32
| 12
| 1
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,628
|
crashdump.h
|
kovidomi_BBCF-Improvement-Mod/src/Core/crashdump.h
|
#pragma once
#include <Windows.h>
//Custom exception handler to generate memory dump upon crash
LONG WINAPI UnhandledExFilter(PEXCEPTION_POINTERS ExPtr);
| 154
|
C++
|
.h
| 4
| 37.5
| 61
| 0.84
|
kovidomi/BBCF-Improvement-Mod
| 32
| 12
| 1
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,629
|
Settings.h
|
kovidomi_BBCF-Improvement-Mod/src/Core/Settings.h
|
#pragma once
#include "D3D9EXWrapper/d3d9.h"
#include <string>
struct settingsIni_t
{
//X-Macro
#define SETTING(_type, _var, _inistring, _defaultval) \
_type _var
#include "settings.def"
#undef SETTING
};
struct savedSettings_t
{
RECT newSourceRect;
D3DVIEWPORT9 newViewport;
D3DXVECTOR2 origViewportRes;
bool isDuelFieldSprite;
bool isFiltering;
};
class Settings
{
public:
static settingsIni_t settingsIni;
static savedSettings_t savedSettings;
static void applySettingsIni(D3DPRESENT_PARAMETERS* pPresentationParameters);
static bool loadSettingsFile();
static void initSavedSettings();
//static void setViewportSize(D3DVIEWPORT9 Viewport);
static short getButtonValue(std::string button);
private:
static int readSettingsFilePropertyInt(LPCWSTR key, LPCWSTR defaultVal, LPCWSTR filename);
static float readSettingsFilePropertyFloat(LPCWSTR key, LPCWSTR defaultVal, LPCWSTR filename);
static std::string readSettingsFilePropertyString(LPCWSTR key, LPCWSTR defaultVal, LPCWSTR filename);
};
| 1,014
|
C++
|
.h
| 34
| 28.205882
| 102
| 0.831967
|
kovidomi/BBCF-Improvement-Mod
| 32
| 12
| 1
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,630
|
interfaces.h
|
kovidomi_BBCF-Improvement-Mod/src/Core/interfaces.h
|
#pragma once
#include "CustomGameMode/GameModeManager.h"
#include "D3D9EXWrapper/d3d9.h"
#include "D3D9EXWrapper/ID3D9EXWrapper_Device.h"
#include "Game/Player.h"
#include "Game/Room/Room.h"
#include "Network/NetworkManager.h"
#include "Network/OnlineGameModeManager.h"
#include "Network/OnlinePaletteManager.h"
#include "Network/RoomManager.h"
#include "Palette/PaletteManager.h"
#include "SteamApiWrapper/SteamApiHelper.h"
#include "SteamApiWrapper/SteamFriendsWrapper.h"
#include "SteamApiWrapper/SteamMatchmakingWrapper.h"
#include "SteamApiWrapper/SteamNetworkingWrapper.h"
#include "SteamApiWrapper/SteamUserStatsWrapper.h"
#include "SteamApiWrapper/SteamUserWrapper.h"
#include "SteamApiWrapper/SteamUtilsWrapper.h"
struct interfaces_t
{
SteamFriendsWrapper* pSteamFriendsWrapper;
SteamMatchmakingWrapper* pSteamMatchmakingWrapper;
SteamNetworkingWrapper* pSteamNetworkingWrapper;
SteamUserWrapper* pSteamUserWrapper;
SteamUserStatsWrapper* pSteamUserStatsWrapper;
SteamUtilsWrapper* pSteamUtilsWrapper;
IDirect3DDevice9Ex* pD3D9ExWrapper;
NetworkManager* pNetworkManager;
RoomManager* pRoomManager;
SteamApiHelper* pSteamApiHelper;
PaletteManager* pPaletteManager;
OnlinePaletteManager* pOnlinePaletteManager;
GameModeManager* pGameModeManager;
OnlineGameModeManager* pOnlineGameModeManager;
Player player1;
Player player2;
};
struct gameVals_t
{
int* pGameState;
int* pGameMoney;
int* pGameMode;
int* pMatchState;
int* pMatchTimer;
int* pMatchRounds;
int playerAvatarBaseAddr;
int* playerAvatarAddr;
int* playerAvatarColAddr;
byte* playerAvatarAcc1;
byte* playerAvatarAcc2;
int isP1CPU;
unsigned char* stageListMemory;
int *stageSelect_X;
int *stageSelect_Y;
int *musicSelect_X;
int *musicSelect_Y;
/////////////////
// New fields below
/////////////////
// *pIsHUDHidden is a bitfield:
// 0x00 - hud is visible
// 0x01 - hud is hidden (intro)
// 0x02 - hud is hidden (astral)
// 0x04 - loading icon is shown
int* pIsHUDHidden;
bool isFrameFrozen;
unsigned framesToReach;
unsigned* pFrameCount;
D3DXMATRIX* viewMatrix;
D3DXMATRIX* projMatrix;
int* pEntityList;
int entityCount;
Room* pRoom;
};
struct gameProc_t
{
HWND hWndGameWindow;
};
//temporary placeholders until wrappers are created / final addresses updated
struct temps_t
{
ISteamFriends** ppSteamFriends;
ISteamMatchmaking** ppSteamMatchmaking;
ISteamNetworking** ppSteamNetworking;
ISteamUser** ppSteamUser;
ISteamUserStats** ppSteamUserStats;
ISteamUtils** ppSteamUtils;
};
extern interfaces_t g_interfaces;
extern gameProc_t g_gameProc;
extern gameVals_t g_gameVals;
extern temps_t g_tempVals;
void InitManagers();
void CleanupInterfaces();
| 2,691
|
C++
|
.h
| 94
| 26.797872
| 77
| 0.821817
|
kovidomi/BBCF-Improvement-Mod
| 32
| 12
| 1
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,631
|
logger.h
|
kovidomi_BBCF-Improvement-Mod/src/Core/logger.h
|
#pragma once
#include "Settings.h"
#include "D3D9EXWrapper/d3d9.h"
#define DEBUG_LOG_LEVEL 5 //0 = highest, 7 = lowest priority
#define FORCE_LOGGING 0
#if defined(_DEBUG) || FORCE_LOGGING == 1
#define ENABLE_LOGGING 1
#endif
#ifdef ENABLE_LOGGING
#define LOG(_level, _str, ...) { \
if (DEBUG_LOG_LEVEL >= _level) { logger(_str, __VA_ARGS__); }}
//Use this to log in naked asm functions
#define LOG_ASM(_level, _str, ...) { \
__asm{__asm pushad }; \
if (DEBUG_LOG_LEVEL >= _level) { {logger(_str, __VA_ARGS__);} } \
__asm{__asm popad }; }
#else
#define LOG(_level, _str, ...) {}
//Use this to log in naked asm functions
#define LOG_ASM(_level, _str, ...) {}
#endif
inline void logger(const char* message, ...);
void openLogger();
void closeLogger();
//free it after usage!!
char* getFullDate();
void logSettingsIni();
bool hookSucceeded(PBYTE addr, const char* funcName);
void logD3DPParams(D3DPRESENT_PARAMETERS* pPresentationParameters, bool isOriginalSettings = true);
| 982
|
C++
|
.h
| 29
| 32.517241
| 99
| 0.696938
|
kovidomi/BBCF-Improvement-Mod
| 32
| 12
| 1
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,632
|
PaletteManager.h
|
kovidomi_BBCF-Improvement-Mod/src/Palette/PaletteManager.h
|
#pragma once
#include "impl_format.h"
#include "CharPaletteHandle.h"
#include "Game/characters.h"
#include "Game/Player.h"
#include <vector>
class PaletteManager
{
public:
PaletteManager();
~PaletteManager();
std::vector<std::vector<IMPL_data_t>> &GetCustomPalettesVector();
bool PushImplFileIntoVector(IMPL_t &filledPal);
bool PushImplFileIntoVector(CharIndex charIndex, IMPL_data_t &filledPalData);
bool WritePaletteToFile(CharIndex charIndex, IMPL_data_t *filledPalData);
void LoadAllPalettes();
void ReloadAllPalettes();
int GetOnlinePalsStartIndex(CharIndex charIndex);
void OverwriteIMPLDataPalName(std::string fileName, IMPL_data_t& palData);
// Return values:
// ret > 0, index found
// ret == -1, index not found
// ret == -2, charindex out of bound
// ret == -3, default palette or no name given
int FindCustomPalIndex(CharIndex charIndex, const char* palNameToFind);
bool PaletteArchiveDownloaded();
bool SwitchPalette(CharIndex charIndex, CharPaletteHandle& palHandle, int newCustomPalIndex);
void ReplacePaletteFile(const char* newPalData, PaletteFile palFile, CharPaletteHandle& palHandle);
void RestoreOrigPal(CharPaletteHandle& palHandle);
const char* GetCurPalFileAddr(PaletteFile palFile, CharPaletteHandle& palHandle);
const char* GetCustomPalFile(CharIndex charIndex, int palIndex, PaletteFile palFile, CharPaletteHandle& palHandle);
int GetCurrentCustomPalIndex(CharPaletteHandle& palHandle) const;
const IMPL_info_t& GetCurrentPalInfo(CharPaletteHandle& palHandle) const;
void SetCurrentPalInfo(CharPaletteHandle& palHandle, IMPL_info_t& palInfo);
const IMPL_data_t& GetCurrentPalData(CharPaletteHandle& palHandle);
void LoadPaletteSettingsFile();
// Call it ONCE per frame
void OnUpdate(CharPaletteHandle& P1, CharPaletteHandle& P2);
// Call it ONCE upon match start
void OnMatchInit(Player& playerOne, Player& playerTwo);
void OnMatchRematch(Player& playerOne, Player& playerTwo);
void OnMatchEnd(CharPaletteHandle& playerOne, CharPaletteHandle& playerTwo);
private:
std::vector<std::vector<IMPL_data_t>> m_customPalettes;
std::vector<std::vector<std::string>> m_paletteSlots;
std::vector<int> m_onlinePalsStartIndex;
bool m_loadOnlinePalettes = false;
bool m_PaletteArchiveDownloaded = false;
void CreatePaletteFolders();
void InitCustomPaletteVector();
void LoadPalettesIntoVector(CharIndex charIndex, std::wstring& wFolderPath);
void LoadPalettesFromFolder();
void LoadImplFile(const std::string& fullPath, const std::string& fileName, CharIndex charIndex);
void LoadHplFile(const std::string& fullPath, const std::string& fileName, CharIndex charIndex);
void InitPaletteSlotsVector();
void InitOnlinePalsIndexVector();
void ApplyDefaultCustomPalette(CharIndex charIndex, CharPaletteHandle& charPalHandle);
};
| 2,796
|
C++
|
.h
| 58
| 46.189655
| 116
| 0.81328
|
kovidomi/BBCF-Improvement-Mod
| 32
| 12
| 1
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,633
|
CharPaletteHandle.h
|
kovidomi_BBCF-Improvement-Mod/src/Palette/CharPaletteHandle.h
|
#pragma once
#include "Palette/impl_format.h"
#define MAX_PAL_INDEX 23
#define TOTAL_PALETTE_FILES 8
extern char* palFileNames[TOTAL_PALETTE_FILES];
enum PaletteFile
{
PaletteFile_Character,
PaletteFile_Effect1,
PaletteFile_Effect2,
PaletteFile_Effect3,
PaletteFile_Effect4,
PaletteFile_Effect5,
PaletteFile_Effect6,
PaletteFile_Effect7
};
class CharPaletteHandle
{
friend class PaletteManager;
int* m_pCurPalIndex;
int m_origPalIndex;
const char* m_pPalBaseAddr;
IMPL_data_t m_origPalBackup;
IMPL_data_t m_currentPalData;
int m_switchPalIndex1;
int m_switchPalIndex2;
int m_selectedCustomPalIndex;
bool m_updateLocked;
public:
void SetPointerPalIndex(int* pPalIdx);
void SetPointerBasePal(char* pPalBaseAddr);
bool IsNullPointerPalBasePtr();
bool IsNullPointerPalIndex();
int& GetPalIndexRef();
int GetOrigPalIndex() const;
bool IsCurrentPalWithBloom() const;
private:
void SetPaletteIndex(int palIndex);
void ReplacePalData(IMPL_data_t* newPaletteData);
void OnMatchInit();
void OnMatchRematch();
void LockUpdate();
void UnlockUpdate();
int GetSelectedCustomPalIndex();
void SetSelectedCustomPalIndex(int index);
const char* GetCurPalFileAddr(PaletteFile palFile);
const char* GetOrigPalFileAddr(PaletteFile palFile);
const IMPL_info_t& GetCurrentPalInfo() const;
void SetCurrentPalInfo(IMPL_info_t* pPalInfo);
const IMPL_data_t& GetCurrentPalData();
char* GetPalFileAddr(const char* base, int palIdx, int fileIdx);
void ReplacePalArrayInMemory(char* Dst, const void* Src);
void ReplaceSinglePalFile(const char* newPalData, PaletteFile palFile);
void ReplaceAllPalFiles(IMPL_data_t* newPaletteData, int palIdx);
void BackupOrigPal();
void RestoreOrigPal();
void UpdatePalette();
};
| 1,735
|
C++
|
.h
| 58
| 28.034483
| 72
| 0.818073
|
kovidomi/BBCF-Improvement-Mod
| 32
| 12
| 1
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,634
|
impl_templates.h
|
kovidomi_BBCF-Improvement-Mod/src/Palette/impl_templates.h
|
#pragma once
#define LEGACY_HPL_FILE_EXTENSION ".hpl"
#define LEGACY_HPL_HEADER_LEN 32
#define LEGACY_HPL_DATALEN 1024
extern const char* implTemplates[];
| 157
|
C++
|
.h
| 5
| 30
| 40
| 0.806667
|
kovidomi/BBCF-Improvement-Mod
| 32
| 12
| 1
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,635
|
dbus_manager.cpp
|
Samsuper12_OpenWallpaper-Plasma/Plugin/Source/dbus_manager.cpp
|
/*
* This file is part of OpenWallpaper Plasma.
*
* OpenWallpaper Plasma 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 3 of the License, or
* (at your option) any later version.
*
* OpenWallpaper Plasma 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.
*
* Full license: https://github.com/Samsuper12/OpenWallpaper-Plasma/blob/master/LICENSE
* Copyright (C) 2020- by Michael Skorokhodov bakaprogramm29@gmail.com
*/
#include "dbus_manager.hpp"
#include "dbus_manager_adaptor.h"
DBusManager::DBusManager(QObject *parent)
: QObject(parent)
{
#ifdef DEBUG
LOG_CONSOLE("DBus adaptor has been created.")
#endif
new DBusManagerAdaptor(this);
QDBusConnection connection = QDBusConnection::sessionBus();
connection.registerObject("/DBusManager", this);
connection.registerService("org.OpenWallpaper.DBusManager");
}
DBusManager::~DBusManager()
{
}
void DBusManager::setPlaySlot(int arg)
{
#ifdef DEBUG
LOG_CONSOLE("setPlaySlot.")
#endif
emit playSignal(arg);
}
void DBusManager::setVolumeSlot(double volume)
{
#ifdef DEBUG
LOG_CONSOLE("setVolumeSlot.")
#endif
emit volumeSignal(volume);
}
void DBusManager::setPackageSlot(QString package)
{
#ifdef DEBUG
LOG_CONSOLE("setPackageSlot.")
#endif
emit changePackageSignal(package);
}
void DBusManager::debugSlot(QString arg)
{
#ifdef DEBUG
LOG_CONSOLE("debugSlot.")
#endif
emit debugSignal(arg);
}
void DBusManager::changeConfigSlot(int param, QString value)
{
#ifdef DEBUG
LOG_CONSOLE("changeConfigSlot.")
#endif
emit changeConfigSignal(param, value);
}
void DBusManager::restoreConfigSlot()
{
#ifdef DEBUG
LOG_CONSOLE("restoreConfigSlot.")
#endif
emit restoreConfigSignal();
}
void DBusManager::restoreSuccessfulSlot()
{
#ifdef DEBUG
LOG_CONSOLE("restoreSuccessfulSlot.")
#endif
emit restoreSuccessfulSignal();
}
void DBusManager::getLastPackageRequestSlot()
{
#ifdef DEBUG
LOG_CONSOLE("getLastPackageRequestSlot.")
#endif
emit lastPackageRequestSignal();
}
void DBusManager::getVolumeRequestSlot()
{
#ifdef DEBUG
LOG_CONSOLE("getVolumeRequestSlot.")
#endif
emit volumeRequestSignal();
}
| 2,458
|
C++
|
.cpp
| 95
| 23.536842
| 87
| 0.777872
|
Samsuper12/OpenWallpaper-Plasma
| 30
| 2
| 5
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,636
|
render_manager.cpp
|
Samsuper12_OpenWallpaper-Plasma/Plugin/Source/render_manager.cpp
|
/*
* This file is part of OpenWallpaper Plasma.
*
* OpenWallpaper Plasma 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 3 of the License, or
* (at your option) any later version.
*
* OpenWallpaper Plasma 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.
*
* Full license: https://github.com/Samsuper12/OpenWallpaper-Plasma/blob/master/LICENSE
* Copyright (C) 2020- by Michael Skorokhodov bakaprogramm29@gmail.com
*/
#include "render_manager.hpp"
RenderManager::RenderManager(QObject *parent)
: QObject(parent)
, libRef(nullptr)
{
renderObject = std::make_shared<DefaultScene>();
}
RenderManager::~RenderManager()
{
if (libRef != nullptr) {
delete libRef;
libRef = nullptr;
}
}
void RenderManager::set(const QString& sourcePath, const QString& packageDir)
{
if (sourcePath == lastPackage) {
LOG("This is same package!")
return;
}
this->lastPackage = sourcePath;
setDefault();
libRef = new DllLoader<QtRender>(sourcePath.toStdString());
std::shared_ptr<QtRender> BufferRef = libRef->loadClass();
if (BufferRef.get() == nullptr) {
LOG("OpenGL package was not loaded.")
return;
}
//useless now. created for future
std::vector<std::string> vec;
BufferRef->init(packageDir.toStdString(),vec);
renderObject = std::move(BufferRef);
}
void RenderManager::setDefault()
{
if (libRef != nullptr) {
delete libRef;
libRef = nullptr;
}
//useless now. created for future
std::vector<std::string> vec;
lastPackage.clear();
renderObject = std::make_shared<DefaultScene>();
renderObject->init(std::string(), vec);
}
void RenderManager::resume() const
{
renderObject->onResume();
}
void RenderManager::pause() const
{
renderObject->onPause();
}
| 2,132
|
C++
|
.cpp
| 69
| 26.956522
| 87
| 0.706888
|
Samsuper12/OpenWallpaper-Plasma
| 30
| 2
| 5
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,637
|
default_scene.cpp
|
Samsuper12_OpenWallpaper-Plasma/Plugin/Source/default_scene.cpp
|
/*
* This file is part of OpenWallpaper Plasma.
*
* OpenWallpaper Plasma 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 3 of the License, or
* (at your option) any later version.
*
* OpenWallpaper Plasma 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.
*
* Full license: https://github.com/Samsuper12/OpenWallpaper-Plasma/blob/master/LICENSE
* Copyright (C) 2020- by Michael Skorokhodov bakaprogramm29@gmail.com
*/
#include "default_scene.hpp"
DefaultScene::DefaultScene()
{
functions = QOpenGLContext::currentContext()->functions();
functions->glClearColor(0.0, 0.0, 0.0, 1.0);
}
DefaultScene::~DefaultScene()
{
}
void DefaultScene::init(const std::string& dir, const std::vector<std::string>& params)
{
Q_UNUSED(dir)
Q_UNUSED(params)
}
void DefaultScene::data(bool focus, bool music, float volume, const std::vector<std::string> ¶ms)
{
Q_UNUSED(focus)
Q_UNUSED(music)
Q_UNUSED(volume)
Q_UNUSED(params)
}
void DefaultScene::draw()
{
functions->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
functions->glEnable(GL_DEPTH_TEST);
}
void DefaultScene::onPause()
{
}
void DefaultScene::onResume()
{
}
| 1,501
|
C++
|
.cpp
| 48
| 28.895833
| 101
| 0.750173
|
Samsuper12/OpenWallpaper-Plasma
| 30
| 2
| 5
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,638
|
openwallpaperplasma_plugin.cpp
|
Samsuper12_OpenWallpaper-Plasma/Plugin/Source/openwallpaperplasma_plugin.cpp
|
/*
* This file is part of OpenWallpaper Plasma.
*
* OpenWallpaper Plasma 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 3 of the License, or
* (at your option) any later version.
*
* OpenWallpaper Plasma 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.
*
* Full license: https://github.com/Samsuper12/OpenWallpaper-Plasma/blob/master/LICENSE
* Copyright (C) 2020- by Michael Skorokhodov bakaprogramm29@gmail.com
*/
#include "openwallpaperplasma_plugin.h"
#include "wdesktop.hpp"
#include <qqml.h>
void OpenWallpaperPlasmaPlugin::registerTypes(const char *uri)
{
qmlRegisterType<WDesktop>(uri, 0, 1, "WDesktop");
}
| 945
|
C++
|
.cpp
| 23
| 38.956522
| 87
| 0.777778
|
Samsuper12/OpenWallpaper-Plasma
| 30
| 2
| 5
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,639
|
dll_loader.cpp
|
Samsuper12_OpenWallpaper-Plasma/Plugin/Source/dll_loader.cpp
|
/*
* This file is part of OpenWallpaper Plasma.
*
* OpenWallpaper Plasma 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 3 of the License, or
* (at your option) any later version.
*
* OpenWallpaper Plasma 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.
*
* Full license: https://github.com/Samsuper12/OpenWallpaper-Plasma/blob/master/LICENSE
* Copyright (C) 2014-2020 by Kyle Nusbaum KyleJNusbaum@gmail.com
* Copyright (C) 2020- by Michael Skorokhodov bakaprogramm29@gmail.com
*
*/
template<class T>
DllLoader<T>::DllLoader(const std::string& path)
: libPath(path)
{
libClass = std::make_shared<Object>();
}
template<class T>
DllLoader<T>::~DllLoader()
{
}
template<class T>
bool DllLoader<T>::Object::open(const std::string& path)
{
handle = dlopen(path.c_str(), RTLD_NOW);
if (!handle) {
LOG(dlerror())
return false;
}
dlerror();
create = (typename T::create_t*) dlsym(handle, "create");
if (!create) {
LOG(dlerror())
return false;
}
dlerror();
destroy = (typename T::destroy_t*) dlsym(handle, "destroy");
if (!destroy) {
LOG(dlerror())
return false;
}
return true;
}
template<class T>
void DllLoader<T>::Object::close()
{
dlclose(handle);
create = nullptr;
destroy = nullptr;
}
template<class T>
std::shared_ptr<T> DllLoader<T>::loadClass()
{
if (!libClass->create || !libClass->destroy) {
if (!libClass->open(libPath)) {
return std::shared_ptr<T>(nullptr);
}
}
std::shared_ptr<Object> ref = libClass;
return std::shared_ptr<T>(libClass->create(), [ref] (T*t) {
ref->destroy(t);
});
}
template<class T>
DllLoader<T>::Object::~Object()
{
close();
}
| 2,092
|
C++
|
.cpp
| 75
| 23.746667
| 87
| 0.671371
|
Samsuper12/OpenWallpaper-Plasma
| 30
| 2
| 5
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,640
|
wdesktop.cpp
|
Samsuper12_OpenWallpaper-Plasma/Plugin/Source/wdesktop.cpp
|
/*
* This file is part of OpenWallpaper Plasma.
*
* OpenWallpaper Plasma 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 3 of the License, or
* (at your option) any later version.
*
* OpenWallpaper Plasma 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.
*
* Full license: https://github.com/Samsuper12/OpenWallpaper-Plasma/blob/master/LICENSE
* Copyright (C) 2020- by Michael Skorokhodov bakaprogramm29@gmail.com
*/
#include "wdesktop.hpp"
#include <QQuickWindow>
#include <QOpenGLFramebufferObject>
#include <QOpenGLFramebufferObjectFormat>
class ObjectRenderer : public QQuickFramebufferObject::Renderer
{
public:
ObjectRenderer() {
lastTime = std::time(nullptr);
rendManager = new RenderManager();
}
virtual ~ObjectRenderer() {
delete rendManager;
}
void synchronize(QQuickFramebufferObject *item) override {
plasmaDesktop = item->window();
WDesktop *wdesk = static_cast<WDesktop *>(item);
switch (wdesk->renderStatus) {
case renderState::change:
rendManager->set(wdesk->getSourcePath(), wdesk->getDir());
play = true;
break;
case renderState::play:
play = true;
rendManager->resume();
break;
case renderState::pause:
play = false;
rendManager->pause();
break;
case renderState::stop:
play = false;
rendManager->setDefault();
break;
default:
break;
}
if (play) {
focus = wdesk->getFocus();
musicVolume = wdesk->mainCfg->lastVolume;
music = wdesk->musicPlay;
}
wdesk->renderStatus = renderState::nullCommand;
}
void render() override {
if (play) {
rendManager->renderObject->data(focus, music, musicVolume, vec);
rendManager->renderObject->draw();
update();
plasmaDesktop->resetOpenGLState();
//fps();
}
}
QOpenGLFramebufferObject *createFramebufferObject(const QSize &size) override {
QOpenGLFramebufferObjectFormat format;
format.setSamples(4);
format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
return new QOpenGLFramebufferObject(size, format);
}
inline void fps() {
currentTime = std::time(nullptr);
frame++;
if ((currentTime - lastTime) > 1) {
LOG_CONSOLE(frame)
frame = 0;
//lastTime++;
lastTime = currentTime;
}
}
private:
QQuickWindow* plasmaDesktop;
RenderManager* rendManager;
//useless now. created for future
std::vector<std::string> vec;
bool play = true;
bool focus = false;
bool music = false;
float musicVolume;
int frame = 0;
std::time_t currentTime = 0;
std::time_t lastTime = 0;
};
WDesktop::WDesktop(QQuickItem *parent)
: QQuickFramebufferObject(parent)
, renderStatus(renderState::nullCommand)
, mainCfg(new MainConfig)
, currentConfig(nullptr)
, renderer(renderType::ogl)
{
setupConfigs();
connect(this, &WDesktop::playingSignalC, this, &WDesktop::playingSignalQ);
connect(this, &WDesktop::disableSignalC, this, &WDesktop::disableSignalQ);
connect(this, &WDesktop::enableSignalC, this, &WDesktop::enableSignalQ);
connect(this, &WDesktop::debugSignalC, this, &WDesktop::debugSignalQ);
connect(&dBus, &DBusManager::changeConfigSignal, this, &WDesktop::changeMainCfg);
connect(&dBus, &DBusManager::changePackageSignal, this, &WDesktop::setPackage);
connect(&dBus, &DBusManager::playSignal, this, &WDesktop::setPlaying);
connect(&dBus, &DBusManager::debugSignal, this, &WDesktop::testSlot);
connect(&dBus, &DBusManager::volumeSignal, this, [&](double volume) {
setMusicVolume(volume);
});
connect(&dBus, &DBusManager::volumeRequestSignal, [&]() {
emit dBus.volumeToManagerSignal(mainCfg->lastVolume);
});
connect(&dBus, &DBusManager::lastPackageRequestSignal, [&]() {
emit dBus.lastPackageSignal(mainCfg->lastPackage);
});
connect(&dBus, &DBusManager::restoreConfigSignal, this, [&]() {
restoreConfig(QDir::homePath().toStdString() +
'/' + WP_DIR+ '/' + WP_MAIN_FILE, WP_DEFAULT_CFG);
});
renderMap["OGL"] = renderType::ogl;
renderMap["Video"] = renderType::video;
renderMap["Gif"] = renderType::gif;
renderMap["QML"] = renderType::qml; // later
}
WDesktop::~WDesktop()
{
mainCfgParser.replace("LastVolume", std::to_string(mainCfg->lastVolume));
mainCfgParser.replace("LastPackage", mainCfg->lastPackage.toStdString());
mainCfgParser.replace("AlwaysInFocus", (mainCfg->alwaysInFocus) ? "True" : "False");
mainCfgParser.replace("MusicCycle", (mainCfg->musicCycle) ? "True" : "False");
delete mainCfg;
}
QQuickFramebufferObject::Renderer *WDesktop::createRenderer() const
{
return new ObjectRenderer;
}
int WDesktop::getFillMode() const
{
if (currentConfig->fillmode == "PreserveAspectCrop") {
return 2; // VideoOutput.PreserveAspectCrop
}
else if (currentConfig->fillmode == "PreserveAspectFit") {
return 1; // VideoOutput.PreserveAspectFit
}
else {
return 0; // VideoOutput.Stretch // std
}
}
void WDesktop::setOglPlaying(const int state)
{
switch (state) {
case 0:
renderStatus = renderState::stop;
break;
case 1:
renderStatus = renderState::play;
break;
case 2:
renderStatus = renderState::pause;
break;
default:
break;
}
update();
}
void WDesktop::setMusicVolume(double volume)
{
emit musicVolumeSignalQ(volume);
mainCfg->lastVolume = volume;
update();
}
void WDesktop::checkFocus(QModelIndex task)
{
if (mainCfg->alwaysInFocus) {
return;
}
// desktop always have -1 position
// also we can check focus with TaskModel.count
// if count == 0 (zero windows open), then we look at desktop
if(task.row() == -1) {
this->focus = true;
} else {
this->focus = false;
}
emit focusChanged(focus);
update();
}
void WDesktop::checkLastPackage()
{
if (mainCfg->lastPackage != "null" && !mainCfg->lastPackage.isNull()) {
setPackage(mainCfg->lastPackage);
}
// else - default OGL scene
}
bool WDesktop::getFocus() const
{
if (mainCfg->alwaysInFocus) {
return true;
}
return focus;
}
void WDesktop::restoreConfig(const std::string& path, const std::string& text)
{
QDir dir(QDir::home());
if (!dir.exists(WP_DIR)) {
dir.mkdir(WP_DIR);
}
//set default main config;
delete mainCfg;
mainCfg = new MainConfig;
// and replace main.ini
ConfigParser::createFile(path, text);
// emit signal to manager
dBus.restoreSuccessfulSlot();
}
void WDesktop::hideRenderer(renderType type)
{
if (type == renderer) {
return;
}
switch (renderer) {
case renderType::ogl:
emit disableSignalC(static_cast<int>(renderer));
update();
break;
case renderType::video:
emit disableSignalC(static_cast<int>(renderer));
break;
case renderType::gif:
emit disableSignalC(static_cast<int>(renderer));
break;
case renderType::qml:
break;
default: break;
}
}
void WDesktop::setupConfigs()
{
QDir dir(QDir::home());
std::string cfgPath;
if(!dir.cd(WP_DIR)) {
restoreConfig(QDir::homePath().toStdString() + '/' + WP_DIR+ '/' + WP_MAIN_FILE, WP_DEFAULT_CFG);
dir.cd(WP_DIR);
}
cfgPath = dir.path().toStdString() + '/' + WP_MAIN_FILE;
QStringList files = dir.entryList(QDir::Files | QDir::NoDotAndDotDot);
if (!files.contains(WP_MAIN_FILE)) {
restoreConfig(cfgPath, WP_DEFAULT_CFG);
}
packageParser.findValue("Type",
"Source",
"MusicSource",
"Music",
"StartVolume",
"FillMode");
mainCfgParser.findValue("IgnoreDefaultVolume",
"AlwaysInFocus",
"LastVolume",
"LastPackage",
"MusicCycle");
if (!mainCfgParser.open(cfgPath)) {
LOG("Main config not open.")
restoreConfig(cfgPath, WP_DEFAULT_CFG);
}
try {
mainCfg->alwaysInFocus = (mainCfgParser["AlwaysInFocus"] == "True") ? true : false;
mainCfg->ignoreDefaultVolume = (mainCfgParser["IgnoreDefaultVolume"] == "True") ? true : false;
mainCfg->lastVolume = std::stod(mainCfgParser["LastVolume"]);
mainCfg->lastPackage = QString(mainCfgParser["LastPackage"].c_str());
mainCfg->musicCycle = (mainCfgParser["MusicCycle"] == "True") ? true : false;
} catch (const std::exception& e) {
LOG(e.what())
restoreConfig(cfgPath, WP_DEFAULT_CFG);
//manager.sendError (or maybe later...)
}
}
void WDesktop::setMusicCycle(bool value)
{
mainCfg->musicCycle = value;
emit musicCycleChanged(value);
}
bool WDesktop::getMusicCycle() const
{
return mainCfg->musicCycle;
}
void WDesktop::changeMainCfg(int param, QString value)
{
switch (param) {
case receivedValue::alwaysInFocus:
mainCfg->alwaysInFocus =
(value == "True") ? true : false;
break;
case receivedValue::ignoreDefaultVolume:
mainCfg->ignoreDefaultVolume =
(value == "True") ? true : false;
break;
case receivedValue::musicCycle:
setMusicCycle((value == "True") ? true : false);
break;
default:
break;
}
this->update();
}
void WDesktop::setPackage(QString path)
{
std::unique_ptr<PackageConfig> guard;
QString pathBuf = path;
packageParser.clear();
if (!packageParser.open(path.toStdString())) {
LOG("Package was not open")
return;
}
if(currentConfig != nullptr) {
guard = std::move(currentConfig);
}
path.remove(WP_PACKAGE_FILE);
currentConfig = std::make_unique<PackageConfig>();
try {
currentConfig->type = renderMap[packageParser["Type"]];
currentConfig->sourcePath = path + QString(packageParser["Source"].c_str());
currentConfig->musicPath = path + QString(packageParser["MusicSource"].c_str());
currentConfig->haveMusic = (packageParser["Music"] == "True") ? true: false;
currentConfig->fillmode = QString(packageParser["FillMode"].c_str());
currentConfig->dir = path;
if (!mainCfg->ignoreDefaultVolume) {
const std::string sref = packageParser["StartVolume"];
if (!sref.empty()) {
currentConfig->startVolume = std::stod(sref);
mainCfg->lastVolume = currentConfig->startVolume;
emit dBus.volumeToManagerSignal(mainCfg->lastVolume);
}
} else {
currentConfig->startVolume = mainCfg->lastVolume;
}
if (currentConfig->startVolume > 0.0) {
musicPlay = true;
}
if (currentConfig->type == renderType::unknownRender ||
currentConfig->sourcePath == path) {
LOG("Incorrect source path or unknown render type")
return;
}
} catch (const std::exception& e) {
currentConfig = std::move(guard);
LOG(e.what())
return;
}
mainCfg->lastPackage = pathBuf;
hideRenderer(currentConfig->type);
renderer = currentConfig->type;
if (currentConfig->type == renderType::ogl) {
renderStatus = renderState::change;
}
emit enableSignalC(renderer);
update();
}
void WDesktop::setPlaying(int value)
{
if (value > 0) {
emit playingSignalC(renderer, true);
musicPlay = true;
update();
return;
}
emit playingSignalC(renderer, false);
musicPlay = false;
update();
}
void WDesktop::testSlot()
{
}
| 12,524
|
C++
|
.cpp
| 380
| 25.957895
| 105
| 0.632188
|
Samsuper12/OpenWallpaper-Plasma
| 30
| 2
| 5
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,641
|
dll_loader.hpp
|
Samsuper12_OpenWallpaper-Plasma/Plugin/Source/dll_loader.hpp
|
/*
* This file is part of OpenWallpaper Plasma.
*
* OpenWallpaper Plasma 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 3 of the License, or
* (at your option) any later version.
*
* OpenWallpaper Plasma 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.
*
* Full license: https://github.com/Samsuper12/OpenWallpaper-Plasma/blob/master/LICENSE
* Copyright (C) 2014-2020 by Kyle Nusbaum KyleJNusbaum@gmail.com
* Copyright (C) 2020- by Michael Skorokhodov bakaprogramm29@gmail.com
*/
#ifndef DLL_LOADER_HPP
#define DLL_LOADER_HPP
// Author: https://github.com/knusbaum/CPP-Dynamic-Class-Loading
// also check https://www.linuxjournal.com/article/3687
#include <memory>
#include <string>
#include <dlfcn.h>
#include "debug.hpp"
template<class T>
class DllLoader
{
public:
DllLoader(const std::string& path);
~DllLoader();
std::shared_ptr<T> loadClass();
private:
struct Object{
typename T::create_t* create = nullptr;
typename T::destroy_t* destroy = nullptr;
~Object();
void* handle = nullptr;
bool open(const std::string& path);
void close();
};
private:
std::string libPath;
std::shared_ptr<Object> libClass;
};
#include "dll_loader.cpp"
#endif // DLL_LOADER_HPP
| 1,605
|
C++
|
.h
| 47
| 30.191489
| 87
| 0.732013
|
Samsuper12/OpenWallpaper-Plasma
| 30
| 2
| 5
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,642
|
debug.hpp
|
Samsuper12_OpenWallpaper-Plasma/Plugin/Source/debug.hpp
|
/*
* This file is part of OpenWallpaper Plasma.
*
* OpenWallpaper Plasma 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 3 of the License, or
* (at your option) any later version.
*
* OpenWallpaper Plasma 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.
*
* Full license: https://github.com/Samsuper12/OpenWallpaper-Plasma/blob/master/LICENSE
* Copyright (C) 2020- by Michael Skorokhodov bakaprogramm29@gmail.com
*/
#ifndef DEBUG_HPP
#define DEBUG_HPP
#include <fstream>
#include <QDebug>
#include <QDir>
#define LOG_PATH QDir::homePath().toStdString() \
+ '/' + ".openWallpaper" \
+ '/' + "log"
#define LOG_CONSOLE(comment) \
qDebug() << comment;
#define LOG(comment) { \
std::ofstream file(LOG_PATH, std::ios::app | std::ios::out); \
file << __TIME__ \
<< " [" \
<< __FILE__ \
<< ": " \
<< __LINE__ \
<< "] " \
<< comment \
<< '\n' \
<< std::flush; \
file.close(); } \
LOG_CONSOLE(comment)
#endif // DEBUG_HPP
| 1,302
|
C++
|
.h
| 40
| 29.425
| 87
| 0.670916
|
Samsuper12/OpenWallpaper-Plasma
| 30
| 2
| 5
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,643
|
wdesktop.hpp
|
Samsuper12_OpenWallpaper-Plasma/Plugin/Source/wdesktop.hpp
|
/*
* This file is part of OpenWallpaper Plasma.
*
* OpenWallpaper Plasma 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 3 of the License, or
* (at your option) any later version.
*
* OpenWallpaper Plasma 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.
*
* Full license: https://github.com/Samsuper12/OpenWallpaper-Plasma/blob/master/LICENSE
* Copyright (C) 2020- by Michael Skorokhodov bakaprogramm29@gmail.com
*/
#ifndef WDESKTOP_HPP
#define WDESKTOP_HPP
#include <QQuickFramebufferObject>
#include <QStringList>
#include <QModelIndex>
#include "debug.hpp"
#include "dbus_manager.hpp"
#include "render_manager.hpp"
#include "config_parser.hpp"
class WDesktop;
class ObjectRenderer;
struct PackageConfig;
struct StartConfig;
enum renderType : int;
enum receivedValue : int;
enum renderState {
nullCommand = 0,
change,
play,
pause,
stop
};
class WDesktop : public QQuickFramebufferObject
{
Q_OBJECT
Q_DISABLE_COPY(WDesktop)
Q_PROPERTY(bool focus READ getFocus NOTIFY focusChanged)
Q_PROPERTY(bool musicCycle READ getMusicCycle WRITE setMusicCycle NOTIFY musicCycleChanged)
const char* WP_DIR = ".openWallpaper";
const char* WP_PACKAGE_FILE = "wallpaper.ini";
const char* WP_MAIN_FILE = "main.ini";
const char* WP_DEFAULT_CFG = "[PluginSettings]\n"
"AlwaysInFocus=False\n"
"IgnoreDefaultVolume=False\n"
"LastVolume=0.0\n"
"LastPackage=null\n"
"MusicCycle=True\n"
"\n"
"[ManagerSettings]\n"
"CopyToHiddenPlace=True\n";
enum renderType : int {
unknownRender = 0,
ogl,
video,
gif,
qml
};
enum receivedValue : int {
alwaysInFocus = 0,
ignoreDefaultVolume,
musicCycle
};
struct MainConfig
{
bool alwaysInFocus = false;
bool ignoreDefaultVolume = false;
double lastVolume = 0.0;
QString lastPackage = "null";
bool musicCycle = true;
};
struct PackageConfig
{
renderType type = renderType::unknownRender;
QString sourcePath;
bool haveMusic = false;
double startVolume = 0.0;
QString musicPath;
QString fillmode;
QString dir;
};
public:
explicit WDesktop(QQuickItem *parent = nullptr);
~WDesktop() override;
Renderer *createRenderer() const Q_DECL_OVERRIDE;
Q_INVOKABLE QString getMusicSourcePath() const {return currentConfig->musicPath; }
Q_INVOKABLE float getStartVolume() const {return currentConfig->startVolume; }
Q_INVOKABLE QString getSourcePath() const {return currentConfig->sourcePath; }
Q_INVOKABLE bool getHaveMusic() const {return currentConfig->haveMusic; }
Q_INVOKABLE QString getDir() const {return currentConfig->dir; }
Q_INVOKABLE int getFillMode() const;
Q_INVOKABLE void setOglPlaying(const int state);
Q_INVOKABLE void setMusicVolume(double volume);
Q_INVOKABLE void checkFocus(QModelIndex task);
Q_INVOKABLE void checkLastPackage();
bool getFocus() const;
private:
void restoreConfig(const std::string& path, const std::string& text);
void hideRenderer(renderType type);
void setupConfigs();
void setMusicCycle(bool value);
bool getMusicCycle() const;
public slots:
void changeMainCfg(int param, QString value);
void setPackage(QString path);
void setPlaying(int value);
void testSlot();
signals:
//Postfix C - local C++ signal;
//Postfix Q - emited signal from C to QML layer;
//Sometimes emit signal is not work in qml.
//Fix in next version
void playingSignalC(int render, bool mode);
void playingSignalQ(int Render, bool Mode);
void musicVolumeSignalQ(float Volume);
void disableSignalC(int render);
void disableSignalQ(int Render);
void enableSignalC(int render);
void enableSignalQ(int Render);
void debugSignalC();
void debugSignalQ();
void musicCycleChanged(bool value) const;
void focusChanged(bool focus) const;
public:
renderState renderStatus;
MainConfig* mainCfg;
// only for OpenGL Renderer
bool musicPlay = false;
private:
std::unique_ptr<PackageConfig> currentConfig;
std::map<std::string, renderType> renderMap;
ConfigParser packageParser;
ConfigParser mainCfgParser;
// only for OpenGL Renderer
renderType renderer;
DBusManager dBus;
bool focus = false;
};
#endif // WDESKTOP_HPP
| 5,032
|
C++
|
.h
| 144
| 28.770833
| 95
| 0.68118
|
Samsuper12/OpenWallpaper-Plasma
| 30
| 2
| 5
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,645
|
abstract_render.hpp
|
Samsuper12_OpenWallpaper-Plasma/Plugin/Source/abstract_render.hpp
|
/*
* This file is part of OpenWallpaper Plasma.
*
* OpenWallpaper Plasma 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 3 of the License, or
* (at your option) any later version.
*
* OpenWallpaper Plasma 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.
*
* Full license: https://github.com/Samsuper12/OpenWallpaper-Plasma/blob/master/LICENSE
* Copyright (C) 2020- by Michael Skorokhodov bakaprogramm29@gmail.com
*/
#ifndef ABSTRACT_RENDER_HPP
#define ABSTRACT_RENDER_HPP
#include <vector>
#include <string>
namespace openWallpaper {
namespace ogl {
class QtRender {
public:
virtual void init(const std::string& dir,const std::vector<std::string>& params) = 0;
virtual void data(bool focus, bool music, float volume, const std::vector<std::string>& params) = 0;
virtual void draw() = 0;
virtual void onPause() = 0;
virtual void onResume() = 0;
QtRender() {}
virtual ~QtRender() {}
typedef QtRender* create_t();
typedef void destroy_t(QtRender*);
};
}
}
#endif
| 1,458
|
C++
|
.h
| 37
| 33.162162
| 112
| 0.688809
|
Samsuper12/OpenWallpaper-Plasma
| 30
| 2
| 5
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,646
|
dbus_manager.hpp
|
Samsuper12_OpenWallpaper-Plasma/Plugin/Source/dbus_manager.hpp
|
/*
* This file is part of OpenWallpaper Plasma.
*
* OpenWallpaper Plasma 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 3 of the License, or
* (at your option) any later version.
*
* OpenWallpaper Plasma 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.
*
* Full license: https://github.com/Samsuper12/OpenWallpaper-Plasma/blob/master/LICENSE
* Copyright (C) 2020- by Michael Skorokhodov bakaprogramm29@gmail.com
*/
#ifndef DBUS_MANAGER_HPP
#define DBUS_MANAGER_HPP
#include <QObject>
#include <QtDBus>
#include "debug.hpp"
class DBusManager : public QObject
{
Q_OBJECT
public:
explicit DBusManager(QObject *parent = nullptr);
~DBusManager();
public slots:
void setPlaySlot(int arg);
void setVolumeSlot(double volume);
void setPackageSlot(QString package);
void debugSlot(QString Arg);
void changeConfigSlot(int param, QString value);
void restoreConfigSlot();
void restoreSuccessfulSlot();
void getLastPackageRequestSlot();
void getVolumeRequestSlot();
signals:
void playSignal(int arg);
void volumeSignal(double volume);
void changePackageSignal(QString package);
void debugSignal(QString arg);
void changeConfigSignal(int param, QString value);
void restoreConfigSignal();
void restoreSuccessfulSignal();
void lastPackageRequestSignal();
void lastPackageSignal(QString path);
void volumeRequestSignal();
void volumeToManagerSignal(double value);
};
#endif // DBUS_MANAGER_HPP
| 1,806
|
C++
|
.h
| 51
| 32
| 87
| 0.767509
|
Samsuper12/OpenWallpaper-Plasma
| 30
| 2
| 5
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,647
|
render_manager.hpp
|
Samsuper12_OpenWallpaper-Plasma/Plugin/Source/render_manager.hpp
|
/*
* This file is part of OpenWallpaper Plasma.
*
* OpenWallpaper Plasma 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 3 of the License, or
* (at your option) any later version.
*
* OpenWallpaper Plasma 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.
*
* Full license: https://github.com/Samsuper12/OpenWallpaper-Plasma/blob/master/LICENSE
* Copyright (C) 2020- by Michael Skorokhodov bakaprogramm29@gmail.com
*/
#ifndef RENDERMANAGER_H
#define RENDERMANAGER_H
#include <QObject>
#include <memory>
#include "debug.hpp"
#include "dll_loader.hpp"
#include "default_scene.hpp"
using QtRender = openWallpaper::ogl::QtRender;
class RenderManager : public QObject
{
Q_OBJECT
public:
explicit RenderManager(QObject *parent = nullptr);
~RenderManager();
void set(const QString& sourcePath, const QString& packageDir);
void setDefault();
void resume() const;
void pause() const;
std::shared_ptr<QtRender> renderObject;
private:
QString lastPackage;
DllLoader<QtRender>* libRef;
};
#endif // RENDERMANAGER_H
| 1,374
|
C++
|
.h
| 40
| 31.625
| 87
| 0.764928
|
Samsuper12/OpenWallpaper-Plasma
| 30
| 2
| 5
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,648
|
default_scene.hpp
|
Samsuper12_OpenWallpaper-Plasma/Plugin/Source/default_scene.hpp
|
/*
* This file is part of OpenWallpaper Plasma.
*
* OpenWallpaper Plasma 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 3 of the License, or
* (at your option) any later version.
*
* OpenWallpaper Plasma 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.
*
* Full license: https://github.com/Samsuper12/OpenWallpaper-Plasma/blob/master/LICENSE
* Copyright (C) 2020- by Michael Skorokhodov bakaprogramm29@gmail.com
*/
#ifndef DEFAULT_SCENE_HPP
#define DEFAULT_SCENE_HPP
#include <QOpenGLContext>
#include <QOpenGLFunctions>
#include <QOpenGLShaderProgram>
#include "abstract_render.hpp"
class DefaultScene : public openWallpaper::ogl::QtRender
{
public:
DefaultScene();
~DefaultScene();
void init(const std::string& dir, const std::vector<std::string>& params) override;
void data(bool focus, bool music, float volume, const std::vector<std::string>& params) override;
void draw() override;
void onPause() override;
void onResume() override;
private:
QOpenGLFunctions* functions;
};
#endif // DEFAULT_SCENE_HPP
| 1,370
|
C++
|
.h
| 36
| 35.472222
| 101
| 0.767144
|
Samsuper12/OpenWallpaper-Plasma
| 30
| 2
| 5
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,649
|
polynomial.cpp
|
MarwanNour_SEAL-FYP-Logistic-Regression/polynomial.cpp
|
#include <iostream>
#include <iomanip>
#include <fstream>
#include <unistd.h>
#include "seal/seal.h"
using namespace std;
using namespace seal;
// Helper function that prints parameters
void print_parameters(shared_ptr<SEALContext> context)
{
// Verify parameters
if (!context)
{
throw invalid_argument("context is not set");
}
auto &context_data = *context->key_context_data();
string scheme_name;
switch (context_data.parms().scheme())
{
case scheme_type::BFV:
scheme_name = "BFV";
break;
case scheme_type::CKKS:
scheme_name = "CKKS";
break;
default:
throw invalid_argument("unsupported scheme");
}
cout << "/" << endl;
cout << "| Encryption parameters :" << endl;
cout << "| scheme: " << scheme_name << endl;
cout << "| poly_modulus_degree: " << context_data.parms().poly_modulus_degree() << endl;
cout << "| coeff_modulus size: ";
cout << context_data.total_coeff_modulus_bit_count() << " (";
auto coeff_modulus = context_data.parms().coeff_modulus();
size_t coeff_mod_count = coeff_modulus.size();
for (size_t i = 0; i < coeff_mod_count - 1; i++)
{
cout << coeff_modulus[i].bit_count() << " + ";
}
cout << coeff_modulus.back().bit_count();
cout << ") bits" << endl;
if (context_data.parms().scheme() == scheme_type::BFV)
{
cout << "| plain_modulus: " << context_data.parms().plain_modulus().value() << endl;
}
cout << "\\" << endl;
}
void compute_all_powers(const Ciphertext &ctx, int degree, Evaluator &evaluator, RelinKeys &relin_keys, vector<Ciphertext> &powers)
{
powers.resize(degree + 1);
powers[1] = ctx;
vector<int> levels(degree + 1, 0);
levels[1] = 0;
levels[0] = 0;
for (int i = 2; i <= degree; i++)
{
// compute x^i
int minlevel = i;
int cand = -1;
for (int j = 1; j <= i / 2; j++)
{
int k = i - j;
//
int newlevel = max(levels[j], levels[k]) + 1;
if (newlevel < minlevel)
{
cand = j;
minlevel = newlevel;
}
}
levels[i] = minlevel;
// use cand
if (cand < 0)
throw runtime_error("error");
//cout << "levels " << i << " = " << levels[i] << endl;
// cand <= i - cand by definition
Ciphertext temp = powers[cand];
evaluator.mod_switch_to_inplace(temp, powers[i - cand].parms_id());
evaluator.multiply(temp, powers[i - cand], powers[i]);
evaluator.relinearize_inplace(powers[i], relin_keys);
evaluator.rescale_to_next_inplace(powers[i]);
}
return;
}
// Horner's method for polynomial evaluation
void horner(int degree, double x)
{
chrono::high_resolution_clock::time_point time_start, time_end;
chrono::microseconds time_diff;
EncryptionParameters parms(scheme_type::CKKS);
size_t poly_modulus_degree = 32768;
parms.set_poly_modulus_degree(poly_modulus_degree);
vector<int> moduli(degree + 4, 40);
moduli[0] = 50;
moduli[moduli.size() - 1] = 59;
parms.set_coeff_modulus(CoeffModulus::Create(
poly_modulus_degree, moduli));
double scale = pow(2.0, 40);
auto context = SEALContext::Create(parms);
KeyGenerator keygen(context);
auto pk = keygen.public_key();
auto sk = keygen.secret_key();
auto relin_keys = keygen.relin_keys();
Encryptor encryptor(context, pk);
Decryptor decryptor(context, sk);
Evaluator evaluator(context);
CKKSEncoder ckks_encoder(context);
print_parameters(context);
cout << endl;
Plaintext ptx;
ckks_encoder.encode(x, scale, ptx);
Ciphertext ctx;
encryptor.encrypt(ptx, ctx);
cout << "x = " << x << endl;
vector<double> coeffs(degree + 1);
vector<Plaintext> plain_coeffs(degree + 1);
// Random Coefficients from 0-1
cout << "Polynomial = ";
int counter = 0;
for (size_t i = 0; i < degree + 1; i++)
{
coeffs[i] = (double)rand() / RAND_MAX;
ckks_encoder.encode(coeffs[i], scale, plain_coeffs[i]);
cout << "x^" << counter << " * (" << coeffs[i] << ")"
<< ", ";
counter++;
}
cout << endl;
time_start = chrono::high_resolution_clock::now();
Ciphertext temp;
cout << "Encrypt last coeff...";
encryptor.encrypt(plain_coeffs[degree], temp);
cout << "Done" << endl;
Plaintext plain_result;
vector<double> result;
/*
decryptor.decrypt(ctx, plain_result);
ckks_encoder.decode(plain_result, result);
cout << "ctx = " << result[0] << endl;
*/
double expected_result = coeffs[degree];
for (int i = degree - 1; i >= 0; i--)
{
// temp *= x
expected_result *= x;
evaluator.mod_switch_to_inplace(ctx, temp.parms_id());
evaluator.multiply_inplace(temp, ctx);
/*
decryptor.decrypt(temp, plain_result);
ckks_encoder.decode(plain_result, result);
cout << "temp2 = " << result[0] << endl;
*/
evaluator.relinearize_inplace(temp, relin_keys);
/*
decryptor.decrypt(temp, plain_result);
ckks_encoder.decode(plain_result, result);
cout << "temp after relin = " << result[0] << endl;
*/
evaluator.rescale_to_next_inplace(temp);
/*
decryptor.decrypt(temp, plain_result);
ckks_encoder.decode(plain_result, result);
cout << "temp1 = " << result[0] << endl;
*/
// temp += a[i]
expected_result += coeffs[i];
evaluator.mod_switch_to_inplace(plain_coeffs[i], temp.parms_id());
// Manual rescale
temp.scale() = pow(2.0, 40);
evaluator.add_plain_inplace(temp, plain_coeffs[i]);
//cout << i << "-th iteration done" << endl;
/*
decryptor.decrypt(temp, plain_result);
ckks_encoder.decode(plain_result, result);
cout << "temp = " << result[0] << endl;
*/
}
time_end = chrono::high_resolution_clock::now();
time_diff = chrono::duration_cast<chrono::microseconds>(time_end - time_start);
cout << "Evaluation Duration:\t" << time_diff.count() << " microseconds" << endl;
decryptor.decrypt(temp, plain_result);
ckks_encoder.decode(plain_result, result);
//cout << "ctx = " << result[0] << endl;
cout << "Actual : " << result[0] << "\nExpected : " << expected_result << "\ndiff : " << abs(result[0] - expected_result) << endl;
}
// Tree method for polynomial evaluation
void tree(int degree, double x)
{
chrono::high_resolution_clock::time_point time_start, time_end;
chrono::microseconds time_diff;
EncryptionParameters parms(scheme_type::CKKS);
int depth = ceil(log2(degree));
vector<int> moduli(depth + 4, 40);
moduli[0] = 50;
moduli[moduli.size() - 1] = 59;
size_t poly_modulus_degree = 16384;
parms.set_poly_modulus_degree(poly_modulus_degree);
parms.set_coeff_modulus(CoeffModulus::Create(
poly_modulus_degree, moduli));
double scale = pow(2.0, 40);
auto context = SEALContext::Create(parms);
KeyGenerator keygen(context);
auto pk = keygen.public_key();
auto sk = keygen.secret_key();
auto relin_keys = keygen.relin_keys();
Encryptor encryptor(context, pk);
Decryptor decryptor(context, sk);
Evaluator evaluator(context);
CKKSEncoder ckks_encoder(context);
print_parameters(context);
cout << endl;
Plaintext ptx;
ckks_encoder.encode(x, scale, ptx);
Ciphertext ctx;
encryptor.encrypt(ptx, ctx);
cout << "x = " << x << endl;
vector<double> coeffs(degree + 1);
vector<Plaintext> plain_coeffs(degree + 1);
// Random Coefficients from 0-1
cout << "Polynomial = ";
int counter = 0;
for (size_t i = 0; i < degree + 1; i++)
{
coeffs[i] = (double)rand() / RAND_MAX;
ckks_encoder.encode(coeffs[i], scale, plain_coeffs[i]);
cout << "x^" << counter << " * (" << coeffs[i] << ")"
<< ", ";
}
cout << endl;
Plaintext plain_result;
vector<double> result;
/*
decryptor.decrypt(ctx, plain_result);
ckks_encoder.decode(plain_result, result);
cout << "ctx = " << result[0] << endl;
*/
double expected_result = coeffs[degree];
// Compute all powers
vector<Ciphertext> powers(degree + 1);
time_start = chrono::high_resolution_clock::now();
compute_all_powers(ctx, degree, evaluator, relin_keys, powers);
cout << "All powers computed " << endl;
Ciphertext enc_result;
// result = a[0]
cout << "Encrypt first coeff...";
encryptor.encrypt(plain_coeffs[0], enc_result);
cout << "Done" << endl;
/*
for (int i = 1; i <= degree; i++){
decryptor.decrypt(powers[i], plain_result);
ckks_encoder.decode(plain_result, result);
// cout << "power = " << result[0] << endl;
}
*/
Ciphertext temp;
// result += a[i]*x[i]
for (int i = 1; i <= degree; i++)
{
// cout << i << "-th sum started" << endl;
evaluator.mod_switch_to_inplace(plain_coeffs[i], powers[i].parms_id());
evaluator.multiply_plain(powers[i], plain_coeffs[i], temp);
evaluator.rescale_to_next_inplace(temp);
evaluator.mod_switch_to_inplace(enc_result, temp.parms_id());
// Manual Rescale
enc_result.scale() = pow(2.0, 40);
temp.scale() = pow(2.0, 40);
evaluator.add_inplace(enc_result, temp);
// cout << i << "-th sum done" << endl;
}
time_end = chrono::high_resolution_clock::now();
time_diff = chrono::duration_cast<chrono::microseconds>(time_end - time_start);
cout << "Evaluation Duration:\t" << time_diff.count() << " microseconds" << endl;
// Compute Expected result
for (int i = degree - 1; i >= 0; i--)
{
expected_result *= x;
expected_result += coeffs[i];
}
decryptor.decrypt(enc_result, plain_result);
ckks_encoder.decode(plain_result, result);
cout << "Actual : " << result[0] << "\nExpected : " << expected_result << "\ndiff : " << abs(result[0] - expected_result) << endl;
}
int main()
{
int degree = 0;
cout << "Enter Degree: ";
cin >> degree;
double x = 0;
cout << "Enter x value: ";
cin >> x;
cout << endl;
if (degree > 15)
{
cerr << "Invalid degree" << endl;
exit(EXIT_FAILURE);
}
while (true)
{
cout << "\nSelect method:\n"
<< endl;
cout << " 1. Horner" << endl;
cout << " 2. Tree" << endl;
cout << " 0. Quit" << endl;
int selection = 0;
if (!(cin >> selection))
{
cout << "Invalid option" << endl;
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(), '\n');
continue;
}
switch (selection)
{
case 1:
horner(degree, x);
break;
case 2:
tree(degree, x);
break;
case 0:
cout << "Exit" << endl;
return 0;
}
}
return 0;
}
| 11,264
|
C++
|
.cpp
| 327
| 27.672783
| 134
| 0.578471
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,650
|
vector_ops.cpp
|
MarwanNour_SEAL-FYP-Logistic-Regression/vector_ops.cpp
|
#include "seal/seal.h"
#include <iostream>
#include <iomanip>
#include <chrono>
using namespace std;
using namespace seal;
// Helper function that prints a matrix
template <typename T>
void print_matrix(vector<T> matrix, size_t row_size)
{
size_t print_size = 5;
cout << "\t[";
for (size_t i = 0; i < print_size; i++)
{
cout << matrix[i] << ", ";
}
cout << "...,";
for (size_t i = row_size - print_size; i < row_size; i++)
{
cout << matrix[i]
<< ((i != row_size - 1) ? ", " : " ]\n");
}
cout << "\t[";
for (size_t i = row_size; i < row_size + print_size; i++)
{
cout << matrix[i] << ", ";
}
cout << "...,";
for (size_t i = 2 * row_size - print_size; i < 2 * row_size; i++)
{
cout << matrix[i]
<< ((i != 2 * row_size - 1) ? ", " : " ]\n");
}
cout << endl;
}
template <typename T>
void print_full_vector(vector<T> vec)
{
cout << "\t[ ";
for (unsigned int i = 0; i < vec.size() - 1; i++)
{
cout << vec[i] << ", ";
}
cout << vec[vec.size() - 1] << " ]" << endl;
}
// Helper function that prints a vector of floats
template <typename T>
inline void print_vector(std::vector<T> vec, std::size_t print_size = 4, int prec = 3)
{
/*
Save the formatting information for std::cout.
*/
std::ios old_fmt(nullptr);
old_fmt.copyfmt(std::cout);
std::size_t slot_count = vec.size();
std::cout << std::fixed << std::setprecision(prec);
std::cout << std::endl;
if (slot_count <= 2 * print_size)
{
std::cout << " [";
for (std::size_t i = 0; i < slot_count; i++)
{
std::cout << " " << vec[i] << ((i != slot_count - 1) ? "," : " ]\n");
}
}
else
{
vec.resize(std::max(vec.size(), 2 * print_size));
std::cout << " [";
for (std::size_t i = 0; i < print_size; i++)
{
std::cout << " " << vec[i] << ",";
}
if (vec.size() > 2 * print_size)
{
std::cout << " ...,";
}
for (std::size_t i = slot_count - print_size; i < slot_count; i++)
{
std::cout << " " << vec[i] << ((i != slot_count - 1) ? "," : " ]\n");
}
}
std::cout << std::endl;
/*
Restore the old std::cout formatting.
*/
std::cout.copyfmt(old_fmt);
}
// Ops in BFV
void bfvOps()
{
cout << "------BFV TEST------\n"
<< endl;
// Set the parameters
EncryptionParameters params(scheme_type::BFV);
size_t poly_modulus_degree = 8192;
params.set_poly_modulus_degree(poly_modulus_degree);
params.set_coeff_modulus(CoeffModulus::BFVDefault(poly_modulus_degree));
params.set_plain_modulus(786433);
auto context = SEALContext::Create(params);
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
RelinKeys relin_keys = keygen.relin_keys();
Encryptor encryptor(context, pk);
Evaluator evaluator(context);
Decryptor decryptor(context, sk);
// Create BatchEncoder
BatchEncoder batch_encoder(context);
// In BFV the number of slots is equal to poly_modulus_degree
// and they are arranged into a matrix with 2 rows
size_t slot_count = batch_encoder.slot_count();
size_t row_size = slot_count / 2;
cout << "Plaintext Matrix row size: " << row_size << endl;
// Create first matrix
vector<uint64_t> matrix1(slot_count, 0);
for (unsigned int i = 0; i < slot_count; i++)
{
matrix1[i] = i;
}
cout << "First Input plaintext matrix:" << endl;
// Print the matrix
print_matrix(matrix1, row_size);
// Encode the matrix into a plaintext polynomial
Plaintext plaint_matrix1;
cout << "Encode plaintext matrix" << endl;
batch_encoder.encode(matrix1, plaint_matrix1);
// Encrypt the encoded matrix
Ciphertext cipher_matrix1;
cout << "Encrypt plaint_matrix1 to cipher_matrix: " << endl;
encryptor.encrypt(plaint_matrix1, cipher_matrix1);
cout << "\t+ NOISE budget in cipher_matrix: " << decryptor.invariant_noise_budget(cipher_matrix1) << " bits" << endl;
// Create second matrix
vector<uint64_t> matrix2;
for (size_t i = 0; i < slot_count; i++)
{
matrix2.push_back((i % 2) + 1);
}
cout << "\nSecond input plaintext matrix: " << endl;
print_matrix(matrix2, row_size);
Plaintext plain_matrix2;
batch_encoder.encode(matrix2, plain_matrix2);
// Compute (cipher_matrix1 + plain_matrix2)^2
cout << "Computing (cipher_matrix1 + plain_matrix2)^2" << endl;
cout << "Sum, square and relinearize" << endl;
// TIME START
auto start = chrono::high_resolution_clock::now();
evaluator.add_plain_inplace(cipher_matrix1, plain_matrix2);
evaluator.square_inplace(cipher_matrix1);
evaluator.relinearize_inplace(cipher_matrix1, relin_keys);
// TIME END
auto stop = chrono::high_resolution_clock::now();
auto duration = chrono::duration_cast<chrono::microseconds>(stop - start);
cout << "\t+ NOISE budget in result: " << decryptor.invariant_noise_budget(cipher_matrix1) << " bits" << endl;
// Decrypt and Decode
Plaintext plain_result;
cout << "Decrypt and Decode the result" << endl;
decryptor.decrypt(cipher_matrix1, plain_result);
vector<uint64_t> matrix_result;
batch_encoder.decode(plain_result, matrix_result);
print_matrix(matrix_result, row_size);
cout << "\nTime to compute (cipher_matrix1 + plain_matrix2)^2 :" << duration.count() << " microseconds" << endl;
}
// Ops in CKKS
void ckksOps()
{
cout << "------CKKS TEST------\n"
<< endl;
// Set params
EncryptionParameters params(scheme_type::CKKS);
size_t poly_modulus_degree = 8192;
params.set_poly_modulus_degree(poly_modulus_degree);
params.set_coeff_modulus(CoeffModulus::BFVDefault(poly_modulus_degree));
auto context = SEALContext::Create(params);
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
RelinKeys relin_keys = keygen.relin_keys();
Encryptor encryptor(context, pk);
Evaluator evaluator(context);
Decryptor decryptor(context, sk);
// Create CKKS encoder
CKKSEncoder ckks_encoder(context);
/* In CKKS the number of slots is poly_modulus_degree / 2 and each slot encodes
one real or complex number. This should be contrasted with BatchEncoder in
the BFV scheme, where the number of slots is equal to poly_modulus_degree
and they are arranged into a matrix with two rows. */
size_t slot_count = ckks_encoder.slot_count();
cout << "Slot count : " << slot_count << endl;
// First vector
vector<double> pod_vec1(slot_count, 0);
for (unsigned int i = 0; i < slot_count; i++)
{
pod_vec1[i] = static_cast<double>(i);
}
print_vector(pod_vec1);
// Second vector
vector<double> pod_vec2(slot_count, 0);
for (unsigned int i = 0; i < slot_count; i++)
{
pod_vec2[i] = static_cast<double>((i % 2) + 1);
}
print_vector(pod_vec2);
// Encode the pod_vec1 and pod_vec2
Plaintext plain_vec1, plain_vec2;
// Scale used here sqrt of last coeff modulus
double scale = sqrt(static_cast<double>(params.coeff_modulus().back().value()));
ckks_encoder.encode(pod_vec1, scale, plain_vec1);
ckks_encoder.encode(pod_vec2, scale, plain_vec2);
// Encrypt plain_vec1
cout << "Encrypt plain_vec1 to cipher_vec1:" << endl;
Ciphertext cipher_vec1;
encryptor.encrypt(plain_vec1, cipher_vec1);
// cout << "\t+ NOISE budget in cipher_vec1: " << decryptor.invariant_noise_budget(cipher_vec1) << " bits" << endl;
// Compute (cipher_vec1 + plain_vec2)^2
cout << "Computing (cipher_vec1 + plain_vec2)^2" << endl;
// TIME START
auto start = chrono::high_resolution_clock::now();
evaluator.add_plain_inplace(cipher_vec1, plain_vec2);
evaluator.square_inplace(cipher_vec1);
evaluator.relinearize_inplace(cipher_vec1, relin_keys);
// TIME END
auto stop = chrono::high_resolution_clock::now();
auto duration = chrono::duration_cast<chrono::microseconds>(stop - start);
// cout << "\t+ NOISE budget in result: " << decryptor.invariant_noise_budget(cipher_vec1) << " bits" << endl;
// Decrypt and Decode
Plaintext plain_result;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_vec1, plain_result);
vector<double> vec_result;
ckks_encoder.decode(plain_result, vec_result);
print_vector(vec_result);
cout << "\nTime to compute (cipher_vec1 + plain_vec2)^2 :" << duration.count() << " microseconds" << endl;
}
int main()
{
bfvOps();
ckksOps();
return 0;
}
| 8,946
|
C++
|
.cpp
| 242
| 31.599174
| 121
| 0.620562
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,651
|
matrix_mult_benchmark.cpp
|
MarwanNour_SEAL-FYP-Logistic-Regression/matrix_mult_benchmark.cpp
|
#include <iostream>
#include <iomanip>
#include <fstream>
#include <unistd.h>
#include "seal/seal.h"
#include "helper.h"
using namespace std;
using namespace seal;
Ciphertext CC_Matrix_Multiplication(Ciphertext ctA, Ciphertext ctB, int dimension, vector<Plaintext> U_sigma_diagonals, vector<Plaintext> U_tau_diagonals, vector<vector<Plaintext>> V_diagonals, vector<vector<Plaintext>> W_diagonals, GaloisKeys gal_keys, EncryptionParameters params)
{
auto context = SEALContext::Create(params);
Evaluator evaluator(context);
vector<Ciphertext> ctA_result(dimension);
vector<Ciphertext> ctB_result(dimension);
cout << "----------Step 1----------- " << endl;
// Step 1-1
ctA_result[0] = Linear_Transform_Plain(ctA, U_sigma_diagonals, gal_keys, params);
// Step 1-2
ctB_result[0] = Linear_Transform_Plain(ctB, U_tau_diagonals, gal_keys, params);
// Step 2
cout << "----------Step 2----------- " << endl;
for (int k = 1; k < dimension; k++)
{
cout << "Linear Transf at k = " << k;
ctA_result[k] = Linear_Transform_Plain(ctA_result[0], V_diagonals[k - 1], gal_keys, params);
ctB_result[k] = Linear_Transform_Plain(ctB_result[0], W_diagonals[k - 1], gal_keys, params);
cout << "..... Done" << endl;
}
// Step 3
cout << "----------Step 3----------- " << endl;
// Test Rescale
cout << "RESCALE--------" << endl;
for (int i = 1; i < dimension; i++)
{
evaluator.rescale_to_next_inplace(ctA_result[i]);
evaluator.rescale_to_next_inplace(ctB_result[i]);
}
Ciphertext ctAB;
evaluator.multiply(ctA_result[0], ctB_result[0], ctAB);
evaluator.mod_switch_to_next_inplace(ctAB);
// Manual scale set
for (int i = 1; i < dimension; i++)
{
ctA_result[i].scale() = pow(2, (int)log2(ctA_result[i].scale()));
ctB_result[i].scale() = pow(2, (int)log2(ctB_result[i].scale()));
}
for (int k = 1; k < dimension; k++)
{
cout << "Iteration k = " << k << endl;
Ciphertext temp_mul;
evaluator.multiply(ctA_result[k], ctB_result[k], temp_mul);
evaluator.add_inplace(ctAB, temp_mul);
}
return ctAB;
}
vector<vector<double>> test_matrix_mult(vector<vector<double>> mat_A, vector<vector<double>> mat_B, int dimension)
{
vector<vector<double>> mat_res(dimension, vector<double>(dimension));
for (int i = 0; i < dimension; i++)
{
for (int j = 0; j < dimension; j++)
{
for (int k = 0; k < dimension; k++)
{
mat_res[i][j] += mat_A[i][k] * mat_B[k][j];
}
}
}
return mat_res;
}
void Matrix_Multiplication(size_t poly_modulus_degree, int dimension)
{
// Handle Rotation Error First
if (dimension > poly_modulus_degree / 4)
{
cerr << "Dimension is too large. Choose a dimension less than " << poly_modulus_degree / 4 << endl;
exit(1);
}
EncryptionParameters params(scheme_type::CKKS);
params.set_poly_modulus_degree(poly_modulus_degree);
cout << "MAX BIT COUNT: " << CoeffModulus::MaxBitCount(poly_modulus_degree) << endl;
params.set_coeff_modulus(CoeffModulus::Create(poly_modulus_degree, {60, 40, 40, 40, 40, 60}));
auto context = SEALContext::Create(params);
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
GaloisKeys gal_keys = keygen.galois_keys();
Encryptor encryptor(context, pk);
Evaluator evaluator(context);
Decryptor decryptor(context, sk);
// Create CKKS encoder
CKKSEncoder ckks_encoder(context);
// Create Scale
double scale = pow(2.0, 40);
// Set output script
string script = "matrix_mult_plot_p" + to_string(poly_modulus_degree) + "_d" + to_string(dimension) + ".py";
ofstream outscript(script);
// Handle script error
if (!outscript)
{
cerr << "Couldn't open file: " << script << endl;
exit(1);
}
// Write to Script
outscript << "import matplotlib.pyplot as plt" << endl;
outscript << "labels = 'Encode', 'Encrypt', 'M. Encode', 'Computation', 'Decrypt', 'Decode'" << endl;
outscript << "colors = ['gold', 'green', 'lightskyblue', 'white', 'red', 'violet']" << endl;
outscript << "sizes = [";
cout << "Dimension : " << dimension << endl
<< endl;
vector<vector<double>> pod_matrix1_set1(dimension, vector<double>(dimension));
vector<vector<double>> pod_matrix2_set1(dimension, vector<double>(dimension));
// Fill input matrices
double r = ((double)rand() / (RAND_MAX));
// double filler = 1;
// Matrix 1
for (int i = 0; i < dimension; i++)
{
for (int j = 0; j < dimension; j++)
{
pod_matrix1_set1[i][j] = r;
// filler++;
r = ((double)rand() / (RAND_MAX));
}
}
cout << "Matrix 1:" << endl;
print_full_matrix(pod_matrix1_set1, 0);
// filler = 1;
// Matrix 2
for (int i = 0; i < dimension; i++)
{
for (int j = 0; j < dimension; j++)
{
pod_matrix2_set1[i][j] = r;
r = ((double)rand() / (RAND_MAX));
// filler++;
}
}
cout << "Matrix 2:" << endl;
print_full_matrix(pod_matrix2_set1, 0);
int dimensionSq = pow(dimension, 2);
// Get U_sigma for first matrix
vector<vector<double>> U_sigma = get_U_sigma(pod_matrix1_set1);
cout << "\nU_sigma:" << endl;
print_full_matrix(U_sigma, 0);
// Get U_tau for second matrix
vector<vector<double>> U_tau = get_U_tau(pod_matrix1_set1);
cout << "\nU_tau:" << endl;
print_full_matrix(U_tau, 0);
// Get V_k (3D matrix)
vector<vector<vector<double>>> V_k(dimension - 1, vector<vector<double>>(dimensionSq, vector<double>(dimensionSq)));
for (int i = 1; i < dimension; i++)
{
V_k[i - 1] = get_V_k(pod_matrix1_set1, i);
cout << "\nV_" << to_string(i) << ":" << endl;
print_full_matrix(V_k[i - 1], 0);
}
// Get W_k (3D matrix)
vector<vector<vector<double>>> W_k(dimension - 1, vector<vector<double>>(dimensionSq, vector<double>(dimensionSq)));
for (int i = 1; i < dimension; i++)
{
W_k[i - 1] = get_W_k(pod_matrix1_set1, i);
cout << "\nW_" << to_string(i) << ":" << endl;
print_full_matrix(W_k[i - 1], 0);
}
// Get Diagonals for U_sigma
vector<vector<double>> U_sigma_diagonals = get_all_diagonals(U_sigma);
cout << "U_sigma Diagonal Matrix:" << endl;
print_full_matrix(U_sigma_diagonals, 0);
// Test ADD EPSILON
double epsilon = 0.00000001;
for (int i = 0; i < dimensionSq; i++)
{
for (int j = 0; j < dimensionSq; j++)
{
U_sigma_diagonals[i][j] += epsilon;
}
}
// Get Diagonals for U_tau
vector<vector<double>> U_tau_diagonals = get_all_diagonals(U_tau);
// Test ADD EPSILON
for (int i = 0; i < dimensionSq; i++)
{
for (int j = 0; j < dimensionSq; j++)
{
U_tau_diagonals[i][j] += epsilon;
}
}
// Get Diagonals for V_k
vector<vector<vector<double>>> V_k_diagonals(dimension - 1, vector<vector<double>>(dimensionSq, vector<double>(dimensionSq)));
for (int i = 1; i < dimension; i++)
{
V_k_diagonals[i - 1] = get_all_diagonals(V_k[i - 1]);
}
// Test ADD EPSILON
for (int i = 0; i < dimension - 1; i++)
{
for (int j = 0; j < dimensionSq; j++)
{
for (int k = 0; k < dimensionSq; k++)
{
V_k_diagonals[i][j][k] += epsilon;
}
}
}
// Get Diagonals for W_k
vector<vector<vector<double>>> W_k_diagonals(dimension - 1, vector<vector<double>>(dimensionSq, vector<double>(dimensionSq)));
for (int i = 1; i < dimension; i++)
{
W_k_diagonals[i - 1] = get_all_diagonals(W_k[i - 1]);
}
// Test ADD EPSILON
for (int i = 0; i < dimension - 1; i++)
{
for (int j = 0; j < dimensionSq; j++)
{
for (int k = 0; k < dimensionSq; k++)
{
W_k_diagonals[i][j][k] += epsilon;
}
}
}
// --------------- ENCODING ----------------
// Encode U_sigma diagonals
// Encode U_tau diagonals
vector<Plaintext> U_sigma_diagonals_plain(dimensionSq);
vector<Plaintext> U_tau_diagonals_plain(dimensionSq);
vector<vector<Plaintext>> V_k_diagonals_plain(dimension - 1, vector<Plaintext>(dimensionSq));
vector<vector<Plaintext>> W_k_diagonals_plain(dimension - 1, vector<Plaintext>(dimensionSq));
vector<Plaintext> plain_matrix1_set1(dimension);
vector<Plaintext> plain_matrix2_set1(dimension);
// cout << "\nEncoding U_sigma_diagonals...Encoding U_tau_diagonals...";
cout << "\nENCODING...." << endl;
auto start_encode = chrono::high_resolution_clock::now();
for (int i = 0; i < dimensionSq; i++)
{
ckks_encoder.encode(U_sigma_diagonals[i], scale, U_sigma_diagonals_plain[i]);
ckks_encoder.encode(U_tau_diagonals[i], scale, U_tau_diagonals_plain[i]);
}
// cout << "Done" << endl;
// Encode V_k diagonals
// Encode W_k diagonals
// cout << "\nEncoding V_K_diagonals...Encoding W_k_diagonals...";
for (int i = 1; i < dimension; i++)
{
for (int j = 0; j < dimensionSq; j++)
{
ckks_encoder.encode(V_k_diagonals[i - 1][j], scale, V_k_diagonals_plain[i - 1][j]);
ckks_encoder.encode(W_k_diagonals[i - 1][j], scale, W_k_diagonals_plain[i - 1][j]);
}
}
// cout << "Done" << endl;
// Encode Matrices
// Encode Matrix 1
// cout << "\nEncoding Matrix 1...Encoding Matrix 2...";
for (int i = 0; i < dimension; i++)
{
ckks_encoder.encode(pod_matrix1_set1[i], scale, plain_matrix1_set1[i]);
ckks_encoder.encode(pod_matrix2_set1[i], scale, plain_matrix2_set1[i]);
}
// cout << "Done" << endl;
auto stop_encode = chrono::high_resolution_clock::now();
cout << "Encoding is Complete" << endl;
auto duration_encode = chrono::duration_cast<chrono::microseconds>(stop_encode - start_encode);
cout << "Encode Duration:\t" << duration_encode.count() << endl;
outscript << duration_encode.count() << ", ";
// Encode Matrix 2
// --------------- ENCRYPTING ----------------
// Encrypt Matrix 1
vector<Ciphertext> cipher_matrix1_set1(dimension);
vector<Ciphertext> cipher_matrix2_set1(dimension);
// cout << "\nEncrypting Matrix 1...Encrypting Matrix 2...";
cout << "\nENCRYPTING...." << endl;
auto start_encrypt = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension; i++)
{
encryptor.encrypt(plain_matrix1_set1[i], cipher_matrix1_set1[i]);
encryptor.encrypt(plain_matrix2_set1[i], cipher_matrix2_set1[i]);
}
auto stop_encrypt = chrono::high_resolution_clock::now();
cout << "Encrypting is Complete" << endl;
auto duration_encrypt = chrono::duration_cast<chrono::microseconds>(stop_encrypt - start_encrypt);
cout << "Encrypt Duration:\t" << duration_encrypt.count() << endl;
outscript << duration_encrypt.count() << ", ";
// cout << "Done" << endl;
// --------------- MATRIX ENCODING ----------------
// Matrix Encode Matrix 1
cout << "\nMatrix Encoding-----" << endl;
auto start_matrix_encoding = chrono::high_resolution_clock::now();
Ciphertext cipher_encoded_matrix1_set1 = C_Matrix_Encode(cipher_matrix1_set1, gal_keys, evaluator);
Ciphertext cipher_encoded_matrix2_set1 = C_Matrix_Encode(cipher_matrix2_set1, gal_keys, evaluator);
auto stop_matrix_encoding = chrono::high_resolution_clock::now();
cout << "Matrix Encoding is Complete" << endl;
auto duration_matrix_encoding = chrono::duration_cast<chrono::microseconds>(stop_matrix_encoding - start_matrix_encoding);
cout << "Matrix Encoding Duration:\t" << duration_matrix_encoding.count() << endl;
outscript << duration_matrix_encoding.count() << ", ";
// --------------- MATRIX MULTIPLICATION ----------------
cout << "\nMatrix Multiplication..." << endl;
auto start_matrix_mult = chrono::high_resolution_clock::now();
Ciphertext ct_result = CC_Matrix_Multiplication(cipher_encoded_matrix1_set1, cipher_encoded_matrix2_set1, dimension, U_sigma_diagonals_plain, U_tau_diagonals_plain, V_k_diagonals_plain, W_k_diagonals_plain, gal_keys, params);
auto stop_matrix_mutl = chrono::high_resolution_clock::now();
auto duration_matrix_mult = chrono::duration_cast<chrono::microseconds>(stop_matrix_mutl - start_matrix_mult);
cout << "Matrix Mult Duration:\t" << duration_matrix_mult.count() << endl;
outscript << duration_matrix_mult.count() << ", ";
// --------------- DECRYPT ----------------
Plaintext pt_result;
cout << "\nResult Decrypt...";
auto start_result_decrypt = chrono::high_resolution_clock::now();
decryptor.decrypt(ct_result, pt_result);
auto stop_result_decrypt = chrono::high_resolution_clock::now();
auto duration_result_decrypt = chrono::duration_cast<chrono::microseconds>(stop_result_decrypt - start_result_decrypt);
cout << "Result Decrypt Duration:\t" << duration_result_decrypt.count() << endl;
outscript << duration_result_decrypt.count() << ", ";
// --------------- DECODE ----------------
vector<double> result_matrix;
cout << "\nResult Decode...";
auto start_result_decode = chrono::high_resolution_clock::now();
ckks_encoder.decode(pt_result, result_matrix);
auto stop_result_decode = chrono::high_resolution_clock::now();
auto duration_result_decode = chrono::duration_cast<chrono::microseconds>(stop_result_decode - start_result_decode);
cout << "Result Decode Duration:\t" << duration_result_decode.count() << endl;
outscript << duration_result_decode.count() << ", ";
cout << "Resulting matrix: ";
for (int i = 0; i < dimensionSq; i++)
{
if (i % dimension == 0)
{
cout << "\n\t";
}
cout << result_matrix[i] << ", ";
}
cout << endl;
cout << "Expected Matrix: " << endl;
vector<vector<double>> expected_mat = test_matrix_mult(pod_matrix1_set1, pod_matrix2_set1, dimension);
print_full_matrix(expected_mat, 5);
outscript << "]" << endl;
outscript << "plt.pie(sizes, colors=colors, autopct='%.1f')" << endl;
outscript << "plt.title(\"Matrix Multiplication Test p" << to_string(poly_modulus_degree) << " d" << to_string(dimension) << "\")" << endl;
outscript << "plt.legend(labels)" << endl;
outscript << "plt.tight_layout()" << endl;
outscript << "plt.axis('equal')" << endl;
outscript << "plt.show()" << endl;
outscript.close();
}
int main()
{
Matrix_Multiplication(8192 * 2, 5);
return 0;
}
| 14,940
|
C++
|
.cpp
| 350
| 36.477143
| 282
| 0.601584
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,652
|
2_encoders.cpp
|
MarwanNour_SEAL-FYP-Logistic-Regression/2_encoders.cpp
|
#include "seal/seal.h"
#include <iostream>
#include <iomanip>
#include <vector>
#include "seal/seal.h"
using namespace std;
using namespace seal;
// Helper function that prints a matrix
template <typename T>
void print_matrix(vector<T> matrix, size_t row_size)
{
size_t print_size = 5;
cout << "\t[";
for (size_t i = 0; i < print_size; i++)
{
cout << matrix[i] << ", ";
}
cout << "...,";
for (size_t i = row_size - print_size; i < row_size; i++)
{
cout << matrix[i]
<< ((i != row_size - 1) ? ", " : " ]\n");
}
cout << "\t[";
for (size_t i = row_size; i < row_size + print_size; i++)
{
cout << matrix[i] << ", ";
}
cout << "...,";
for (size_t i = 2 * row_size - print_size; i < 2 * row_size; i++)
{
cout << matrix[i]
<< ((i != 2 * row_size - 1) ? ", " : " ]\n");
}
cout << endl;
}
// Helper function that prints a vector of floats
template <typename T>
inline void print_vector(std::vector<T> vec, std::size_t print_size = 4, int prec = 3)
{
/*
Save the formatting information for std::cout.
*/
std::ios old_fmt(nullptr);
old_fmt.copyfmt(std::cout);
std::size_t slot_count = vec.size();
std::cout << std::fixed << std::setprecision(prec);
std::cout << std::endl;
if (slot_count <= 2 * print_size)
{
std::cout << " [";
for (std::size_t i = 0; i < slot_count; i++)
{
std::cout << " " << vec[i] << ((i != slot_count - 1) ? "," : " ]\n");
}
}
else
{
vec.resize(std::max(vec.size(), 2 * print_size));
std::cout << " [";
for (std::size_t i = 0; i < print_size; i++)
{
std::cout << " " << vec[i] << ",";
}
if (vec.size() > 2 * print_size)
{
std::cout << " ...,";
}
for (std::size_t i = slot_count - print_size; i < slot_count; i++)
{
std::cout << " " << vec[i] << ((i != slot_count - 1) ? "," : " ]\n");
}
}
std::cout << std::endl;
/*
Restore the old std::cout formatting.
*/
std::cout.copyfmt(old_fmt);
}
void integerEncoding()
{
cout << "\n--------- Integer Encoding ---------\n"
<< endl;
// Set the parameters
EncryptionParameters params(scheme_type::BFV);
size_t poly_modulus_degree = 4096;
params.set_poly_modulus_degree(poly_modulus_degree);
params.set_coeff_modulus(CoeffModulus::BFVDefault(poly_modulus_degree));
params.set_plain_modulus(512);
auto context = SEALContext::Create(params);
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
Encryptor encryptor(context, pk);
Decryptor decryptor(context, sk);
Evaluator evaluator(context);
// Create IntegerEncoder
IntegerEncoder encoder(context);
// Encode two values
int val1 = 10;
Plaintext plain1 = encoder.encode(val1);
cout << "Encode " << val1 << " as polynomial " << plain1.to_string() << endl;
int val2 = 12;
Plaintext plain2 = encoder.encode(val2);
cout << "Encode " << val2 << " as polynomial " << plain2.to_string() << endl;
// Encrypt the encoded values
Ciphertext cipher1, cipher2;
cout << "\nEncrypt plain1 to cipher1 and plain2 to cipher2" << endl;
encryptor.encrypt(plain1, cipher1);
encryptor.encrypt(plain2, cipher2);
cout << "\t+ NOISE budget in cipher1: " << decryptor.invariant_noise_budget(cipher1) << " bits" << endl;
cout << "\t+ NOISE budget in cipher2: " << decryptor.invariant_noise_budget(cipher2) << " bits" << endl;
// Example: Compute (cipher1*cipher2) - cipher1
Ciphertext cipherResult;
cout << "\nComputing (cipher1*cipher2) - cipher1:" << endl;
Ciphertext cipher1_mul_cipher2;
evaluator.multiply(cipher1, cipher2, cipher1_mul_cipher2);
evaluator.sub(cipher1_mul_cipher2, cipher1, cipherResult);
cout << "\t+ NOISE budget in cipherResult: " << decryptor.invariant_noise_budget(cipherResult) << " bits" << endl;
// Decrypt
Plaintext plain_result;
decryptor.decrypt(cipherResult, plain_result);
cout << "Decrypted plaintext result:\n\t" << plain_result.to_string() << endl;
// Decode
cout << "Decoded Result:\n\t" << encoder.decode_int32(plain_result) << endl;
}
void batchEncoding()
{
cout << "\n--------- Batch Encoding ---------\n"
<< endl;
// Set the parameters
EncryptionParameters params(scheme_type::BFV);
size_t poly_modulus_degree = 8192;
params.set_poly_modulus_degree(poly_modulus_degree);
params.set_coeff_modulus(CoeffModulus::BFVDefault(poly_modulus_degree));
// Plain modulus in batching is a prime number congruent to: 1 mod 2*poly_modulus_degree.
// SEAL provides a helper function for it
// Creating a 20 bit prime
params.set_plain_modulus(PlainModulus::Batching(poly_modulus_degree, 20));
auto context = SEALContext::Create(params);
auto qualifiers = context->first_context_data()->qualifiers();
cout << "Batching enabled: " << boolalpha << qualifiers.using_batching << endl;
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
RelinKeys relin_keys = keygen.relin_keys();
Encryptor encryptor(context, pk);
Evaluator evaluator(context);
Decryptor decryptor(context, sk);
// Create BatchEncoder
BatchEncoder batch_encoder(context);
// In BFV the number of slots is equal to poly_modulus_degree
// and they are arranged into a matrix with 2 rows
size_t slot_count = batch_encoder.slot_count();
size_t row_size = slot_count / 2;
cout << "Plaintext Matrix row size: " << row_size << endl;
// Create first matrix
vector<uint64_t> matrix1(slot_count, 0);
matrix1[0] = 0;
matrix1[1] = 1;
matrix1[2] = 2;
matrix1[3] = 3;
matrix1[row_size] = 4;
matrix1[row_size + 1] = 5;
matrix1[row_size + 2] = 6;
matrix1[row_size + 3] = 7;
cout << "First Input plaintext matrix:" << endl;
// Print the matrix
print_matrix(matrix1, row_size);
// Encode the matrix into a plaintext polynomial
Plaintext plaint_matrix1;
cout << "Encoded plaintext matrix:" << endl;
batch_encoder.encode(matrix1, plaint_matrix1);
// Encrypt the encoded matrix
Ciphertext cipher_matrix1;
cout << "Encrypt plaint_matrix1 to cipher_matrix: " << endl;
encryptor.encrypt(plaint_matrix1, cipher_matrix1);
cout << "\t+ NOISE budget in cipher_matrix: " << decryptor.invariant_noise_budget(cipher_matrix1) << " bits" << endl;
// Create second matrix
vector<uint64_t> matrix2;
for (size_t i = 0; i < slot_count; i++)
{
matrix2.push_back((i % 2) + 1);
}
cout << "\nSecond input plaintext matrix: " << endl;
print_matrix(matrix2, row_size);
Plaintext plain_matrix2;
batch_encoder.encode(matrix2, plain_matrix2);
// Compute (cipher_matrix1 + plain_matrix2)^2
cout << "Computing (cipher_matrix1 + plain_matrix2)^2" << endl;
cout << "Sum, square and relinearize" << endl;
evaluator.add_plain_inplace(cipher_matrix1, plain_matrix2);
evaluator.square_inplace(cipher_matrix1);
evaluator.relinearize_inplace(cipher_matrix1, relin_keys);
cout << "\t+ NOISE budget in result: " << decryptor.invariant_noise_budget(cipher_matrix1) << " bits" << endl;
// Decrypt and Decode
Plaintext plain_result;
cout << "Decrypt and Decode the result" << endl;
decryptor.decrypt(cipher_matrix1, plain_result);
vector<uint64_t> matrix_result;
batch_encoder.decode(plain_result, matrix_result);
print_matrix(matrix_result, row_size);
}
void ckksEncoding()
{
cout << "\n--------- CKKS Encoding ---------\n"
<< endl;
// Set the parameters
EncryptionParameters params(scheme_type::CKKS);
size_t poly_modulus_degree = 8192;
params.set_poly_modulus_degree(poly_modulus_degree);
// CKKS doesn't require a plain_modulus
// Generating 5 40bit prime numbers for CoeffModulus
params.set_coeff_modulus(CoeffModulus::Create(poly_modulus_degree, {40, 40, 40, 40, 40}));
auto context = SEALContext::Create(params);
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
RelinKeys relin_keys = keygen.relin_keys();
Encryptor encryptor(context, pk);
Decryptor decryptor(context, sk);
Evaluator evaluator(context);
// Create CKKSEncoder
CKKSEncoder ckks_encoder(context);
// In CKKS the number of slots is poly_modulus_degree / 2
size_t slot_count = ckks_encoder.slot_count();
cout << "Number of slots: " << slot_count << endl;
vector<double> input_vec{0.0, 1.1, 2.2, 3.3};
cout << "Input vector: " << endl;
// print vector
print_vector(input_vec);
// Encode the vector
Plaintext plain_vec;
double scale = pow(2.0, 30); // scale is used like a precision parameter
cout << "Encode input_vec" << endl;
ckks_encoder.encode(input_vec, scale, plain_vec);
// Encrypt
Ciphertext cipher_vec;
encryptor.encrypt(plain_vec, cipher_vec);
// Squaring the cipher_vec
evaluator.square_inplace(cipher_vec);
evaluator.relinearize_inplace(cipher_vec, relin_keys);
cout << "\t+ Scale in cipher_vec: " << cipher_vec.scale()
<< " (" << log2(cipher_vec.scale()) << " bits)" << endl;
cout << "Decrypt and Decode cipher_vec" << endl;
decryptor.decrypt(cipher_vec, plain_vec);
vector<double> output_vec;
ckks_encoder.decode(plain_vec, output_vec);
print_vector(output_vec);
}
int main()
{
integerEncoding();
batchEncoding();
ckksEncoding();
return 0;
}
| 9,967
|
C++
|
.cpp
| 260
| 32.996154
| 121
| 0.632446
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,654
|
3_levels.cpp
|
MarwanNour_SEAL-FYP-Logistic-Regression/3_levels.cpp
|
#include "seal/seal.h"
#include <iostream>
using namespace std;
using namespace seal;
int main()
{
cout << "\n--------- Levels Demo ---------\n"
<< endl;
EncryptionParameters params(scheme_type::BFV);
size_t poly_modulus_degree = 8192;
params.set_poly_modulus_degree(poly_modulus_degree);
// Use a of coeff_modulus of 5 primes of sizes 50, 30, 30, 50 and bits
params.set_coeff_modulus(CoeffModulus::Create(poly_modulus_degree, {50, 30, 30, 50, 50}));
// 20 bit poly mod degree
params.set_plain_modulus(PlainModulus::Batching(poly_modulus_degree, 20));
auto context = SEALContext::Create(params);
cout << "Print the modulus switching chain" << endl;
// Print the key level parameter info
auto context_data = context->key_context_data();
cout << "\tLevel (chain index): " << context_data->chain_index() << endl;
// cout << "\tparms_id: " << context_data->parms_id() << endl;
cout << "\tcoeff_modulus primes: ";
cout << hex;
for (const auto &prime : context_data->parms().coeff_modulus())
{
cout << prime.value() << " ";
}
cout << dec << endl;
cout << "\\" << endl;
cout << " \\-->";
// Iterate over the remaining levels
context_data = context->first_context_data();
while (context_data)
{
cout << " Level (chain index): " << context_data->chain_index();
if (context_data->parms_id() == context->first_parms_id())
{
cout << " ...... first_context_data()" << endl;
}
else if (context_data->parms_id() == context->last_parms_id())
{
cout << " ...... last_context_data()" << endl;
}
else
{
cout << endl;
}
// cout << " parms_id: " << context_data->parms_id() << endl;
cout << " coeff_modulus primes: ";
cout << hex;
for (const auto &prime : context_data->parms().coeff_modulus())
{
cout << prime.value() << " ";
}
cout << dec << endl;
cout << "\\" << endl;
cout << " \\-->";
/*
Step forward in the chain.
*/
context_data = context_data->next_context_data();
}
cout << "End of chain reached\n"
<< endl;
// Generate keys
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
RelinKeys relin_keys = keygen.relin_keys();
GaloisKeys gal_keys = keygen.galois_keys();
Encryptor encryptor(context, pk);
Decryptor decryptor(context, sk);
Evaluator evaluator(context);
Plaintext plain("1x^3 + 2x^2 + 3x^1 + 4");
Ciphertext cipher;
encryptor.encrypt(plain, cipher);
cout << "Perform modulus switching on cipher" << endl;
context_data = context->first_context_data();
cout << "---->";
while (context_data->next_context_data())
{
cout << " Level (chain index): " << context_data->chain_index() << endl;
// cout << " parms_id of encrypted: " << cipher.parms_id() << endl;
cout << " Noise budget at this level: "
<< decryptor.invariant_noise_budget(cipher) << " bits" << endl;
cout << "\\" << endl;
cout << " \\-->";
evaluator.mod_switch_to_next_inplace(cipher);
context_data = context_data->next_context_data();
}
cout << " Level (chain index): " << context_data->chain_index() << endl;
// cout << " parms_id of encrypted: " << cipher.parms_id() << endl;
cout << " Noise budget at this level: "
<< decryptor.invariant_noise_budget(cipher) << " bits" << endl;
cout << "\\" << endl;
cout << " \\-->";
cout << " End of chain reached" << endl
<< endl;
cout << "Decrypt still works after modulus switching." << endl;
decryptor.decrypt(cipher, plain);
cout << " + Decryption of encrypted: " << plain.to_string() << endl;
cout << "\tComputation is more efficient with modulus switching." << endl;
cout << "Compute the 8th power." << endl;
encryptor.encrypt(plain, cipher);
cout << " + Noise budget fresh: "
<< decryptor.invariant_noise_budget(cipher) << " bits" << endl;
evaluator.square_inplace(cipher);
evaluator.relinearize_inplace(cipher, relin_keys);
cout << " + Noise budget of the 2nd power: "
<< decryptor.invariant_noise_budget(cipher) << " bits" << endl;
evaluator.square_inplace(cipher);
evaluator.relinearize_inplace(cipher, relin_keys);
cout << " + Noise budget of the 4th power: "
<< decryptor.invariant_noise_budget(cipher) << " bits" << endl;
evaluator.mod_switch_to_next_inplace(cipher);
cout << " + Noise budget after modulus switching: "
<< decryptor.invariant_noise_budget(cipher) << " bits" << endl;
evaluator.square_inplace(cipher);
evaluator.relinearize_inplace(cipher, relin_keys);
cout << " + Noise budget of the 8th power: "
<< decryptor.invariant_noise_budget(cipher) << " bits" << endl;
evaluator.mod_switch_to_next_inplace(cipher);
cout << " + Noise budget after modulus switching: "
<< decryptor.invariant_noise_budget(cipher) << " bits" << endl;
decryptor.decrypt(cipher, plain);
cout << " + Decryption of the 8th power (hexadecimal) ...... Correct." << endl;
cout << " " << plain.to_string() << endl
<< endl;
return 0;
}
| 5,507
|
C++
|
.cpp
| 130
| 35.730769
| 94
| 0.578122
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,655
|
matrix_ops.cpp
|
MarwanNour_SEAL-FYP-Logistic-Regression/matrix_ops.cpp
|
#include <iostream>
#include <iomanip>
#include <fstream>
#include "seal/seal.h"
using namespace std;
using namespace seal;
// Helper function that prints a matrix (vector of vectors)
template <typename T>
inline void print_full_matrix(vector<vector<T>> matrix, int precision = 3)
{
// save formatting for cout
ios old_fmt(nullptr);
old_fmt.copyfmt(cout);
cout << fixed << setprecision(precision);
int row_size = matrix.size();
int col_size = matrix[0].size();
for (unsigned int i = 0; i < row_size; i++)
{
cout << "[";
for (unsigned int j = 0; j < col_size - 1; j++)
{
cout << matrix[i][j] << ", ";
}
cout << matrix[i][col_size - 1];
cout << "]" << endl;
}
cout << endl;
// restore old cout formatting
cout.copyfmt(old_fmt);
}
// Helper function that prints parts of a matrix (only squared matrix)
template <typename T>
inline void print_partial_matrix(vector<vector<T>> matrix, int print_size = 3, int precision = 3)
{
// save formatting for cout
ios old_fmt(nullptr);
old_fmt.copyfmt(cout);
cout << fixed << setprecision(precision);
int row_size = matrix.size();
int col_size = matrix[0].size();
// Boundary check
if (row_size < 2 * print_size && col_size < 2 * print_size)
{
cerr << "Cannot print matrix with these dimensions: " << to_string(row_size) << "x" << to_string(col_size) << ". Increase the print size" << endl;
return;
}
// print first 4 elements
for (unsigned int row = 0; row < print_size; row++)
{
cout << "\t[";
for (unsigned int col = 0; col < print_size; col++)
{
cout << matrix[row][col] << ", ";
}
cout << "..., ";
for (unsigned int col = col_size - print_size; col < col_size - 1; col++)
{
cout << matrix[row][col] << ", ";
}
cout << matrix[row][col_size - 1];
cout << "]" << endl;
}
cout << "\t..." << endl;
for (unsigned int row = row_size - print_size; row < row_size; row++)
{
cout << "\t[";
for (unsigned int col = 0; col < print_size; col++)
{
cout << matrix[row][col] << ", ";
}
cout << "..., ";
for (unsigned int col = col_size - print_size; col < col_size - 1; col++)
{
cout << matrix[row][col] << ", ";
}
cout << matrix[row][col_size - 1];
cout << "]" << endl;
}
cout << endl;
// restore old cout formatting
cout.copyfmt(old_fmt);
}
void slowEncoding(size_t poly_modulus_degree)
{
// Set output file
string filename = "matrix_ops_" + to_string(poly_modulus_degree) + ".dat";
ofstream outf(filename);
// Handle file error
if (!outf)
{
cerr << "Couldn't open file: " << filename << endl;
exit(1);
}
// Set output script
string script = "script_matrix_ops_" + to_string(poly_modulus_degree) + ".p";
ofstream outscript(script);
// Handle script error
if (!outscript)
{
cerr << "Couldn't open file: " << script << endl;
exit(1);
}
// Write to script
outscript << "# Set the output terminal" << endl;
outscript << "set terminal canvas" << endl;
outscript << "set output \"canvas_matrix_ops_" << to_string(poly_modulus_degree) << ".html\"" << endl;
outscript << "set title \"CKKS Matrix Ops Benchmark " << to_string(poly_modulus_degree) << "\"" << endl;
outscript << "set xlabel 'Input Vector Size'" << endl;
outscript << "set ylabel 'Time (microseconds)'" << endl;
outscript << "set logscale y" << endl;
outscript << "set xtics nomirror" << endl;
outscript << "set ytics nomirror" << endl;
outscript << "set grid" << endl;
outscript << "set key outside" << endl;
outscript << "set key spacing 2" << endl;
outscript << "\n# Set the styling " << endl;
outscript << "set style line 1\\\n"
<< "linecolor rgb '#3da3f5'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 7 pointsize 1\n"
<< endl;
outscript << "set style line 2\\\n"
<< "linecolor rgb '#dd181f'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 5 pointsize 1\n"
<< endl;
outscript << "set style line 3\\\n"
<< "linecolor rgb '#00FF00'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 6 pointsize 1\n"
<< endl;
outscript << "set style line 4\\\n"
<< "linecolor rgb '#EC00EC'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 4 pointsize 1\n"
<< endl;
outscript << "set style line 5\\\n"
<< "linecolor rgb '#f5a142'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 3 pointsize 1\n"
<< endl;
outscript << "set style line 6\\\n"
<< "linecolor rgb '#07025e'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 2 pointsize 1\n"
<< endl;
outscript << "set style line 7\\\n"
<< "linecolor rgb '#07025e'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 9 pointsize 1\n"
<< endl;
outscript << "set style line 8\\\n"
<< "linecolor rgb '#07025e'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 10 pointsize 1\n"
<< endl;
outscript << "\nplot 'matrix_ops_" << to_string(poly_modulus_degree) << ".dat'"
<< " index 0 title \"Encode\" with linespoints ls 1, \\\n"
<< "'' index 1 title \"Encrypt\" with linespoints ls 2, \\\n"
<< "'' index 2 title \"C1 + P2\" with linespoints ls 3, \\\n"
<< "'' index 3 title \"C1 + C2\" with linespoints ls 4, \\\n"
<< "'' index 4 title \"C1 * P2\" with linespoints ls 5, \\\n"
<< "'' index 5 title \"C1 * C2\" with linespoints ls 6, \\\n"
<< "'' index 6 title \"C1 . P2\" with linespoints ls 7, \\\n"
<< "'' index 7 title \"C1 . C2\" with linespoints ls 8";
// Close script
outscript.close();
EncryptionParameters params(scheme_type::CKKS);
params.set_poly_modulus_degree(poly_modulus_degree);
params.set_coeff_modulus(CoeffModulus::BFVDefault(poly_modulus_degree));
auto context = SEALContext::Create(params);
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
Encryptor encryptor(context, pk);
Evaluator evaluator(context);
Decryptor decryptor(context, sk);
// Create CKKS encoder
CKKSEncoder ckks_encoder(context);
// Create scale
double scale = sqrt(static_cast<double>(params.coeff_modulus().back().value()));
int dimension1 = 10;
cout << "Dimension Set 1 :" << dimension1 << endl
<< endl;
int dimension2 = 20;
cout << "Dimension Set 2 :" << dimension2 << endl
<< endl;
int dimension3 = 50;
cout << "Dimension Set 3 :" << dimension3 << endl
<< endl;
// Create Input matrices
// Set 1
vector<vector<double>> pod_matrix1_set1(dimension1, vector<double>(dimension1));
vector<vector<double>> pod_matrix2_set1(dimension1, vector<double>(dimension1));
// Set 2
vector<vector<double>> pod_matrix1_set2(dimension2, vector<double>(dimension2));
vector<vector<double>> pod_matrix2_set2(dimension2, vector<double>(dimension2));
// Set 3
vector<vector<double>> pod_matrix1_set3(dimension3, vector<double>(dimension3));
vector<vector<double>> pod_matrix2_set3(dimension3, vector<double>(dimension3));
// Fill input matrices
double filler = 0.0;
// Set 1
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
pod_matrix1_set1[i][j] = filler;
pod_matrix2_set1[i][j] = static_cast<double>((j % 2) + 1);
filler++;
}
}
print_partial_matrix(pod_matrix1_set1);
print_partial_matrix(pod_matrix2_set1);
// Set 2
filler = 0.0;
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
pod_matrix1_set2[i][j] = filler;
pod_matrix2_set2[i][j] = static_cast<double>((j % 2) + 1);
filler++;
}
}
// Set 3
filler = 0.0;
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
pod_matrix1_set3[i][j] = filler;
pod_matrix2_set3[i][j] = static_cast<double>((j % 2) + 1);
filler++;
}
}
// Encode matrices
// Set 1
vector<vector<Plaintext>> plain_matrix1_set1(dimension1, vector<Plaintext>(dimension1));
vector<vector<Plaintext>> plain_matrix2_set1(dimension1, vector<Plaintext>(dimension1));
// Set 2
vector<vector<Plaintext>> plain_matrix1_set2(dimension2, vector<Plaintext>(dimension2));
vector<vector<Plaintext>> plain_matrix2_set2(dimension2, vector<Plaintext>(dimension2));
// Set 1
vector<vector<Plaintext>> plain_matrix1_set3(dimension3, vector<Plaintext>(dimension3));
vector<vector<Plaintext>> plain_matrix2_set3(dimension3, vector<Plaintext>(dimension3));
outf << "# index 0" << endl;
outf << "# Encoding" << endl;
// Set 1
auto start_encode_set1 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
ckks_encoder.encode(pod_matrix1_set1[i][j], scale, plain_matrix1_set1[i][j]);
ckks_encoder.encode(pod_matrix2_set1[i][j], scale, plain_matrix2_set1[i][j]);
}
}
auto stop_encode_set1 = chrono::high_resolution_clock::now();
auto duration_encode_set1 = chrono::duration_cast<chrono::microseconds>(stop_encode_set1 - start_encode_set1);
cout << "Encoding time Set 1: " << duration_encode_set1.count() << " microseconds" << endl;
outf << dimension1 << "\t\t" << duration_encode_set1.count() << endl;
// Set 2
auto start_encode_set2 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
ckks_encoder.encode(pod_matrix1_set2[i][j], scale, plain_matrix1_set2[i][j]);
ckks_encoder.encode(pod_matrix2_set2[i][j], scale, plain_matrix2_set2[i][j]);
}
}
auto stop_encode_set2 = chrono::high_resolution_clock::now();
auto duration_encode_set2 = chrono::duration_cast<chrono::microseconds>(stop_encode_set2 - start_encode_set2);
cout << "Encoding time Set 2: " << duration_encode_set2.count() << " microseconds" << endl;
outf << dimension2 << "\t\t" << duration_encode_set2.count() << endl;
// Set 3
auto start_encode_set3 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
ckks_encoder.encode(pod_matrix1_set3[i][j], scale, plain_matrix1_set3[i][j]);
ckks_encoder.encode(pod_matrix2_set3[i][j], scale, plain_matrix2_set3[i][j]);
}
}
auto stop_encode_set3 = chrono::high_resolution_clock::now();
auto duration_encode_set3 = chrono::duration_cast<chrono::microseconds>(stop_encode_set3 - start_encode_set3);
cout << "Encoding time Set 3: " << duration_encode_set3.count() << " microseconds" << endl;
outf << dimension3 << "\t\t" << duration_encode_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// Encrypt the matrices
// Set 1
vector<vector<Ciphertext>> cipher_matrix1_set1(dimension1, vector<Ciphertext>(dimension1));
vector<vector<Ciphertext>> cipher_matrix2_set1(dimension1, vector<Ciphertext>(dimension1));
// Set 2
vector<vector<Ciphertext>> cipher_matrix1_set2(dimension2, vector<Ciphertext>(dimension2));
vector<vector<Ciphertext>> cipher_matrix2_set2(dimension2, vector<Ciphertext>(dimension2));
// Set 3
vector<vector<Ciphertext>> cipher_matrix1_set3(dimension3, vector<Ciphertext>(dimension3));
vector<vector<Ciphertext>> cipher_matrix2_set3(dimension3, vector<Ciphertext>(dimension3));
outf << "# index 1" << endl;
outf << "# Encryption" << endl;
// Set 1
auto start_encrypt_set1 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
encryptor.encrypt(plain_matrix1_set1[i][j], cipher_matrix1_set1[i][j]);
encryptor.encrypt(plain_matrix2_set1[i][j], cipher_matrix2_set1[i][j]);
}
}
auto stop_encrypt_set1 = chrono::high_resolution_clock::now();
auto duration_encrypt_set1 = chrono::duration_cast<chrono::microseconds>(stop_encrypt_set1 - start_encrypt_set1);
cout << "Encryption time Set 1: " << duration_encrypt_set1.count() << " microseconds" << endl;
outf << dimension1 << "\t\t" << duration_encrypt_set1.count() << endl;
// Set 2
auto start_encrypt_set2 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
encryptor.encrypt(plain_matrix1_set2[i][j], cipher_matrix1_set2[i][j]);
encryptor.encrypt(plain_matrix2_set2[i][j], cipher_matrix2_set2[i][j]);
}
}
auto stop_encrypt_set2 = chrono::high_resolution_clock::now();
auto duration_encrypt_set2 = chrono::duration_cast<chrono::microseconds>(stop_encrypt_set2 - start_encrypt_set2);
cout << "Encryption time Set 2: " << duration_encrypt_set2.count() << " microseconds" << endl;
outf << dimension2 << "\t\t" << duration_encrypt_set2.count() << endl;
// Set 3
auto start_encrypt_set3 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
encryptor.encrypt(plain_matrix1_set3[i][j], cipher_matrix1_set3[i][j]);
encryptor.encrypt(plain_matrix2_set3[i][j], cipher_matrix2_set3[i][j]);
}
}
auto stop_encrypt_set3 = chrono::high_resolution_clock::now();
auto duration_encrypt_set3 = chrono::duration_cast<chrono::microseconds>(stop_encrypt_set3 - start_encrypt_set3);
cout << "Encryption time Set 3: " << duration_encrypt_set3.count() << " microseconds" << endl;
outf << dimension3 << "\t\t" << duration_encrypt_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// C1+P2
cout << "\n----------------- C1 + P2----------------\n"
<< endl;
outf << "# index 2" << endl;
outf << "# C1 + P2" << endl;
// Set 1
vector<vector<Ciphertext>> cipher_result_addition_plain_set1(dimension1, vector<Ciphertext>(dimension1));
auto start_add_plain_set1 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
evaluator.add_plain(cipher_matrix1_set1[i][j], plain_matrix2_set1[i][j], cipher_result_addition_plain_set1[i][j]);
}
}
auto stop_add_plain_set1 = chrono::high_resolution_clock::now();
auto duration_add_plain_set1 = chrono::duration_cast<chrono::microseconds>(stop_add_plain_set1 - start_add_plain_set1);
// Decrypt
vector<vector<Plaintext>> plain_result_addition_plain_set1(dimension1, vector<Plaintext>(dimension1));
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
decryptor.decrypt(cipher_result_addition_plain_set1[i][j], plain_result_addition_plain_set1[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_addition_plain_set1(dimension1, vector<double>(dimension1));
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_addition_plain_set1[i][j], temp);
pod_result_addition_plain_set1[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_addition_plain_set1);
cout << "Compute C1+P2 time Set 1: " << duration_add_plain_set1.count() << " microseconds" << endl;
outf << dimension1 << "\t\t" << duration_add_plain_set1.count() << endl;
// Set 2
vector<vector<Ciphertext>> cipher_result_addition_plain_set2(dimension2, vector<Ciphertext>(dimension2));
auto start_add_plain_set2 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
evaluator.add_plain(cipher_matrix1_set2[i][j], plain_matrix2_set2[i][j], cipher_result_addition_plain_set2[i][j]);
}
}
auto stop_add_plain_set2 = chrono::high_resolution_clock::now();
auto duration_add_plain_set2 = chrono::duration_cast<chrono::microseconds>(stop_add_plain_set2 - start_add_plain_set2);
// Decrypt
vector<vector<Plaintext>> plain_result_addition_plain_set2(dimension2, vector<Plaintext>(dimension2));
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
decryptor.decrypt(cipher_result_addition_plain_set2[i][j], plain_result_addition_plain_set2[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_addition_plain_set2(dimension2, vector<double>(dimension2));
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_addition_plain_set2[i][j], temp);
pod_result_addition_plain_set2[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_addition_plain_set2);
cout << "Compute C1+P2 time Set 2: " << duration_add_plain_set2.count() << " microseconds" << endl;
outf << dimension2 << "\t\t" << duration_add_plain_set2.count() << endl;
// Set 3
vector<vector<Ciphertext>> cipher_result_addition_plain_set3(dimension3, vector<Ciphertext>(dimension3));
auto start_add_plain_set3 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
evaluator.add_plain(cipher_matrix1_set3[i][j], plain_matrix2_set3[i][j], cipher_result_addition_plain_set3[i][j]);
}
}
auto stop_add_plain_set3 = chrono::high_resolution_clock::now();
auto duration_add_plain_set3 = chrono::duration_cast<chrono::microseconds>(stop_add_plain_set3 - start_add_plain_set3);
// Decrypt
vector<vector<Plaintext>> plain_result_addition_plain_set3(dimension3, vector<Plaintext>(dimension3));
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
decryptor.decrypt(cipher_result_addition_plain_set3[i][j], plain_result_addition_plain_set3[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_addition_plain_set3(dimension3, vector<double>(dimension3));
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_addition_plain_set3[i][j], temp);
pod_result_addition_plain_set3[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_addition_plain_set3);
cout << "Compute C1+P2 time Set 3: " << duration_add_plain_set3.count() << " microseconds" << endl;
outf << dimension3 << "\t\t" << duration_add_plain_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// C1+C2
cout << "\n----------------- C1 + C2----------------\n"
<< endl;
outf << "# index 3" << endl;
outf << "# C1 + C2" << endl;
// Set 1
vector<vector<Ciphertext>> cipher_result_addition_cipher_set1(dimension1, vector<Ciphertext>(dimension1));
auto start_add_cipher_set1 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
evaluator.add(cipher_matrix1_set1[i][j], cipher_matrix2_set1[i][j], cipher_result_addition_cipher_set1[i][j]);
}
}
auto stop_add_cipher_set1 = chrono::high_resolution_clock::now();
auto duration_add_cipher_set1 = chrono::duration_cast<chrono::microseconds>(stop_add_cipher_set1 - start_add_cipher_set1);
// Decrypt
vector<vector<Plaintext>> plain_result_addition_cipher_set1(dimension1, vector<Plaintext>(dimension1));
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
decryptor.decrypt(cipher_result_addition_plain_set1[i][j], plain_result_addition_cipher_set1[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_addition_cipher_set1(dimension1, vector<double>(dimension1));
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_addition_cipher_set1[i][j], temp);
pod_result_addition_cipher_set1[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_addition_cipher_set1);
cout << "Compute C1+C2 time Set 1: " << duration_add_cipher_set1.count() << " microseconds" << endl;
outf << dimension1 << "\t\t" << duration_add_cipher_set1.count() << endl;
// Set 2
vector<vector<Ciphertext>> cipher_result_addition_cipher_set2(dimension2, vector<Ciphertext>(dimension2));
auto start_add_cipher_set2 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
evaluator.add(cipher_matrix1_set2[i][j], cipher_matrix2_set2[i][j], cipher_result_addition_cipher_set2[i][j]);
}
}
auto stop_add_cipher_set2 = chrono::high_resolution_clock::now();
auto duration_add_cipher_set2 = chrono::duration_cast<chrono::microseconds>(stop_add_cipher_set2 - start_add_cipher_set2);
// Decrypt
vector<vector<Plaintext>> plain_result_addition_cipher_set2(dimension2, vector<Plaintext>(dimension2));
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
decryptor.decrypt(cipher_result_addition_plain_set2[i][j], plain_result_addition_cipher_set2[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_addition_cipher_set2(dimension2, vector<double>(dimension2));
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_addition_cipher_set2[i][j], temp);
pod_result_addition_cipher_set2[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_addition_cipher_set2);
cout << "Compute C1+C2 time Set 2: " << duration_add_cipher_set2.count() << " microseconds" << endl;
outf << dimension2 << "\t\t" << duration_add_cipher_set2.count() << endl;
// Set 3
vector<vector<Ciphertext>> cipher_result_addition_cipher_set3(dimension3, vector<Ciphertext>(dimension3));
auto start_add_cipher_set3 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
evaluator.add(cipher_matrix1_set3[i][j], cipher_matrix2_set3[i][j], cipher_result_addition_cipher_set3[i][j]);
}
}
auto stop_add_cipher_set3 = chrono::high_resolution_clock::now();
auto duration_add_cipher_set3 = chrono::duration_cast<chrono::microseconds>(stop_add_cipher_set3 - start_add_cipher_set3);
// Decrypt
vector<vector<Plaintext>> plain_result_addition_cipher_set3(dimension3, vector<Plaintext>(dimension3));
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
decryptor.decrypt(cipher_result_addition_plain_set3[i][j], plain_result_addition_cipher_set3[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_addition_cipher_set3(dimension3, vector<double>(dimension3));
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_addition_cipher_set3[i][j], temp);
pod_result_addition_cipher_set3[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_addition_cipher_set3);
cout << "Compute C1+C2 time Set 3: " << duration_add_cipher_set3.count() << " microseconds" << endl;
outf << dimension3 << "\t\t" << duration_add_cipher_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// C1*P2
cout << "\n----------------- C1 * P2 (component-wise)----------------\n"
<< endl;
outf << "# index 4" << endl;
outf << "# C1 * P2" << endl;
// Set 1
vector<vector<Ciphertext>> cipher_result_mult_plain_set1(dimension1, vector<Ciphertext>(dimension1));
auto start_mult_plain_set1 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
evaluator.multiply_plain(cipher_matrix1_set1[i][j], plain_matrix2_set1[i][j], cipher_result_mult_plain_set1[i][j]);
}
}
auto stop_mult_plain_set1 = chrono::high_resolution_clock::now();
auto duration_mult_plain_set1 = chrono::duration_cast<chrono::microseconds>(stop_mult_plain_set1 - start_mult_plain_set1);
// Decrypt
vector<vector<Plaintext>> plain_result_mult_plain_set1(dimension1, vector<Plaintext>(dimension1));
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
decryptor.decrypt(cipher_result_mult_plain_set1[i][j], plain_result_mult_plain_set1[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_mult_plain_set1(dimension1, vector<double>(dimension1));
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_mult_plain_set1[i][j], temp);
pod_result_mult_plain_set1[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_mult_plain_set1);
cout << "Compute C1 * P2 (component-wise) time Set 1: " << duration_mult_plain_set1.count() << " microseconds" << endl;
outf << dimension1 << "\t\t" << duration_mult_plain_set1.count() << endl;
// Set 2
vector<vector<Ciphertext>> cipher_result_mult_plain_set2(dimension2, vector<Ciphertext>(dimension2));
auto start_mult_plain_set2 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
evaluator.multiply_plain(cipher_matrix1_set2[i][j], plain_matrix2_set2[i][j], cipher_result_mult_plain_set2[i][j]);
}
}
auto stop_mult_plain_set2 = chrono::high_resolution_clock::now();
auto duration_mult_plain_set2 = chrono::duration_cast<chrono::microseconds>(stop_mult_plain_set2 - start_mult_plain_set2);
// Decrypt
vector<vector<Plaintext>> plain_result_mult_plain_set2(dimension2, vector<Plaintext>(dimension2));
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
decryptor.decrypt(cipher_result_mult_plain_set2[i][j], plain_result_mult_plain_set2[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_mult_plain_set2(dimension2, vector<double>(dimension2));
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_mult_plain_set2[i][j], temp);
pod_result_mult_plain_set2[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_mult_plain_set2);
cout << "Compute C1 * P2 (component-wise) time Set 2: " << duration_mult_plain_set2.count() << " microseconds" << endl;
outf << dimension2 << "\t\t" << duration_mult_plain_set2.count() << endl;
// Set 3
vector<vector<Ciphertext>> cipher_result_mult_plain_set3(dimension3, vector<Ciphertext>(dimension3));
auto start_mult_plain_set3 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
evaluator.multiply_plain(cipher_matrix1_set3[i][j], plain_matrix2_set3[i][j], cipher_result_mult_plain_set3[i][j]);
}
}
auto stop_mult_plain_set3 = chrono::high_resolution_clock::now();
auto duration_mult_plain_set3 = chrono::duration_cast<chrono::microseconds>(stop_mult_plain_set3 - start_mult_plain_set3);
// Decrypt
vector<vector<Plaintext>> plain_result_mult_plain_set3(dimension3, vector<Plaintext>(dimension3));
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
decryptor.decrypt(cipher_result_mult_plain_set3[i][j], plain_result_mult_plain_set3[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_mult_plain_set3(dimension3, vector<double>(dimension3));
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_mult_plain_set3[i][j], temp);
pod_result_mult_plain_set3[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_mult_plain_set3);
cout << "Compute C1 * P2 (component-wise) time Set 3: " << duration_mult_plain_set3.count() << " microseconds" << endl;
outf << dimension3 << "\t\t" << duration_mult_plain_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// C1*C2
cout << "\n----------------- C1 * C2 (component-wise)----------------\n"
<< endl;
outf << "# index 5" << endl;
outf << "# C1 * C2" << endl;
// Set 1
vector<vector<Ciphertext>> cipher_result_mult_cipher_set1(dimension1, vector<Ciphertext>(dimension1));
auto start_mult_cipher_set1 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
evaluator.multiply(cipher_matrix1_set1[i][j], cipher_matrix2_set1[i][j], cipher_result_mult_cipher_set1[i][j]);
}
}
auto stop_mult_cipher_set1 = chrono::high_resolution_clock::now();
auto duration_mult_cipher_set1 = chrono::duration_cast<chrono::microseconds>(stop_mult_cipher_set1 - start_mult_cipher_set1);
// Decrypt
vector<vector<Plaintext>> plain_result_mult_cipher_set1(dimension1, vector<Plaintext>(dimension1));
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
decryptor.decrypt(cipher_result_mult_cipher_set1[i][j], plain_result_mult_cipher_set1[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_mult_cipher_set1(dimension1, vector<double>(dimension1));
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_mult_cipher_set1[i][j], temp);
pod_result_mult_cipher_set1[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_mult_cipher_set1);
cout << "Compute C1 * C2 (component-wise) time Set 1: " << duration_mult_cipher_set1.count() << " microseconds" << endl;
outf << dimension1 << "\t\t" << duration_mult_cipher_set1.count() << endl;
// Set 2
vector<vector<Ciphertext>> cipher_result_mult_cipher_set2(dimension2, vector<Ciphertext>(dimension2));
auto start_mult_cipher_set2 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
evaluator.multiply(cipher_matrix1_set2[i][j], cipher_matrix2_set2[i][j], cipher_result_mult_cipher_set2[i][j]);
}
}
auto stop_mult_cipher_set2 = chrono::high_resolution_clock::now();
auto duration_mult_cipher_set2 = chrono::duration_cast<chrono::microseconds>(stop_mult_cipher_set2 - start_mult_cipher_set2);
// Decrypt
vector<vector<Plaintext>> plain_result_mult_cipher_set2(dimension2, vector<Plaintext>(dimension2));
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
decryptor.decrypt(cipher_result_mult_cipher_set2[i][j], plain_result_mult_cipher_set2[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_mult_cipher_set2(dimension2, vector<double>(dimension2));
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_mult_cipher_set2[i][j], temp);
pod_result_mult_cipher_set2[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_mult_cipher_set2);
cout << "Compute C1 * C2 (component-wise) time Set 2: " << duration_mult_cipher_set2.count() << " microseconds" << endl;
outf << dimension2 << "\t\t" << duration_mult_cipher_set2.count() << endl;
// Set 3
vector<vector<Ciphertext>> cipher_result_mult_cipher_set3(dimension3, vector<Ciphertext>(dimension3));
auto start_mult_cipher_set3 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
evaluator.multiply(cipher_matrix1_set3[i][j], cipher_matrix2_set3[i][j], cipher_result_mult_cipher_set3[i][j]);
}
}
auto stop_mult_cipher_set3 = chrono::high_resolution_clock::now();
auto duration_mult_cipher_set3 = chrono::duration_cast<chrono::microseconds>(stop_mult_cipher_set3 - start_mult_cipher_set3);
// Decrypt
vector<vector<Plaintext>> plain_result_mult_cipher_set3(dimension3, vector<Plaintext>(dimension3));
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
decryptor.decrypt(cipher_result_mult_cipher_set3[i][j], plain_result_mult_cipher_set3[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_mult_cipher_set3(dimension3, vector<double>(dimension3));
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_mult_cipher_set3[i][j], temp);
pod_result_mult_cipher_set3[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_mult_cipher_set3);
cout << "Compute C1 * C2 (component-wise) time Set 3: " << duration_mult_cipher_set3.count() << " microseconds" << endl;
outf << dimension3 << "\t\t" << duration_mult_cipher_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// C1*P2 (Matrix)
cout << "\n----------------- C1 * P2 (matrix multiplication)----------------\n"
<< endl;
outf << "# index 6" << endl;
outf << "# C1 . C2" << endl;
// Set 1
vector<vector<Ciphertext>> cipher_result_matrix_mult_plain_set1(dimension1, vector<Ciphertext>(dimension1));
auto start_matrix_mult_plain_set1 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
vector<Ciphertext> temp(dimension1);
for (int k = 0; k < dimension1; k++)
{
evaluator.multiply_plain(cipher_matrix1_set1[i][k], plain_matrix2_set1[k][j], temp[k]);
}
evaluator.add_many(temp, cipher_result_matrix_mult_plain_set1[i][j]);
}
}
auto stop_matrix_mult_plain_set1 = chrono::high_resolution_clock::now();
auto duration_matrix_mult_plain_set1 = chrono::duration_cast<chrono::microseconds>(stop_matrix_mult_plain_set1 - start_matrix_mult_plain_set1);
// Decrypt
vector<vector<Plaintext>> plain_result_matrix_mult_plain_set1(dimension1, vector<Plaintext>(dimension1));
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
decryptor.decrypt(cipher_result_matrix_mult_plain_set1[i][j], plain_result_matrix_mult_plain_set1[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_matrix_mult_plain_set1(dimension1, vector<double>(dimension1));
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_matrix_mult_plain_set1[i][j], temp);
pod_result_matrix_mult_plain_set1[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_matrix_mult_plain_set1);
cout << "Compute C1 * P2 (matrix multiplication) time Set 1: " << duration_matrix_mult_plain_set1.count() << " microseconds" << endl;
outf << dimension1 << "\t\t" << duration_matrix_mult_plain_set1.count() << endl;
// Set 2
vector<vector<Ciphertext>> cipher_result_matrix_mult_plain_set2(dimension2, vector<Ciphertext>(dimension2));
auto start_matrix_mult_plain_set2 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
vector<Ciphertext> temp(dimension2);
for (int k = 0; k < dimension2; k++)
{
evaluator.multiply_plain(cipher_matrix1_set2[i][k], plain_matrix2_set2[k][j], temp[k]);
}
evaluator.add_many(temp, cipher_result_matrix_mult_plain_set2[i][j]);
}
}
auto stop_matrix_mult_plain_set2 = chrono::high_resolution_clock::now();
auto duration_matrix_mult_plain_set2 = chrono::duration_cast<chrono::microseconds>(stop_matrix_mult_plain_set2 - start_matrix_mult_plain_set2);
// Decrypt
vector<vector<Plaintext>> plain_result_matrix_mult_plain_set2(dimension2, vector<Plaintext>(dimension2));
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
decryptor.decrypt(cipher_result_matrix_mult_plain_set2[i][j], plain_result_matrix_mult_plain_set2[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_matrix_mult_plain_set2(dimension2, vector<double>(dimension2));
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_matrix_mult_plain_set2[i][j], temp);
pod_result_matrix_mult_plain_set2[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_matrix_mult_plain_set2);
cout << "Compute C1 * P2 (matrix multiplication) time Set 2: " << duration_matrix_mult_plain_set2.count() << " microseconds" << endl;
outf << dimension2 << "\t\t" << duration_matrix_mult_plain_set2.count() << endl;
// Set 3
vector<vector<Ciphertext>> cipher_result_matrix_mult_plain_set3(dimension3, vector<Ciphertext>(dimension3));
auto start_matrix_mult_plain_set3 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
vector<Ciphertext> temp(dimension3);
for (int k = 0; k < dimension3; k++)
{
evaluator.multiply_plain(cipher_matrix1_set3[i][k], plain_matrix2_set3[k][j], temp[k]);
}
evaluator.add_many(temp, cipher_result_matrix_mult_plain_set3[i][j]);
}
}
auto stop_matrix_mult_plain_set3 = chrono::high_resolution_clock::now();
auto duration_matrix_mult_plain_set3 = chrono::duration_cast<chrono::microseconds>(stop_matrix_mult_plain_set3 - start_matrix_mult_plain_set3);
// Decrypt
vector<vector<Plaintext>> plain_result_matrix_mult_plain_set3(dimension3, vector<Plaintext>(dimension3));
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
decryptor.decrypt(cipher_result_matrix_mult_plain_set3[i][j], plain_result_matrix_mult_plain_set3[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_matrix_mult_plain_set3(dimension3, vector<double>(dimension3));
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_matrix_mult_plain_set3[i][j], temp);
pod_result_matrix_mult_plain_set3[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_matrix_mult_plain_set3);
cout << "Compute C1 * P2 (matrix multiplication) time Set 3: " << duration_matrix_mult_plain_set3.count() << " microseconds" << endl;
outf << dimension3 << "\t\t" << duration_matrix_mult_plain_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// C1*C2 (Matrix)
cout << "\n----------------- C1 * C2 (matrix multiplication)----------------\n"
<< endl;
outf << "# index 7" << endl;
outf << "# C1 . C2" << endl;
// Set 1
vector<vector<Ciphertext>> cipher_result_matrix_mult_cipher_set1(dimension1, vector<Ciphertext>(dimension1));
auto start_matrix_mult_cipher_set1 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
vector<Ciphertext> temp(dimension1);
for (int k = 0; k < dimension1; k++)
{
evaluator.multiply(cipher_matrix1_set1[i][k], cipher_matrix2_set1[k][j], temp[k]);
}
evaluator.add_many(temp, cipher_result_matrix_mult_cipher_set1[i][j]);
}
}
auto stop_matrix_mult_cipher_set1 = chrono::high_resolution_clock::now();
auto duration_matrix_mult_cipher_set1 = chrono::duration_cast<chrono::microseconds>(stop_matrix_mult_cipher_set1 - start_matrix_mult_cipher_set1);
// Decrypt
vector<vector<Plaintext>> plain_result_matrix_mult_cipher_set1(dimension1, vector<Plaintext>(dimension1));
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
decryptor.decrypt(cipher_result_matrix_mult_cipher_set1[i][j], plain_result_matrix_mult_cipher_set1[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_matrix_mult_cipher_set1(dimension1, vector<double>(dimension1));
for (int i = 0; i < dimension1; i++)
{
for (int j = 0; j < dimension1; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_matrix_mult_cipher_set1[i][j], temp);
pod_result_matrix_mult_cipher_set1[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_matrix_mult_cipher_set1);
cout << "Compute C1 * C2 (matrix multiplication) time Set 1: " << duration_matrix_mult_cipher_set1.count() << " microseconds" << endl;
outf << dimension1 << "\t\t" << duration_matrix_mult_cipher_set1.count() << endl;
// Set 2
vector<vector<Ciphertext>> cipher_result_matrix_mult_cipher_set2(dimension2, vector<Ciphertext>(dimension2));
auto start_matrix_mult_cipher_set2 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
vector<Ciphertext> temp(dimension2);
for (int k = 0; k < dimension2; k++)
{
evaluator.multiply(cipher_matrix1_set2[i][k], cipher_matrix2_set2[k][j], temp[k]);
}
evaluator.add_many(temp, cipher_result_matrix_mult_cipher_set2[i][j]);
}
}
auto stop_matrix_mult_cipher_set2 = chrono::high_resolution_clock::now();
auto duration_matrix_mult_cipher_set2 = chrono::duration_cast<chrono::microseconds>(stop_matrix_mult_cipher_set2 - start_matrix_mult_cipher_set2);
// Decrypt
vector<vector<Plaintext>> plain_result_matrix_mult_cipher_set2(dimension2, vector<Plaintext>(dimension2));
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
decryptor.decrypt(cipher_result_matrix_mult_cipher_set2[i][j], plain_result_matrix_mult_cipher_set2[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_matrix_mult_cipher_set2(dimension2, vector<double>(dimension2));
for (int i = 0; i < dimension2; i++)
{
for (int j = 0; j < dimension2; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_matrix_mult_cipher_set2[i][j], temp);
pod_result_matrix_mult_cipher_set2[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_matrix_mult_cipher_set2);
cout << "Compute C1 * C2 (matrix multiplication) time Set 2: " << duration_matrix_mult_cipher_set2.count() << " microseconds" << endl;
outf << dimension2 << "\t\t" << duration_matrix_mult_cipher_set2.count() << endl;
// Set 3
vector<vector<Ciphertext>> cipher_result_matrix_mult_cipher_set3(dimension3, vector<Ciphertext>(dimension3));
auto start_matrix_mult_cipher_set3 = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
vector<Ciphertext> temp(dimension3);
for (int k = 0; k < dimension3; k++)
{
evaluator.multiply(cipher_matrix1_set3[i][k], cipher_matrix2_set3[k][j], temp[k]);
}
evaluator.add_many(temp, cipher_result_matrix_mult_cipher_set3[i][j]);
}
}
auto stop_matrix_mult_cipher_set3 = chrono::high_resolution_clock::now();
auto duration_matrix_mult_cipher_set3 = chrono::duration_cast<chrono::microseconds>(stop_matrix_mult_cipher_set3 - start_matrix_mult_cipher_set3);
// Decrypt
vector<vector<Plaintext>> plain_result_matrix_mult_cipher_set3(dimension3, vector<Plaintext>(dimension3));
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
decryptor.decrypt(cipher_result_matrix_mult_cipher_set3[i][j], plain_result_matrix_mult_cipher_set3[i][j]);
}
}
// Decode
vector<vector<double>> pod_result_matrix_mult_cipher_set3(dimension3, vector<double>(dimension3));
for (int i = 0; i < dimension3; i++)
{
for (int j = 0; j < dimension3; j++)
{
vector<double> temp;
ckks_encoder.decode(plain_result_matrix_mult_cipher_set3[i][j], temp);
pod_result_matrix_mult_cipher_set3[i][j] = temp[0];
}
}
// Print output
print_partial_matrix(pod_result_matrix_mult_cipher_set3);
cout << "Compute C1 * C2 (matrix multiplication) time Set 3: " << duration_matrix_mult_cipher_set3.count() << " microseconds" << endl;
outf << dimension3 << "\t\t" << duration_matrix_mult_cipher_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
outf.close();
}
int main()
{
slowEncoding(4096);
return 0;
}
| 47,772
|
C++
|
.cpp
| 1,084
| 36.583948
| 154
| 0.600202
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,656
|
benchmark.cpp
|
MarwanNour_SEAL-FYP-Logistic-Regression/benchmark.cpp
|
#include <iostream>
#include <fstream>
#include <iomanip>
#include "seal/seal.h"
using namespace std;
using namespace seal;
// Helper function that prints a vector of floats
template <typename T>
inline void print_vector(std::vector<T> vec, std::size_t print_size = 4, int prec = 4)
{
/*
Save the formatting information for std::cout.
*/
std::ios old_fmt(nullptr);
old_fmt.copyfmt(std::cout);
std::size_t slot_count = vec.size();
std::cout << std::fixed << std::setprecision(prec);
std::cout << std::endl;
if (slot_count <= 2 * print_size)
{
std::cout << " [";
for (std::size_t i = 0; i < slot_count; i++)
{
std::cout << " " << vec[i] << ((i != slot_count - 1) ? "," : " ]\n");
}
}
else
{
vec.resize(std::max(vec.size(), 2 * print_size));
std::cout << " [";
for (std::size_t i = 0; i < print_size; i++)
{
std::cout << " " << vec[i] << ",";
}
if (vec.size() > 2 * print_size)
{
std::cout << " ...,";
}
for (std::size_t i = slot_count - print_size; i < slot_count; i++)
{
std::cout << " " << vec[i] << ((i != slot_count - 1) ? "," : " ]\n");
}
}
std::cout << std::endl;
/*
Restore the old std::cout formatting.
*/
std::cout.copyfmt(old_fmt);
}
// Helper function that prints a matrix (vector of vectors)
template <typename T>
inline void print_full_matrix(vector<vector<T>> matrix, int size, int precision = 3)
{
// save formatting for cout
ios old_fmt(nullptr);
old_fmt.copyfmt(cout);
cout << fixed << setprecision(precision);
for (unsigned int i = 0; i < size; i++)
{
cout << "[";
for (unsigned int j = 0; j < size - 1; j++)
{
cout << matrix[i][j] << ", ";
}
cout << matrix[i][size - 1];
cout << "]" << endl;
}
cout << endl;
// restore old cout formatting
cout.copyfmt(old_fmt);
}
template <typename T>
inline void print_partial_matrix(vector<vector<T>> matrix, int size, int precision = 3)
{
// save formatting for cout
ios old_fmt(nullptr);
old_fmt.copyfmt(cout);
cout << fixed << setprecision(precision);
int print_size = 4;
// print first 4 elements
for (unsigned int row = 0; row < print_size; row++)
{
cout << "\t[";
for (unsigned int col = 0; col < print_size; col++)
{
cout << matrix[row][col] << ", ";
}
cout << "..., ";
for (unsigned int col = size - print_size; col < size - 1; col++)
{
cout << matrix[row][col] << ", ";
}
cout << matrix[row][size - 1];
cout << "]" << endl;
}
cout << "\t..." << endl;
for (unsigned int row = size - print_size; row < size; row++)
{
cout << "\t[";
for (unsigned int col = 0; col < print_size; col++)
{
cout << matrix[row][col] << ", ";
}
cout << "..., ";
for (unsigned int col = size - print_size; col < size - 1; col++)
{
cout << matrix[row][col] << ", ";
}
cout << matrix[row][size - 1];
cout << "]" << endl;
}
cout << endl;
// restore old cout formatting
cout.copyfmt(old_fmt);
}
void ckksBenchmark(size_t poly_modulus_degree)
{
cout << "------CKKS TEST------\n"
<< endl;
// Set params
EncryptionParameters params(scheme_type::CKKS);
params.set_poly_modulus_degree(poly_modulus_degree);
params.set_coeff_modulus(CoeffModulus::BFVDefault(poly_modulus_degree));
auto context = SEALContext::Create(params);
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
Encryptor encryptor(context, pk);
Evaluator evaluator(context);
Decryptor decryptor(context, sk);
// Create CKKS encoder
CKKSEncoder ckks_encoder(context);
size_t slot_count = ckks_encoder.slot_count();
cout << "Slot count : " << slot_count << endl;
// Set output file
string filename = "bench_" + to_string(poly_modulus_degree) + ".dat";
ofstream outf(filename);
// Handle file error
if (!outf)
{
cerr << "Couldn't open file: " << filename << endl;
exit(1);
}
// Set output script
string script = "script_" + to_string(poly_modulus_degree) + ".p";
ofstream outscript(script);
// Handle script error
if (!outscript)
{
cerr << "Couldn't open file: " << script << endl;
exit(1);
}
// Write to script
outscript << "# Set the output terminal" << endl;
outscript << "set terminal canvas" << endl;
outscript << "set output \"canvas_" << to_string(poly_modulus_degree) << ".html\"" << endl;
outscript << "set title \"CKKS Benchmark " << to_string(poly_modulus_degree) << "\"" << endl;
outscript << "set xlabel 'Input Vector Size'" << endl;
outscript << "set ylabel 'Time (microseconds)'" << endl;
outscript << "\n# Set the styling " << endl;
outscript << "set style line 1\\\n"
<< "linecolor rgb '#0060ad'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 7 pointsize 1.5\n"
<< endl;
outscript << "set style line 2\\\n"
<< "linecolor rgb '#dd181f'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 5 pointsize 1.5\n"
<< endl;
outscript << "set style line 3\\\n"
<< "linecolor rgb '#00FF00'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 6 pointsize 1.5\n"
<< endl;
outscript << "set style line 4\\\n"
<< "linecolor rgb '#EC00EC'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 4 pointsize 1.5\n"
<< endl;
outscript << "\nplot 'bench_" << to_string(poly_modulus_degree) << ".dat' index 0 title \"C1 + P2\" with linespoints ls 1, \\\n"
<< "'' index 1 title \"C1 + C2\" with linespoints ls 2, \\\n"
<< "'' index 2 title \"C1 * P2\" with linespoints ls 3, \\\n"
<< "'' index 3 title \"C1 * C2\" with linespoints ls 4";
// Close script
outscript.close();
/*
3 sets of vectors:
1st set: sizes = 10
2nd set: sizes = 100
3rd set: sizes = 1000
*/
// ------------- FIRST SET -------------
// First vector
vector<double> pod_vec1_set1(10, 0);
for (unsigned int i = 0; i < 10; i++)
{
pod_vec1_set1[i] = static_cast<double>(i);
}
print_vector(pod_vec1_set1);
// Second vector
vector<double> pod_vec2_set1(10, 0);
for (unsigned int i = 0; i < 10; i++)
{
pod_vec2_set1[i] = static_cast<double>((i % 2) + 1);
}
print_vector(pod_vec2_set1);
// -------------- SECOND SET -------------
// First vector
vector<double> pod_vec1_set2(100, 0);
for (unsigned int i = 0; i < 100; i++)
{
pod_vec1_set2[i] = static_cast<double>(i);
}
print_vector(pod_vec1_set2);
// Second vector
vector<double> pod_vec2_set2(100, 0);
for (unsigned int i = 0; i < 100; i++)
{
pod_vec2_set2[i] = static_cast<double>((i % 2) + 1);
}
print_vector(pod_vec2_set2);
// -------------- THIRD SET -------------
// First vector
vector<double> pod_vec1_set3(1000, 0);
for (unsigned int i = 0; i < 1000; i++)
{
pod_vec1_set3[i] = static_cast<double>(i);
}
print_vector(pod_vec1_set3);
// Second vector
vector<double> pod_vec2_set3(1000, 0);
for (unsigned int i = 0; i < 1000; i++)
{
pod_vec2_set3[i] = static_cast<double>((i % 2) + 1);
}
print_vector(pod_vec2_set3);
// Encode all vectors
Plaintext plain_vec1_set1, plain_vec2_set1, plain_vec1_set2, plain_vec2_set2, plain_vec1_set3, plain_vec2_set3;
double scale = sqrt(static_cast<double>(params.coeff_modulus().back().value()));
// First set encode
ckks_encoder.encode(pod_vec1_set1, scale, plain_vec1_set1);
ckks_encoder.encode(pod_vec2_set1, scale, plain_vec2_set1);
// Second set encode
ckks_encoder.encode(pod_vec1_set2, scale, plain_vec1_set2);
ckks_encoder.encode(pod_vec2_set2, scale, plain_vec2_set2);
// Third set encode
ckks_encoder.encode(pod_vec1_set3, scale, plain_vec1_set3);
ckks_encoder.encode(pod_vec2_set3, scale, plain_vec2_set3);
// Encrypt all vectors
Ciphertext cipher_vec1_set1, cipher_vec2_set1, cipher_vec1_set2, cipher_vec2_set2, cipher_vec1_set3, cipher_vec2_set3;
// First set cipher
encryptor.encrypt(plain_vec1_set1, cipher_vec1_set1);
encryptor.encrypt(plain_vec2_set1, cipher_vec2_set1);
// Second set cipher
encryptor.encrypt(plain_vec1_set2, cipher_vec1_set2);
encryptor.encrypt(plain_vec2_set2, cipher_vec2_set2);
// Third set cipher
encryptor.encrypt(plain_vec1_set3, cipher_vec1_set3);
encryptor.encrypt(plain_vec2_set3, cipher_vec2_set3);
// Create Ciphertext Outputs
Ciphertext cipher_result1_set1, cipher_result1_set2, cipher_result1_set3;
Ciphertext cipher_result2_set1, cipher_result2_set2, cipher_result2_set3;
Ciphertext cipher_result3_set1, cipher_result3_set2, cipher_result3_set3;
Ciphertext cipher_result4_set1, cipher_result4_set2, cipher_result4_set3;
// ------------------ (cipher1 + plain2) ---------------
cout << "\n------------------ FIRST OPERATION ------------------\n"
<< endl;
outf << "# index 0" << endl;
outf << "# C1 + P2" << endl;
// Compute (cipher1 + plain2) for set 1
cout << "Compute (cipher1 + plain2) for set 1" << endl;
// TIME START
auto start_comp1_set1 = chrono::high_resolution_clock::now();
evaluator.add_plain(cipher_vec1_set1, plain_vec2_set1, cipher_result1_set1);
// TIME END
auto stop_comp1_set1 = chrono::high_resolution_clock::now();
auto duration_comp1_set1 = chrono::duration_cast<chrono::microseconds>(stop_comp1_set1 - start_comp1_set1);
// Decrypt and Decode
Plaintext plain_result1_set1;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result1_set1, plain_result1_set1);
vector<double> vec_result1_set1;
ckks_encoder.decode(plain_result1_set1, vec_result1_set1);
print_vector(vec_result1_set1);
cout << "\nTime to compute (cipher1 + plain2): " << duration_comp1_set1.count() << " microseconds" << endl;
outf << "10\t\t" << duration_comp1_set1.count() << endl;
// Compute (cipher1 + plain2) for set 2
cout << "Compute (cipher1 + plain2) for set 2" << endl;
// TIME START
auto start_comp1_set2 = chrono::high_resolution_clock::now();
evaluator.add_plain(cipher_vec1_set2, plain_vec2_set2, cipher_result1_set2);
// TIME END
auto stop_comp1_set2 = chrono::high_resolution_clock::now();
auto duration_comp1_set2 = chrono::duration_cast<chrono::microseconds>(stop_comp1_set2 - start_comp1_set2);
// Decrypt and Decode
Plaintext plain_result1_set2;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result1_set2, plain_result1_set2);
vector<double> vec_result1_set2;
ckks_encoder.decode(plain_result1_set2, vec_result1_set2);
print_vector(vec_result1_set2);
cout << "\nTime to compute (cipher1 + plain2): " << duration_comp1_set2.count() << " microseconds" << endl;
outf << "100\t\t" << duration_comp1_set2.count() << endl;
// Compute (cipher1 + plain2) for set 3
cout << "Compute (cipher1 + plain2) for set 3" << endl;
// TIME START
auto start_comp1_set3 = chrono::high_resolution_clock::now();
evaluator.add_plain(cipher_vec1_set3, plain_vec2_set3, cipher_result1_set3);
// TIME END
auto stop_comp1_set3 = chrono::high_resolution_clock::now();
auto duration_comp1_set3 = chrono::duration_cast<chrono::microseconds>(stop_comp1_set3 - start_comp1_set3);
// Decrypt and Decode
Plaintext plain_result1_set3;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result1_set3, plain_result1_set3);
vector<double> vec_result1_set3;
ckks_encoder.decode(plain_result1_set3, vec_result1_set3);
print_vector(vec_result1_set3);
cout << "\nTime to compute (cipher1 + plain2): " << duration_comp1_set3.count() << " microseconds" << endl;
outf << "1000\t\t" << duration_comp1_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// ------------------ (cipher1 + cipher2) ---------------
cout << "\n------------------ SECOND OPERATION ------------------\n"
<< endl;
// Compute (cipher1 + cipher2) for set 1
cout << "Compute (cipher1 + cipher2) for set 1" << endl;
outf << "# index 1" << endl;
outf << "# C1 + C2" << endl;
// TIME START
auto start_comp2_set1 = chrono::high_resolution_clock::now();
evaluator.add(cipher_vec1_set1, cipher_vec2_set1, cipher_result2_set1);
// TIME END
auto stop_comp2_set1 = chrono::high_resolution_clock::now();
auto duration_comp2_set1 = chrono::duration_cast<chrono::microseconds>(stop_comp2_set1 - start_comp2_set1);
// Decrypt and Decode
Plaintext plain_result2_set1;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result2_set1, plain_result2_set1);
vector<double> vec_result2_set1;
ckks_encoder.decode(plain_result2_set1, vec_result2_set1);
print_vector(vec_result2_set1);
cout << "\nTime to compute (cipher1 + cipher2): " << duration_comp2_set1.count() << " microseconds" << endl;
outf << "10\t\t" << duration_comp2_set1.count() << endl;
// Compute (cipher1 + cipher2) for set 2
cout << "Compute (cipher1 + cipher2) for set 2" << endl;
// TIME START
auto start_comp2_set2 = chrono::high_resolution_clock::now();
evaluator.add(cipher_vec1_set2, cipher_vec2_set2, cipher_result2_set2);
// TIME END
auto stop_comp2_set2 = chrono::high_resolution_clock::now();
auto duration_comp2_set2 = chrono::duration_cast<chrono::microseconds>(stop_comp2_set2 - start_comp2_set2);
// Decrypt and Decode
Plaintext plain_result2_set2;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result2_set2, plain_result2_set2);
vector<double> vec_result2_set2;
ckks_encoder.decode(plain_result2_set2, vec_result2_set2);
print_vector(vec_result2_set2);
cout << "\nTime to compute (cipher1 + cipher2): " << duration_comp2_set2.count() << " microseconds" << endl;
outf << "100\t\t" << duration_comp2_set2.count() << endl;
// Compute (cipher1 + cipher2) for set 3
cout << "Compute (cipher1 + cipher2) for set 3" << endl;
// TIME START
auto start_comp2_set3 = chrono::high_resolution_clock::now();
evaluator.add(cipher_vec1_set3, cipher_vec2_set3, cipher_result2_set3);
// TIME END
auto stop_comp2_set3 = chrono::high_resolution_clock::now();
auto duration_comp2_set3 = chrono::duration_cast<chrono::microseconds>(stop_comp2_set3 - start_comp2_set3);
// Decrypt and Decode
Plaintext plain_result2_set3;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result2_set3, plain_result2_set3);
vector<double> vec_result2_set3;
ckks_encoder.decode(plain_result2_set3, vec_result2_set3);
print_vector(vec_result2_set3);
cout << "\nTime to compute (cipher1 + cipher2): " << duration_comp2_set3.count() << " microseconds" << endl;
outf << "1000\t\t" << duration_comp2_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// ------------------ (cipher1 * plain2) ---------------
cout << "\n------------------ THIRD OPERATION ------------------\n"
<< endl;
// Compute (cipher1 + plain2) for set 1
cout << "Compute (cipher1 * plain2) for set 1" << endl;
outf << "# index 2" << endl;
outf << "# C1 * P2" << endl;
// TIME START
auto start_comp3_set1 = chrono::high_resolution_clock::now();
evaluator.multiply_plain(cipher_vec1_set1, plain_vec2_set1, cipher_result3_set1);
// TIME END
auto stop_comp3_set1 = chrono::high_resolution_clock::now();
auto duration_comp3_set1 = chrono::duration_cast<chrono::microseconds>(stop_comp3_set1 - start_comp3_set1);
// Decrypt and Decode
Plaintext plain_result3_set1;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result3_set1, plain_result3_set1);
vector<double> vec_result3_set1;
ckks_encoder.decode(plain_result3_set1, vec_result3_set1);
print_vector(vec_result3_set1);
cout << "\nTime to compute (cipher1 * plain2): " << duration_comp3_set1.count() << " microseconds" << endl;
outf << "10\t\t" << duration_comp3_set1.count() << endl;
// Compute (cipher1 * plain2) for set 2
cout << "Compute (cipher1 * plain2) for set 2" << endl;
// TIME START
auto start_comp3_set2 = chrono::high_resolution_clock::now();
evaluator.multiply_plain(cipher_vec1_set2, plain_vec2_set2, cipher_result3_set2);
// TIME END
auto stop_comp3_set2 = chrono::high_resolution_clock::now();
auto duration_comp3_set2 = chrono::duration_cast<chrono::microseconds>(stop_comp3_set2 - start_comp3_set2);
// Decrypt and Decode
Plaintext plain_result3_set2;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result3_set2, plain_result3_set2);
vector<double> vec_result3_set2;
ckks_encoder.decode(plain_result3_set2, vec_result3_set2);
print_vector(vec_result3_set2);
cout << "\nTime to compute (cipher1 * plain2): " << duration_comp3_set2.count() << " microseconds" << endl;
outf << "100\t\t" << duration_comp3_set2.count() << endl;
// Compute (cipher1 * plain2) for set 3
cout << "Compute (cipher1 * plain2) for set 3" << endl;
// TIME START
auto start_comp3_set3 = chrono::high_resolution_clock::now();
evaluator.multiply_plain(cipher_vec1_set3, plain_vec2_set3, cipher_result3_set3);
// TIME END
auto stop_comp3_set3 = chrono::high_resolution_clock::now();
auto duration_comp3_set3 = chrono::duration_cast<chrono::microseconds>(stop_comp3_set3 - start_comp3_set3);
// Decrypt and Decode
Plaintext plain_result3_set3;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result3_set3, plain_result3_set3);
vector<double> vec_result3_set3;
ckks_encoder.decode(plain_result3_set3, vec_result3_set3);
print_vector(vec_result3_set3);
cout << "\nTime to compute (cipher1 * plain2): " << duration_comp3_set3.count() << " microseconds" << endl;
outf << "1000\t\t" << duration_comp3_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// ------------------ (cipher1 * cipher2) ---------------
cout << "\n------------------ FOURTH OPERATION ------------------\n"
<< endl;
// Compute (cipher1 * cipher2) for set 1
cout << "Compute (cipher1 * cipher2) for set 1" << endl;
outf << "# index 3" << endl;
outf << "# C1 * C2" << endl;
// TIME START
auto start_comp4_set1 = chrono::high_resolution_clock::now();
evaluator.multiply(cipher_vec1_set1, cipher_vec2_set1, cipher_result4_set1);
// TIME END
auto stop_comp4_set1 = chrono::high_resolution_clock::now();
auto duration_comp4_set1 = chrono::duration_cast<chrono::microseconds>(stop_comp4_set1 - start_comp4_set1);
// Decrypt and Decode
Plaintext plain_result4_set1;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result4_set1, plain_result4_set1);
vector<double> vec_result4_set1;
ckks_encoder.decode(plain_result4_set1, vec_result4_set1);
print_vector(vec_result4_set1);
cout << "\nTime to compute (cipher1 * cipher2): " << duration_comp4_set1.count() << " microseconds" << endl;
outf << "10\t\t" << duration_comp4_set1.count() << endl;
// Compute (cipher1 * cipher2) for set 2
cout << "Compute (cipher1 * cipher2) for set 2" << endl;
// TIME START
auto start_comp4_set2 = chrono::high_resolution_clock::now();
evaluator.multiply(cipher_vec1_set2, cipher_vec2_set2, cipher_result4_set2);
// TIME END
auto stop_comp4_set2 = chrono::high_resolution_clock::now();
auto duration_comp4_set2 = chrono::duration_cast<chrono::microseconds>(stop_comp4_set2 - start_comp4_set2);
// Decrypt and Decode
Plaintext plain_result4_set2;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result4_set2, plain_result4_set2);
vector<double> vec_result4_set2;
ckks_encoder.decode(plain_result4_set2, vec_result4_set2);
print_vector(vec_result4_set2);
cout << "\nTime to compute (cipher1 * cipher2): " << duration_comp4_set2.count() << " microseconds" << endl;
outf << "100\t\t" << duration_comp4_set2.count() << endl;
// Compute (cipher1 * cipher2) for set 3
cout << "Compute (cipher1 * cipher2) for set 3" << endl;
// TIME START
auto start_comp4_set3 = chrono::high_resolution_clock::now();
evaluator.multiply(cipher_vec1_set3, cipher_vec2_set3, cipher_result4_set3);
// TIME END
auto stop_comp4_set3 = chrono::high_resolution_clock::now();
auto duration_comp4_set3 = chrono::duration_cast<chrono::microseconds>(stop_comp4_set3 - start_comp4_set3);
// Decrypt and Decode
Plaintext plain_result4_set3;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result4_set3, plain_result4_set3);
vector<double> vec_result4_set3;
ckks_encoder.decode(plain_result4_set3, vec_result4_set3);
print_vector(vec_result4_set3);
cout << "\nTime to compute (cipher1 * cipher2): " << duration_comp4_set3.count() << " microseconds" << endl;
outf << "1000\t\t" << duration_comp4_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// Close the file
outf.close();
}
void ckksBenchmarkMatrix(size_t poly_modulus_degree)
{
cout << "------CKKS Matrix TEST------\n"
<< endl;
// Set params
EncryptionParameters params(scheme_type::CKKS);
params.set_poly_modulus_degree(poly_modulus_degree);
params.set_coeff_modulus(CoeffModulus::BFVDefault(poly_modulus_degree));
auto context = SEALContext::Create(params);
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
Encryptor encryptor(context, pk);
Evaluator evaluator(context);
Decryptor decryptor(context, sk);
// Create CKKS encoder
CKKSEncoder ckks_encoder(context);
size_t slot_count = ckks_encoder.slot_count();
cout << "Slot count : " << slot_count << endl;
// Set output file
string filename = "bench_matrix_" + to_string(poly_modulus_degree) + ".dat";
ofstream outf(filename);
// Handle file error
if (!outf)
{
cerr << "Couldn't open file: " << filename << endl;
exit(1);
}
// Set output script
string script = "script_matrix_" + to_string(poly_modulus_degree) + ".p";
ofstream outscript(script);
// Handle script error
if (!outscript)
{
cerr << "Couldn't open file: " << script << endl;
exit(1);
}
// Write to script
outscript << "# Set the output terminal" << endl;
outscript << "set terminal canvas" << endl;
outscript << "set output \"canvas_matrix_" << to_string(poly_modulus_degree) << ".html\"" << endl;
outscript << "set title \"CKKS Matrix Benchmark " << to_string(poly_modulus_degree) << "\"" << endl;
outscript << "set xlabel 'Input Matrix Size (NxN)'" << endl;
outscript << "set ylabel 'Time (microseconds)'" << endl;
outscript << "\n# Set the styling " << endl;
outscript << "set style line 1\\\n"
<< "linecolor rgb '#0060ad'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 7 pointsize 1.5\n"
<< endl;
outscript << "set style line 2\\\n"
<< "linecolor rgb '#dd181f'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 5 pointsize 1.5\n"
<< endl;
outscript << "set style line 3\\\n"
<< "linecolor rgb '#00FF00'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 6 pointsize 1.5\n"
<< endl;
outscript << "set style line 4\\\n"
<< "linecolor rgb '#EC00EC'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 4 pointsize 1.5\n"
<< endl;
outscript << "\nplot 'bench_matrix_" << to_string(poly_modulus_degree) << ".dat' index 0 title \"C1 + P2\" with linespoints ls 1, \\\n"
<< "'' index 1 title \"C1 + C2\" with linespoints ls 2, \\\n"
<< "'' index 2 title \"C1 * P2\" with linespoints ls 3, \\\n"
<< "'' index 3 title \"C1 * C2\" with linespoints ls 4";
// Close script
outscript.close();
// ------------- FIRST SET -------------
// First Matrix
int set_size1 = 10;
vector<vector<double>> pod_matrix1_set1(set_size1, vector<double>(set_size1));
double k = 0.0;
for (unsigned int i = 0; i < set_size1; i++)
{
for (unsigned int j = 0; j < set_size1; j++)
{
pod_matrix1_set1[i][j] = k;
// cout << "k = " << k;
k++;
}
}
cout << "Matrix 1 Set 1:\n"
<< endl;
// print_full_matrix(pod_matrix1_set1, set_size1);
print_partial_matrix(pod_matrix1_set1, set_size1);
// Second Matrix
vector<vector<double>> pod_matrix2_set1(set_size1, vector<double>(set_size1));
k = 0.0;
for (unsigned int i = 0; i < set_size1; i++)
{
for (unsigned int j = 0; j < set_size1; j++)
{
pod_matrix2_set1[i][j] = static_cast<double>((int(k) % 2) + 1);
k++;
}
}
cout << "Matrix 2 Set 1:\n"
<< endl;
// print_full_matrix(pod_matrix2_set1, set_size1);
print_partial_matrix(pod_matrix2_set1, set_size1);
// ------------- Second SET -------------
// First Matrix
int set_size2 = 100;
vector<vector<double>> pod_matrix1_set2(set_size2, vector<double>(set_size2));
k = 0.0;
for (unsigned int i = 0; i < set_size2; i++)
{
for (unsigned int j = 0; j < set_size2; j++)
{
pod_matrix1_set2[i][j] = k;
// cout << "k = " << k;
k++;
}
}
cout << "Matrix 1 Set 2:\n"
<< endl;
print_partial_matrix(pod_matrix1_set2, set_size2);
// Second Matrix
vector<vector<double>> pod_matrix2_set2(set_size2, vector<double>(set_size2));
k = 0.0;
for (unsigned int i = 0; i < set_size2; i++)
{
for (unsigned int j = 0; j < set_size2; j++)
{
pod_matrix2_set2[i][j] = static_cast<double>((int(k) % 2) + 1);
k++;
}
}
cout << "Matrix 2 Set 2:\n"
<< endl;
print_partial_matrix(pod_matrix2_set2, set_size2);
// ------------- THIRD SET -------------
// First Matrix
int set_size3 = 1000;
vector<vector<double>> pod_matrix1_set3(set_size3, vector<double>(set_size3));
k = 0.0;
for (unsigned int i = 0; i < set_size3; i++)
{
for (unsigned int j = 0; j < set_size3; j++)
{
pod_matrix1_set3[i][j] = k;
// cout << "k = " << k;
k++;
}
}
cout << "Matrix 1 Set 3:\n"
<< endl;
print_partial_matrix(pod_matrix1_set3, set_size3);
// Second Matrix
vector<vector<double>> pod_matrix2_set3(set_size3, vector<double>(set_size3));
k = 0.0;
for (unsigned int i = 0; i < set_size3; i++)
{
for (unsigned int j = 0; j < set_size3; j++)
{
pod_matrix2_set3[i][j] = static_cast<double>((int(k) % 2) + 1);
k++;
}
}
cout << "Matrix 2 Set 3:\n"
<< endl;
print_partial_matrix(pod_matrix2_set3, set_size3);
// Encode the matrices
vector<Plaintext> plain_matrix1_set1(set_size1), plain_matrix2_set1(set_size1);
vector<Plaintext> plain_matrix1_set2(set_size2), plain_matrix2_set2(set_size2);
vector<Plaintext> plain_matrix1_set3(set_size3), plain_matrix2_set3(set_size3);
double scale = sqrt(static_cast<double>(params.coeff_modulus().back().value()));
// First set encode
for (unsigned int i = 0; i < pod_matrix1_set1.size(); i++)
{
ckks_encoder.encode(pod_matrix1_set1[i], scale, plain_matrix1_set1[i]);
}
for (unsigned int i = 0; i < pod_matrix2_set1.size(); i++)
{
ckks_encoder.encode(pod_matrix2_set1[i], scale, plain_matrix2_set1[i]);
}
// Second set encode
for (unsigned int i = 0; i < pod_matrix1_set2.size(); i++)
{
ckks_encoder.encode(pod_matrix1_set2[i], scale, plain_matrix1_set2[i]);
}
for (unsigned int i = 0; i < pod_matrix2_set2.size(); i++)
{
ckks_encoder.encode(pod_matrix2_set2[i], scale, plain_matrix2_set2[i]);
}
// Third set encode
for (unsigned int i = 0; i < pod_matrix1_set3.size(); i++)
{
ckks_encoder.encode(pod_matrix1_set3[i], scale, plain_matrix1_set3[i]);
}
for (unsigned int i = 0; i < pod_matrix2_set3.size(); i++)
{
ckks_encoder.encode(pod_matrix2_set3[i], scale, plain_matrix2_set3[i]);
}
// Encrypt the matrices
vector<Ciphertext> cipher_matrix1_set1(set_size1), cipher_matrix2_set1(set_size1);
vector<Ciphertext> cipher_matrix1_set2(set_size2), cipher_matrix2_set2(set_size2);
vector<Ciphertext> cipher_matrix1_set3(set_size3), cipher_matrix2_set3(set_size3);
// First set cipher
for (unsigned int i = 0; i < plain_matrix1_set1.size(); i++)
{
encryptor.encrypt(plain_matrix1_set1[i], cipher_matrix1_set1[i]);
}
for (unsigned int i = 0; i < plain_matrix2_set1.size(); i++)
{
encryptor.encrypt(plain_matrix2_set1[i], cipher_matrix2_set1[i]);
}
// Second set cipher
for (unsigned int i = 0; i < plain_matrix1_set2.size(); i++)
{
encryptor.encrypt(plain_matrix1_set2[i], cipher_matrix1_set2[i]);
}
for (unsigned int i = 0; i < plain_matrix2_set2.size(); i++)
{
encryptor.encrypt(plain_matrix2_set2[i], cipher_matrix2_set2[i]);
}
// Third set cipher
for (unsigned int i = 0; i < plain_matrix1_set3.size(); i++)
{
encryptor.encrypt(plain_matrix1_set3[i], cipher_matrix1_set3[i]);
}
for (unsigned int i = 0; i < plain_matrix2_set3.size(); i++)
{
encryptor.encrypt(plain_matrix2_set3[i], cipher_matrix2_set3[i]);
}
// Create ciphertext output
// Set 1 output
vector<Ciphertext> cipher_result1_set1(set_size1), cipher_result2_set1(set_size1), cipher_result3_set1(set_size1), cipher_result4_set1(set_size1);
// Set 2 output
vector<Ciphertext> cipher_result1_set2(set_size2), cipher_result2_set2(set_size2), cipher_result3_set2(set_size2), cipher_result4_set2(set_size2);
// Set 3 output
vector<Ciphertext> cipher_result1_set3(set_size3), cipher_result2_set3(set_size3), cipher_result3_set3(set_size3), cipher_result4_set3(set_size3);
// ------------------ (cipher1 + plain2) ---------------
cout << "\n------------------ FIRST OPERATION ------------------\n"
<< endl;
outf << "# index 0" << endl;
outf << "# C1 + P2" << endl;
// Compute (cipher1 + plain2) for set 1
cout << "Compute (cipher1 + plain2) for set 1" << endl;
// TIME START
auto start_comp1_set1 = chrono::high_resolution_clock::now();
for (unsigned int i = 0; i < cipher_matrix1_set1.size(); i++)
{
evaluator.add_plain(cipher_matrix1_set1[i], plain_matrix2_set1[i], cipher_result1_set1[i]);
}
// TIME END
auto stop_comp1_set1 = chrono::high_resolution_clock::now();
auto duration_comp1_set1 = chrono::duration_cast<chrono::microseconds>(stop_comp1_set1 - start_comp1_set1);
// Decrypt and Decode
vector<Plaintext> plain_result1_set1(set_size1);
cout << "Decrypt and decode the result" << endl;
for (unsigned int i = 0; i < cipher_result1_set1.size(); i++)
{
decryptor.decrypt(cipher_result1_set1[i], plain_result1_set1[i]);
}
vector<vector<double>> matrix_result1_set1(set_size1, vector<double>(set_size1));
for (unsigned int i = 0; i < plain_result1_set1.size(); i++)
{
ckks_encoder.decode(plain_result1_set1[i], matrix_result1_set1[i]);
}
print_partial_matrix(matrix_result1_set1, set_size1);
cout << "\nTime to compute cipher1 + plain2: " << duration_comp1_set1.count() << " microseconds" << endl;
outf << set_size1 << "\t\t" << duration_comp1_set1.count() << endl;
// Compute (cipher1 + plain2) for set 2
cout << "Compute (cipher1 + plain2) for set 2" << endl;
// TIME START
auto start_comp1_set2 = chrono::high_resolution_clock::now();
for (unsigned int i = 0; i < cipher_matrix1_set2.size(); i++)
{
evaluator.add_plain(cipher_matrix1_set2[i], plain_matrix2_set2[i], cipher_result1_set2[i]);
}
// TIME END
auto stop_comp1_set2 = chrono::high_resolution_clock::now();
auto duration_comp1_set2 = chrono::duration_cast<chrono::microseconds>(stop_comp1_set2 - start_comp1_set2);
// Decrypt and Decode
vector<Plaintext> plain_result1_set2(set_size2);
cout << "Decrypt and decode the result" << endl;
for (unsigned int i = 0; i < cipher_result1_set2.size(); i++)
{
decryptor.decrypt(cipher_result1_set2[i], plain_result1_set2[i]);
}
vector<vector<double>> matrix_result1_set2(set_size2, vector<double>(set_size2));
for (unsigned int i = 0; i < plain_result1_set2.size(); i++)
{
ckks_encoder.decode(plain_result1_set2[i], matrix_result1_set2[i]);
}
print_partial_matrix(matrix_result1_set2, set_size2);
cout << "\nTime to compute cipher1 + plain2: " << duration_comp1_set2.count() << " microseconds" << endl;
outf << set_size2 << "\t\t" << duration_comp1_set2.count() << endl;
// Compute (cipher1 + plain2) for set 3
cout << "Compute (cipher1 + plain2) for set 3" << endl;
// TIME START
auto start_comp1_set3 = chrono::high_resolution_clock::now();
for (unsigned int i = 0; i < cipher_matrix1_set3.size(); i++)
{
evaluator.add_plain(cipher_matrix1_set3[i], plain_matrix2_set3[i], cipher_result1_set3[i]);
}
// TIME END
auto stop_comp1_set3 = chrono::high_resolution_clock::now();
auto duration_comp1_set3 = chrono::duration_cast<chrono::microseconds>(stop_comp1_set3 - start_comp1_set3);
// Decrypt and Decode
vector<Plaintext> plain_result1_set3(set_size3);
cout << "Decrypt and decode the result" << endl;
for (unsigned int i = 0; i < cipher_result1_set3.size(); i++)
{
decryptor.decrypt(cipher_result1_set3[i], plain_result1_set3[i]);
}
vector<vector<double>> matrix_result1_set3(set_size3, vector<double>(set_size3));
for (unsigned int i = 0; i < plain_result1_set3.size(); i++)
{
ckks_encoder.decode(plain_result1_set3[i], matrix_result1_set3[i]);
}
print_partial_matrix(matrix_result1_set3, set_size3);
cout << "\nTime to compute cipher1 + plain2: " << duration_comp1_set3.count() << " microseconds" << endl;
outf << set_size3 << "\t\t" << duration_comp1_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// ------------------ (cipher1 + cipher2) ---------------
cout << "\n------------------ SECOND OPERATION ------------------\n"
<< endl;
outf << "# index 1" << endl;
outf << "# C1 + C2" << endl;
// Compute (cipher1 + cipher2) for set 1
cout << "Compute (cipher1 + cipher2) for set 1" << endl;
// TIME START
auto start_comp2_set1 = chrono::high_resolution_clock::now();
for (unsigned int i = 0; i < cipher_matrix1_set1.size(); i++)
{
evaluator.add(cipher_matrix1_set1[i], cipher_matrix2_set1[i], cipher_result2_set1[i]);
}
// TIME END
auto stop_comp2_set1 = chrono::high_resolution_clock::now();
auto duration_comp2_set1 = chrono::duration_cast<chrono::microseconds>(stop_comp2_set1 - start_comp2_set1);
// Decrypt and Decode
vector<Plaintext> plain_result2_set1(set_size1);
cout << "Decrypt and decode the result" << endl;
for (unsigned int i = 0; i < cipher_result2_set1.size(); i++)
{
decryptor.decrypt(cipher_result2_set1[i], plain_result2_set1[i]);
}
vector<vector<double>> matrix_result2_set1(set_size1, vector<double>(set_size1));
for (unsigned int i = 0; i < plain_result2_set1.size(); i++)
{
ckks_encoder.decode(plain_result2_set1[i], matrix_result2_set1[i]);
}
print_partial_matrix(matrix_result2_set1, set_size1);
cout << "\nTime to compute cipher1 + cipher2: " << duration_comp2_set1.count() << " microseconds" << endl;
outf << set_size1 << "\t\t" << duration_comp2_set1.count() << endl;
// Compute (cipher1 + cipher2) for set 2
cout << "Compute (cipher1 + cipher2) for set 2" << endl;
// TIME START
auto start_comp2_set2 = chrono::high_resolution_clock::now();
for (unsigned int i = 0; i < cipher_matrix1_set2.size(); i++)
{
evaluator.add(cipher_matrix1_set2[i], cipher_matrix2_set2[i], cipher_result2_set2[i]);
}
// TIME END
auto stop_comp2_set2 = chrono::high_resolution_clock::now();
auto duration_comp2_set2 = chrono::duration_cast<chrono::microseconds>(stop_comp2_set2 - start_comp2_set2);
// Decrypt and Decode
vector<Plaintext> plain_result2_set2(set_size2);
cout << "Decrypt and decode the result" << endl;
for (unsigned int i = 0; i < cipher_result2_set2.size(); i++)
{
decryptor.decrypt(cipher_result2_set2[i], plain_result2_set2[i]);
}
vector<vector<double>> matrix_result2_set2(set_size2, vector<double>(set_size2));
for (unsigned int i = 0; i < plain_result2_set2.size(); i++)
{
ckks_encoder.decode(plain_result2_set2[i], matrix_result2_set2[i]);
}
print_partial_matrix(matrix_result2_set2, set_size2);
cout << "\nTime to compute cipher1 + cipher2: " << duration_comp2_set2.count() << " microseconds" << endl;
outf << set_size2 << "\t\t" << duration_comp2_set2.count() << endl;
// Compute (cipher1 + cipher2) for set 3
cout << "Compute (cipher1 + cipher2) for set 3" << endl;
// TIME START
auto start_comp2_set3 = chrono::high_resolution_clock::now();
for (unsigned int i = 0; i < cipher_matrix1_set3.size(); i++)
{
evaluator.add(cipher_matrix1_set3[i], cipher_matrix2_set3[i], cipher_result2_set3[i]);
}
// TIME END
auto stop_comp2_set3 = chrono::high_resolution_clock::now();
auto duration_comp2_set3 = chrono::duration_cast<chrono::microseconds>(stop_comp2_set3 - start_comp2_set3);
// Decrypt and Decode
vector<Plaintext> plain_result2_set3(set_size3);
cout << "Decrypt and decode the result" << endl;
for (unsigned int i = 0; i < cipher_result2_set3.size(); i++)
{
decryptor.decrypt(cipher_result2_set3[i], plain_result2_set3[i]);
}
vector<vector<double>> matrix_result2_set3(set_size3, vector<double>(set_size3));
for (unsigned int i = 0; i < plain_result2_set3.size(); i++)
{
ckks_encoder.decode(plain_result2_set3[i], matrix_result2_set3[i]);
}
print_partial_matrix(matrix_result2_set3, set_size3);
cout << "\nTime to compute cipher1 + cipher2: " << duration_comp2_set3.count() << " microseconds" << endl;
outf << set_size3 << "\t\t" << duration_comp2_set3.count() << endl;
outf.close();
}
int main()
{
// Need to plot graph with x-axis as the size and y-axis as the duration
// Plot 3 different graphs (with 3 different ploy_modulus_degree)
EncryptionParameters params(scheme_type::CKKS);
// Case 1 : poly_modulus_degree = 4096
size_t poly_modulus_degree = 4096;
params.set_poly_modulus_degree(poly_modulus_degree);
params.set_coeff_modulus(CoeffModulus::BFVDefault(poly_modulus_degree));
// Run the tests
ckksBenchmark(poly_modulus_degree);
ckksBenchmarkMatrix(poly_modulus_degree);
return 0;
}
| 40,457
|
C++
|
.cpp
| 927
| 37.390507
| 150
| 0.612275
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,657
|
matrix_transpose.cpp
|
MarwanNour_SEAL-FYP-Logistic-Regression/matrix_transpose.cpp
|
#include <iostream>
#include <iomanip>
#include <fstream>
#include "seal/seal.h"
#include "helper.h"
using namespace std;
using namespace seal;
void MatrixTranspose(size_t poly_modulus_degree, int dimension)
{
// Handle Rotation Error First
if (dimension > poly_modulus_degree / 4)
{
cerr << "Dimension is too large. Choose a dimension less than " << poly_modulus_degree / 4 << endl;
exit(1);
}
EncryptionParameters params(scheme_type::ckks);
params.set_poly_modulus_degree(poly_modulus_degree);
cout << "MAX BIT COUNT: " << CoeffModulus::MaxBitCount(poly_modulus_degree) << endl;
params.set_coeff_modulus(CoeffModulus::Create(poly_modulus_degree, {60, 40, 40, 40, 40, 60}));
SEALContext context(params);
auto tmp = make_shared<SEALContext>(context);
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
PublicKey pk;
keygen.create_public_key(pk);
SecretKey sk = keygen.secret_key();
GaloisKeys gal_keys;
keygen.create_galois_keys(gal_keys);
RelinKeys relin_keys;
keygen.create_relin_keys(relin_keys);
Encryptor encryptor(context, pk);
Evaluator evaluator(context);
Decryptor decryptor(context, sk);
// Create CKKS encoder
CKKSEncoder ckks_encoder(context);
// Create Scale
double scale = pow(2.0, 40);
int dimensionSq = pow(dimension, 2);
// Create input matrix
vector<vector<double>> pod_matrix1_set1(dimension, vector<double>(dimension));
// Fill input matrices
// double r = ((double)rand() / (RAND_MAX));
double filler = 1;
// Matrix 1
for (int i = 0; i < dimension; i++)
{
for (int j = 0; j < dimension; j++)
{
pod_matrix1_set1[i][j] = filler;
filler++;
// r = ((double)rand() / (RAND_MAX));
}
}
cout << "Matrix 1:" << endl;
print_full_matrix(pod_matrix1_set1, 0);
// Get U_tranposed
vector<vector<double>> U_transposed = get_U_transpose(pod_matrix1_set1);
cout << "\nU_tranposed:" << endl;
print_full_matrix(U_transposed, 0);
// Get diagonals for U_transposed
vector<vector<double>> U_transposed_diagonals = get_all_diagonals(U_transposed);
// Test ADD EPSILON
double epsilon = 0.00000001;
for (int i = 0; i < dimensionSq; i++)
{
for (int j = 0; j < dimensionSq; j++)
{
U_transposed_diagonals[i][j] += epsilon;
}
}
// --------------- ENCODING ----------------
// Encode U_transposed_diagonals
vector<Plaintext> U_transposed_diagonals_plain(dimensionSq);
cout << "\nEncoding U_tranposed_diagonals...";
for (int i = 0; i < dimensionSq; i++)
{
ckks_encoder.encode(U_transposed_diagonals[i], scale, U_transposed_diagonals_plain[i]);
}
cout << "Done" << endl;
// Encode Matrix 1
vector<Plaintext> plain_matrix1_set1(dimension);
cout << "\nEncoding Matrix 1...";
for (int i = 0; i < dimension; i++)
{
ckks_encoder.encode(pod_matrix1_set1[i], scale, plain_matrix1_set1[i]);
}
cout << "Done" << endl;
// --------------- ENCRYPTING ----------------
// Encrypt Matrix 1
vector<Ciphertext> cipher_matrix1_set1(dimension);
cout << "\nEncrypting Matrix 1...";
for (int i = 0; i < dimension; i++)
{
encryptor.encrypt(plain_matrix1_set1[i], cipher_matrix1_set1[i]);
}
cout << "Done" << endl;
// --------------- MATRIX ENCODING ----------------
// Matrix Encode Matrix 1
cout << "\nMatrix Encoding Matrix 1...";
Ciphertext cipher_encoded_matrix1_set1 = C_Matrix_Encode(cipher_matrix1_set1, gal_keys, evaluator);
cout << "Done" << endl;
// --------------- MATRIX TRANSPOSING ----------------
cout << "\nMatrix Transposition...";
Ciphertext ct_result = Linear_Transform_Plain(cipher_encoded_matrix1_set1, U_transposed_diagonals_plain, gal_keys, params);
cout << "Done" << endl;
// --------------- DECRYPT ----------------
Plaintext pt_result;
cout << "\nResult Decrypt...";
decryptor.decrypt(ct_result, pt_result);
cout << "Done" << endl;
// --------------- DECODE ----------------
vector<double> result_matrix;
cout << "\nResult Decode...";
ckks_encoder.decode(pt_result, result_matrix);
cout << "Done" << endl;
// print_partial_vector(result_matrix, result_matrix.size());
cout << "Resulting matrix: ";
for (int i = 0; i < dimensionSq; i++)
{
if (i % dimension == 0)
{
cout << "\n\t";
}
cout << result_matrix[i] << ", ";
}
cout << endl;
// Test Matrix DECODE
cout << "\nMATRIX DECODING... ";
vector<Ciphertext> ct_decoded_vec = C_Matrix_Decode(ct_result, dimension, scale, gal_keys, ckks_encoder, evaluator);
cout << "Done" << endl;
// DECRYPT and DECODE
vector<Plaintext> pt_decoded_vec(dimension);
for (int i = 0; i < dimension; i++)
{
decryptor.decrypt(ct_decoded_vec[i], pt_decoded_vec[i]);
vector<double> decoded_vec;
ckks_encoder.decode(pt_decoded_vec[i], decoded_vec);
cout << "\t[";
for (int j = 0; j < dimension; j++)
{
cout << decoded_vec[j] << ", ";
}
cout << "]" << endl;
}
// Dummy Diagonal test
cout << "\n----------------DUMMY TEST-----------------\n"
<< endl;
int coldim = 4;
int rowdim = 3;
vector<vector<double>> dummy_matrix(rowdim, vector<double>(coldim));
vector<double> row_0 = {1, 2, 3, 4};
vector<double> row_1 = {5, 6, 7, 8};
vector<double> row_2 = {9, 10, 11, 12};
dummy_matrix[0] = row_0;
dummy_matrix[1] = row_1;
dummy_matrix[2] = row_2;
cout << "Dummy matrix:" << endl;
print_full_matrix(dummy_matrix);
vector<vector<double>> dummy_diagonals = get_all_diagonals(dummy_matrix);
cout << "\nDummy matrix diagonals:" << endl;
print_full_matrix(dummy_diagonals);
// cout << "\nTransposed dummy matrix diagonals:" << endl;
// vector<vector<double>> tranposed_diag = transpose_matrix(dummy_diagonals);
// print_full_matrix(tranposed_diag);
// cout << "\n\nTransposed dummy matrix:" << endl;
// vector<vector<double>> tranposed_dummy = transpose_matrix(dummy_matrix);
// print_full_matrix(tranposed_dummy);
// cout << "\nDiagonals of Transposed dummy:" << endl;
// vector<vector<double>> diag_tranposed_dummy = get_all_diagonals(tranposed_dummy);
// print_full_matrix(diag_tranposed_dummy);
// TEST DOT PRODUCT
Plaintext pt_0;
ckks_encoder.encode(row_0, scale, pt_0);
Plaintext pt_1;
ckks_encoder.encode(row_1, scale, pt_1);
Ciphertext ct_0;
encryptor.encrypt(pt_0, ct_0);
Ciphertext ct_1;
encryptor.encrypt(pt_1, ct_1);
Ciphertext dot_prod_ct = cipher_dot_product(ct_0, ct_1, 4, relin_keys, gal_keys, evaluator);
Plaintext dot_prod_pt;
decryptor.decrypt(dot_prod_ct, dot_prod_pt);
vector<double> dot_prod;
ckks_encoder.decode(dot_prod_pt, dot_prod);
cout << "\n\n DOT PROD:" << endl;
for (int i = 0; i < 10; i++)
{
cout << dot_prod[i] << ", ";
}
cout << "\n"
<< endl;
}
int main()
{
MatrixTranspose(8192 * 2, 4);
return 0;
}
| 7,302
|
C++
|
.cpp
| 197
| 31.324873
| 127
| 0.600906
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,658
|
matrix_multiplication.cpp
|
MarwanNour_SEAL-FYP-Logistic-Regression/matrix_multiplication.cpp
|
#include <iostream>
#include <iomanip>
#include <fstream>
#include <unistd.h>
#include "seal/seal.h"
#include "helper.h"
using namespace std;
using namespace seal;
Ciphertext CC_Matrix_Multiplication(Ciphertext ctA, Ciphertext ctB, int dimension, vector<Plaintext> U_sigma_diagonals, vector<Plaintext> U_tau_diagonals, vector<vector<Plaintext>> V_diagonals, vector<vector<Plaintext>> W_diagonals, GaloisKeys gal_keys, EncryptionParameters params)
{
auto context = SEALContext::Create(params);
Evaluator evaluator(context);
vector<Ciphertext> ctA_result(dimension);
vector<Ciphertext> ctB_result(dimension);
cout << "----------Step 1----------- " << endl;
// Step 1-1
ctA_result[0] = Linear_Transform_Plain(ctA, U_sigma_diagonals, gal_keys, params);
// Step 1-2
ctB_result[0] = Linear_Transform_Plain(ctB, U_tau_diagonals, gal_keys, params);
/*
// Test scale
cout << "\nSCALE TEST -----------:" << endl;
for (int i = 0; i < dimension; i++)
{
cout << "CTA scale at i = " << i << ":\t" << log2(ctA_result[i].scale()) << endl;
cout << "CTB scale at i = " << i << ":\t" << log2(ctB_result[i].scale()) << endl;
}
*/
// Step 2
cout << "----------Step 2----------- " << endl;
for (int k = 1; k < dimension; k++)
{
cout << "Linear Transf at k = " << k;
ctA_result[k] = Linear_Transform_Plain(ctA_result[0], V_diagonals[k - 1], gal_keys, params);
ctB_result[k] = Linear_Transform_Plain(ctB_result[0], W_diagonals[k - 1], gal_keys, params);
cout << "..... Done" << endl;
}
/*
// Test scale
for (int i = 0; i < dimension; i++)
{
cout << "CTA scale at i = " << i << ":\t" << log2(ctA_result[i].scale()) << endl;
cout << "CTB scale at i = " << i << ":\t" << log2(ctB_result[i].scale()) << endl;
}
// Test Chain
cout << "\nCHAIN TEST -----------:" << endl;
for (int i = 0; i < dimension; i++)
{
cout << "chain index A at i = " << i << ":\t" << context->get_context_data(ctA_result[i].parms_id())->chain_index() << endl;
cout << "chain index B at i = " << i << ":\t" << context->get_context_data(ctB_result[i].parms_id())->chain_index() << endl;
}
cout << "context data total coeff modulus bit count = " << context->get_context_data(U_sigma_diagonals[0].parms_id())->total_coeff_modulus_bit_count() << endl;
*/
// Step 3
cout << "----------Step 3----------- " << endl;
// Test Rescale
cout << "RESCALE--------" << endl;
for (int i = 1; i < dimension; i++)
{
evaluator.rescale_to_next_inplace(ctA_result[i]);
evaluator.rescale_to_next_inplace(ctB_result[i]);
}
/*
// Test scale
for (int i = 0; i < dimension; i++)
{
cout << "CTA scale at i = " << i << ":\t" << log2(ctA_result[i].scale()) << endl;
cout << "CTB scale at i = " << i << ":\t" << log2(ctB_result[i].scale()) << endl;
}
cout << "Exact scale" << endl;
ios old_fmt(nullptr);
old_fmt.copyfmt(cout);
cout << fixed << setprecision(10);
for (int i = 0; i < dimension; i++)
{
cout << "\t Exact scale in ctA at i = " << i << ":\t" << ctA_result[i].scale() << endl;
cout << "\t Exact scale in ctB at i = " << i << ":\t" << ctB_result[i].scale() << endl;
}
cout << endl;
cout.copyfmt(old_fmt);
// Test Chain
cout << "\nCHAIN TEST -----------:" << endl;
for (int i = 0; i < dimension; i++)
{
cout << "chain index A at i = " << i << ":\t" << context->get_context_data(ctA_result[i].parms_id())->chain_index() << endl;
cout << "chain index B at i = " << i << ":\t" << context->get_context_data(ctB_result[i].parms_id())->chain_index() << endl;
}
*/
Ciphertext ctAB;
evaluator.multiply(ctA_result[0], ctB_result[0], ctAB);
// cout << "TEST" << endl;
// cout << "CTAB scale :\t" << log2(ctAB.scale()) << endl;
// cout << "CTAB chain index :\t" << context->get_context_data(ctAB.parms_id())->chain_index() << endl;
// Mod switch CTAB
// cout << "MOD SWITCH CTAB:" << endl;
evaluator.mod_switch_to_next_inplace(ctAB);
// cout << "CTAB chain index :\t" << context->get_context_data(ctAB.parms_id())->chain_index() << endl;
// Manual scale set
cout << "\nMANUAL SCALE:" << endl;
for (int i = 1; i < dimension; i++)
{
ctA_result[i].scale() = pow(2, (int)log2(ctA_result[i].scale()));
ctB_result[i].scale() = pow(2, (int)log2(ctB_result[i].scale()));
}
for (int k = 1; k < dimension; k++)
{
cout << "Iteration k = " << k << endl;
Ciphertext temp_mul;
evaluator.multiply(ctA_result[k], ctB_result[k], temp_mul);
evaluator.add_inplace(ctAB, temp_mul);
}
return ctAB;
}
void Matrix_Multiplication(size_t poly_modulus_degree, int dimension)
{
// Handle Rotation Error First
if (dimension > poly_modulus_degree / 4)
{
cerr << "Dimension is too large. Choose a dimension less than " << poly_modulus_degree / 4 << endl;
exit(1);
}
EncryptionParameters params(scheme_type::CKKS);
params.set_poly_modulus_degree(poly_modulus_degree);
cout << "MAX BIT COUNT: " << CoeffModulus::MaxBitCount(poly_modulus_degree) << endl;
params.set_coeff_modulus(CoeffModulus::Create(poly_modulus_degree, {60, 40, 40, 40, 40, 60}));
auto context = SEALContext::Create(params);
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
GaloisKeys gal_keys = keygen.galois_keys();
Encryptor encryptor(context, pk);
Evaluator evaluator(context);
Decryptor decryptor(context, sk);
// Create CKKS encoder
CKKSEncoder ckks_encoder(context);
// Create Scale
double scale = pow(2.0, 40);
vector<vector<double>> pod_matrix1_set1(dimension, vector<double>(dimension));
vector<vector<double>> pod_matrix2_set1(dimension, vector<double>(dimension));
// Fill input matrices
// double r = ((double)rand() / (RAND_MAX));
double filler = 1;
// Matrix 1
for (int i = 0; i < dimension; i++)
{
for (int j = 0; j < dimension; j++)
{
pod_matrix1_set1[i][j] = filler;
filler++;
// r = ((double)rand() / (RAND_MAX));
}
}
cout << "Matrix 1:" << endl;
print_full_matrix(pod_matrix1_set1, 0);
filler = 1;
// Matrix 2
for (int i = 0; i < dimension; i++)
{
for (int j = 0; j < dimension; j++)
{
pod_matrix2_set1[i][j] = filler;
// r = ((double)rand() / (RAND_MAX));
filler++;
}
}
cout << "Matrix 2:" << endl;
print_full_matrix(pod_matrix2_set1, 0);
int dimensionSq = pow(dimension, 2);
// Get U_sigma for first matrix
vector<vector<double>> U_sigma = get_U_sigma(pod_matrix1_set1);
cout << "\nU_sigma:" << endl;
print_full_matrix(U_sigma, 0);
// Get U_tau for second matrix
vector<vector<double>> U_tau = get_U_tau(pod_matrix1_set1);
cout << "\nU_tau:" << endl;
print_full_matrix(U_tau, 0);
// Get V_k (3D matrix)
vector<vector<vector<double>>> V_k(dimension - 1, vector<vector<double>>(dimensionSq, vector<double>(dimensionSq)));
for (int i = 1; i < dimension; i++)
{
V_k[i - 1] = get_V_k(pod_matrix1_set1, i);
cout << "\nV_" << to_string(i) << ":" << endl;
print_full_matrix(V_k[i - 1], 0);
}
// Get W_k (3D matrix)
vector<vector<vector<double>>> W_k(dimension - 1, vector<vector<double>>(dimensionSq, vector<double>(dimensionSq)));
for (int i = 1; i < dimension; i++)
{
W_k[i - 1] = get_W_k(pod_matrix1_set1, i);
cout << "\nW_" << to_string(i) << ":" << endl;
print_full_matrix(W_k[i - 1], 0);
}
// Get Diagonals for U_sigma
vector<vector<double>> U_sigma_diagonals = get_all_diagonals(U_sigma);
cout << "U_sigma Diagonal Matrix:" << endl;
print_full_matrix(U_sigma_diagonals, 0);
// Test ADD EPSILON
double epsilon = 0.00000001;
for (int i = 0; i < dimensionSq; i++)
{
for (int j = 0; j < dimensionSq; j++)
{
U_sigma_diagonals[i][j] += epsilon;
}
}
// Get Diagonals for U_tau
vector<vector<double>> U_tau_diagonals = get_all_diagonals(U_tau);
// Test ADD EPSILON
for (int i = 0; i < dimensionSq; i++)
{
for (int j = 0; j < dimensionSq; j++)
{
U_tau_diagonals[i][j] += epsilon;
}
}
// Get Diagonals for V_k
vector<vector<vector<double>>> V_k_diagonals(dimension - 1, vector<vector<double>>(dimensionSq, vector<double>(dimensionSq)));
for (int i = 1; i < dimension; i++)
{
V_k_diagonals[i - 1] = get_all_diagonals(V_k[i - 1]);
}
// Test ADD EPSILON
for (int i = 0; i < dimension - 1; i++)
{
for (int j = 0; j < dimensionSq; j++)
{
for (int k = 0; k < dimensionSq; k++)
{
V_k_diagonals[i][j][k] += epsilon;
}
}
}
// Get Diagonals for W_k
vector<vector<vector<double>>> W_k_diagonals(dimension - 1, vector<vector<double>>(dimensionSq, vector<double>(dimensionSq)));
for (int i = 1; i < dimension; i++)
{
W_k_diagonals[i - 1] = get_all_diagonals(W_k[i - 1]);
}
// Test ADD EPSILON
for (int i = 0; i < dimension - 1; i++)
{
for (int j = 0; j < dimensionSq; j++)
{
for (int k = 0; k < dimensionSq; k++)
{
W_k_diagonals[i][j][k] += epsilon;
}
}
}
// --------------- ENCODING ----------------
// Encode U_sigma diagonals
vector<Plaintext> U_sigma_diagonals_plain(dimensionSq);
cout << "\nEncoding U_sigma_diagonals...";
for (int i = 0; i < dimensionSq; i++)
{
ckks_encoder.encode(U_sigma_diagonals[i], scale, U_sigma_diagonals_plain[i]);
}
cout << "Done" << endl;
// Encode U_tau diagonals
vector<Plaintext> U_tau_diagonals_plain(dimensionSq);
cout << "\nEncoding U_tau_diagonals...";
for (int i = 0; i < dimensionSq; i++)
{
ckks_encoder.encode(U_tau_diagonals[i], scale, U_tau_diagonals_plain[i]);
}
cout << "Done" << endl;
// Encode V_k diagonals
vector<vector<Plaintext>> V_k_diagonals_plain(dimension - 1, vector<Plaintext>(dimensionSq));
cout << "\nEncoding V_K_diagonals...";
for (int i = 1; i < dimension; i++)
{
for (int j = 0; j < dimensionSq; j++)
{
ckks_encoder.encode(V_k_diagonals[i - 1][j], scale, V_k_diagonals_plain[i - 1][j]);
}
}
cout << "Done" << endl;
// Encode W_k
vector<vector<Plaintext>> W_k_diagonals_plain(dimension - 1, vector<Plaintext>(dimensionSq));
cout << "\nEncoding W_k_diagonals...";
for (int i = 1; i < dimension; i++)
{
for (int j = 0; j < dimensionSq; j++)
{
ckks_encoder.encode(W_k_diagonals[i - 1][j], scale, W_k_diagonals_plain[i - 1][j]);
}
}
cout << "Done" << endl;
// Encode Matrices
// Encode Matrix 1
vector<Plaintext> plain_matrix1_set1(dimension);
cout << "\nEncoding Matrix 1...";
for (int i = 0; i < dimension; i++)
{
ckks_encoder.encode(pod_matrix1_set1[i], scale, plain_matrix1_set1[i]);
}
cout << "Done" << endl;
// Encode Matrix 2
vector<Plaintext> plain_matrix2_set1(dimension);
cout << "\nEncoding Matrix 2...";
for (int i = 0; i < dimension; i++)
{
ckks_encoder.encode(pod_matrix2_set1[i], scale, plain_matrix2_set1[i]);
}
cout << "Done" << endl;
// --------------- ENCRYPTING ----------------
// Encrypt Matrix 1
vector<Ciphertext> cipher_matrix1_set1(dimension);
cout << "\nEncrypting Matrix 1...";
for (int i = 0; i < dimension; i++)
{
encryptor.encrypt(plain_matrix1_set1[i], cipher_matrix1_set1[i]);
}
cout << "Done" << endl;
// Encrypt Matrix 2
vector<Ciphertext> cipher_matrix2_set1(dimension);
cout << "\nEncrypting Matrix 2...";
for (int i = 0; i < dimension; i++)
{
encryptor.encrypt(plain_matrix2_set1[i], cipher_matrix2_set1[i]);
}
cout << "Done" << endl;
// --------------- MATRIX ENCODING ----------------
// Matrix Encode Matrix 1
cout << "\nMatrix Encoding Matrix 1...";
Ciphertext cipher_encoded_matrix1_set1 = C_Matrix_Encode(cipher_matrix1_set1, gal_keys, evaluator);
cout << "Done" << endl;
// Matrix Encode Matrix 2
cout << "\nMatrix Encoding Matrix 2...";
Ciphertext cipher_encoded_matrix2_set1 = C_Matrix_Encode(cipher_matrix2_set1, gal_keys, evaluator);
cout << "Done" << endl;
/*
// Test Matrix Encoding
Plaintext test_matrix_encoding;
decryptor.decrypt(cipher_encoded_matrix1_set1, test_matrix_encoding);
vector<double> test_matrix_encoding_result(dimensionSq);
ckks_encoder.decode(test_matrix_encoding, test_matrix_encoding_result);
cout << "Decoded Matrix : " << endl;
cout << "\t[";
for (int i = 0; i < dimensionSq - 1; i++)
{
cout << test_matrix_encoding_result[i] << ", ";
}
cout << test_matrix_encoding_result[dimensionSq - 1] << "]" << endl;
*/
// --------------- MATRIX MULTIPLICATION ----------------
cout << "\nMatrix Multiplication...";
cout << "test " << endl;
Ciphertext ct_result = CC_Matrix_Multiplication(cipher_encoded_matrix1_set1, cipher_encoded_matrix2_set1, dimension, U_sigma_diagonals_plain, U_tau_diagonals_plain, V_k_diagonals_plain, W_k_diagonals_plain, gal_keys, params);
cout << "Done" << endl;
// --------------- DECRYPT ----------------
Plaintext pt_result;
cout << "\nResult Decrypt...";
decryptor.decrypt(ct_result, pt_result);
cout << "Done" << endl;
// --------------- DECODE ----------------
vector<double> result_matrix;
cout << "\nResult Decode...";
ckks_encoder.decode(pt_result, result_matrix);
cout << "Done" << endl;
// print_partial_vector(result_matrix, result_matrix.size());
cout << "Resulting matrix: ";
for (int i = 0; i < dimensionSq; i++)
{
if (i % 4 == 0)
{
cout << "\n\t";
}
cout << result_matrix[i] << ", ";
}
cout << endl;
/*
cout << "------------ TESTING ------------" << endl;
vector<Ciphertext> ctA_result(dimension);
vector<Ciphertext> ctB_result(dimension);
cout << "----------Step 1----------- " << endl;
// Step 1-1
ctA_result[0] = Linear_Transform_Plain(cipher_encoded_matrix1_set1, U_sigma_diagonals_plain, gal_keys, params);
// Step 1-2
ctB_result[0] = Linear_Transform_Plain(cipher_encoded_matrix2_set1, U_tau_diagonals_plain, gal_keys, params);
// TEST CTA _ RESULT [0]
Plaintext cta_0;
decryptor.decrypt(ctA_result[0], cta_0);
vector<double> cta_0_res;
ckks_encoder.decode(cta_0, cta_0_res);
cout << "Resulting matrix cta[0]: ";
for (int i = 0; i < dimensionSq; i++)
{
if (i % 4 == 0)
{
cout << "\n\t";
}
cout << cta_0_res[i] << ", ";
}
cout << endl;
// TEST CTB _ RESULT [0]
Plaintext ctb_0;
decryptor.decrypt(ctB_result[0], ctb_0);
vector<double> ctb_0_res;
ckks_encoder.decode(ctb_0, ctb_0_res);
cout << "Resulting matrix ctb[0]: ";
for (int i = 0; i < dimensionSq; i++)
{
if (i % 4 == 0)
{
cout << "\n\t";
}
cout << ctb_0_res[i] << ", ";
}
cout << endl;
// Step 2
cout << "----------Step 2----------- " << endl;
for (int k = 1; k < dimension; k++)
{
cout << "Linear Transf at k = " << k;
ctA_result[k] = Linear_Transform_Plain(ctA_result[0], V_k_diagonals_plain[k - 1], gal_keys, params);
ctB_result[k] = Linear_Transform_Plain(ctB_result[0], W_k_diagonals_plain[k - 1], gal_keys, params);
cout << "..... Done" << endl;
}
// Step 3
cout << "----------Step 3----------- " << endl;
// Test Rescale
cout << "RESCALE--------" << endl;
for (int i = 1; i < dimension; i++)
{
evaluator.rescale_to_next_inplace(ctA_result[i]);
evaluator.rescale_to_next_inplace(ctB_result[i]);
}
Ciphertext ctAB;
evaluator.multiply(ctA_result[0], ctB_result[0], ctAB);
evaluator.mod_switch_to_next_inplace(ctAB);
// Manual scale set
for (int i = 1; i < dimension; i++)
{
ctA_result[i].scale() = pow(2, 80);
ctB_result[i].scale() = pow(2, 80);
}
for (int k = 1; k < dimension; k++)
{
cout << "Iteration k = " << k << endl;
Ciphertext temp_mul;
evaluator.multiply(ctA_result[k], ctB_result[k], temp_mul);
evaluator.add_inplace(ctAB, temp_mul);
}
*/
}
int main()
{
Matrix_Multiplication(8192 * 2, 4);
return 0;
}
| 17,039
|
C++
|
.cpp
| 452
| 31.517699
| 282
| 0.55969
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,659
|
5_rotation.cpp
|
MarwanNour_SEAL-FYP-Logistic-Regression/5_rotation.cpp
|
#include "seal/seal.h"
#include <iostream>
#include <iomanip>
using namespace std;
using namespace seal;
// Helper function that prints a vector of floats
template <typename T>
inline void print_vector(std::vector<T> vec, std::size_t print_size = 4, int prec = 3)
{
/*
Save the formatting information for std::cout.
*/
std::ios old_fmt(nullptr);
old_fmt.copyfmt(std::cout);
std::size_t slot_count = vec.size();
std::cout << std::fixed << std::setprecision(prec);
std::cout << std::endl;
if (slot_count <= 2 * print_size)
{
std::cout << " [";
for (std::size_t i = 0; i < slot_count; i++)
{
std::cout << " " << vec[i] << ((i != slot_count - 1) ? "," : " ]\n");
}
}
else
{
vec.resize(std::max(vec.size(), 2 * print_size));
std::cout << " [";
for (std::size_t i = 0; i < print_size; i++)
{
std::cout << " " << vec[i] << ",";
}
if (vec.size() > 2 * print_size)
{
std::cout << " ...,";
}
for (std::size_t i = slot_count - print_size; i < slot_count; i++)
{
std::cout << " " << vec[i] << ((i != slot_count - 1) ? "," : " ]\n");
}
}
std::cout << std::endl;
/*
Restore the old std::cout formatting.
*/
std::cout.copyfmt(old_fmt);
}
// Helper function that prints a matrix
template <typename T>
void print_matrix(vector<T> matrix, size_t row_size)
{
size_t print_size = 5;
cout << "\t[";
for (size_t i = 0; i < print_size; i++)
{
cout << matrix[i] << ", ";
}
cout << "...,";
for (size_t i = row_size - print_size; i < row_size; i++)
{
cout << matrix[i]
<< ((i != row_size - 1) ? ", " : " ]\n");
}
cout << "\t[";
for (size_t i = row_size; i < row_size + print_size; i++)
{
cout << matrix[i] << ", ";
}
cout << "...,";
for (size_t i = 2 * row_size - print_size; i < 2 * row_size; i++)
{
cout << matrix[i]
<< ((i != 2 * row_size - 1) ? ", " : " ]\n");
}
cout << endl;
}
void bfvRotation()
{
cout << "---------- Rotations in BFV -----------\n"
<< endl;
EncryptionParameters params(scheme_type::BFV);
size_t poly_modulus_degree = 8192;
params.set_poly_modulus_degree(poly_modulus_degree);
params.set_coeff_modulus(CoeffModulus::BFVDefault(poly_modulus_degree));
params.set_plain_modulus(PlainModulus::Batching(poly_modulus_degree, 20));
auto context = SEALContext::Create(params);
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
RelinKeys relin_keys = keygen.relin_keys();
Encryptor encryptor(context, pk);
Decryptor decryptor(context, sk);
Evaluator evaluator(context);
BatchEncoder encoder(context);
size_t slot_count = encoder.slot_count();
size_t row_size = slot_count / 2;
cout << "Plaintext Matrix row size: " << row_size << endl;
vector<uint64_t> pod_matrix(slot_count, 0ULL);
pod_matrix[0] = 0ULL;
pod_matrix[1] = 1ULL;
pod_matrix[2] = 2ULL;
pod_matrix[3] = 3ULL;
pod_matrix[row_size] = 4ULL;
pod_matrix[row_size + 1] = 5ULL;
pod_matrix[row_size + 2] = 6ULL;
pod_matrix[row_size + 3] = 7ULL;
cout << "Input plaintext matrix:" << endl;
print_matrix(pod_matrix, row_size);
Plaintext plain_matrix;
cout << "\nEncode and encrypt: " << endl;
encoder.encode(pod_matrix, plain_matrix);
Ciphertext cipher_matrix;
encryptor.encrypt(plain_matrix, cipher_matrix);
cout << "\t+ NOISE budget in cipher_matrix: " << decryptor.invariant_noise_budget(cipher_matrix) << " bits" << endl;
GaloisKeys gal_keys = keygen.galois_keys();
// Rotate matrix rows 3 steps to the left
cout << "\nRotate rows 3 steps left:" << endl;
evaluator.rotate_rows_inplace(cipher_matrix, 3, gal_keys);
cout << "\t+ NOISE budget after rotations: " << decryptor.invariant_noise_budget(cipher_matrix) << " bits" << endl;
cout << "\t+ Decrypt and decode: " << endl;
Plaintext plain_result;
decryptor.decrypt(cipher_matrix, plain_result);
encoder.decode(plain_result, pod_matrix);
print_matrix(pod_matrix, row_size);
// Rotate columns (swap rows)
cout << "\nRotate Columns (Swap the rows:" << endl;
evaluator.rotate_columns_inplace(cipher_matrix, gal_keys);
cout << "\t+ NOISE budget after rotations: " << decryptor.invariant_noise_budget(cipher_matrix) << " bits" << endl;
cout << "\t+ Decrypt and decode: " << endl;
decryptor.decrypt(cipher_matrix, plain_result);
encoder.decode(plain_result, pod_matrix);
print_matrix(pod_matrix, row_size);
// Rotate the rows 4 steps to the right
cout << "\nRotate rows 4 steps right: " << endl;
evaluator.rotate_rows_inplace(cipher_matrix, -4, gal_keys);
cout << "\t+ NOISE budget after rotations: " << decryptor.invariant_noise_budget(cipher_matrix) << " bits" << endl;
cout << "\t+ Decrypt and decode: " << endl;
decryptor.decrypt(cipher_matrix, plain_result);
encoder.decode(plain_result, pod_matrix);
print_matrix(pod_matrix, row_size);
}
void ckksRotation()
{
cout << "---------- Rotations in CKKS -----------\n"
<< endl;
EncryptionParameters parms(scheme_type::CKKS);
size_t poly_modulus_degree = 8192;
parms.set_poly_modulus_degree(poly_modulus_degree);
parms.set_coeff_modulus(CoeffModulus::Create(
poly_modulus_degree, {40, 40, 40, 40, 40}));
auto context = SEALContext::Create(parms);
cout << endl;
KeyGenerator keygen(context);
PublicKey public_key = keygen.public_key();
SecretKey secret_key = keygen.secret_key();
RelinKeys relin_keys = keygen.relin_keys();
GaloisKeys gal_keys = keygen.galois_keys();
Encryptor encryptor(context, public_key);
Evaluator evaluator(context);
Decryptor decryptor(context, secret_key);
CKKSEncoder ckks_encoder(context);
size_t slot_count = ckks_encoder.slot_count();
cout << "Number of slots: " << slot_count << endl;
vector<double> input;
input.reserve(slot_count);
double curr_point = 0;
double step_size = 1.0 / (static_cast<double>(slot_count) - 1);
for (size_t i = 0; i < slot_count; i++, curr_point += step_size)
{
input.push_back(curr_point);
}
cout << "Input vector:" << endl;
print_vector(input, 3, 7);
auto scale = pow(2.0, 50);
cout << "Encode and encrypt." << endl;
Plaintext plain;
ckks_encoder.encode(input, scale, plain);
Ciphertext encrypted;
encryptor.encrypt(plain, encrypted);
Ciphertext rotated;
cout << "Rotate 2 steps left." << endl;
evaluator.rotate_vector(encrypted, 2, gal_keys, rotated);
cout << " + Decrypt and decode ...... Correct." << endl;
decryptor.decrypt(rotated, plain);
vector<double> result;
ckks_encoder.decode(plain, result);
print_vector(result, 3, 7);
}
int main()
{
bfvRotation();
ckksRotation();
return 0;
}
| 7,105
|
C++
|
.cpp
| 195
| 31.020513
| 120
| 0.606078
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,660
|
logistic_regression.cpp
|
MarwanNour_SEAL-FYP-Logistic-Regression/logistic_regression.cpp
|
#include <iostream>
#include <iomanip>
#include <fstream>
#include <unistd.h>
#include <cmath>
#include <vector>
#include <string.h>
using namespace std;
// Dot Product
float vector_dot_product(vector<float> vec_A, vector<float> vec_B)
{
if (vec_A.size() != vec_B.size())
{
cerr << "Vector size mismatch" << endl;
exit(1);
}
float result = 0;
for (unsigned int i = 0; i < vec_A.size(); i++)
{
result += vec_A[i] * vec_B[i];
}
return result;
}
// Matrix Transpose
vector<vector<float>> transpose_matrix(vector<vector<float>> input_matrix)
{
int rowSize = input_matrix.size();
int colSize = input_matrix[0].size();
vector<vector<float>> transposed(colSize, vector<float>(rowSize));
for (int i = 0; i < rowSize; i++)
{
for (int j = 0; j < colSize; j++)
{
transposed[j][i] = input_matrix[i][j];
}
}
return transposed;
}
// Linear Transformation (or Matrix * Vector)
vector<float> linear_transformation(vector<vector<float>> input_matrix, vector<float> input_vec)
{
int rowSize = input_matrix.size();
int colSize = input_matrix[0].size();
if (colSize != input_vec.size())
{
cerr << "Matrix Vector sizes error" << endl;
exit(EXIT_FAILURE);
}
vector<float> result_vec(rowSize);
for (int i = 0; i < input_matrix.size(); i++)
{
result_vec[i] = vector_dot_product(input_matrix[i], input_vec);
}
return result_vec;
}
// Sigmoid
float sigmoid(float z)
{
return 1 / (1 + exp(-z));
}
// Predict
vector<float> predict(vector<vector<float>> features, vector<float> weights)
{
vector<float> lintransf_vec = linear_transformation(features, weights);
vector<float> result_sigmoid_vec(features.size());
for (int i = 0; i < result_sigmoid_vec.size(); i++)
{
result_sigmoid_vec[i] = sigmoid(lintransf_vec[i]);
// DEBUG
// cout << "lintransf_vec[i] = " << lintransf_vec[i] << endl;
// cout << "result_sigmoid_vec[i] = " << result_sigmoid_vec[i] << endl;
// if (i == 10)
// {
// exit(0);
// }
}
return result_sigmoid_vec;
}
// Cost Function
float cost_function(vector<vector<float>> features, vector<float> labels, vector<float> weights)
{
int observations = labels.size();
vector<float> predictions = predict(features, weights);
vector<float> cost_result_vec(observations);
float cost_sum = 0;
for (int i = 0; i < observations; i++)
{
// Handle Prediction = 1 issue: Epsilon subtraction
float epsilon = 0.0001;
if (predictions[i] == 1)
{
predictions[i] -= epsilon;
}
// Calculate Cost 0 and 1
float cost0 = (1.0 - labels[i]) * log(1.0 - predictions[i]);
float cost1 = (-labels[i]) * log(predictions[i]);
cost_result_vec[i] = cost1 - cost0;
cost_sum += cost_result_vec[i];
// Log Progress
if (i % 2000 == 0)
{
cout << "i = " << i << "\t\t";
cout << "labels[i] = " << labels[i] << "\t\t";
cout << "predictions[i] = " << predictions[i] << "\t\t";
cout << "cost 0 = " << cost0 << "\t\t";
cout << "cost 1 = " << cost1 << "\t\t";
cout << "cost sum = " << cost_sum << endl;
}
// // DEBUG
// if (i == 100)
// {
// exit(0);
// }
}
float cost_result = cost_sum / observations;
return cost_result;
}
// Gradient Descent (or Update Weights)
vector<float> update_weights(vector<vector<float>> features, vector<float> labels, vector<float> weights, float learning_rate)
{
vector<float> new_weights(weights.size());
int N = features.size();
// Get predictions
vector<float> predictions = predict(features, weights);
// Tranpose features matrix
vector<vector<float>> features_T = transpose_matrix(features);
// Calculate Predictions - Labels vector
vector<float> pred_labels(labels.size());
for (int i = 0; i < labels.size(); i++)
{
pred_labels[i] = predictions[i] - labels[i];
}
// Calculate Gradient vector
vector<float> gradient = linear_transformation(features_T, pred_labels);
for (int i = 0; i < gradient.size(); i++)
{
// Divide by N to get average
gradient[i] /= N;
// Multiply by learning rate
gradient[i] *= learning_rate;
// Subtract from weights to minimize cost
new_weights[i] = weights[i] - gradient[i];
}
return new_weights;
}
// Training
tuple<vector<float>, vector<float>> train(vector<vector<float>> features, vector<float> labels, vector<float> weights, float learning_rate, int iters)
{
int colSize = weights.size();
vector<float> new_weights(colSize);
vector<float> cost_history(iters);
// Set temp weights
vector<float> temp_weights(colSize);
for (int i = 0; i < colSize; i++)
{
temp_weights[i] = weights[i];
}
for (int i = 0; i < iters; i++)
{
// Get new weights
new_weights = update_weights(features, labels, temp_weights, learning_rate);
// Get cost
float cost = cost_function(features, labels, new_weights);
cost_history[i] = cost;
// Log Progress
if (i % 100 == 0)
{
cout << "Iteration:\t" << i << "\t" << cost << endl;
cout << "Weights: ";
for (int i = 0; i < colSize; i++)
{
cout << new_weights[i] << ", ";
}
cout << endl;
}
// Set temp weights to new weights
for (int j = 0; j < colSize; j++)
{
temp_weights[j] = new_weights[j];
}
}
return make_tuple(new_weights, cost_history);
}
// CSV to string matrix converter
vector<vector<string>> CSVtoMatrix(string filename)
{
vector<vector<string>> result_matrix;
ifstream data(filename);
string line;
int line_count = 0;
while (getline(data, line))
{
stringstream lineStream(line);
string cell;
vector<string> parsedRow;
while (getline(lineStream, cell, ','))
{
parsedRow.push_back(cell);
}
// Skip first line since it has text instead of numbers
if (line_count != 0)
{
result_matrix.push_back(parsedRow);
}
line_count++;
}
return result_matrix;
}
// String matrix to float matrix converter
vector<vector<float>> stringToFloatMatrix(vector<vector<string>> matrix)
{
vector<vector<float>> result(matrix.size(), vector<float>(matrix[0].size()));
for (int i = 0; i < matrix.size(); i++)
{
for (int j = 0; j < matrix[0].size(); j++)
{
result[i][j] = ::atof(matrix[i][j].c_str());
}
}
return result;
}
// Mean calculation
float getMean(vector<float> input_vec)
{
float mean = 0;
for (int i = 0; i < input_vec.size(); i++)
{
mean += input_vec[i];
}
mean /= input_vec.size();
return mean;
}
// Standard Dev calculation
float getStandardDev(vector<float> input_vec, float mean)
{
float variance = 0;
for (int i = 0; i < input_vec.size(); i++)
{
variance += pow(input_vec[i] - mean, 2);
}
variance /= input_vec.size();
float standard_dev = sqrt(variance);
return standard_dev;
}
// Standard Scaler
vector<vector<float>> standard_scaler(vector<vector<float>> input_matrix)
{
int rowSize = input_matrix.size();
int colSize = input_matrix[0].size();
vector<vector<float>> result_matrix(rowSize, vector<float>(colSize));
// Optimization: Get Means and Standard Devs first then do the scaling
// first pass: get means and standard devs
vector<float> means_vec(colSize);
vector<float> stdev_vec(colSize);
for (int i = 0; i < colSize; i++)
{
vector<float> column(rowSize);
for (int j = 0; j < rowSize; j++)
{
// cout << input_matrix[j][i] << ", ";
column[j] = input_matrix[j][i];
// cout << column[j] << ", ";
}
means_vec[i] = getMean(column);
stdev_vec[i] = getStandardDev(column, means_vec[i]);
// cout << "MEAN at i = " << i << ":\t" << means_vec[i] << endl;
// cout << "STDV at i = " << i << ":\t" << stdev_vec[i] << endl;
}
// second pass: scale
for (int i = 0; i < rowSize; i++)
{
for (int j = 0; j < colSize; j++)
{
result_matrix[i][j] = (input_matrix[i][j] - means_vec[j]) / stdev_vec[j];
// cout << "RESULT at i = " << i << ":\t" << result_matrix[i][j] << endl;
}
}
return result_matrix;
}
float accuracy(vector<float> predicted_labels, vector<float> actual_labels)
{
// handle error
if (predicted_labels.size() != actual_labels.size())
{
cerr << "Vector size mismatch" << endl;
exit(EXIT_FAILURE);
}
int size = predicted_labels.size();
vector<float> diff(size);
int nnz = 0;
for (int i = 0; i < size; i++)
{
diff[i] = predicted_labels[i] - actual_labels[i];
// count non zero in diff
if (diff[i] != 0)
{
nnz++;
}
}
float result = 1.0 - (nnz / size);
return result;
}
float RandomFloat(float a, float b)
{
float random = ((float)rand()) / (float)RAND_MAX;
float diff = b - a;
float r = random * diff;
return a + r;
}
int main()
{
// Read File
string filename = "pulsar_stars.csv";
vector<vector<string>> s_matrix = CSVtoMatrix(filename);
vector<vector<float>> f_matrix = stringToFloatMatrix(s_matrix);
// Test print first 10 rows
cout << "First 10 rows of CSV file --------\n"
<< endl;
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < f_matrix[0].size(); j++)
{
cout << f_matrix[i][j] << ", ";
}
cout << endl;
}
cout << "...........\nLast 10 rows of CSV file ----------\n"
<< endl;
// Test print last 10 rows
for (int i = f_matrix.size() - 10; i < f_matrix.size(); i++)
{
for (int j = 0; j < f_matrix[0].size(); j++)
{
cout << f_matrix[i][j] << ", ";
}
cout << endl;
}
// Init features, labels and weights
// Init features (rows of f_matrix , cols of f_matrix - 1)
int rows = f_matrix.size();
cout << "\nNumber of rows = " << rows << endl;
int cols = f_matrix[0].size() - 1;
cout << "\nNumber of cols = " << cols << endl;
vector<vector<float>> features(rows, vector<float>(cols));
// Init labels (rows of f_matrix)
vector<float> labels(rows);
// Init weight vector with zeros (cols of features)
vector<float> weights(cols);
// Fill the features matrix and labels vector
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++)
{
features[i][j] = f_matrix[i][j];
}
labels[i] = f_matrix[i][cols];
}
// Fill the weights with random numbers (from 1 - 2)
for (int i = 0; i < cols; i++)
{
weights[i] = RandomFloat(-2, 2);
cout << "weights[i] = " << weights[i] << endl;
}
// Test print the features and labels
cout << "\nTesting features\n--------------\n"
<< endl;
// Features Print test
cout << "Features row size = " << features.size() << endl;
cout << "Features col size = " << features[0].size() << endl;
cout << "Labels row size = " << labels.size() << endl;
cout << "Weights row size = " << weights.size() << endl;
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < features[0].size(); j++)
{
cout << features[i][j] << ", ";
}
cout << endl;
}
// Standardize the features
cout << "\nSTANDARDIZE TEST---------\n"
<< endl;
vector<vector<float>> standard_features = standard_scaler(features);
// Test print first 10 rows
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < cols; j++)
{
cout << standard_features[i][j] << ", ";
}
cout << endl;
}
cout << "..........." << endl;
// Test print last 10 rows
for (int i = rows - 10; i < rows; i++)
{
for (int j = 0; j < cols; j++)
{
cout << standard_features[i][j] << ", ";
}
cout << endl;
}
cout << "\nTesting labels\n--------------\n"
<< endl;
// Labels Print Test
for (int i = 0; i < 10; i++)
{
cout << labels[i] << ", ";
}
cout << endl;
// TRAIN
cout << "\nTraining--------------\n"
<< endl;
tuple<vector<float>, vector<float>> training_tuple = train(standard_features, labels, weights, 0.1, 100);
vector<float> new_weights = get<0>(training_tuple);
vector<float> cost_history = get<1>(training_tuple);
// Print old weights
cout << "\nOLD WEIGHTS\n------------------"
<< endl;
for (int i = 0; i < weights.size(); i++)
{
cout << weights[i] << ", ";
}
cout << endl;
// Print mew weights
cout << "\nNEW WEIGHTS\n------------------"
<< endl;
for (int i = 0; i < new_weights.size(); i++)
{
cout << new_weights[i] << ", ";
}
cout << endl;
// Print Cost history
cout << "\nCOST HISTORY\n------------------"
<< endl;
for (int i = 0; i < cost_history.size(); i++)
{
cout << cost_history[i] << ", ";
if (i % 10 == 0 && i > 0)
{
cout << "\n";
}
}
cout << endl;
// Print Accuracy
cout << "\nACCURACY\n-------------------" << endl;
return 0;
}
| 13,827
|
C++
|
.cpp
| 448
| 24.493304
| 150
| 0.539278
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,661
|
4_ckks.cpp
|
MarwanNour_SEAL-FYP-Logistic-Regression/4_ckks.cpp
|
#include "seal/seal.h"
#include <iostream>
#include <iomanip>
using namespace std;
using namespace seal;
// Helper function that prints a vector of floats
template <typename T>
inline void print_vector(std::vector<T> vec, std::size_t print_size = 4, int prec = 3)
{
/*
Save the formatting information for std::cout.
*/
std::ios old_fmt(nullptr);
old_fmt.copyfmt(std::cout);
std::size_t slot_count = vec.size();
std::cout << std::fixed << std::setprecision(prec);
std::cout << std::endl;
if (slot_count <= 2 * print_size)
{
std::cout << " [";
for (std::size_t i = 0; i < slot_count; i++)
{
std::cout << " " << vec[i] << ((i != slot_count - 1) ? "," : " ]\n");
}
}
else
{
vec.resize(std::max(vec.size(), 2 * print_size));
std::cout << " [";
for (std::size_t i = 0; i < print_size; i++)
{
std::cout << " " << vec[i] << ",";
}
if (vec.size() > 2 * print_size)
{
std::cout << " ...,";
}
for (std::size_t i = slot_count - print_size; i < slot_count; i++)
{
std::cout << " " << vec[i] << ((i != slot_count - 1) ? "," : " ]\n");
}
}
std::cout << std::endl;
/*
Restore the old std::cout formatting.
*/
std::cout.copyfmt(old_fmt);
}
int main()
{
cout << "------- CKKS ---------\n"
<< endl;
// Set up the parameters
EncryptionParameters params(scheme_type::CKKS);
size_t poly_modulus_degree = 8192;
params.set_poly_modulus_degree(poly_modulus_degree);
params.set_coeff_modulus(CoeffModulus::Create(poly_modulus_degree, {60, 40, 40, 60}));
double scale = pow(2.0, 40);
auto context = SEALContext::Create(params);
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
RelinKeys relin_keys = keygen.relin_keys();
Encryptor encryptor(context, pk);
Decryptor decryptor(context, sk);
Evaluator evaluator(context);
CKKSEncoder encoder(context);
size_t slot_count = encoder.slot_count();
cout << "Number of slots: " << slot_count << endl;
vector<double> input_vec;
input_vec.reserve(slot_count);
double curr_point = 0;
double step_size = 1.0 / (static_cast<double>(slot_count) - 1);
for (size_t i = 0; i < slot_count; i++, curr_point += step_size)
{
input_vec.push_back(curr_point);
}
cout << "Input Vector: " << endl;
print_vector(input_vec, 3, 7);
cout << "Evaluating polynomial PI*x^3 + 0.4x + 1 :\n"
<< endl;
// Create Plaintexts and encode them in CKKSEncoder
Plaintext plain_coeff3, plain_coeff1, plain_coeff0;
encoder.encode(3.14159265, scale, plain_coeff3);
encoder.encode(0.4, scale, plain_coeff1);
encoder.encode(1.0, scale, plain_coeff0);
Plaintext x_plain;
cout << "Encode input vectors" << endl;
encoder.encode(input_vec, scale, x_plain);
Ciphertext x1_encrypted;
encryptor.encrypt(x_plain, x1_encrypted);
// To compute x^3, we need to compute first x^2 and relinearize.
Ciphertext x3_encrypted;
cout << "Compute x^2 and relinearize:" << endl;
evaluator.square(x1_encrypted, x3_encrypted);
evaluator.relinearize_inplace(x3_encrypted, relin_keys);
cout << "\t+ Scale of x^2 before rescale: " << log2(x3_encrypted.scale()) << " bits" << endl;
// Rescale
cout << "Rescale x^2: " << endl;
evaluator.rescale_to_next_inplace(x3_encrypted);
cout << "\t+ Scale of x^2 after rescale: " << log2(x3_encrypted.scale()) << " bits" << endl;
// Compute PI*x and rescale
cout << "Compute and rescale PI*x" << endl;
Ciphertext x1_encrypted_coeff3;
evaluator.multiply_plain(x1_encrypted, plain_coeff3, x1_encrypted_coeff3);
cout << "\t+ Scale of PI*x before rescale: " << log2(x1_encrypted_coeff3.scale()) << " bits" << endl;
evaluator.rescale_to_next_inplace(x1_encrypted_coeff3);
cout << "\t+ Scale of PI*x after rescale: " << log2(x1_encrypted_coeff3.scale()) << " bits" << endl;
// Compute, relin and rescale (PI*x)*x^2
cout << "Compute, relin, and rescale (PI*x)*x^2" << endl;
evaluator.multiply_inplace(x3_encrypted, x1_encrypted_coeff3);
evaluator.relinearize_inplace(x3_encrypted, relin_keys);
cout << "\t+ Scale of PI*x^3 before rescale: " << log2(x3_encrypted.scale()) << " bits" << endl;
evaluator.rescale_to_next_inplace(x3_encrypted);
cout << "\t+ Scale of PI*x^3 after rescale: " << log2(x3_encrypted.scale()) << " bits" << endl;
// Compute and rescale 0.4*x
cout << "Compute and rescale 0.4*x" << endl;
evaluator.multiply_plain_inplace(x1_encrypted, plain_coeff1);
cout << "\t+ Scale of 0.4*x before rescale: " << log2(x1_encrypted.scale()) << " bits" << endl;
evaluator.rescale_to_next_inplace(x1_encrypted);
cout << "\t+ Scale of 0.4*x after rescale: " << log2(x1_encrypted.scale()) << " bits" << endl;
cout << "\nParameters use by all three terms are different:" << endl;
cout << "\t+ Modulus chain index for x3_encrypted: "
<< context->get_context_data(x3_encrypted.parms_id())->chain_index() << endl;
cout << "\t+ Modulus chain index for x1_encrypted: "
<< context->get_context_data(x1_encrypted.parms_id())->chain_index() << endl;
cout << "\t+ Modulus chain index for plain_coeff0: "
<< context->get_context_data(plain_coeff0.parms_id())->chain_index() << endl;
cout << endl;
/*
Let us carefully consider what the scales are at this point. We denote the
primes in coeff_modulus as P_0, P_1, P_2, P_3, in this order. P_3 is used as
the special modulus and is not involved in rescalings. After the computations
above the scales in ciphertexts are:
- Product x^2 has scale 2^80 and is at level 2;
- Product PI*x has scale 2^80 and is at level 2;
- We rescaled both down to scale 2^80/P_2 and level 1;
- Product PI*x^3 has scale (2^80/P_2)^2;
- We rescaled it down to scale (2^80/P_2)^2/P_1 and level 0;
- Product 0.4*x has scale 2^80;
- We rescaled it down to scale 2^80/P_2 and level 1;
- The contant term 1 has scale 2^40 and is at level 2.
Although the scales of all three terms are approximately 2^40, their exact
values are different, hence they cannot be added together.
*/
cout << "The exact scales of all three terms are different:" << endl;
ios old_fmt(nullptr);
old_fmt.copyfmt(cout);
cout << fixed << setprecision(10);
cout << " + Exact scale in PI*x^3: " << x3_encrypted.scale() << endl;
cout << " + Exact scale in 0.4*x: " << x1_encrypted.scale() << endl;
cout << " + Exact scale in 1: " << plain_coeff0.scale() << endl;
cout << endl;
cout.copyfmt(old_fmt);
/*
There are many ways to fix this problem. Since P_2 and P_1 are really close
to 2^40, we can simply "lie" to Microsoft SEAL and set the scales to be the
same. For example, changing the scale of PI*x^3 to 2^40 simply means that we
scale the value of PI*x^3 by 2^120/(P_2^2*P_1), which is very close to 1.
This should not result in any noticeable error.
Another option would be to encode 1 with scale 2^80/P_2, do a multiply_plain
with 0.4*x, and finally rescale. In this case we would need to additionally
make sure to encode 1 with appropriate encryption parameters (parms_id).
In this example we will use the first (simplest) approach and simply change
the scale of PI*x^3 and 0.4*x to 2^40.
*/
cout << "Normalize scales to 2^40" << endl;
x3_encrypted.scale() = pow(2.0, 40);
x1_encrypted.scale() = pow(2.0, 40);
/*
We still have a problem with mismatching encryption parameters. This is easy
to fix by using traditional modulus switching (no rescaling). CKKS supports
modulus switching just like the BFV scheme, allowing us to switch away parts
of the coefficient modulus when it is simply not needed.
*/
cout << "Normalize encryption parameters to the lowest levvel" << endl;
parms_id_type last_parms_id = x3_encrypted.parms_id();
evaluator.mod_switch_to_inplace(x1_encrypted, last_parms_id);
evaluator.mod_switch_to_inplace(plain_coeff0, last_parms_id);
// All three ciphertexts are now compatible and can be added
cout << "Compute PI*x^3 + 0.4*x + 1" << endl;
Ciphertext encrypted_result;
evaluator.add(x3_encrypted, x1_encrypted, encrypted_result);
evaluator.add_plain_inplace(encrypted_result, plain_coeff0);
// Print the true result
cout << "Decrypt and decode PI*x^3 + 0.4*x + 1" << endl;
cout << "\t+ Expected result: " << endl;
vector<double> true_result;
for (size_t i = 0; i < input_vec.size(); i++)
{
double x = input_vec[i];
true_result.push_back((3.14159265 * x * x + 0.4) * x + 1);
}
print_vector(true_result, 3, 7);
// Decrypt and decode
Plaintext plain_result;
decryptor.decrypt(encrypted_result, plain_result);
vector<double> result;
encoder.decode(plain_result, result);
cout << "\t+ Computed result: " << endl;
print_vector(result, 3, 7);
return 0;
}
| 9,328
|
C++
|
.cpp
| 204
| 39.990196
| 105
| 0.63272
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,663
|
logistic_regression_ckks.cpp
|
MarwanNour_SEAL-FYP-Logistic-Regression/logistic_regression_ckks.cpp
|
#include <iostream>
#include <iomanip>
#include <fstream>
#include "seal/seal.h"
#include "helper.h"
using namespace std;
using namespace seal;
#define POLY_MOD_DEGREE 16384
#define DEGREE 3
#define ITERS 10
#define LEARNING_RATE 0.1
template <typename T>
vector<T> rotate_vec(vector<T> input_vec, int num_rotations)
{
if (num_rotations > input_vec.size())
{
cerr << "Invalid number of rotations" << endl;
exit(EXIT_FAILURE);
}
vector<T> rotated_res(input_vec.size());
for (int i = 0; i < input_vec.size(); i++)
{
rotated_res[i] = input_vec[(i + num_rotations) % (input_vec.size())];
}
return rotated_res;
}
void print_Ciphertext_Info(string ctx_name, Ciphertext ctx, shared_ptr<SEALContext> context)
{
cout << "/" << endl;
cout << "| " << ctx_name << " Info:" << endl;
cout << "|\tLevel:\t" << context->get_context_data(ctx.parms_id())->chain_index() << endl;
cout << "|\tScale:\t" << log2(ctx.scale()) << endl;
ios old_fmt(nullptr);
old_fmt.copyfmt(cout);
cout << fixed << setprecision(10);
cout << "|\tExact Scale:\t" << ctx.scale() << endl;
cout.copyfmt(old_fmt);
cout << "|\tSize:\t" << ctx.size() << endl;
cout << "\\" << endl;
}
// Sigmoid
float sigmoid(float z)
{
return 1 / (1 + exp(-z));
}
// Tree Method
Ciphertext Tree_cipher(Ciphertext ctx, int degree, double scale, vector<double> coeffs, CKKSEncoder &ckks_encoder, Evaluator &evaluator, Encryptor &encryptor, RelinKeys relin_keys, EncryptionParameters params)
{
cout << "->" << __func__ << endl;
SEALContext context(params);
auto tmp = make_shared<SEALContext>(context);
// Print Ciphertext Information
print_Ciphertext_Info("CTX", ctx, tmp);
int depth = ceil(log2(degree));
// Form the polynomial
vector<Plaintext> plain_coeffs(degree + 1);
cout << "Polynomial = ";
int counter = 0;
for (size_t i = 0; i < degree + 1; i++)
{
// cout << "-> " << __LINE__ << endl;
if (coeffs[i] == 0)
{
continue;
}
ckks_encoder.encode(coeffs[i], scale, plain_coeffs[i]);
cout << "x^" << counter << " * (" << coeffs[i] << ")"
<< ", ";
counter++;
}
cout << endl;
Plaintext plain_result;
vector<double> result;
double expected_result = coeffs[degree];
// Compute all powers
vector<Ciphertext> powers(degree + 1);
compute_all_powers(ctx, degree, evaluator, relin_keys, powers);
cout << "All powers computed " << endl;
// Print Ciphertext Information
print_Ciphertext_Info("CTX", ctx, tmp);
// Encrypt First Coefficient
Ciphertext enc_result;
cout << "Encrypt first coeff...";
encryptor.encrypt(plain_coeffs[0], enc_result);
cout << "Done" << endl;
// Print Ciphertext Information
print_Ciphertext_Info("enc_result", enc_result, tmp);
Ciphertext temp;
for (int i = 1; i <= degree; i++)
{
// cout << "-> " << __LINE__ << endl;
evaluator.mod_switch_to_inplace(plain_coeffs[i], powers[i].parms_id());
// cout << "-> " << __LINE__ << endl;
evaluator.multiply_plain(powers[i], plain_coeffs[i], temp);
// cout << "-> " << __LINE__ << endl;
evaluator.rescale_to_next_inplace(temp);
// cout << "-> " << __LINE__ << endl;
evaluator.mod_switch_to_inplace(enc_result, temp.parms_id());
// cout << "-> " << __LINE__ << endl;
// Manual Rescale
enc_result.scale() = pow(2.0, (int)log2(enc_result.scale()));
temp.scale() = pow(2.0, (int)log2(enc_result.scale()));
// cout << "-> " << __LINE__ << endl;
evaluator.add_inplace(enc_result, temp);
}
// Print Ciphertext Information
print_Ciphertext_Info("enc_result", enc_result, tmp);
return enc_result;
}
Ciphertext Horner_cipher(Ciphertext ctx, int degree, vector<double> coeffs, CKKSEncoder &ckks_encoder, double scale, Evaluator &evaluator, Encryptor &encryptor, RelinKeys relin_keys, EncryptionParameters params)
{
SEALContext context(params);
auto tmp = make_shared<SEALContext>(context);
cout << "->" << __func__ << endl;
cout << "->" << __LINE__ << endl;
print_Ciphertext_Info("CTX", ctx, tmp);
vector<Plaintext> plain_coeffs(degree + 1);
// Random Coefficients from 0-1
cout << "Polynomial = ";
int counter = 0;
for (size_t i = 0; i < degree + 1; i++)
{
// coeffs[i] = (double)rand() / RAND_MAX;
ckks_encoder.encode(coeffs[i], scale, plain_coeffs[i]);
cout << "x^" << counter << " * (" << coeffs[i] << ")"
<< ", ";
counter++;
}
cout << endl;
// cout << "->" << __LINE__ << endl;
Ciphertext temp;
encryptor.encrypt(plain_coeffs[degree], temp);
Plaintext plain_result;
vector<double> result;
// cout << "->" << __LINE__ << endl;
for (int i = degree - 1; i >= 0; i--)
{
int ctx_level = tmp->get_context_data(ctx.parms_id())->chain_index();
int temp_level = tmp->get_context_data(temp.parms_id())->chain_index();
if (ctx_level > temp_level)
{
evaluator.mod_switch_to_inplace(ctx, temp.parms_id());
}
else if (ctx_level < temp_level)
{
evaluator.mod_switch_to_inplace(temp, ctx.parms_id());
}
evaluator.multiply_inplace(temp, ctx);
// cout << "->" << __LINE__ << endl;
evaluator.relinearize_inplace(temp, relin_keys);
evaluator.rescale_to_next_inplace(temp);
// cout << "->" << __LINE__ << endl;
evaluator.mod_switch_to_inplace(plain_coeffs[i], temp.parms_id());
// Manual rescale
temp.scale() = pow(2.0, 40);
// cout << "->" << __LINE__ << endl;
evaluator.add_plain_inplace(temp, plain_coeffs[i]);
}
// cout << "->" << __LINE__ << endl;
print_Ciphertext_Info("temp", temp, tmp);
return temp;
}
// Predict Ciphertext Weights
Ciphertext predict_cipher_weights(vector<Ciphertext> features, Ciphertext weights, int num_weights, double scale, Evaluator &evaluator, CKKSEncoder &ckks_encoder, GaloisKeys gal_keys, RelinKeys relin_keys, Encryptor &encryptor, EncryptionParameters params)
{
cout << "->" << __func__ << endl;
cout << "->" << __LINE__ << endl;
// Linear Transformation (loop over rows and dot product)
int num_rows = features.size();
vector<Ciphertext> results(num_rows);
for (int i = 0; i < num_rows; i++)
{
// Dot Product
results[i] = cipher_dot_product(features[i], weights, num_weights, relin_keys, gal_keys, evaluator);
// Create mask
vector<double> mask_vec(num_rows, 0);
mask_vec[i] = 1;
Plaintext mask_pt;
ckks_encoder.encode(mask_vec, scale, mask_pt);
// Bring down mask by 1 level since dot product consumed 1 level
evaluator.mod_switch_to_next_inplace(mask_pt);
// Multiply result with mask
evaluator.multiply_plain_inplace(results[i], mask_pt);
}
// Add all results to ciphertext vec
Ciphertext lintransf_vec;
evaluator.add_many(results, lintransf_vec);
cout << "->" << __LINE__ << endl;
// Relin
evaluator.relinearize_inplace(lintransf_vec, relin_keys);
// Rescale
evaluator.rescale_to_next_inplace(lintransf_vec);
// Manual Rescale
lintransf_vec.scale() = pow(2, (int)log2(lintransf_vec.scale()));
cout << "->" << __LINE__ << endl;
// Sigmoid over result
vector<double> coeffs;
if (DEGREE == 3)
{
coeffs = {0.5, 1.20069, 0.00001, -0.81562};
}
else if (DEGREE == 5)
{
coeffs = {0.5, 1.53048, 0.00001, -2.3533056, 0.00001, 1.3511295};
}
else if (DEGREE == 7)
{
coeffs = {0.5, 1.73496, 0.00001, -4.19407, 0.00001, 5.43402, 0.00001, -2.50739};
}
else
{
cerr << "Invalid DEGREE" << endl;
exit(EXIT_FAILURE);
}
Ciphertext predict_res = Horner_cipher(lintransf_vec, coeffs.size() - 1, coeffs, ckks_encoder, scale, evaluator, encryptor, relin_keys, params);
cout << "->" << __LINE__ << endl;
return predict_res;
}
// Update Weights (or Gradient Descent)
Ciphertext update_weights(vector<Ciphertext> features, vector<Ciphertext> features_T, Ciphertext labels, Ciphertext weights, float learning_rate, Evaluator &evaluator, CKKSEncoder &ckks_encoder, GaloisKeys gal_keys, RelinKeys relin_keys, Encryptor &encryptor, double scale, EncryptionParameters params)
{
cout << "->" << __func__ << endl;
cout << "->" << __LINE__ << endl;
int num_observations = features.size();
int num_weights = features_T.size();
cout << "num obs = " << num_observations << endl;
cout << "num weights = " << num_weights << endl;
// Get predictions
Ciphertext predictions = predict_cipher_weights(features, weights, num_weights, scale, evaluator, ckks_encoder, gal_keys, relin_keys, encryptor, params);
// Calculate Predictions - Labels
// Mod switch labels
evaluator.mod_switch_to_inplace(labels, predictions.parms_id());
Ciphertext pred_labels;
evaluator.sub(predictions, labels, pred_labels);
cout << "->" << __LINE__ << endl;
// Calculate Gradient vector (loop over rows and dot product)
vector<Ciphertext> gradient_results(num_weights);
for (int i = 0; i < num_weights; i++)
{
// Mod switch features T [i]
evaluator.mod_switch_to_inplace(features_T[i], pred_labels.parms_id());
gradient_results[i] = cipher_dot_product(features_T[i], pred_labels, num_observations, relin_keys, gal_keys, evaluator);
// Create mask
vector<double> mask_vec(num_weights, 0);
mask_vec[i] = 1;
Plaintext mask_pt;
ckks_encoder.encode(mask_vec, scale, mask_pt);
// Mod switch mask
evaluator.mod_switch_to_inplace(mask_pt, gradient_results[i].parms_id());
// Multiply result with mask
evaluator.multiply_plain_inplace(gradient_results[i], mask_pt);
}
cout << "->" << __LINE__ << endl;
// Add all gradient results to gradient
Ciphertext gradient;
evaluator.add_many(gradient_results, gradient);
// Relin
evaluator.relinearize_inplace(gradient, relin_keys);
// Rescale
evaluator.rescale_to_next_inplace(gradient);
// Manual rescale
gradient.scale() = pow(2, (int)log2(gradient.scale()));
// Multiply by learning_rate/observations
double N = learning_rate / num_observations;
cout << "LR / num_obs = " << N << endl;
Plaintext N_pt;
ckks_encoder.encode(N, scale, N_pt);
// Mod Switch N_pt
evaluator.mod_switch_to_inplace(N_pt, gradient.parms_id());
cout << "->" << __LINE__ << endl;
evaluator.multiply_plain_inplace(gradient, N_pt); // ERROR HERE: CIPHERTEXT IS TRANSPARENT
// I fixed this error, just change "ckks_encoder.encode(N, N_pt);" to "ckks_encoder.encode(N, scale, N_pt);", line 331
// Subtract from weights
Ciphertext new_weights;
evaluator.sub(gradient, weights, new_weights);
evaluator.negate_inplace(new_weights);
return new_weights;
}
// Train model function
Ciphertext train_cipher(vector<Ciphertext> features, vector<Ciphertext> features_T, Ciphertext labels, Ciphertext weights, float learning_rate, int iters, int observations, int num_weights, Evaluator &evaluator, CKKSEncoder &ckks_encoder, double scale, GaloisKeys gal_keys, RelinKeys relin_keys, Encryptor &encryptor, Decryptor &decryptor, EncryptionParameters params)
{
cout << "->" << __func__ << endl;
cout << "->" << __LINE__ << endl;
// Copy weights to new_weights
Ciphertext new_weights = weights;
for (int i = 0; i < iters; i++)
{
// Get new weights
new_weights = update_weights(features, features_T, labels, new_weights, learning_rate, evaluator, ckks_encoder, gal_keys, relin_keys, encryptor, scale, params);
// Refresh weights (Decrypt and Re-Encrypt)
Plaintext new_weights_pt;
decryptor.decrypt(new_weights, new_weights_pt);
vector<double> new_weights_decoded;
ckks_encoder.decode(new_weights_pt, new_weights_decoded);
// Log Progress
if (i % 5 == 0)
{
cout << "\nIteration:\t" << i << endl;
// Print weights
cout << "Weights:\n\t[";
for (int i = 0; i < num_weights; i++)
{
cout << new_weights_decoded[i] << ", ";
}
cout << "]" << endl;
}
encryptor.encrypt(new_weights_pt, new_weights);
}
return new_weights;
}
// Sigmoid approximation without encryption
double sigmoid_approx(double x)
{
cout << "->" << __func__ << endl;
cout << "->" << __LINE__ << endl;
double res;
if (DEGREE == 3)
{
res = 0.5 + (1.20096 * (x / 8)) - (0.81562 * (pow((x / 8), 3)));
}
else if (DEGREE == 5)
{
res = 0.5 + (1.53048 * (x / 8)) - (2.3533056 * (pow((x / 8), 3))) + (1.3511295 * (pow((x / 8), 5)));
}
else if (DEGREE == 7)
{
res = 0.5 + (1.73496 * (x / 8)) - (4.19407 * (pow((x / 8), 3))) + (5.43402 * (pow((x / 8), 5))) - (2.50739 * (pow((x / 8), 3)));
}
else
{
cerr << "Invalid DEGREE" << endl;
exit(EXIT_SUCCESS);
}
return res;
}
int main()
{
// Test evaluate sigmoid approx
EncryptionParameters params(scheme_type::ckks);
params.set_poly_modulus_degree(POLY_MOD_DEGREE);
params.set_coeff_modulus(CoeffModulus::Create(POLY_MOD_DEGREE, {60, 40, 40, 40, 40, 40, 40, 40, 60}));
// "scale out of bounds" because primes are not sufficient
double scale = pow(2.0, 40);
SEALContext context(params);
auto tmp = make_shared<SEALContext>(context);
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
SecretKey sk = keygen.secret_key();
PublicKey pk;
keygen.create_public_key(pk);
RelinKeys relin_keys;
keygen.create_relin_keys(relin_keys);
GaloisKeys gal_keys;
keygen.create_galois_keys(gal_keys);
Encryptor encryptor(context, pk);
Evaluator evaluator(context);
Decryptor decryptor(context, sk);
// Create CKKS encoder
CKKSEncoder ckks_encoder(context);
print_parameters(tmp);
// -------------------------- TEST SIGMOID APPROXIMATION ---------------------------
cout << "\n------------------- TEST SIGMOID APPROXIMATION -------------------\n"
<< endl;
// Create data
double x = 0.8;
double x_eight = x / 8;
Plaintext ptx;
ckks_encoder.encode(x_eight, scale, ptx);
Ciphertext ctx;
encryptor.encrypt(ptx, ctx);
// Create coeffs (Change with degree)
vector<double> coeffs;
if (DEGREE == 3)
{
coeffs = {0.5, 1.20069, 0.00001, -0.81562};
}
else if (DEGREE == 5)
{
coeffs = {0.5, 1.53048, 0.00001, -2.3533056, 0.00001, 1.3511295};
}
else if (DEGREE == 7)
{
coeffs = {0.5, 1.73496, 0.00001, -4.19407, 0.00001, 5.43402, 0.00001, -2.50739};
}
else
{
cerr << "Invalid DEGREE" << endl;
exit(EXIT_FAILURE);
}
// Multiply x by 1/8
double eight = 1 / 8;
Plaintext eight_pt;
ckks_encoder.encode(eight, scale, eight_pt);
chrono::high_resolution_clock::time_point time_start, time_end;
chrono::microseconds time_diff;
time_start = chrono::high_resolution_clock::now();
// Ciphertext ct_res_sigmoid = Tree_cipher(ctx, DEGREE, scale, coeffs, ckks_encoder, evaluator, encryptor, relin_keys, params);
Ciphertext ct_res_sigmoid = Horner_cipher(ctx, DEGREE, coeffs, ckks_encoder, scale, evaluator, encryptor, relin_keys, params);
time_end = chrono::high_resolution_clock::now();
time_diff = chrono::duration_cast<chrono::microseconds>(time_end - time_start);
cout << "Polynomial Evaluation Duration:\t" << time_diff.count() << " microseconds" << endl;
// Decrypt and decode
Plaintext pt_res_sigmoid;
decryptor.decrypt(ct_res_sigmoid, pt_res_sigmoid);
vector<double> res_sigmoid_vec;
ckks_encoder.decode(pt_res_sigmoid, res_sigmoid_vec);
// Get True expected result
double true_expected_res = sigmoid(x_eight);
// Get expected approximate result
double expected_approx_res = sigmoid_approx(x);
cout << "Actual Approximate Result =\t\t" << res_sigmoid_vec[0] << endl;
cout << "Expected Approximate Result =\t\t" << expected_approx_res << endl;
cout << "True Result =\t\t\t\t" << true_expected_res << endl;
double difference = abs(res_sigmoid_vec[0] - true_expected_res);
cout << "Approx. Error: Diff Actual and True =\t" << difference << endl;
double horner_error = abs(res_sigmoid_vec[0] - expected_approx_res);
cout << "CKKS Error: Diff Actual and Expected =\t" << horner_error << endl;
// --------------------------- TEST LR -----------------------------------------
cout << "\n--------------------------- TEST LR CKKS ---------------------------\n"
<< endl;
// Read File
string filename = "pulsar_stars_copy.csv";
vector<vector<string>> s_matrix = CSVtoMatrix(filename);
vector<vector<double>> f_matrix = stringToDoubleMatrix(s_matrix);
// Init features, labels and weights
// Init features (rows of f_matrix , cols of f_matrix - 1)
int rows = f_matrix.size();
cout << "\nNumber of rows = " << rows << endl;
int cols = f_matrix[0].size() - 1;
cout << "\nNumber of cols = " << cols << endl;
vector<vector<double>> features(rows, vector<double>(cols));
// Init labels (rows of f_matrix)
vector<double> labels(rows);
// Init weight vector with zeros (cols of features)
vector<double> weights(cols);
// Fill the features matrix and labels vector
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++)
{
features[i][j] = f_matrix[i][j];
}
labels[i] = f_matrix[i][cols];
}
// Fill the weights with random numbers (from 1 - 2)
for (int i = 0; i < cols; i++)
{
weights[i] = RandomFloat(-2, 2);
}
// Test print the features and labels
cout << "\nTesting features\n--------------\n"
<< endl;
// Features Print test
cout << "Features row size = " << features.size() << endl;
cout << "Features col size = " << features[0].size() << endl;
cout << "Labels row size = " << labels.size() << endl;
cout << "Weights row size = " << weights.size() << endl;
// Standardize the features
cout << "\nSTANDARDIZE TEST---------\n"
<< endl;
vector<vector<double>> standard_features = standard_scaler_double(features);
// Print old weights
cout << "\nOLD WEIGHTS\n------------------"
<< endl;
for (int i = 0; i < weights.size(); i++)
{
cout << weights[i] << ", ";
}
cout << endl;
// Get tranpose from client
vector<vector<double>> features_T = transpose_matrix(features);
// -------------- ENCODING ----------------
// Encode features
vector<Plaintext> features_pt(features.size());
cout << "\nENCODING FEATURES ...";
for (int i = 0; i < features.size(); i++)
{
ckks_encoder.encode(features[i], scale, features_pt[i]);
}
cout << "Done" << endl;
vector<Plaintext> features_T_pt(features_T.size());
cout << "\nENCODING TRANSPOSED FEATURES ...";
for (int i = 0; i < features_T.size(); i++)
{
ckks_encoder.encode(features_T[i], scale, features_T_pt[i]);
}
cout << "Done" << endl;
// Encode weights
Plaintext weights_pt;
cout << "\nENCODING WEIGHTS...";
ckks_encoder.encode(weights, scale, weights_pt);
cout << "Done" << endl;
// Encode labels
Plaintext labels_pt;
cout << "\nENCODING LABELS...";
ckks_encoder.encode(labels, scale, labels_pt);
cout << "Done" << endl;
// -------------- ENCRYPTING ----------------
//Encrypt features
vector<Ciphertext> features_ct(features.size());
cout << "\nENCRYPTING FEATURES ...";
for (int i = 0; i < features.size(); i++)
{
encryptor.encrypt(features_pt[i], features_ct[i]);
}
cout << "Done" << endl;
vector<Ciphertext> features_T_ct(features_T.size());
cout << "\nENCRYPTING TRANSPOSED FEATURES ...";
for (int i = 0; i < features_T.size(); i++)
{
encryptor.encrypt(features_T_pt[i], features_T_ct[i]);
}
cout << "Done" << endl;
// Encrypt weights
Ciphertext weights_ct;
cout << "\nENCRYPTING WEIGHTS...";
encryptor.encrypt(weights_pt, weights_ct);
cout << "Done" << endl;
// Encrypt labels
Ciphertext labels_ct;
cout << "\nENCRYPTING LABELS...";
encryptor.encrypt(labels_pt, labels_ct);
cout << "Done" << endl;
// --------------- TRAIN ---------------
cout << "\nTraining--------------\n"
<< endl;
int observations = features.size();
int num_weights = features[0].size();
Ciphertext predictions;
// predictions = predict_cipher_weights(features_ct, weights_ct, num_weights, scale, evaluator, ckks_encoder, gal_keys, relin_keys, encryptor, params);
Ciphertext new_weights = train_cipher(features_ct, features_T_ct, labels_ct, weights_ct, LEARNING_RATE, ITERS, observations, num_weights, evaluator, ckks_encoder, scale, gal_keys, relin_keys, encryptor, decryptor, params);
return 0;
}
| 21,452
|
C++
|
.cpp
| 533
| 34.294559
| 368
| 0.603001
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,664
|
linear_transformation2.cpp
|
MarwanNour_SEAL-FYP-Logistic-Regression/linear_transformation2.cpp
|
#include <iostream>
#include <iomanip>
#include <fstream>
#include "seal/seal.h"
using namespace std;
using namespace seal;
// Helper function that prints a matrix (vector of vectors)
template <typename T>
inline void print_full_matrix(vector<vector<T>> matrix, int precision = 3)
{
// save formatting for cout
ios old_fmt(nullptr);
old_fmt.copyfmt(cout);
cout << fixed << setprecision(precision);
int row_size = matrix.size();
int col_size = matrix[0].size();
for (unsigned int i = 0; i < row_size; i++)
{
cout << "[";
for (unsigned int j = 0; j < col_size - 1; j++)
{
cout << matrix[i][j] << ", ";
}
cout << matrix[i][col_size - 1];
cout << "]" << endl;
}
cout << endl;
// restore old cout formatting
cout.copyfmt(old_fmt);
}
// Helper function that prints parts of a matrix (only squared matrix)
template <typename T>
inline void print_partial_matrix(vector<vector<T>> matrix, int print_size = 3, int precision = 3)
{
// save formatting for cout
ios old_fmt(nullptr);
old_fmt.copyfmt(cout);
cout << fixed << setprecision(precision);
int row_size = matrix.size();
int col_size = matrix[0].size();
// Boundary check
if (row_size < 2 * print_size && col_size < 2 * print_size)
{
cerr << "Cannot print matrix with these dimensions: " << to_string(row_size) << "x" << to_string(col_size) << ". Increase the print size" << endl;
return;
}
// print first 4 elements
for (unsigned int row = 0; row < print_size; row++)
{
cout << "\t[";
for (unsigned int col = 0; col < print_size; col++)
{
cout << matrix[row][col] << ", ";
}
cout << "..., ";
for (unsigned int col = col_size - print_size; col < col_size - 1; col++)
{
cout << matrix[row][col] << ", ";
}
cout << matrix[row][col_size - 1];
cout << "]" << endl;
}
cout << "\t..." << endl;
for (unsigned int row = row_size - print_size; row < row_size; row++)
{
cout << "\t[";
for (unsigned int col = 0; col < print_size; col++)
{
cout << matrix[row][col] << ", ";
}
cout << "..., ";
for (unsigned int col = col_size - print_size; col < col_size - 1; col++)
{
cout << matrix[row][col] << ", ";
}
cout << matrix[row][col_size - 1];
cout << "]" << endl;
}
cout << endl;
// restore old cout formatting
cout.copyfmt(old_fmt);
}
template <typename T>
inline void print_partial_vector(vector<T> vec, int size, int print_size = 3, int precision = 3)
{
// save formatting for cout
ios old_fmt(nullptr);
old_fmt.copyfmt(cout);
cout << fixed << setprecision(precision);
int row_size = size;
// Boundary check
if (row_size < 2 * print_size)
{
cerr << "Cannot print vector with these dimensions: " << to_string(row_size) << ". Increase the print size" << endl;
return;
}
cout << "\t[";
for (unsigned int row = 0; row < print_size; row++)
{
cout << vec[row] << ", ";
}
cout << "..., ";
for (unsigned int row = row_size - print_size; row < row_size - 1; row++)
{
cout << vec[row] << ", ";
}
cout << vec[row_size - 1] << "]\n";
cout << endl;
// restore old cout formatting
cout.copyfmt(old_fmt);
}
// Gets a diagonal from a matrix U
template <typename T>
vector<T> get_diagonal(int position, vector<vector<T>> U)
{
vector<T> diagonal(U.size());
int k = 0;
// U(0,l) , U(1,l+1), ... , U(n-l-1, n-1)
for (int i = 0, j = position; (i < U.size() - position) && (j < U.size()); i++, j++)
{
diagonal[k] = U[i][j];
k++;
}
for (int i = U.size() - position, j = 0; (i < U.size()) && (j < position); i++, j++)
{
diagonal[k] = U[i][j];
k++;
}
return diagonal;
}
Ciphertext Linear_Transform_Plain(Ciphertext ct, vector<Plaintext> U_diagonals, GaloisKeys gal_keys, EncryptionParameters params)
{
auto context = SEALContext::Create(params);
Evaluator evaluator(context);
// Fill ct with duplicate
Ciphertext ct_rot;
evaluator.rotate_vector(ct, -U_diagonals.size(), gal_keys, ct_rot);
// cout << "U_diagonals.size() = " << U_diagonals.size() << endl;
Ciphertext ct_new;
evaluator.add(ct, ct_rot, ct_new);
vector<Ciphertext> ct_result(U_diagonals.size());
evaluator.multiply_plain(ct_new, U_diagonals[0], ct_result[0]);
for (int l = 1; l < U_diagonals.size(); l++)
{
Ciphertext temp_rot;
evaluator.rotate_vector(ct_new, l, gal_keys, temp_rot);
evaluator.multiply_plain(temp_rot, U_diagonals[l], ct_result[l]);
}
Ciphertext ct_prime;
evaluator.add_many(ct_result, ct_prime);
return ct_prime;
}
Ciphertext Linear_Transform_Cipher(Ciphertext ct, vector<Ciphertext> U_diagonals, GaloisKeys gal_keys, EncryptionParameters params)
{
auto context = SEALContext::Create(params);
Evaluator evaluator(context);
// Fill ct with duplicate
Ciphertext ct_rot;
evaluator.rotate_vector(ct, -U_diagonals.size(), gal_keys, ct_rot);
// cout << "U_diagonals.size() = " << U_diagonals.size() << endl;
Ciphertext ct_new;
evaluator.add(ct, ct_rot, ct_new);
vector<Ciphertext> ct_result(U_diagonals.size());
evaluator.multiply(ct_new, U_diagonals[0], ct_result[0]);
for (int l = 1; l < U_diagonals.size(); l++)
{
Ciphertext temp_rot;
evaluator.rotate_vector(ct_new, l, gal_keys, temp_rot);
evaluator.multiply(temp_rot, U_diagonals[l], ct_result[l]);
}
Ciphertext ct_prime;
evaluator.add_many(ct_result, ct_prime);
return ct_prime;
}
void test_Linear_Transformation(int dimension, vector<vector<double>> input_matrix, vector<double> input_vec)
{
vector<double> result(dimension);
int k = 0;
for (int i = 0; i < dimension; i++)
{
for (int j = 0; j < dimension; j++)
{
result[k] += input_matrix[i][j] * input_vec[j];
}
k++;
}
// Print Result vector
print_partial_vector(result, dimension);
}
void PMatrix_CVector_Multiplication(size_t poly_modulus_degree, int dimension)
{
// Handle Rotation Error First
if (dimension > poly_modulus_degree / 4)
{
cerr << "Dimension is too large. Choose a dimension less than " << poly_modulus_degree / 4 << endl;
exit(1);
}
EncryptionParameters params(scheme_type::CKKS);
params.set_poly_modulus_degree(poly_modulus_degree);
cout << "MAX BIT COUNT: " << CoeffModulus::MaxBitCount(poly_modulus_degree) << endl;
params.set_coeff_modulus(CoeffModulus::Create(poly_modulus_degree, {60, 40, 40, 60}));
auto context = SEALContext::Create(params);
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
GaloisKeys gal_keys = keygen.galois_keys();
Encryptor encryptor(context, pk);
Evaluator evaluator(context);
Decryptor decryptor(context, sk);
// Create CKKS encoder
CKKSEncoder ckks_encoder(context);
// Create scale
cout << "Coeff Modulus Back Value: " << params.coeff_modulus().back().value() << endl;
double scale = pow(2.0, 40);
// Set output file
string filename = "linear_transf_p" + to_string(poly_modulus_degree) + "_d" + to_string(dimension) + ".dat";
ofstream outf(filename);
// Handle file error
if (!outf)
{
cerr << "Couldn't open file: " << filename << endl;
exit(1);
}
// Set output script
string script = "linear_transf_plot_p" + to_string(poly_modulus_degree) + "_d" + to_string(dimension) + ".py";
ofstream outscript(script);
// Handle script error
if (!outscript)
{
cerr << "Couldn't open file: " << script << endl;
exit(1);
}
// Write to Script
outscript << "import matplotlib.pyplot as plt" << endl;
outscript << "labels = 'Encode', 'Encrypt', 'Computation', 'Decode', 'Decrypt'" << endl;
outscript << "colors = ['gold', 'green', 'lightskyblue', 'red', 'violet']" << endl;
outscript << "sizes = [";
cout << "Dimension : " << dimension << endl
<< endl;
vector<vector<double>> pod_matrix_set1(dimension, vector<double>(dimension));
vector<double> pod_vec_set1(dimension);
// Fill input matrices
double r = ((double)rand() / (RAND_MAX));
for (int i = 0; i < dimension; i++)
{
for (int j = 0; j < dimension; j++)
{
pod_matrix_set1[i][j] = r;
r = ((double)rand() / (RAND_MAX));
}
}
for (int i = 0; i < dimension; i++)
{
r = ((double)rand() / (RAND_MAX));
pod_vec_set1[i] = r;
}
cout << "Matrix:" << endl;
print_partial_matrix(pod_matrix_set1);
cout << "Vector:" << endl;
print_partial_vector(pod_vec_set1, dimension);
// Get all diagonals
vector<vector<double>> all_diagonal_set1(dimension, vector<double>(dimension));
for (int i = 0; i < dimension; i++)
{
all_diagonal_set1[i] = get_diagonal(i, pod_matrix_set1);
}
cout << "Diagonal Expected:" << endl;
print_partial_matrix(all_diagonal_set1);
// Encode Matrices into vectors with Diagonals
vector<Plaintext> plain_matrix_set1(dimension);
Plaintext plain_vec_set1;
vector<Plaintext> plain_diagonal_set1(dimension);
auto start_encode = chrono::high_resolution_clock::now();
for (int i = 0; i < dimension; i++)
{
ckks_encoder.encode(pod_matrix_set1[i], scale, plain_matrix_set1[i]);
ckks_encoder.encode(pod_vec_set1, scale, plain_vec_set1);
ckks_encoder.encode(all_diagonal_set1[i], scale, plain_diagonal_set1[i]);
}
auto stop_encode = chrono::high_resolution_clock::now();
cout << "Encoding is Complete" << endl;
auto duration_encode = chrono::duration_cast<chrono::microseconds>(stop_encode - start_encode);
cout << "Encode Duration:\t" << duration_encode.count() << endl;
outscript << duration_encode.count() << ", ";
// Encrypt the matrices with Diagonals
vector<Ciphertext> cipher_matrix_set1(dimension);
Ciphertext cipher_vec_set1;
vector<Ciphertext> cipher_diagonal_set1(dimension);
auto start_encrypt = chrono::high_resolution_clock::now();
for (unsigned int i = 0; i < dimension; i++)
{
encryptor.encrypt(plain_matrix_set1[i], cipher_matrix_set1[i]);
encryptor.encrypt(plain_vec_set1, cipher_vec_set1);
encryptor.encrypt(plain_diagonal_set1[i], cipher_diagonal_set1[i]);
}
auto stop_encrypt = chrono::high_resolution_clock::now();
cout << "Encrypting is Complete" << endl;
auto duration_encrypt = chrono::duration_cast<chrono::microseconds>(stop_encrypt - start_encrypt);
cout << "Encrypt Duration:\t" << duration_encrypt.count() << endl;
outscript << duration_encrypt.count() << ", ";
// ------------- FIRST COMPUTATION ----------------
outf << "# index 0" << endl;
outf << "# C_Vec . P_Mat" << endl;
// Test LinearTransform here
auto start_comp1_set1 = chrono::high_resolution_clock::now();
Ciphertext ct_prime1_set1 = Linear_Transform_Plain(cipher_matrix_set1[0], plain_diagonal_set1, gal_keys, params);
auto stop_comp1_set1 = chrono::high_resolution_clock::now();
auto duration_comp1_set1 = chrono::duration_cast<chrono::microseconds>(stop_comp1_set1 - start_comp1_set1);
cout << "\nTime to compute C_vec . P_mat: " << duration_comp1_set1.count() << " microseconds" << endl;
outf << to_string(dimension) << "\t\t" << duration_comp1_set1.count() << endl;
outscript << duration_comp1_set1.count() << ", ";
// Decrypt
Plaintext pt_result1_set1;
auto start_decrypt = chrono::high_resolution_clock::now();
decryptor.decrypt(ct_prime1_set1, pt_result1_set1);
auto stop_decrypt = chrono::high_resolution_clock::now();
auto duration_decrypt = chrono::duration_cast<chrono::microseconds>(stop_decrypt - start_decrypt);
cout << "Decrypt Duration:\t" << duration_decrypt.count() << endl;
outscript << duration_decrypt.count() << ", ";
// Decode
vector<double> output_result1_set1;
auto start_decode = chrono::high_resolution_clock::now();
ckks_encoder.decode(pt_result1_set1, output_result1_set1);
auto stop_decode = chrono::high_resolution_clock::now();
auto duration_decode = chrono::duration_cast<chrono::microseconds>(stop_decode - start_decode);
cout << "Decode Duration:\t" << duration_decode.count() << endl;
outscript << duration_decode.count();
cout << "Linear Transformation:" << endl;
print_partial_vector(output_result1_set1, dimension);
// Check result
cout << "Expected output: " << endl;
test_Linear_Transformation(dimension, pod_matrix_set1, pod_matrix_set1[0]);
outf << "\n"
<< endl;
outf.close();
outscript << "]" << endl;
outscript << "plt.pie(sizes, colors=colors, autopct='%.1f')" << endl;
outscript << "plt.title(\"Linear Transformation Test p" << to_string(poly_modulus_degree) << " d"<< to_string(dimension) << "\")" << endl;
outscript << "plt.legend(labels)" << endl;
outscript << "plt.tight_layout()" << endl;
outscript << "plt.axis('equal')" << endl;
outscript << "plt.show()" << endl;
outscript.close();
}
int main()
{
PMatrix_CVector_Multiplication(8192, 2000);
return 0;
}
| 13,622
|
C++
|
.cpp
| 350
| 33.242857
| 154
| 0.615297
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,665
|
benchmark2.cpp
|
MarwanNour_SEAL-FYP-Logistic-Regression/benchmark2.cpp
|
#include <iostream>
#include <fstream>
#include <iomanip>
#include "seal/seal.h"
using namespace std;
using namespace seal;
// Helper function that prints a vector of floats
template <typename T>
inline void print_vector(std::vector<T> vec, std::size_t print_size = 4, int prec = 4)
{
/*
Save the formatting information for std::cout.
*/
std::ios old_fmt(nullptr);
old_fmt.copyfmt(std::cout);
std::size_t slot_count = vec.size();
std::cout << std::fixed << std::setprecision(prec);
std::cout << std::endl;
if (slot_count <= 2 * print_size)
{
std::cout << " [";
for (std::size_t i = 0; i < slot_count; i++)
{
std::cout << " " << vec[i] << ((i != slot_count - 1) ? "," : " ]\n");
}
}
else
{
vec.resize(std::max(vec.size(), 2 * print_size));
std::cout << " [";
for (std::size_t i = 0; i < print_size; i++)
{
std::cout << " " << vec[i] << ",";
}
if (vec.size() > 2 * print_size)
{
std::cout << " ...,";
}
for (std::size_t i = slot_count - print_size; i < slot_count; i++)
{
std::cout << " " << vec[i] << ((i != slot_count - 1) ? "," : " ]\n");
}
}
std::cout << std::endl;
/*
Restore the old std::cout formatting.
*/
std::cout.copyfmt(old_fmt);
}
// Helper function that prints a matrix (vector of vectors)
template <typename T>
inline void print_full_matrix(vector<vector<T>> matrix, int precision = 3)
{
// save formatting for cout
ios old_fmt(nullptr);
old_fmt.copyfmt(cout);
cout << fixed << setprecision(precision);
int row_size = matrix.size();
int col_size = matrix[0].size();
for (unsigned int i = 0; i < row_size; i++)
{
cout << "[";
for (unsigned int j = 0; j < col_size - 1; j++)
{
cout << matrix[i][j] << ", ";
}
cout << matrix[i][col_size - 1];
cout << "]" << endl;
}
cout << endl;
// restore old cout formatting
cout.copyfmt(old_fmt);
}
// Helper function that prints parts of a matrix (only squared matrix)
template <typename T>
inline void print_partial_matrix(vector<vector<T>> matrix, int print_size = 3, int precision = 3)
{
// save formatting for cout
ios old_fmt(nullptr);
old_fmt.copyfmt(cout);
cout << fixed << setprecision(precision);
int row_size = matrix.size();
int col_size = matrix[0].size();
// Boundary check
if (row_size < 2 * print_size && col_size < 2 * print_size)
{
cerr << "Cannot print matrix with these dimensions: " << to_string(row_size) << "x" << to_string(col_size) << ". Increase the print size" << endl;
return;
}
// print first 4 elements
for (unsigned int row = 0; row < print_size; row++)
{
cout << "\t[";
for (unsigned int col = 0; col < print_size; col++)
{
cout << matrix[row][col] << ", ";
}
cout << "..., ";
for (unsigned int col = col_size - print_size; col < col_size - 1; col++)
{
cout << matrix[row][col] << ", ";
}
cout << matrix[row][col_size - 1];
cout << "]" << endl;
}
cout << "\t..." << endl;
for (unsigned int row = row_size - print_size; row < row_size; row++)
{
cout << "\t[";
for (unsigned int col = 0; col < print_size; col++)
{
cout << matrix[row][col] << ", ";
}
cout << "..., ";
for (unsigned int col = col_size - print_size; col < col_size - 1; col++)
{
cout << matrix[row][col] << ", ";
}
cout << matrix[row][col_size - 1];
cout << "]" << endl;
}
cout << endl;
// restore old cout formatting
cout.copyfmt(old_fmt);
}
// Helper function that tranposes a matrix
template <typename T>
inline vector<vector<T>> transpose_matrix(vector<vector<T>> matrix)
{
vector<vector<T>> m_t(matrix[0].size(), vector<T>(matrix.size()));
for (unsigned int i = 0; i < matrix[0].size(); i++)
{
for (unsigned int j = 0; j < m_t[0].size(); j++)
{
m_t[i][j] = matrix[j][i];
}
}
return m_t;
}
void ckksBenchmark(size_t poly_modulus_degree)
{
cout << "------CKKS TEST------\n"
<< endl;
// Set params
EncryptionParameters params(scheme_type::CKKS);
params.set_poly_modulus_degree(poly_modulus_degree);
params.set_coeff_modulus(CoeffModulus::BFVDefault(poly_modulus_degree));
auto context = SEALContext::Create(params);
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
Encryptor encryptor(context, pk);
Evaluator evaluator(context);
Decryptor decryptor(context, sk);
// Create CKKS encoder
CKKSEncoder ckks_encoder(context);
size_t slot_count = ckks_encoder.slot_count();
cout << "Slot count : " << slot_count << endl;
// Set output file
string filename = "bench_" + to_string(poly_modulus_degree) + ".dat";
ofstream outf(filename);
// Handle file error
if (!outf)
{
cerr << "Couldn't open file: " << filename << endl;
exit(1);
}
// Set output script
string script = "script_" + to_string(poly_modulus_degree) + ".p";
ofstream outscript(script);
// Handle script error
if (!outscript)
{
cerr << "Couldn't open file: " << script << endl;
exit(1);
}
// Write to script
outscript << "# Set the output terminal" << endl;
outscript << "set terminal canvas" << endl;
outscript << "set output \"canvas_" << to_string(poly_modulus_degree) << ".html\"" << endl;
outscript << "set title \"CKKS Benchmark " << to_string(poly_modulus_degree) << "\"" << endl;
outscript << "set xlabel 'Input Vector Size'" << endl;
outscript << "set ylabel 'Time (microseconds)'" << endl;
outscript << "\n# Set the styling " << endl;
outscript << "set style line 1\\\n"
<< "linecolor rgb '#0060ad'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 7 pointsize 1.5\n"
<< endl;
outscript << "set style line 2\\\n"
<< "linecolor rgb '#dd181f'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 5 pointsize 1.5\n"
<< endl;
outscript << "set style line 3\\\n"
<< "linecolor rgb '#00FF00'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 6 pointsize 1.5\n"
<< endl;
outscript << "set style line 4\\\n"
<< "linecolor rgb '#EC00EC'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 4 pointsize 1.5\n"
<< endl;
outscript << "\nplot 'bench_" << to_string(poly_modulus_degree) << ".dat' index 0 title \"C1 + P2\" with linespoints ls 1, \\\n"
<< "'' index 1 title \"C1 + C2\" with linespoints ls 2, \\\n"
<< "'' index 2 title \"C1 * P2\" with linespoints ls 3, \\\n"
<< "'' index 3 title \"C1 * C2\" with linespoints ls 4";
// Close script
outscript.close();
/*
3 sets of vectors:
1st set: sizes = 10
2nd set: sizes = 100
3rd set: sizes = 1000
*/
// ------------- FIRST SET -------------
// First vector
vector<double> pod_vec1_set1(10, 0);
for (unsigned int i = 0; i < 10; i++)
{
pod_vec1_set1[i] = static_cast<double>(i);
}
print_vector(pod_vec1_set1);
// Second vector
vector<double> pod_vec2_set1(10, 0);
for (unsigned int i = 0; i < 10; i++)
{
pod_vec2_set1[i] = static_cast<double>((i % 2) + 1);
}
print_vector(pod_vec2_set1);
// -------------- SECOND SET -------------
// First vector
vector<double> pod_vec1_set2(100, 0);
for (unsigned int i = 0; i < 100; i++)
{
pod_vec1_set2[i] = static_cast<double>(i);
}
print_vector(pod_vec1_set2);
// Second vector
vector<double> pod_vec2_set2(100, 0);
for (unsigned int i = 0; i < 100; i++)
{
pod_vec2_set2[i] = static_cast<double>((i % 2) + 1);
}
print_vector(pod_vec2_set2);
// -------------- THIRD SET -------------
// First vector
vector<double> pod_vec1_set3(1000, 0);
for (unsigned int i = 0; i < 1000; i++)
{
pod_vec1_set3[i] = static_cast<double>(i);
}
print_vector(pod_vec1_set3);
// Second vector
vector<double> pod_vec2_set3(1000, 0);
for (unsigned int i = 0; i < 1000; i++)
{
pod_vec2_set3[i] = static_cast<double>((i % 2) + 1);
}
print_vector(pod_vec2_set3);
// Encode all vectors
Plaintext plain_vec1_set1, plain_vec2_set1, plain_vec1_set2, plain_vec2_set2, plain_vec1_set3, plain_vec2_set3;
double scale = sqrt(static_cast<double>(params.coeff_modulus().back().value()));
// First set encode
ckks_encoder.encode(pod_vec1_set1, scale, plain_vec1_set1);
ckks_encoder.encode(pod_vec2_set1, scale, plain_vec2_set1);
// Second set encode
ckks_encoder.encode(pod_vec1_set2, scale, plain_vec1_set2);
ckks_encoder.encode(pod_vec2_set2, scale, plain_vec2_set2);
// Third set encode
ckks_encoder.encode(pod_vec1_set3, scale, plain_vec1_set3);
ckks_encoder.encode(pod_vec2_set3, scale, plain_vec2_set3);
// Encrypt all vectors
Ciphertext cipher_vec1_set1, cipher_vec2_set1, cipher_vec1_set2, cipher_vec2_set2, cipher_vec1_set3, cipher_vec2_set3;
// First set cipher
encryptor.encrypt(plain_vec1_set1, cipher_vec1_set1);
encryptor.encrypt(plain_vec2_set1, cipher_vec2_set1);
// Second set cipher
encryptor.encrypt(plain_vec1_set2, cipher_vec1_set2);
encryptor.encrypt(plain_vec2_set2, cipher_vec2_set2);
// Third set cipher
encryptor.encrypt(plain_vec1_set3, cipher_vec1_set3);
encryptor.encrypt(plain_vec2_set3, cipher_vec2_set3);
// Create Ciphertext Outputs
Ciphertext cipher_result1_set1, cipher_result1_set2, cipher_result1_set3;
Ciphertext cipher_result2_set1, cipher_result2_set2, cipher_result2_set3;
Ciphertext cipher_result3_set1, cipher_result3_set2, cipher_result3_set3;
Ciphertext cipher_result4_set1, cipher_result4_set2, cipher_result4_set3;
// ------------------ (cipher1 + plain2) ---------------
cout << "\n------------------ FIRST OPERATION ------------------\n"
<< endl;
outf << "# index 0" << endl;
outf << "# C1 + P2" << endl;
// Compute (cipher1 + plain2) for set 1
cout << "Compute (cipher1 + plain2) for set 1" << endl;
// TIME START
auto start_comp1_set1 = chrono::high_resolution_clock::now();
evaluator.add_plain(cipher_vec1_set1, plain_vec2_set1, cipher_result1_set1);
// TIME END
auto stop_comp1_set1 = chrono::high_resolution_clock::now();
auto duration_comp1_set1 = chrono::duration_cast<chrono::microseconds>(stop_comp1_set1 - start_comp1_set1);
// Decrypt and Decode
Plaintext plain_result1_set1;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result1_set1, plain_result1_set1);
vector<double> vec_result1_set1;
ckks_encoder.decode(plain_result1_set1, vec_result1_set1);
print_vector(vec_result1_set1);
cout << "\nTime to compute (cipher1 + plain2): " << duration_comp1_set1.count() << " microseconds" << endl;
outf << "10\t\t" << duration_comp1_set1.count() << endl;
// Compute (cipher1 + plain2) for set 2
cout << "Compute (cipher1 + plain2) for set 2" << endl;
// TIME START
auto start_comp1_set2 = chrono::high_resolution_clock::now();
evaluator.add_plain(cipher_vec1_set2, plain_vec2_set2, cipher_result1_set2);
// TIME END
auto stop_comp1_set2 = chrono::high_resolution_clock::now();
auto duration_comp1_set2 = chrono::duration_cast<chrono::microseconds>(stop_comp1_set2 - start_comp1_set2);
// Decrypt and Decode
Plaintext plain_result1_set2;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result1_set2, plain_result1_set2);
vector<double> vec_result1_set2;
ckks_encoder.decode(plain_result1_set2, vec_result1_set2);
print_vector(vec_result1_set2);
cout << "\nTime to compute (cipher1 + plain2): " << duration_comp1_set2.count() << " microseconds" << endl;
outf << "100\t\t" << duration_comp1_set2.count() << endl;
// Compute (cipher1 + plain2) for set 3
cout << "Compute (cipher1 + plain2) for set 3" << endl;
// TIME START
auto start_comp1_set3 = chrono::high_resolution_clock::now();
evaluator.add_plain(cipher_vec1_set3, plain_vec2_set3, cipher_result1_set3);
// TIME END
auto stop_comp1_set3 = chrono::high_resolution_clock::now();
auto duration_comp1_set3 = chrono::duration_cast<chrono::microseconds>(stop_comp1_set3 - start_comp1_set3);
// Decrypt and Decode
Plaintext plain_result1_set3;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result1_set3, plain_result1_set3);
vector<double> vec_result1_set3;
ckks_encoder.decode(plain_result1_set3, vec_result1_set3);
print_vector(vec_result1_set3);
cout << "\nTime to compute (cipher1 + plain2): " << duration_comp1_set3.count() << " microseconds" << endl;
outf << "1000\t\t" << duration_comp1_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// ------------------ (cipher1 + cipher2) ---------------
cout << "\n------------------ SECOND OPERATION ------------------\n"
<< endl;
// Compute (cipher1 + cipher2) for set 1
cout << "Compute (cipher1 + cipher2) for set 1" << endl;
outf << "# index 1" << endl;
outf << "# C1 + C2" << endl;
// TIME START
auto start_comp2_set1 = chrono::high_resolution_clock::now();
evaluator.add(cipher_vec1_set1, cipher_vec2_set1, cipher_result2_set1);
// TIME END
auto stop_comp2_set1 = chrono::high_resolution_clock::now();
auto duration_comp2_set1 = chrono::duration_cast<chrono::microseconds>(stop_comp2_set1 - start_comp2_set1);
// Decrypt and Decode
Plaintext plain_result2_set1;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result2_set1, plain_result2_set1);
vector<double> vec_result2_set1;
ckks_encoder.decode(plain_result2_set1, vec_result2_set1);
print_vector(vec_result2_set1);
cout << "\nTime to compute (cipher1 + cipher2): " << duration_comp2_set1.count() << " microseconds" << endl;
outf << "10\t\t" << duration_comp2_set1.count() << endl;
// Compute (cipher1 + cipher2) for set 2
cout << "Compute (cipher1 + cipher2) for set 2" << endl;
// TIME START
auto start_comp2_set2 = chrono::high_resolution_clock::now();
evaluator.add(cipher_vec1_set2, cipher_vec2_set2, cipher_result2_set2);
// TIME END
auto stop_comp2_set2 = chrono::high_resolution_clock::now();
auto duration_comp2_set2 = chrono::duration_cast<chrono::microseconds>(stop_comp2_set2 - start_comp2_set2);
// Decrypt and Decode
Plaintext plain_result2_set2;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result2_set2, plain_result2_set2);
vector<double> vec_result2_set2;
ckks_encoder.decode(plain_result2_set2, vec_result2_set2);
print_vector(vec_result2_set2);
cout << "\nTime to compute (cipher1 + cipher2): " << duration_comp2_set2.count() << " microseconds" << endl;
outf << "100\t\t" << duration_comp2_set2.count() << endl;
// Compute (cipher1 + cipher2) for set 3
cout << "Compute (cipher1 + cipher2) for set 3" << endl;
// TIME START
auto start_comp2_set3 = chrono::high_resolution_clock::now();
evaluator.add(cipher_vec1_set3, cipher_vec2_set3, cipher_result2_set3);
// TIME END
auto stop_comp2_set3 = chrono::high_resolution_clock::now();
auto duration_comp2_set3 = chrono::duration_cast<chrono::microseconds>(stop_comp2_set3 - start_comp2_set3);
// Decrypt and Decode
Plaintext plain_result2_set3;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result2_set3, plain_result2_set3);
vector<double> vec_result2_set3;
ckks_encoder.decode(plain_result2_set3, vec_result2_set3);
print_vector(vec_result2_set3);
cout << "\nTime to compute (cipher1 + cipher2): " << duration_comp2_set3.count() << " microseconds" << endl;
outf << "1000\t\t" << duration_comp2_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// ------------------ (cipher1 * plain2) ---------------
cout << "\n------------------ THIRD OPERATION ------------------\n"
<< endl;
// Compute (cipher1 + plain2) for set 1
cout << "Compute (cipher1 * plain2) for set 1" << endl;
outf << "# index 2" << endl;
outf << "# C1 * P2" << endl;
// TIME START
auto start_comp3_set1 = chrono::high_resolution_clock::now();
evaluator.multiply_plain(cipher_vec1_set1, plain_vec2_set1, cipher_result3_set1);
// TIME END
auto stop_comp3_set1 = chrono::high_resolution_clock::now();
auto duration_comp3_set1 = chrono::duration_cast<chrono::microseconds>(stop_comp3_set1 - start_comp3_set1);
// Decrypt and Decode
Plaintext plain_result3_set1;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result3_set1, plain_result3_set1);
vector<double> vec_result3_set1;
ckks_encoder.decode(plain_result3_set1, vec_result3_set1);
print_vector(vec_result3_set1);
cout << "\nTime to compute (cipher1 * plain2): " << duration_comp3_set1.count() << " microseconds" << endl;
outf << "10\t\t" << duration_comp3_set1.count() << endl;
// Compute (cipher1 * plain2) for set 2
cout << "Compute (cipher1 * plain2) for set 2" << endl;
// TIME START
auto start_comp3_set2 = chrono::high_resolution_clock::now();
evaluator.multiply_plain(cipher_vec1_set2, plain_vec2_set2, cipher_result3_set2);
// TIME END
auto stop_comp3_set2 = chrono::high_resolution_clock::now();
auto duration_comp3_set2 = chrono::duration_cast<chrono::microseconds>(stop_comp3_set2 - start_comp3_set2);
// Decrypt and Decode
Plaintext plain_result3_set2;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result3_set2, plain_result3_set2);
vector<double> vec_result3_set2;
ckks_encoder.decode(plain_result3_set2, vec_result3_set2);
print_vector(vec_result3_set2);
cout << "\nTime to compute (cipher1 * plain2): " << duration_comp3_set2.count() << " microseconds" << endl;
outf << "100\t\t" << duration_comp3_set2.count() << endl;
// Compute (cipher1 * plain2) for set 3
cout << "Compute (cipher1 * plain2) for set 3" << endl;
// TIME START
auto start_comp3_set3 = chrono::high_resolution_clock::now();
evaluator.multiply_plain(cipher_vec1_set3, plain_vec2_set3, cipher_result3_set3);
// TIME END
auto stop_comp3_set3 = chrono::high_resolution_clock::now();
auto duration_comp3_set3 = chrono::duration_cast<chrono::microseconds>(stop_comp3_set3 - start_comp3_set3);
// Decrypt and Decode
Plaintext plain_result3_set3;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result3_set3, plain_result3_set3);
vector<double> vec_result3_set3;
ckks_encoder.decode(plain_result3_set3, vec_result3_set3);
print_vector(vec_result3_set3);
cout << "\nTime to compute (cipher1 * plain2): " << duration_comp3_set3.count() << " microseconds" << endl;
outf << "1000\t\t" << duration_comp3_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// ------------------ (cipher1 * cipher2) ---------------
cout << "\n------------------ FOURTH OPERATION ------------------\n"
<< endl;
// Compute (cipher1 * cipher2) for set 1
cout << "Compute (cipher1 * cipher2) for set 1" << endl;
outf << "# index 3" << endl;
outf << "# C1 * C2" << endl;
// TIME START
auto start_comp4_set1 = chrono::high_resolution_clock::now();
evaluator.multiply(cipher_vec1_set1, cipher_vec2_set1, cipher_result4_set1);
// TIME END
auto stop_comp4_set1 = chrono::high_resolution_clock::now();
auto duration_comp4_set1 = chrono::duration_cast<chrono::microseconds>(stop_comp4_set1 - start_comp4_set1);
// Decrypt and Decode
Plaintext plain_result4_set1;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result4_set1, plain_result4_set1);
vector<double> vec_result4_set1;
ckks_encoder.decode(plain_result4_set1, vec_result4_set1);
print_vector(vec_result4_set1);
cout << "\nTime to compute (cipher1 * cipher2): " << duration_comp4_set1.count() << " microseconds" << endl;
outf << "10\t\t" << duration_comp4_set1.count() << endl;
// Compute (cipher1 * cipher2) for set 2
cout << "Compute (cipher1 * cipher2) for set 2" << endl;
// TIME START
auto start_comp4_set2 = chrono::high_resolution_clock::now();
evaluator.multiply(cipher_vec1_set2, cipher_vec2_set2, cipher_result4_set2);
// TIME END
auto stop_comp4_set2 = chrono::high_resolution_clock::now();
auto duration_comp4_set2 = chrono::duration_cast<chrono::microseconds>(stop_comp4_set2 - start_comp4_set2);
// Decrypt and Decode
Plaintext plain_result4_set2;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result4_set2, plain_result4_set2);
vector<double> vec_result4_set2;
ckks_encoder.decode(plain_result4_set2, vec_result4_set2);
print_vector(vec_result4_set2);
cout << "\nTime to compute (cipher1 * cipher2): " << duration_comp4_set2.count() << " microseconds" << endl;
outf << "100\t\t" << duration_comp4_set2.count() << endl;
// Compute (cipher1 * cipher2) for set 3
cout << "Compute (cipher1 * cipher2) for set 3" << endl;
// TIME START
auto start_comp4_set3 = chrono::high_resolution_clock::now();
evaluator.multiply(cipher_vec1_set3, cipher_vec2_set3, cipher_result4_set3);
// TIME END
auto stop_comp4_set3 = chrono::high_resolution_clock::now();
auto duration_comp4_set3 = chrono::duration_cast<chrono::microseconds>(stop_comp4_set3 - start_comp4_set3);
// Decrypt and Decode
Plaintext plain_result4_set3;
cout << "Decrypt and decode the result" << endl;
decryptor.decrypt(cipher_result4_set3, plain_result4_set3);
vector<double> vec_result4_set3;
ckks_encoder.decode(plain_result4_set3, vec_result4_set3);
print_vector(vec_result4_set3);
cout << "\nTime to compute (cipher1 * cipher2): " << duration_comp4_set3.count() << " microseconds" << endl;
outf << "1000\t\t" << duration_comp4_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// Close the file
outf.close();
}
void ckksBenchmarkMatrix(size_t poly_modulus_degree)
{
cout << "------CKKS Matrix TEST------\n"
<< endl;
// Set params
EncryptionParameters params(scheme_type::CKKS);
params.set_poly_modulus_degree(poly_modulus_degree);
params.set_coeff_modulus(CoeffModulus::BFVDefault(poly_modulus_degree));
auto context = SEALContext::Create(params);
// Generate keys, encryptor, decryptor and evaluator
KeyGenerator keygen(context);
PublicKey pk = keygen.public_key();
SecretKey sk = keygen.secret_key();
Encryptor encryptor(context, pk);
Evaluator evaluator(context);
Decryptor decryptor(context, sk);
// Create CKKS encoder
CKKSEncoder ckks_encoder(context);
size_t slot_count = ckks_encoder.slot_count();
cout << "Slot count : " << slot_count << endl;
// Set output file
string filename = "bench_matrix_" + to_string(poly_modulus_degree) + ".dat";
ofstream outf(filename);
// Handle file error
if (!outf)
{
cerr << "Couldn't open file: " << filename << endl;
exit(1);
}
// Set output script
string script = "script_matrix_" + to_string(poly_modulus_degree) + ".p";
ofstream outscript(script);
// Handle script error
if (!outscript)
{
cerr << "Couldn't open file: " << script << endl;
exit(1);
}
// Write to script
outscript << "# Set the output terminal" << endl;
outscript << "set terminal canvas" << endl;
outscript << "set output \"canvas_matrix_" << to_string(poly_modulus_degree) << ".html\"" << endl;
outscript << "set title \"CKKS Matrix Benchmark " << to_string(poly_modulus_degree) << "\"" << endl;
outscript << "set xlabel 'Input Matrix Size (NxN)'" << endl;
outscript << "set ylabel 'Time (microseconds)'" << endl;
outscript << "\n# Set the styling " << endl;
outscript << "set style line 1\\\n"
<< "linecolor rgb '#0060ad'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 7 pointsize 1.5\n"
<< endl;
outscript << "set style line 2\\\n"
<< "linecolor rgb '#dd181f'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 5 pointsize 1.5\n"
<< endl;
outscript << "set style line 3\\\n"
<< "linecolor rgb '#00FF00'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 6 pointsize 1.5\n"
<< endl;
outscript << "set style line 4\\\n"
<< "linecolor rgb '#EC00EC'\\\n"
<< "linetype 1 linewidth 2\\\n"
<< "pointtype 4 pointsize 1.5\n"
<< endl;
outscript << "\nplot 'bench_matrix_" << to_string(poly_modulus_degree) << ".dat' index 0 title \"C1 + P2\" with linespoints ls 1, \\\n"
<< "'' index 1 title \"C1 + C2\" with linespoints ls 2, \\\n"
<< "'' index 2 title \"C1 * P2\" with linespoints ls 3, \\\n"
<< "'' index 3 title \"C1 * C2\" with linespoints ls 4";
// Close script
outscript.close();
// ------------- FIRST SET -------------
// First Matrix
int set_size1 = 10;
vector<vector<double>> pod_matrix1_set1(set_size1, vector<double>(set_size1));
double k = 0.0;
for (unsigned int i = 0; i < set_size1; i++)
{
for (unsigned int j = 0; j < set_size1; j++)
{
pod_matrix1_set1[i][j] = k;
// cout << "k = " << k;
k++;
}
}
cout << "Matrix 1 Set 1:\n"
<< endl;
// print_full_matrix(pod_matrix1_set1, set_size1);
print_partial_matrix(pod_matrix1_set1);
// Second Matrix
vector<vector<double>> pod_matrix2_set1(set_size1, vector<double>(set_size1));
k = 0.0;
for (unsigned int i = 0; i < set_size1; i++)
{
for (unsigned int j = 0; j < set_size1; j++)
{
pod_matrix2_set1[i][j] = static_cast<double>((int(k) % 2) + 1);
k++;
}
}
cout << "Matrix 2 Set 1:\n"
<< endl;
// print_full_matrix(pod_matrix2_set1, set_size1);
print_partial_matrix(pod_matrix2_set1);
// ------------- Second SET -------------
// First Matrix
int set_size2 = 100;
vector<vector<double>> pod_matrix1_set2(set_size2, vector<double>(set_size2));
k = 0.0;
for (unsigned int i = 0; i < set_size2; i++)
{
for (unsigned int j = 0; j < set_size2; j++)
{
pod_matrix1_set2[i][j] = k;
// cout << "k = " << k;
k++;
}
}
cout << "Matrix 1 Set 2:\n"
<< endl;
print_partial_matrix(pod_matrix1_set2);
// Second Matrix
vector<vector<double>> pod_matrix2_set2(set_size2, vector<double>(set_size2));
k = 0.0;
for (unsigned int i = 0; i < set_size2; i++)
{
for (unsigned int j = 0; j < set_size2; j++)
{
pod_matrix2_set2[i][j] = static_cast<double>((int(k) % 2) + 1);
k++;
}
}
cout << "Matrix 2 Set 2:\n"
<< endl;
print_partial_matrix(pod_matrix2_set2);
// ------------- THIRD SET -------------
// First Matrix
int set_size3 = 1000;
vector<vector<double>> pod_matrix1_set3(set_size3, vector<double>(set_size3));
k = 0.0;
for (unsigned int i = 0; i < set_size3; i++)
{
for (unsigned int j = 0; j < set_size3; j++)
{
pod_matrix1_set3[i][j] = k;
// cout << "k = " << k;
k++;
}
}
cout << "Matrix 1 Set 3:\n"
<< endl;
print_partial_matrix(pod_matrix1_set3);
// Second Matrix
vector<vector<double>> pod_matrix2_set3(set_size3, vector<double>(set_size3));
k = 0.0;
for (unsigned int i = 0; i < set_size3; i++)
{
for (unsigned int j = 0; j < set_size3; j++)
{
pod_matrix2_set3[i][j] = static_cast<double>((int(k) % 2) + 1);
k++;
}
}
cout << "Matrix 2 Set 3:\n"
<< endl;
print_partial_matrix(pod_matrix2_set3);
// Encode the matrices
vector<Plaintext> plain_matrix1_set1(set_size1), plain_matrix2_set1(set_size1);
vector<Plaintext> plain_matrix1_set2(set_size2), plain_matrix2_set2(set_size2);
vector<Plaintext> plain_matrix1_set3(set_size3), plain_matrix2_set3(set_size3);
double scale = sqrt(static_cast<double>(params.coeff_modulus().back().value()));
// First set encode
for (unsigned int i = 0; i < pod_matrix1_set1.size(); i++)
{
ckks_encoder.encode(pod_matrix1_set1[i], scale, plain_matrix1_set1[i]);
}
for (unsigned int i = 0; i < pod_matrix2_set1.size(); i++)
{
ckks_encoder.encode(pod_matrix2_set1[i], scale, plain_matrix2_set1[i]);
}
// Second set encode
for (unsigned int i = 0; i < pod_matrix1_set2.size(); i++)
{
ckks_encoder.encode(pod_matrix1_set2[i], scale, plain_matrix1_set2[i]);
}
for (unsigned int i = 0; i < pod_matrix2_set2.size(); i++)
{
ckks_encoder.encode(pod_matrix2_set2[i], scale, plain_matrix2_set2[i]);
}
// Third set encode
for (unsigned int i = 0; i < pod_matrix1_set3.size(); i++)
{
ckks_encoder.encode(pod_matrix1_set3[i], scale, plain_matrix1_set3[i]);
}
for (unsigned int i = 0; i < pod_matrix2_set3.size(); i++)
{
ckks_encoder.encode(pod_matrix2_set3[i], scale, plain_matrix2_set3[i]);
}
// Encrypt the matrices
vector<Ciphertext> cipher_matrix1_set1(set_size1), cipher_matrix2_set1(set_size1);
vector<Ciphertext> cipher_matrix1_set2(set_size2), cipher_matrix2_set2(set_size2);
vector<Ciphertext> cipher_matrix1_set3(set_size3), cipher_matrix2_set3(set_size3);
// First set cipher
for (unsigned int i = 0; i < plain_matrix1_set1.size(); i++)
{
encryptor.encrypt(plain_matrix1_set1[i], cipher_matrix1_set1[i]);
}
for (unsigned int i = 0; i < plain_matrix2_set1.size(); i++)
{
encryptor.encrypt(plain_matrix2_set1[i], cipher_matrix2_set1[i]);
}
// Second set cipher
for (unsigned int i = 0; i < plain_matrix1_set2.size(); i++)
{
encryptor.encrypt(plain_matrix1_set2[i], cipher_matrix1_set2[i]);
}
for (unsigned int i = 0; i < plain_matrix2_set2.size(); i++)
{
encryptor.encrypt(plain_matrix2_set2[i], cipher_matrix2_set2[i]);
}
// Third set cipher
for (unsigned int i = 0; i < plain_matrix1_set3.size(); i++)
{
encryptor.encrypt(plain_matrix1_set3[i], cipher_matrix1_set3[i]);
}
for (unsigned int i = 0; i < plain_matrix2_set3.size(); i++)
{
encryptor.encrypt(plain_matrix2_set3[i], cipher_matrix2_set3[i]);
}
// Create ciphertext output
// Set 1 output
vector<Ciphertext> cipher_result1_set1(set_size1), cipher_result2_set1(set_size1), cipher_result3_set1(set_size1), cipher_result4_set1(set_size1);
// Set 2 output
vector<Ciphertext> cipher_result1_set2(set_size2), cipher_result2_set2(set_size2), cipher_result3_set2(set_size2), cipher_result4_set2(set_size2);
// Set 3 output
vector<Ciphertext> cipher_result1_set3(set_size3), cipher_result2_set3(set_size3), cipher_result3_set3(set_size3), cipher_result4_set3(set_size3);
// ------------------ (cipher1 + plain2) ---------------
cout << "\n------------------ FIRST OPERATION ------------------\n"
<< endl;
outf << "# index 0" << endl;
outf << "# C1 + P2" << endl;
// Compute (cipher1 + plain2) for set 1
cout << "Compute (cipher1 + plain2) for set 1" << endl;
// TIME START
auto start_comp1_set1 = chrono::high_resolution_clock::now();
for (unsigned int i = 0; i < cipher_matrix1_set1.size(); i++)
{
evaluator.add_plain(cipher_matrix1_set1[i], plain_matrix2_set1[i], cipher_result1_set1[i]);
}
// TIME END
auto stop_comp1_set1 = chrono::high_resolution_clock::now();
auto duration_comp1_set1 = chrono::duration_cast<chrono::microseconds>(stop_comp1_set1 - start_comp1_set1);
// Decrypt and Decode
vector<Plaintext> plain_result1_set1(set_size1);
cout << "Decrypt and decode the result" << endl;
for (unsigned int i = 0; i < cipher_result1_set1.size(); i++)
{
decryptor.decrypt(cipher_result1_set1[i], plain_result1_set1[i]);
}
vector<vector<double>> matrix_result1_set1(set_size1, vector<double>(set_size1));
for (unsigned int i = 0; i < plain_result1_set1.size(); i++)
{
ckks_encoder.decode(plain_result1_set1[i], matrix_result1_set1[i]);
}
print_partial_matrix(matrix_result1_set1);
cout << "\nTime to compute cipher1 + plain2: " << duration_comp1_set1.count() << " microseconds" << endl;
outf << set_size1 << "\t\t" << duration_comp1_set1.count() << endl;
// Compute (cipher1 + plain2) for set 2
cout << "Compute (cipher1 + plain2) for set 2" << endl;
// TIME START
auto start_comp1_set2 = chrono::high_resolution_clock::now();
for (unsigned int i = 0; i < cipher_matrix1_set2.size(); i++)
{
evaluator.add_plain(cipher_matrix1_set2[i], plain_matrix2_set2[i], cipher_result1_set2[i]);
}
// TIME END
auto stop_comp1_set2 = chrono::high_resolution_clock::now();
auto duration_comp1_set2 = chrono::duration_cast<chrono::microseconds>(stop_comp1_set2 - start_comp1_set2);
// Decrypt and Decode
vector<Plaintext> plain_result1_set2(set_size2);
cout << "Decrypt and decode the result" << endl;
for (unsigned int i = 0; i < cipher_result1_set2.size(); i++)
{
decryptor.decrypt(cipher_result1_set2[i], plain_result1_set2[i]);
}
vector<vector<double>> matrix_result1_set2(set_size2, vector<double>(set_size2));
for (unsigned int i = 0; i < plain_result1_set2.size(); i++)
{
ckks_encoder.decode(plain_result1_set2[i], matrix_result1_set2[i]);
}
print_partial_matrix(matrix_result1_set2);
cout << "\nTime to compute cipher1 + plain2: " << duration_comp1_set2.count() << " microseconds" << endl;
outf << set_size2 << "\t\t" << duration_comp1_set2.count() << endl;
// Compute (cipher1 + plain2) for set 3
cout << "Compute (cipher1 + plain2) for set 3" << endl;
// TIME START
auto start_comp1_set3 = chrono::high_resolution_clock::now();
for (unsigned int i = 0; i < cipher_matrix1_set3.size(); i++)
{
evaluator.add_plain(cipher_matrix1_set3[i], plain_matrix2_set3[i], cipher_result1_set3[i]);
}
// TIME END
auto stop_comp1_set3 = chrono::high_resolution_clock::now();
auto duration_comp1_set3 = chrono::duration_cast<chrono::microseconds>(stop_comp1_set3 - start_comp1_set3);
// Decrypt and Decode
vector<Plaintext> plain_result1_set3(set_size3);
cout << "Decrypt and decode the result" << endl;
for (unsigned int i = 0; i < cipher_result1_set3.size(); i++)
{
decryptor.decrypt(cipher_result1_set3[i], plain_result1_set3[i]);
}
vector<vector<double>> matrix_result1_set3(set_size3, vector<double>(set_size3));
for (unsigned int i = 0; i < plain_result1_set3.size(); i++)
{
ckks_encoder.decode(plain_result1_set3[i], matrix_result1_set3[i]);
}
print_partial_matrix(matrix_result1_set3);
cout << "\nTime to compute cipher1 + plain2: " << duration_comp1_set3.count() << " microseconds" << endl;
outf << set_size3 << "\t\t" << duration_comp1_set3.count() << endl;
cout << endl;
outf << "\n"
<< endl;
// ------------------ (cipher1 + cipher2) ---------------
cout << "\n------------------ SECOND OPERATION ------------------\n"
<< endl;
outf << "# index 1" << endl;
outf << "# C1 + C2" << endl;
// Compute (cipher1 + cipher2) for set 1
cout << "Compute (cipher1 + cipher2) for set 1" << endl;
// TIME START
auto start_comp2_set1 = chrono::high_resolution_clock::now();
for (unsigned int i = 0; i < cipher_matrix1_set1.size(); i++)
{
evaluator.add(cipher_matrix1_set1[i], cipher_matrix2_set1[i], cipher_result2_set1[i]);
}
// TIME END
auto stop_comp2_set1 = chrono::high_resolution_clock::now();
auto duration_comp2_set1 = chrono::duration_cast<chrono::microseconds>(stop_comp2_set1 - start_comp2_set1);
// Decrypt and Decode
vector<Plaintext> plain_result2_set1(set_size1);
cout << "Decrypt and decode the result" << endl;
for (unsigned int i = 0; i < cipher_result2_set1.size(); i++)
{
decryptor.decrypt(cipher_result2_set1[i], plain_result2_set1[i]);
}
vector<vector<double>> matrix_result2_set1(set_size1, vector<double>(set_size1));
for (unsigned int i = 0; i < plain_result2_set1.size(); i++)
{
ckks_encoder.decode(plain_result2_set1[i], matrix_result2_set1[i]);
}
print_partial_matrix(matrix_result2_set1);
cout << "\nTime to compute cipher1 + cipher2: " << duration_comp2_set1.count() << " microseconds" << endl;
outf << set_size1 << "\t\t" << duration_comp2_set1.count() << endl;
// Compute (cipher1 + cipher2) for set 2
cout << "Compute (cipher1 + cipher2) for set 2" << endl;
// TIME START
auto start_comp2_set2 = chrono::high_resolution_clock::now();
for (unsigned int i = 0; i < cipher_matrix1_set2.size(); i++)
{
evaluator.add(cipher_matrix1_set2[i], cipher_matrix2_set2[i], cipher_result2_set2[i]);
}
// TIME END
auto stop_comp2_set2 = chrono::high_resolution_clock::now();
auto duration_comp2_set2 = chrono::duration_cast<chrono::microseconds>(stop_comp2_set2 - start_comp2_set2);
// Decrypt and Decode
vector<Plaintext> plain_result2_set2(set_size2);
cout << "Decrypt and decode the result" << endl;
for (unsigned int i = 0; i < cipher_result2_set2.size(); i++)
{
decryptor.decrypt(cipher_result2_set2[i], plain_result2_set2[i]);
}
vector<vector<double>> matrix_result2_set2(set_size2, vector<double>(set_size2));
for (unsigned int i = 0; i < plain_result2_set2.size(); i++)
{
ckks_encoder.decode(plain_result2_set2[i], matrix_result2_set2[i]);
}
print_partial_matrix(matrix_result2_set2);
cout << "\nTime to compute cipher1 + cipher2: " << duration_comp2_set2.count() << " microseconds" << endl;
outf << set_size2 << "\t\t" << duration_comp2_set2.count() << endl;
// Compute (cipher1 + cipher2) for set 3
cout << "Compute (cipher1 + cipher2) for set 3" << endl;
// TIME START
auto start_comp2_set3 = chrono::high_resolution_clock::now();
for (unsigned int i = 0; i < cipher_matrix1_set3.size(); i++)
{
evaluator.add(cipher_matrix1_set3[i], cipher_matrix2_set3[i], cipher_result2_set3[i]);
}
// TIME END
auto stop_comp2_set3 = chrono::high_resolution_clock::now();
auto duration_comp2_set3 = chrono::duration_cast<chrono::microseconds>(stop_comp2_set3 - start_comp2_set3);
// Decrypt and Decode
vector<Plaintext> plain_result2_set3(set_size3);
cout << "Decrypt and decode the result" << endl;
for (unsigned int i = 0; i < cipher_result2_set3.size(); i++)
{
decryptor.decrypt(cipher_result2_set3[i], plain_result2_set3[i]);
}
vector<vector<double>> matrix_result2_set3(set_size3, vector<double>(set_size3));
for (unsigned int i = 0; i < plain_result2_set3.size(); i++)
{
ckks_encoder.decode(plain_result2_set3[i], matrix_result2_set3[i]);
}
print_partial_matrix(matrix_result2_set3);
cout << "\nTime to compute cipher1 + cipher2: " << duration_comp2_set3.count() << " microseconds" << endl;
outf << set_size3 << "\t\t" << duration_comp2_set3.count() << endl;
outf.close();
}
int main()
{
// Need to plot graph with x-axis as the size and y-axis as the duration
// Plot 3 different graphs (with 3 different ploy_modulus_degree)
EncryptionParameters params(scheme_type::CKKS);
// Case 1 : poly_modulus_degree = 4096
size_t poly_modulus_degree = 4096;
params.set_poly_modulus_degree(poly_modulus_degree);
params.set_coeff_modulus(CoeffModulus::BFVDefault(poly_modulus_degree));
// Run the tests
//ckksBenchmark(poly_modulus_degree);
ckksBenchmarkMatrix(poly_modulus_degree);
cout << "\nTest transpose:\n"
<< endl;
vector<vector<double>> test_matrix(10, vector<double>(8));
double k = 0.0;
for (unsigned int i = 0; i < test_matrix.size(); i++)
{
for (unsigned int j = 0; j < test_matrix[0].size(); j++)
{
test_matrix[i][j] = k;
k++;
}
}
print_full_matrix(test_matrix, 2);
cout << endl;
print_partial_matrix(test_matrix);
vector<vector<double>> test_transpose = transpose_matrix(test_matrix);
print_full_matrix(test_transpose, 2);
print_partial_matrix(test_transpose);
return 0;
}
| 41,837
|
C++
|
.cpp
| 969
| 36.934985
| 154
| 0.610953
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,666
|
helper.h
|
MarwanNour_SEAL-FYP-Logistic-Regression/helper.h
|
#include <iostream>
#include <iomanip>
#include <fstream>
#include "seal/seal.h"
using namespace std;
using namespace seal;
// Helper function that prints parameters
void print_parameters(shared_ptr<SEALContext> context)
{
// Verify parameters
if (!context)
{
throw invalid_argument("context is not set");
}
auto &context_data = *context->key_context_data();
string scheme_name;
switch (context_data.parms().scheme())
{
case scheme_type::bfv:
scheme_name = "BFV";
break;
case scheme_type::ckks:
scheme_name = "CKKS";
break;
default:
throw invalid_argument("unsupported scheme");
}
cout << "/" << endl;
cout << "| Encryption parameters :" << endl;
cout << "| scheme: " << scheme_name << endl;
cout << "| poly_modulus_degree: " << context_data.parms().poly_modulus_degree() << endl;
cout << "| coeff_modulus size: ";
cout << context_data.total_coeff_modulus_bit_count() << " (";
auto coeff_modulus = context_data.parms().coeff_modulus();
size_t coeff_mod_count = coeff_modulus.size();
for (size_t i = 0; i < coeff_mod_count - 1; i++)
{
cout << coeff_modulus[i].bit_count() << " + ";
}
cout << coeff_modulus.back().bit_count();
cout << ") bits" << endl;
if (context_data.parms().scheme() == scheme_type::bfv)
{
cout << "| plain_modulus: " << context_data.parms().plain_modulus().value() << endl;
}
cout << "\\" << endl;
}
// Helper function that prints a matrix (vector of vectors)
template <typename T>
inline void print_full_matrix(vector<vector<T>> matrix, int precision = 3)
{
// save formatting for cout
ios old_fmt(nullptr);
old_fmt.copyfmt(cout);
cout << fixed << setprecision(precision);
int row_size = matrix.size();
int col_size = matrix[0].size();
for (unsigned int i = 0; i < row_size; i++)
{
cout << "[";
for (unsigned int j = 0; j < col_size - 1; j++)
{
cout << matrix[i][j] << ", ";
}
cout << matrix[i][col_size - 1];
cout << "]" << endl;
}
cout << endl;
// restore old cout formatting
cout.copyfmt(old_fmt);
}
// Helper function that prints parts of a matrix (only squared matrix)
template <typename T>
inline void print_partial_matrix(vector<vector<T>> matrix, int print_size = 3, int precision = 3)
{
// save formatting for cout
ios old_fmt(nullptr);
old_fmt.copyfmt(cout);
cout << fixed << setprecision(precision);
int row_size = matrix.size();
int col_size = matrix[0].size();
// Boundary check
if (row_size < 2 * print_size && col_size < 2 * print_size)
{
cerr << "Cannot print matrix with these dimensions: " << to_string(row_size) << "x" << to_string(col_size) << ". Increase the print size" << endl;
return;
}
// print first 4 elements
for (unsigned int row = 0; row < print_size; row++)
{
cout << "\t[";
for (unsigned int col = 0; col < print_size; col++)
{
cout << matrix[row][col] << ", ";
}
cout << "..., ";
for (unsigned int col = col_size - print_size; col < col_size - 1; col++)
{
cout << matrix[row][col] << ", ";
}
cout << matrix[row][col_size - 1];
cout << "]" << endl;
}
cout << "\t..." << endl;
for (unsigned int row = row_size - print_size; row < row_size; row++)
{
cout << "\t[";
for (unsigned int col = 0; col < print_size; col++)
{
cout << matrix[row][col] << ", ";
}
cout << "..., ";
for (unsigned int col = col_size - print_size; col < col_size - 1; col++)
{
cout << matrix[row][col] << ", ";
}
cout << matrix[row][col_size - 1];
cout << "]" << endl;
}
cout << endl;
// restore old cout formatting
cout.copyfmt(old_fmt);
}
// Helper function that prints parts of a vector
template <typename T>
inline void print_partial_vector(vector<T> vec, int size, int print_size = 3, int precision = 3)
{
// save formatting for cout
ios old_fmt(nullptr);
old_fmt.copyfmt(cout);
cout << fixed << setprecision(precision);
int row_size = size;
// Boundary check
if (row_size < 2 * print_size)
{
cerr << "Cannot print vector with these dimensions: " << to_string(row_size) << ". Increase the print size" << endl;
return;
}
cout << "\t[";
for (unsigned int row = 0; row < print_size; row++)
{
cout << vec[row] << ", ";
}
cout << "..., ";
for (unsigned int row = row_size - print_size; row < row_size - 1; row++)
{
cout << vec[row] << ", ";
}
cout << vec[row_size - 1] << "]\n";
cout << endl;
// restore old cout formatting
cout.copyfmt(old_fmt);
}
// Gets a diagonal from a matrix U
template <typename T>
vector<T> get_diagonal(int position, vector<vector<T>> U)
{
vector<T> diagonal(U.size());
int k = 0;
// U(0,l) , U(1,l+1), ... , U(n-l-1, n-1)
for (int i = 0, j = position; (i < U.size() - position) && (j < U.size()); i++, j++)
{
diagonal[k] = U[i][j];
k++;
}
for (int i = U.size() - position, j = 0; (i < U.size()) && (j < position); i++, j++)
{
diagonal[k] = U[i][j];
k++;
}
return diagonal;
}
// Gets all diagonals from a matrix U into a matrix
template <typename T>
vector<vector<T>> get_all_diagonals(vector<vector<T>> U)
{
vector<vector<T>> diagonal_matrix(U.size());
for (int i = 0; i < U.size(); i++)
{
diagonal_matrix[i] = get_diagonal(i, U);
}
return diagonal_matrix;
}
// Linear Transformation function between ciphertext matrix and ciphertext vector
Ciphertext Linear_Transform_Cipher(Ciphertext ct, vector<Ciphertext> U_diagonals, GaloisKeys gal_keys, Evaluator &evaluator)
{
// Fill ct with duplicate
Ciphertext ct_rot;
evaluator.rotate_vector(ct, -U_diagonals.size(), gal_keys, ct_rot);
// cout << "U_diagonals.size() = " << U_diagonals.size() << endl;
Ciphertext ct_new;
evaluator.add(ct, ct_rot, ct_new);
vector<Ciphertext> ct_result(U_diagonals.size());
evaluator.multiply(ct_new, U_diagonals[0], ct_result[0]);
for (int l = 1; l < U_diagonals.size(); l++)
{
Ciphertext temp_rot;
evaluator.rotate_vector(ct_new, l, gal_keys, temp_rot);
evaluator.multiply(temp_rot, U_diagonals[l], ct_result[l]);
}
Ciphertext ct_prime;
evaluator.add_many(ct_result, ct_prime);
return ct_prime;
}
// Linear Transformation function between plaintext matrix and ciphertext vector
Ciphertext Linear_Transform_Plain(Ciphertext ct, vector<Plaintext> U_diagonals, GaloisKeys gal_keys, EncryptionParameters params)
{
SEALContext context(params);
Evaluator evaluator(context);
// Fill ct with duplicate
Ciphertext ct_rot;
evaluator.rotate_vector(ct, -U_diagonals.size(), gal_keys, ct_rot);
// cout << "U_diagonals.size() = " << U_diagonals.size() << endl;
Ciphertext ct_new;
evaluator.add(ct, ct_rot, ct_new);
vector<Ciphertext> ct_result(U_diagonals.size());
evaluator.multiply_plain(ct_new, U_diagonals[0], ct_result[0]);
for (int l = 1; l < U_diagonals.size(); l++)
{
Ciphertext temp_rot;
evaluator.rotate_vector(ct_new, l, gal_keys, temp_rot);
evaluator.multiply_plain(temp_rot, U_diagonals[l], ct_result[l]);
}
Ciphertext ct_prime;
evaluator.add_many(ct_result, ct_prime);
return ct_prime;
}
// Linear transformation function between ciphertext matrix and plaintext vector
Ciphertext Linear_Transform_CipherMatrix_PlainVector(vector<Plaintext> pt_rotations, vector<Ciphertext> U_diagonals, GaloisKeys gal_keys, Evaluator &evaluator)
{
vector<Ciphertext> ct_result(pt_rotations.size());
for (int i = 0; i < pt_rotations.size(); i++)
{
evaluator.multiply_plain(U_diagonals[i], pt_rotations[i], ct_result[i]);
}
Ciphertext ct_prime;
evaluator.add_many(ct_result, ct_prime);
return ct_prime;
}
template <typename T>
vector<vector<double>> get_matrix_of_ones(int position, vector<vector<T>> U)
{
vector<vector<double>> diagonal_of_ones(U.size(), vector<double>(U.size()));
vector<T> U_diag = get_diagonal(position, U);
int k = 0;
for (int i = 0; i < U.size(); i++)
{
for (int j = 0; j < U.size(); j++)
{
if (U[i][j] == U_diag[k])
{
diagonal_of_ones[i][j] = 1;
}
else
{
diagonal_of_ones[i][j] = 0;
}
}
k++;
}
return diagonal_of_ones;
}
// Encodes Ciphertext Matrix into a single vector (Row ordering of a matix)
Ciphertext C_Matrix_Encode(vector<Ciphertext> matrix, GaloisKeys gal_keys, Evaluator &evaluator)
{
Ciphertext ct_result;
int dimension = matrix.size();
vector<Ciphertext> ct_rots(dimension);
ct_rots[0] = matrix[0];
for (int i = 1; i < dimension; i++)
{
evaluator.rotate_vector(matrix[i], (i * -dimension), gal_keys, ct_rots[i]);
}
evaluator.add_many(ct_rots, ct_result);
return ct_result;
}
// Decodes Ciphertext Matrix into vector of Ciphertexts
vector<Ciphertext> C_Matrix_Decode(Ciphertext matrix, int dimension, double scale, GaloisKeys gal_keys, CKKSEncoder &ckks_encoder, Evaluator &evaluator)
{
vector<Ciphertext> ct_result(dimension);
for (int i = 0; i < dimension; i++)
{
// Create masks vector with 1s and 0s
// Fill mask vector with 0s
vector<double> mask_vec(pow(dimension, 2), 0);
// Store 1s in mask vector at dimension offset. Offset = j + (i * dimension)
for (int j = 0; j < dimension; j++)
{
mask_vec[j + (i * dimension)] = 1;
}
// Encode mask vector
Plaintext mask_pt;
ckks_encoder.encode(mask_vec, scale, mask_pt);
// multiply matrix with mask
Ciphertext ct_row;
evaluator.multiply_plain(matrix, mask_pt, ct_row);
// rotate row (not the first one)
if (i != 0)
{
evaluator.rotate_vector_inplace(ct_row, i * dimension, gal_keys);
}
// store in result
ct_result[i] = ct_row;
}
return ct_result;
}
template <typename T>
vector<double> pad_zero(int offset, vector<T> U_vec)
{
vector<double> result_vec(pow(U_vec.size(), 2));
// Fill before U_vec
for (int i = 0; i < offset; i++)
{
result_vec[i] = 0;
}
// Fill U_vec
for (int i = 0; i < U_vec.size(); i++)
{
result_vec[i + offset] = U_vec[i];
}
// Fill after U_vec
for (int i = offset + U_vec.size(); i < result_vec.size(); i++)
{
result_vec[i] = 0;
}
return result_vec;
}
// U_transpose
template <typename T>
vector<vector<double>> get_U_transpose(vector<vector<T>> U)
{
int dimension = U.size();
int dimensionSq = pow(dimension, 2);
vector<vector<double>> U_transpose(dimensionSq, vector<double>(dimensionSq));
int tranposed_row = 0;
for (int i = 0; i < dimension; i++)
{
// Get matrix of ones at position k
vector<vector<double>> one_matrix = get_matrix_of_ones(i, U);
print_full_matrix(one_matrix);
// Loop over matrix of ones
for (int offset = 0; offset < dimension; offset++)
{
vector<double> temp_fill = pad_zero(offset * dimension, one_matrix[0]);
U_transpose[tranposed_row] = temp_fill;
tranposed_row++;
}
}
return U_transpose;
}
// Ciphertext dot product
Ciphertext cipher_dot_product(Ciphertext ctA, Ciphertext ctB, int size, RelinKeys relin_keys, GaloisKeys gal_keys, Evaluator &evaluator)
{
// cout << "\nCTA Info:\n";
// cout << "\tLevel:\t" << context->get_context_data(ctA.parms_id())->chain_index() << endl;
// cout << "\tScale:\t" << log2(ctA.scale()) << endl;
// ios old_fmt(nullptr);
// old_fmt.copyfmt(cout);
// cout << fixed << setprecision(10);
// cout << "\tExact Scale:\t" << ctA.scale() << endl;
// cout.copyfmt(old_fmt);
// cout << "\tSize:\t" << ctA.size() << endl;
Ciphertext mult;
// Component-wise multiplication
evaluator.multiply(ctA, ctB, mult);
// cout << "\nMult Info:\n";
// cout << "\tLevel:\t" << context->get_context_data(mult.parms_id())->chain_index() << endl;
// cout << "\tScale:\t" << log2(mult.scale()) << endl;
// cout << "\tExact Scale:\t" << mult.scale() << endl;
// cout << "\tSize:\t" << mult.size() << endl;
evaluator.relinearize_inplace(mult, relin_keys);
evaluator.rescale_to_next_inplace(mult);
// cout << "\nMult Info:\n";
// cout << "\tLevel:\t" << context->get_context_data(mult.parms_id())->chain_index() << endl;
// cout << "\tScale:\t" << log2(mult.scale()) << endl;
// ios old_fmt1(nullptr);
// old_fmt1.copyfmt(cout);
// cout << fixed << setprecision(10);
// cout << "\tExact Scale:\t" << mult.scale() << endl;
// cout.copyfmt(old_fmt1);
// cout << "\tSize:\t" << mult.size() << endl;
// Fill with duplicate
Ciphertext zero_filled;
evaluator.rotate_vector(mult, -size, gal_keys, zero_filled); // vector has zeros now
// cout << "\nZero Filled Info:\n";
// cout << "\tLevel:\t" << context->get_context_data(zero_filled.parms_id())->chain_index() << endl;
// cout << "\tScale:\t" << log2(zero_filled.scale()) << endl;
// cout << "\tExact Scale:\t" << zero_filled.scale() << endl;
// cout << "\tSize:\t" << zero_filled.size() << endl;
Ciphertext dup;
evaluator.add(mult, zero_filled, dup); // vector has duplicate now
// cout << "\nDup Info:\n";
// cout << "\tLevel:\t" << context->get_context_data(dup.parms_id())->chain_index() << endl;
// cout << "\tScale:\t" << log2(dup.scale()) << endl;
// cout << "\tExact Scale:\t" << dup.scale() << endl;
// cout << "\tSize:\t" << dup.size() << endl;
for (int i = 1; i < size; i++)
{
evaluator.rotate_vector_inplace(dup, 1, gal_keys);
evaluator.add_inplace(mult, dup);
}
// cout << "\nMult Info:\n";
// cout << "\tLevel:\t" << context->get_context_data(mult.parms_id())->chain_index() << endl;
// cout << "\tScale:\t" << log2(mult.scale()) << endl;
// ios old_fmt2(nullptr);
// old_fmt2.copyfmt(cout);
// cout << fixed << setprecision(10);
// cout << "\tExact Scale:\t" << mult.scale() << endl;
// cout.copyfmt(old_fmt2);
// cout << "\tSize:\t" << mult.size() << endl;
// Manual Rescale
mult.scale() = pow(2, (int)log2(mult.scale()));
// cout << "\nMult Info:\n";
// cout << "\tLevel:\t" << context->get_context_data(mult.parms_id())->chain_index() << endl;
// cout << "\tScale:\t" << log2(mult.scale()) << endl;
// ios old_fmt3(nullptr);
// old_fmt3.copyfmt(cout);
// cout << fixed << setprecision(10);
// cout << "\tExact Scale:\t" << mult.scale() << endl;
// cout.copyfmt(old_fmt3);
// cout << "\tSize:\t" << mult.size() << endl;
return mult;
}
// Helper for Tree method, computes powers of x in a tree
void compute_all_powers(const Ciphertext &ctx, int degree, Evaluator &evaluator, RelinKeys &relin_keys, vector<Ciphertext> &powers)
{
powers.resize(degree + 1);
powers[1] = ctx;
vector<int> levels(degree + 1, 0);
levels[1] = 0;
levels[0] = 0;
for (int i = 2; i <= degree; i++)
{
// compute x^i
int minlevel = i;
int cand = -1;
for (int j = 1; j <= i / 2; j++)
{
int k = i - j;
int newlevel = max(levels[j], levels[k]) + 1;
if (newlevel < minlevel)
{
cand = j;
minlevel = newlevel;
}
}
levels[i] = minlevel;
// use cand
if (cand < 0)
throw runtime_error("error");
// cand <= i - cand by definition
Ciphertext temp = powers[cand];
evaluator.mod_switch_to_inplace(temp, powers[i - cand].parms_id());
evaluator.multiply(temp, powers[i - cand], powers[i]);
evaluator.relinearize_inplace(powers[i], relin_keys);
evaluator.rescale_to_next_inplace(powers[i]);
}
return;
}
// Gets a random float between a and b
float RandomFloat(float a, float b)
{
float random = ((float)rand()) / (float)RAND_MAX;
float diff = b - a;
float r = random * diff;
return a + r;
}
// CSV to string matrix converter
vector<vector<string>> CSVtoMatrix(string filename)
{
vector<vector<string>> result_matrix;
ifstream data(filename);
string line;
int line_count = 0;
while (getline(data, line))
{
stringstream lineStream(line);
string cell;
vector<string> parsedRow;
while (getline(lineStream, cell, ','))
{
parsedRow.push_back(cell);
}
// Skip first line since it has text instead of numbers
if (line_count != 0)
{
result_matrix.push_back(parsedRow);
}
line_count++;
}
return result_matrix;
}
// String matrix to float matrix converter
vector<vector<double>> stringToDoubleMatrix(vector<vector<string>> matrix)
{
vector<vector<double>> result(matrix.size(), vector<double>(matrix[0].size()));
for (int i = 0; i < matrix.size(); i++)
{
for (int j = 0; j < matrix[0].size(); j++)
{
result[i][j] = ::atof(matrix[i][j].c_str());
result[i][j] = static_cast<double>(result[i][j]);
}
}
return result;
}
// Mean calculation
double getMean(vector<double> input_vec)
{
float mean = 0;
for (int i = 0; i < input_vec.size(); i++)
{
mean += input_vec[i];
}
mean /= input_vec.size();
return mean;
}
// Standard Dev calculation
double getStandardDev(vector<double> input_vec, double mean)
{
double variance = 0;
for (int i = 0; i < input_vec.size(); i++)
{
variance += pow(input_vec[i] - mean, 2);
}
variance /= input_vec.size();
double standard_dev = sqrt(variance);
return standard_dev;
}
// Standard Scaler
vector<vector<double>> standard_scaler_double(vector<vector<double>> input_matrix)
{
int rowSize = input_matrix.size();
int colSize = input_matrix[0].size();
vector<vector<double>> result_matrix(rowSize, vector<double>(colSize));
// Optimization: Get Means and Standard Devs first then do the scaling
// first pass: get means and standard devs
vector<double> means_vec(colSize);
vector<double> stdev_vec(colSize);
for (int i = 0; i < colSize; i++)
{
vector<double> column(rowSize);
for (int j = 0; j < rowSize; j++)
{
// cout << input_matrix[j][i] << ", ";
column[j] = input_matrix[j][i];
// cout << column[j] << ", ";
}
means_vec[i] = getMean(column);
stdev_vec[i] = getStandardDev(column, means_vec[i]);
// cout << "MEAN at i = " << i << ":\t" << means_vec[i] << endl;
// cout << "STDV at i = " << i << ":\t" << stdev_vec[i] << endl;
}
// second pass: scale
for (int i = 0; i < rowSize; i++)
{
for (int j = 0; j < colSize; j++)
{
result_matrix[i][j] = (input_matrix[i][j] - means_vec[j]) / stdev_vec[j];
// cout << "RESULT at i = " << i << ":\t" << result_matrix[i][j] << endl;
}
}
return result_matrix;
}
// Matrix Transpose
template <typename T>
vector<vector<T>> transpose_matrix(vector<vector<T>> input_matrix)
{
int rowSize = input_matrix.size();
int colSize = input_matrix[0].size();
vector<vector<T>> transposed(colSize, vector<T>(rowSize));
for (int i = 0; i < rowSize; i++)
{
for (int j = 0; j < colSize; j++)
{
transposed[j][i] = input_matrix[i][j];
}
}
return transposed;
}
// Print entire vector
template <typename T>
void print_full_vector(vector<T> vec)
{
cout << "\t[ ";
for (unsigned int i = 0; i < vec.size() - 1; i++)
{
cout << vec[i] << ", ";
}
cout << vec[vec.size() - 1] << " ]" << endl;
}
// U_sigma
template <typename T>
vector<vector<double>> get_U_sigma(vector<vector<T>> U)
{
int dimension = U.size();
int dimensionSq = pow(dimension, 2);
vector<vector<double>> U_sigma(dimensionSq, vector<double>(dimensionSq));
int k = 0;
int sigma_row = 0;
for (int offset = 0; offset < dimensionSq; offset += dimension)
{
// Get the matrix of ones at position k
vector<vector<double>> one_matrix = get_matrix_of_ones(k, U);
// print_full_matrix(one_matrix);
// Loop over the matrix of ones
for (int one_matrix_index = 0; one_matrix_index < dimension; one_matrix_index++)
{
// Pad with zeros the vector of one
vector<double> temp_fill = pad_zero(offset, one_matrix[one_matrix_index]);
// Store vector in U_sigma at position index_sigma
// print_full_vector(temp_fill);
U_sigma[sigma_row] = temp_fill;
sigma_row++;
}
k++;
}
return U_sigma;
}
// U_sigma
template <typename T>
vector<vector<double>> get_U_tau(vector<vector<T>> U)
{
int dimension = U.size();
int dimensionSq = pow(dimension, 2);
vector<vector<double>> U_tau(dimensionSq, vector<double>(dimensionSq));
int tau_row = 0;
// Divide the matrix into blocks of size = dimension
for (int i = 0; i < dimension; i++)
{
// Get the matrix of ones at position i
vector<vector<double>> one_matrix = get_matrix_of_ones(0, U);
// print_full_matrix(one_matrix);
// Loop over the matrix of ones and store in U_tau the rows of the matrix of ones with the offset
int offset = i * dimension;
for (int j = 0; j < dimension; j++)
{
vector<double> temp_fill = pad_zero(offset, one_matrix[j]);
// print_full_vector(temp_fill);
U_tau[tau_row] = temp_fill;
tau_row++;
// Update offset
if (offset + dimension == dimensionSq)
{
offset = 0;
}
else
{
offset += dimension;
}
}
}
return U_tau;
}
// V_k
template <typename T>
vector<vector<double>> get_V_k(vector<vector<T>> U, int k)
{
int dimension = U.size();
if (k < 1 || k >= dimension)
{
cerr << "Invalid K for matrix V_k: " << to_string(k) << ". Choose k to be between 1 and " << to_string(dimension) << endl;
exit(1);
}
int dimensionSq = pow(dimension, 2);
vector<vector<double>> V_k(dimensionSq, vector<double>(dimensionSq));
int V_row = 0;
for (int offset = 0; offset < dimensionSq; offset += dimension)
{
// Get the matrix of ones at position k
vector<vector<double>> one_matrix = get_matrix_of_ones(k, U);
// print_full_matrix(one_matrix);
// Loop over the matrix of ones
for (int one_matrix_index = 0; one_matrix_index < dimension; one_matrix_index++)
{
// Pad with zeros the vector of one
vector<double> temp_fill = pad_zero(offset, one_matrix[one_matrix_index]);
// Store vector in V_k at position V_row
// print_full_vector(temp_fill);
V_k[V_row] = temp_fill;
V_row++;
}
}
return V_k;
}
// W_k
template <typename T>
vector<vector<double>> get_W_k(vector<vector<T>> U, int k)
{
int dimension = U.size();
if (k < 1 || k >= dimension)
{
cerr << "Invalid K for matrix V_k: " << to_string(k) << ". Choose k to be between 1 and " << to_string(dimension) << endl;
exit(1);
}
int dimensionSq = pow(dimension, 2);
vector<vector<double>> W_k(dimensionSq, vector<double>(dimensionSq));
int W_row = 0;
// Get matrix of ones at position 0
vector<vector<double>> one_matrix = get_matrix_of_ones(0, U);
int offset = k * dimension;
// Divide the W matrix into several blocks of size dxd and store matrix of ones in them with offsets
for (int i = 0; i < dimension; i++)
{
// Loop over the matrix of ones
for (int one_matrix_index = 0; one_matrix_index < dimension; one_matrix_index++)
{
// Pad with zeros the vector of one
vector<double> temp_fill = pad_zero(offset, one_matrix[one_matrix_index]);
// Store vector in W_k at position W_row
// print_full_vector(temp_fill);
W_k[W_row] = temp_fill;
W_row++;
}
if (offset + dimension == dimensionSq)
{
offset = 0;
}
else
{
offset += dimension;
}
}
return W_k;
}
| 25,043
|
C++
|
.h
| 725
| 28.347586
| 159
| 0.578869
|
MarwanNour/SEAL-FYP-Logistic-Regression
| 30
| 9
| 0
|
GPL-3.0
|
9/20/2024, 10:44:35 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,667
|
Common.cpp
|
lgottwald_PaPILO/test/Common.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#define CATCH_CONFIG_MAIN
#include "papilo/core/Common.hpp"
#include "catch/catch.hpp"
TEST_CASE( "test activity computation and constraint propagation", "[core]" )
{
Vec<int> colinds{0, 1, 2, 3, 4, 5, 6, 7};
Vec<double> rowvalues{1.0, -1.0, 2.0, -2.0, 3.0, -3.0, 4.0, -4.0};
Vec<double> lbs{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
Vec<double> ubs{1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
int colrows = 0;
Vec<RowActivity<double>> activities;
activities.emplace_back( compute_row_activity(
rowvalues.data(), colinds.data(), rowvalues.size(), lbs, ubs ) );
REQUIRE( activities[0].ninfmin == 0 );
REQUIRE( activities[0].ninfmax == 0 );
REQUIRE( activities[0].min == -activities[0].max );
REQUIRE( activities[0].max == ( 1.0 + 2.0 + 3.0 + 4.0 ) );
int ncalls = 0;
// fix column 0 to upper bound
auto activity_callback = [&]( ActivityChange actChange, int row,
RowActivity<double>& activity ) {
REQUIRE( row == 0 );
REQUIRE( &activity == &activities[0] );
if( ncalls == 0 )
{
REQUIRE( actChange == ActivityChange::kMin );
}
else if( ncalls == 1 )
{
REQUIRE( actChange == ActivityChange::kMax );
}
++ncalls;
};
update_activities_after_boundchange( &rowvalues[0], &colrows, 1, lbs[0],
ubs[0], ubs[0], ubs[0], activities,
activity_callback );
lbs[0] = ubs[0];
REQUIRE( ncalls == 1 );
REQUIRE( activities[0].ninfmin == 0 );
REQUIRE( activities[0].ninfmax == 0 );
REQUIRE( activities[0].max == ( 1.0 + 2.0 + 3.0 + 4.0 ) );
REQUIRE( activities[0].min == -activities[0].max + 1.0 );
// fix column 1 to upper bound
update_activities_after_boundchange( &rowvalues[1], &colrows, 1, lbs[1],
ubs[1], ubs[1], ubs[1], activities,
activity_callback );
lbs[1] = ubs[1];
REQUIRE( activities[0].ninfmin == 0 );
REQUIRE( activities[0].ninfmax == 0 );
REQUIRE( activities[0].max == ( 1.0 - 1.0 + 2.0 + 3.0 + 4.0 ) );
REQUIRE( activities[0].min == -activities[0].max );
REQUIRE( ncalls == 2 );
update_activities_after_coeffchange(
lbs[6], ubs[6], rowvalues[6], 3.0, activities[0],
[&]( ActivityChange actChange, RowActivity<double>& activity ) {
REQUIRE( &activity == &activities[0] );
REQUIRE( actChange == ActivityChange::kMax );
++ncalls;
} );
rowvalues[6] = 3.0;
REQUIRE( activities[0].max == ( 1.0 - 1.0 + 2.0 + 3.0 + 4.0 - 1.0 ) );
REQUIRE( activities[0].min == -( 1.0 - 1.0 + 2.0 + 3.0 + 4.0 ) );
REQUIRE( activities[0].ninfmin == 0 );
REQUIRE( activities[0].ninfmax == 0 );
REQUIRE( ncalls == 3 );
bool maxchanged = false;
bool minchanged = false;
update_activities_after_coeffchange(
lbs[7], ubs[7], rowvalues[7], 3.0, activities[0],
[&]( ActivityChange actChange, RowActivity<double>& activity ) {
REQUIRE( &activity == &activities[0] );
if( actChange == ActivityChange::kMax )
{
REQUIRE( maxchanged == false );
maxchanged = true;
}
else if( actChange == ActivityChange::kMin )
{
REQUIRE( minchanged == false );
minchanged = true;
}
++ncalls;
} );
rowvalues[7] = 3.0;
REQUIRE( ncalls == 5 );
REQUIRE( minchanged );
REQUIRE( maxchanged );
REQUIRE( activities[0].ninfmin == 0 );
REQUIRE( activities[0].ninfmax == 0 );
REQUIRE( activities[0].max == ( 1.0 - 1.0 + 2.0 + 3.0 + 4.0 - 1.0 + 3.0 ) );
REQUIRE( activities[0].min == -( 1.0 - 1.0 + 2.0 + 3.0 ) );
RowActivity<double> recompute = compute_row_activity(
rowvalues.data(), colinds.data(), rowvalues.size(), lbs, ubs );
REQUIRE( recompute.min == activities[0].min );
REQUIRE( recompute.max == activities[0].max );
REQUIRE( recompute.ninfmin == activities[0].ninfmin );
REQUIRE( recompute.ninfmax == activities[0].ninfmax );
Vec<double> lbs_cpy( lbs );
Vec<double> ubs_cpy( ubs );
ncalls = 0;
propagate_row( rowvalues.data(), colinds.data(), rowvalues.size(),
activities[0], -infinity<double>(), activities[0].min, lbs,
ubs, [&]( BoundChange bndChg, int colid, double newbnd ) {
if( bndChg == BoundChange::kLower )
{
lbs_cpy[colid] = newbnd;
}
else if( bndChg == BoundChange::kUpper )
{
ubs_cpy[colid] = newbnd;
}
++ncalls;
} );
REQUIRE( ncalls == 6 );
// everything should be fixed to its bounds
for( size_t i = 0; i < lbs_cpy.size(); ++i )
{
REQUIRE( lbs_cpy[i] == ubs_cpy[i] );
}
// since everything is fixed maximum and minimum activity should match and be
// equal to activities[0].min since this has been passed as side
recompute = compute_row_activity( rowvalues.data(), colinds.data(),
rowvalues.size(), lbs_cpy, ubs_cpy );
REQUIRE( recompute.min == activities[0].min );
REQUIRE( recompute.min == recompute.max );
lbs_cpy = lbs;
ubs_cpy = ubs;
ncalls = 0;
propagate_row( rowvalues.data(), colinds.data(), rowvalues.size(),
activities[0], activities[0].max, infinity<double>(), lbs,
ubs, [&]( BoundChange bndChg, int colid, double newbnd ) {
if( bndChg == BoundChange::kLower )
{
lbs_cpy[colid] = newbnd;
}
else if( bndChg == BoundChange::kUpper )
{
ubs_cpy[colid] = newbnd;
}
++ncalls;
} );
REQUIRE( ncalls == 6 );
// everything should be fixed to its bounds
for( size_t i = 0; i < lbs_cpy.size(); ++i )
{
REQUIRE( lbs_cpy[i] == ubs_cpy[i] );
}
// since everything is fixed maximum and minimum activity should match and be
// equal to activities[0].min since this has been passed as side
recompute = compute_row_activity( rowvalues.data(), colinds.data(),
rowvalues.size(), lbs_cpy, ubs_cpy );
REQUIRE( recompute.min == activities[0].max );
REQUIRE( recompute.min == recompute.max );
}
| 8,329
|
C++
|
.cpp
| 176
| 38.715909
| 80
| 0.50517
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,668
|
MatrixBuffer.cpp
|
lgottwald_PaPILO/test/MatrixBuffer.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/core/MatrixBuffer.hpp"
#include "catch/catch.hpp"
#include "papilo/misc/fmt.hpp"
using namespace papilo;
template <bool StorageOrder>
bool
checkHeapProperty( MatrixBuffer<double>& M )
{
using Node = GetNodeProperty<StorageOrder>;
if( StorageOrder )
fmt::print( "check row major heap property\n" );
else
fmt::print( "check col major heap property\n" );
for( int i = 1; i != M.entries.size(); ++i )
{
int left = Node::left( M.entries[i] );
int right = Node::right( M.entries[i] );
if( ( left != 0 && Node::priority( M.entries[i] ) <
Node::priority( M.entries[left] ) ) ||
( right != 0 && Node::priority( M.entries[i] ) <
Node::priority( M.entries[right] ) ) )
{
fmt::print( "heap property violated: node {} (prio {}), left {} (prio "
"{}), right {} (prio {})\n",
i, Node::priority( M.entries[i] ), left,
Node::priority( M.entries[left] ), right,
Node::priority( M.entries[right] ) );
}
}
return true;
}
template <bool StorageOrder>
bool
checkBstProperty( MatrixBuffer<double>& M )
{
using Node = GetNodeProperty<StorageOrder>;
for( int i = 1; i != M.entries.size(); ++i )
{
int left = Node::left( M.entries[i] );
int right = Node::right( M.entries[i] );
if( left != 0 && Node::lesser( M.entries[i], M.entries[left] ) )
return false;
if( right != 0 && Node::lesser( M.entries[right], M.entries[i] ) )
return false;
}
return true;
}
TEST_CASE( "matrix-buffer", "[core]" )
{
MatrixBuffer<double> M;
// add entries of the following matrix:
// 1 2 0 0 0 0 0 0 0
// 0 3 4 5 6 7 0 0 0
// 0 8 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0
// 9 10 11 0 0 0 0 12 13
Vec<double> colmajor{1.0, 9.0, 2.0, 3.0, 8.0, 10.0, 4.0,
11.0, 5.0, 6.0, 7.0, 12.0, 13.0};
M.addEntry( 4, 8, 13.0 );
REQUIRE( checkBstProperty<true>( M ) );
REQUIRE( checkBstProperty<false>( M ) );
M.addEntry( 0, 0, 1.0 );
REQUIRE( checkBstProperty<true>( M ) );
REQUIRE( checkBstProperty<false>( M ) );
M.addEntry( 1, 2, 4.0 );
REQUIRE( checkBstProperty<true>( M ) );
REQUIRE( checkBstProperty<false>( M ) );
M.addEntry( 2, 1, 8.0 );
REQUIRE( checkBstProperty<true>( M ) );
REQUIRE( checkBstProperty<false>( M ) );
M.addEntry( 4, 7, 12.0 );
REQUIRE( checkBstProperty<true>( M ) );
REQUIRE( checkBstProperty<false>( M ) );
M.addEntry( 4, 0, 9.0 );
REQUIRE( checkBstProperty<true>( M ) );
REQUIRE( checkBstProperty<false>( M ) );
M.addEntry( 4, 2, 11.0 );
REQUIRE( checkBstProperty<true>( M ) );
REQUIRE( checkBstProperty<false>( M ) );
M.addEntry( 1, 5, 7.0 );
REQUIRE( checkBstProperty<true>( M ) );
REQUIRE( checkBstProperty<false>( M ) );
M.addEntry( 0, 1, 2.0 );
REQUIRE( checkBstProperty<true>( M ) );
REQUIRE( checkBstProperty<false>( M ) );
M.addEntry( 4, 1, 10.0 );
REQUIRE( checkBstProperty<true>( M ) );
REQUIRE( checkBstProperty<false>( M ) );
M.addEntry( 1, 4, 6.0 );
REQUIRE( checkBstProperty<true>( M ) );
REQUIRE( checkBstProperty<false>( M ) );
M.addEntry( 1, 1, 3.0 );
REQUIRE( checkBstProperty<true>( M ) );
REQUIRE( checkBstProperty<false>( M ) );
M.addEntry( 1, 3, 5.0 );
SmallVec<int, 32> stack;
const MatrixEntry<double>* it = M.begin<true>( stack );
REQUIRE( checkHeapProperty<true>( M ) );
REQUIRE( checkHeapProperty<false>( M ) );
REQUIRE( checkBstProperty<true>( M ) );
REQUIRE( checkBstProperty<false>( M ) );
int i = 1;
while( it != M.end() )
{
REQUIRE( it->val == double( i ) );
fmt::print( "{} at depth: {}\n", it->val, stack.size() - 1 );
it = M.next<true>( stack );
++i;
}
REQUIRE( stack.size() == 1 );
it = M.begin<false>( stack );
i = 0;
while( it != M.end() )
{
REQUIRE( it->val == colmajor[i] );
fmt::print( "{} at depth: {}\n", it->val, stack.size() - 1 );
++i;
it = M.next<false>( stack );
}
REQUIRE( stack.size() == 1 );
}
| 5,986
|
C++
|
.cpp
| 143
| 36.916084
| 80
| 0.507476
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,669
|
ParallelRows.cpp
|
lgottwald_PaPILO/test/ParallelRows.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#define CATCH_CONFIG_MAIN
#include "catch/catch.hpp"
#include "papilo/core/ParallelRow.hpp"
#include "papilo/misc/compress_vector.hpp"
#include "papilo/misc/fmt.hpp"
// TODO fix
static bool
operator==( const Reductions<double>::Reduction& lhs,
const Reductions<double>::Reduction& rhs )
{
double max = std::max( double{1.0}, std::max( std::fabs( lhs.newval ),
std::fabs( rhs.newval ) ) );
bool equalityCheck = std::fabs( lhs.newval - rhs.newval ) <=
( std::numeric_limits<double>::epsilon() * max );
return equalityCheck && ( lhs.row == rhs.row ) && ( lhs.col == rhs.col );
}
TEST_CASE( "Parallel row detection", "[core]" )
{
double coef1[] = {1, 1, 1, 1, 1};
double coef2[] = {2, 2, 2, 2, 2};
int id1[] = {1, 2, 3, 4, 5};
int id2[] = {1, 2, 3, 4, 5};
double coef3[] = {1.5, -1.5, 1.5, 1.5, -1.5};
double coef4[] = {-1, 1, -1, -1, 1};
int id3[] = {1, 2, 3, 4, 5};
int id4[] = {1, 2, 3, 4, 5};
double coef5[] = {1, 1, 1, 1, 1};
int id5[] = {1, 2, 4, 6, 9};
double coef6[] = {1, 1, 1, -1, -1};
double coef7[] = {2, 2, 2, -2, -2};
int id6[] = {1, 2, 4, 5, 6};
int id7[] = {1, 2, 4, 5, 6};
double coef8[] = {1, 1, -1, -1, -1};
double coef9[] = {1.0000001, 1, -1, -1, -1};
int id8[] = {1, 2, 4, 5, 6};
int id9[] = {1, 2, 4, 5, 6};
const double* coefs[] = {coef1, coef2, coef3, coef4, coef5,
coef6, coef7, coef8, coef9};
const int* ids[] = {id1, id2, id3, id4, id5, id6, id7, id8, id9};
const int lens[] = {5, 5, 5, 5, 5, 5, 5, 5, 5};
double inf = infinity<double>();
Vec<double> lhs_values{-1, -2, 0, -1, -1, -inf, -inf, -1, -3};
Vec<double> rhs_values{4, 1, 0, 1, 1, 2, 1, 1, 3};
PresolveResult result;
Reductions<double> reductions;
// test lambda used in the presolver
auto handlerows = [&reductions, &result, &lhs_values,
&rhs_values]( int row1, int row2, double ratio ) {
bool firstconsEquality = ( rhs_values[row1] == lhs_values[row1] );
bool secondconsEquality = ( rhs_values[row2] == lhs_values[row2] );
assert( ratio != 0.0 );
// TODO use this
double adjustedLHS = lhs_values[row2] * ratio;
double adjustedRHS = rhs_values[row2] * ratio;
if( firstconsEquality && secondconsEquality )
{
// TODO fp comparaison
if( rhs_values[row1] == adjustedRHS )
{
TransactionGuard<double> guard{reductions};
reductions.lockRow( row1 );
reductions.lockRow( row2 );
reductions.markRowRedundant( row2 );
}
else
result = PresolveResult::INFEASIBLE;
}
else if( firstconsEquality && !secondconsEquality )
{
if( ratio > 0 )
{
if( rhs_values[row1] <= adjustedRHS &&
rhs_values[row1] >= adjustedLHS )
{
TransactionGuard<double> guard{reductions};
reductions.lockRow( row1 );
reductions.lockRow( row2 );
reductions.markRowRedundant( row2 );
}
else
result = PresolveResult::INFEASIBLE;
}
else
{
if( rhs_values[row1] <= adjustedLHS &&
rhs_values[row1] >= adjustedRHS )
{
TransactionGuard<double> guard{reductions};
reductions.lockRow( row1 );
reductions.lockRow( row2 );
reductions.markRowRedundant( row2 );
}
else
result = PresolveResult::INFEASIBLE;
}
}
else if( !firstconsEquality && secondconsEquality )
{
if( ratio > 0 )
{
if( rhs_values[row1] >= adjustedRHS &&
lhs_values[row1] <= adjustedRHS )
{
TransactionGuard<double> guard{reductions};
reductions.lockRow( row1 );
reductions.lockRow( row2 );
reductions.markRowRedundant( row1 );
}
else
result = PresolveResult::INFEASIBLE;
}
else
{
if( rhs_values[row1] >= adjustedRHS &&
rhs_values[row1] <= adjustedRHS )
{
TransactionGuard<double> guard{reductions};
reductions.lockRow( row1 );
reductions.lockRow( row2 );
reductions.markRowRedundant( row1 );
}
else
result = PresolveResult::INFEASIBLE;
}
}
else
{
if( ratio > 0 )
{
if( rhs_values[row1] < adjustedLHS ||
adjustedRHS < lhs_values[row1] )
result = PresolveResult::INFEASIBLE;
else
{
TransactionGuard<double> guard{reductions};
reductions.lockRow( row1 );
reductions.lockRow( row2 );
if( rhs_values[row1] < adjustedRHS )
{
reductions.markRowRedundant( row2 );
if( lhs_values[row1] < adjustedLHS )
reductions.changeRowLHS( row1, adjustedLHS );
}
else
{
reductions.markRowRedundant( row1 );
if( lhs_values[row1] > adjustedLHS )
reductions.changeRowLHS( row2, lhs_values[row1] );
}
}
}
else
{
if( rhs_values[row1] < adjustedLHS ||
adjustedRHS < lhs_values[row1] )
result = PresolveResult::INFEASIBLE;
else
{
TransactionGuard<double> guard{reductions};
reductions.lockRow( row1 );
reductions.lockRow( row2 );
if( rhs_values[row1] < adjustedLHS )
{
reductions.markRowRedundant( row2 );
if( lhs_values[row1] < adjustedRHS )
reductions.changeRowLHS( row1, adjustedRHS );
}
else
{
reductions.markRowRedundant( row1 );
if( lhs_values[row1] > adjustedRHS )
reductions.changeRowLHS( row2, lhs_values[row1] );
}
}
}
}
};
getParallelRows( coefs, ids, 9, lens, handlerows );
REQUIRE( reductions.size() == 12 );
const Reductions<double>::Reduction& reduction =
reductions.getReduction( 0 );
REQUIRE( reduction == Reductions<double>::Reduction( 0.0, 0, -4 ) );
const Reductions<double>::Reduction& reduction1 =
reductions.getReduction( 1 );
REQUIRE( reduction1 == Reductions<double>::Reduction( 0.0, 1, -4 ) );
const Reductions<double>::Reduction& reduction2 =
reductions.getReduction( 2 );
REQUIRE( reduction2 == Reductions<double>::Reduction( 0.0, 0, -3 ) );
const Reductions<double>::Reduction& reduction3 =
reductions.getReduction( 3 );
REQUIRE( reduction3 == Reductions<double>::Reduction( 0.0, 2, -4 ) );
const Reductions<double>::Reduction& reduction4 =
reductions.getReduction( 4 );
REQUIRE( reduction4 == Reductions<double>::Reduction( 0.0, 3, -4 ) );
const Reductions<double>::Reduction& reduction5 =
reductions.getReduction( 5 );
REQUIRE( reduction5 == Reductions<double>::Reduction( 0.0, 3, -3 ) );
const Reductions<double>::Reduction& reduction6 =
reductions.getReduction( 6 );
REQUIRE( reduction6 == Reductions<double>::Reduction( 0.0, 5, -4 ) );
const Reductions<double>::Reduction& reduction7 =
reductions.getReduction( 7 );
REQUIRE( reduction7 == Reductions<double>::Reduction( 0.0, 6, -4 ) );
const Reductions<double>::Reduction& reduction8 =
reductions.getReduction( 8 );
REQUIRE( reduction8 == Reductions<double>::Reduction( 0.0, 5, -3 ) );
const Reductions<double>::Reduction& reduction9 =
reductions.getReduction( 9 );
REQUIRE( reduction9 == Reductions<double>::Reduction( 0.0, 7, -4 ) );
const Reductions<double>::Reduction& reduction10 =
reductions.getReduction( 10 );
REQUIRE( reduction10 == Reductions<double>::Reduction( 0.0, 8, -4 ) );
const Reductions<double>::Reduction& reduction11 =
reductions.getReduction( 11 );
REQUIRE( reduction11 == Reductions<double>::Reduction( 0.0, 8, -3 ) );
}
| 10,256
|
C++
|
.cpp
| 238
| 33.659664
| 79
| 0.513262
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,670
|
CoefStren.cpp
|
lgottwald_PaPILO/test/CoefStren.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#define CATCH_CONFIG_MAIN
#include "catch/catch.hpp"
#include "papilo/core/PresolveMethod.hpp"
#include "papilo/core/Strengthening.hpp"
#include "papilo/misc/compress_vector.hpp"
#include <cmath>
#include <limits>
static bool
operator==( const Reductions<float>::Reduction& lhs,
const Reductions<float>::Reduction& rhs )
{
float max = std::max( float{1.0}, std::max( std::fabs( lhs.newval ),
std::fabs( rhs.newval ) ) );
bool equalityCheck = std::fabs( lhs.newval - rhs.newval ) <=
( std::numeric_limits<float>::epsilon() * max );
return equalityCheck && ( lhs.row == rhs.row ) && ( lhs.col == rhs.col );
}
TEST_CASE( "test coefficient tightening reduction", "[core]" )
{
Reductions<float> reductions;
auto constraintchange = [&reductions](
Action constchange, int i,
Vec<std::pair<int, float>> rowcoefchanges,
float newbound ) {
assert( !rowcoefchanges.empty() );
TransactionGuard<float> guard{reductions};
reductions.lockRow( i );
for( auto coefchange : rowcoefchanges )
{
reductions.changeMatrixEntry( i, coefchange.first, coefchange.second );
}
if( constchange == Action::CHANGE_COEF_UPPER_BOUND )
reductions.changeRowRHS( i, newbound );
else if( constchange == Action::CHANGE_COEF_LOWER_BOUND )
reductions.changeRowLHS( i, newbound );
};
// test constraint x + 2y <= 5.1
// 0 <= x <= 2
// 0 <= y <= 2
// x,y integer
float coefficients[] = {1, 2};
int indices[] = {0, 1};
RowActivity<float> activity;
activity.max = 6.0;
activity.min = 0.0;
float lhs = -infinity<float>();
float rhs = 5.1;
VariableDomains<float> domains;
domains.lower_bounds = Vec<float>{0.0, 0.0};
domains.upper_bounds = Vec<float>{2.0, 2.0};
boost::dynamic_bitset<> integral( 2 );
integral[0] = 1;
integral[1] = 1;
domains.is_integral = integral;
strengthen_coefficients( coefficients, indices, 2, lhs, rhs, activity,
domains, 0, constraintchange );
REQUIRE( reductions.size() == 4 );
REQUIRE( reductions.getReduction( 0 ) ==
Reductions<float>::Reduction( 0.0, 0, -4 ) );
REQUIRE( reductions.getReduction( 1 ) ==
Reductions<float>::Reduction( 0.9, 0, 0 ) );
REQUIRE( reductions.getReduction( 2 ) ==
Reductions<float>::Reduction( 0.9, 0, 1 ) );
REQUIRE( reductions.getReduction( 3 ) ==
Reductions<float>::Reduction( 2.7, 0, -1 ) );
// test constraint -x - 2y => -5.1
// 0 <= x <= 2
// 0 <= y <= 2
// x,y integer
coefficients[0] = -1.0;
coefficients[1] = -2.0;
indices[0] = 0;
indices[1] = 1;
activity.max = 0.0;
activity.min = -6.0;
lhs = -5.1;
rhs = infinity<float>();
domains.lower_bounds = Vec<float>{0.0, 0.0};
domains.upper_bounds = Vec<float>{2.0, 2.0};
integral[0] = 1;
integral[1] = 1;
domains.is_integral = integral;
reductions.clear();
strengthen_coefficients( coefficients, indices, 2, lhs, rhs, activity,
domains, 0, constraintchange );
REQUIRE( reductions.size() == 4 );
REQUIRE( reductions.getReduction( 0 ) ==
Reductions<float>::Reduction( 0.0, 0, -4 ) );
REQUIRE( reductions.getReduction( 1 ) ==
Reductions<float>::Reduction( -0.9, 0, 0 ) );
REQUIRE( reductions.getReduction( 2 ) ==
Reductions<float>::Reduction( -0.9, 0, 1 ) );
REQUIRE( reductions.getReduction( 3 ) ==
Reductions<float>::Reduction( -2.7, 0, -2 ) );
// test constraint -x + 2y <= +5.1
// -2 <= x <= 0
// 0 <= y <= 2
// x,y integer
coefficients[0] = -1.0;
coefficients[1] = 2.0;
indices[0] = 0;
indices[1] = 1;
activity.max = 6.0;
activity.min = 0.0;
lhs = -infinity<float>();
rhs = 5.1;
domains.lower_bounds = Vec<float>{-2.0, 0.0};
domains.upper_bounds = Vec<float>{0.0, 2.0};
integral[0] = 1;
integral[1] = 1;
domains.is_integral = integral;
reductions.clear();
strengthen_coefficients( coefficients, indices, 2, lhs, rhs, activity,
domains, 0, constraintchange );
REQUIRE( reductions.size() == 4 );
REQUIRE( reductions.getReduction( 0 ) ==
Reductions<float>::Reduction( 0.0, 0, -4 ) );
REQUIRE( reductions.getReduction( 1 ) ==
Reductions<float>::Reduction( -0.9, 0, 0 ) );
REQUIRE( reductions.getReduction( 2 ) ==
Reductions<float>::Reduction( 0.9, 0, 1 ) );
REQUIRE( reductions.getReduction( 3 ) ==
Reductions<float>::Reduction( 2.7, 0, -1 ) );
// test constraint x - 2y >= -5.1
// -2 <= x <= 0
// 0 <= y <= 2
// x,y integer
coefficients[0] = 1.0;
coefficients[1] = -2.0;
indices[0] = 0;
indices[1] = 1;
activity.max = 0.0;
activity.min = -6.0;
lhs = -5.1;
rhs = infinity<float>();
domains.lower_bounds = Vec<float>{-2.0, 0.0};
domains.upper_bounds = Vec<float>{0.0, 2.0};
integral[0] = 1;
integral[1] = 1;
domains.is_integral = integral;
reductions.clear();
strengthen_coefficients( coefficients, indices, 2, lhs, rhs, activity,
domains, 0, constraintchange );
REQUIRE( reductions.size() == 4 );
REQUIRE( reductions.getReduction( 0 ) ==
Reductions<float>::Reduction( 0.0, 0, -4 ) );
REQUIRE( reductions.getReduction( 1 ) ==
Reductions<float>::Reduction( 0.9, 0, 0 ) );
REQUIRE( reductions.getReduction( 2 ) ==
Reductions<float>::Reduction( -0.9, 0, 1 ) );
REQUIRE( reductions.getReduction( 3 ) ==
Reductions<float>::Reduction( -2.7, 0, -2 ) );
}
| 7,552
|
C++
|
.cpp
| 175
| 37.114286
| 80
| 0.536433
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,671
|
SparseStorage.cpp
|
lgottwald_PaPILO/test/SparseStorage.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#define CATCH_CONFIG_MAIN
#include "papilo/core/SparseStorage.hpp"
#include "catch/catch.hpp"
#include "papilo/misc/compress_vector.hpp"
TEST_CASE( "sparse storage can be created from triplets and compressed",
"[core]" )
{
// build the triplets for the following matrix:
// 1 2 0 0 0 0 0 0 0
// 0 3 4 5 6 7 0 0 0
// 0 8 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0
// 9 10 11 0 0 0 0 12 13
int nrows = 5;
int ncols = 9;
Vec<Triplet<double>> triplets = {
Triplet<double>{0, 0, 1.0}, Triplet<double>{0, 1, 2.0},
Triplet<double>{1, 1, 3.0}, Triplet<double>{1, 2, 4.0},
Triplet<double>{1, 3, 5.0}, Triplet<double>{1, 4, 6.0},
Triplet<double>{1, 5, 7.0}, Triplet<double>{2, 1, 8.0},
Triplet<double>{4, 0, 9.0}, Triplet<double>{4, 1, 10.0},
Triplet<double>{4, 2, 11.0}, Triplet<double>{4, 7, 12.0},
Triplet<double>{4, 8, 13.0}};
Vec<int> rowsize = {2, 5, 1, -1, 5};
Vec<int> colsize = {2, 4, 2, 1, 1, 1, -1, 1, 1};
SparseStorage<double> matrix{triplets, nrows, ncols, true};
SparseStorage<double> transpose = matrix.getTranspose();
REQUIRE( matrix.getNnz() == triplets.size() );
REQUIRE( matrix.getNRows() == nrows );
REQUIRE( matrix.getNCols() == ncols );
REQUIRE( transpose.getNnz() == triplets.size() );
REQUIRE( transpose.getNRows() == ncols );
REQUIRE( transpose.getNCols() == nrows );
auto rowranges = matrix.getRowRanges();
auto rowvalues = matrix.getValues();
auto columns = matrix.getColumns();
for( int i = 0; i < nrows; ++i )
{
REQUIRE( rowranges[i].end - rowranges[i].start == rowsize[i] );
double* row = rowvalues + rowranges[i].start;
int* rowcols = columns + rowranges[i].start;
switch( i )
{
case 0:
REQUIRE( row[0] == 1.0 );
REQUIRE( row[1] == 2.0 );
REQUIRE( rowcols[0] == 0 );
REQUIRE( rowcols[1] == 1 );
break;
case 1:
REQUIRE( row[0] == 3.0 );
REQUIRE( row[1] == 4.0 );
REQUIRE( row[2] == 5.0 );
REQUIRE( row[3] == 6.0 );
REQUIRE( row[4] == 7.0 );
REQUIRE( rowcols[0] == 1 );
REQUIRE( rowcols[1] == 2 );
REQUIRE( rowcols[2] == 3 );
REQUIRE( rowcols[3] == 4 );
REQUIRE( rowcols[4] == 5 );
break;
case 2:
REQUIRE( row[0] == 8.0 );
REQUIRE( rowcols[0] == 1 );
break;
case 3:
continue;
case 4:
REQUIRE( row[0] == 9.0 );
REQUIRE( row[1] == 10.0 );
REQUIRE( row[2] == 11.0 );
REQUIRE( row[3] == 12.0 );
REQUIRE( row[4] == 13.0 );
REQUIRE( rowcols[0] == 0 );
REQUIRE( rowcols[1] == 1 );
REQUIRE( rowcols[2] == 2 );
REQUIRE( rowcols[3] == 7 );
REQUIRE( rowcols[4] == 8 );
}
// todo check the rowvalues and columns are correct
}
auto colranges = transpose.getRowRanges();
auto colvalues = transpose.getValues();
auto rows = transpose.getColumns();
for( int i = 0; i < ncols; ++i )
{
REQUIRE( colranges[i].end - colranges[i].start == colsize[i] );
double* col = colvalues + colranges[i].start;
int* colrows = rows + colranges[i].start;
switch( i )
{
case 0:
REQUIRE( col[0] == 1.0 );
REQUIRE( col[1] == 9.0 );
REQUIRE( colrows[0] == 0 );
REQUIRE( colrows[1] == 4 );
break;
case 1:
REQUIRE( col[0] == 2.0 );
REQUIRE( col[1] == 3.0 );
REQUIRE( col[2] == 8.0 );
REQUIRE( col[3] == 10.0 );
REQUIRE( colrows[0] == 0 );
REQUIRE( colrows[1] == 1 );
REQUIRE( colrows[2] == 2 );
REQUIRE( colrows[3] == 4 );
break;
case 2:
REQUIRE( col[0] == 4.0 );
REQUIRE( col[1] == 11.0 );
REQUIRE( colrows[0] == 1 );
REQUIRE( colrows[1] == 4 );
break;
case 3:
REQUIRE( col[0] == 5.0 );
REQUIRE( colrows[0] == 1 );
break;
case 4:
REQUIRE( col[0] == 6.0 );
REQUIRE( colrows[0] == 1 );
break;
case 5:
REQUIRE( col[0] == 7.0 );
REQUIRE( colrows[0] == 1 );
break;
case 6:
continue;
case 7:
REQUIRE( col[0] == 12.0 );
REQUIRE( colrows[0] == 4 );
break;
case 8:
REQUIRE( col[0] == 13.0 );
REQUIRE( colrows[0] == 4 );
break;
}
}
Vec<int> col_mapping = matrix.compress( colsize );
Vec<int> row_mapping = transpose.compress( rowsize );
REQUIRE( col_mapping.size() == ncols );
REQUIRE( row_mapping.size() == nrows );
/* check if empty row at index 3 was removed properly */
for( int i = 0; i < nrows; ++i )
{
if( i < 3 )
REQUIRE( row_mapping[i] == i );
else if( i == 3 )
REQUIRE( row_mapping[i] == -1 );
else
REQUIRE( row_mapping[i] == i - 1 );
}
/* check if empty col at index 6 was removed properly */
for( int i = 0; i < ncols; ++i )
{
if( i < 6 )
REQUIRE( col_mapping[i] == i );
else if( i == 6 )
REQUIRE( col_mapping[i] == -1 );
else
REQUIRE( col_mapping[i] == i - 1 );
}
--nrows;
--ncols;
compress_vector( col_mapping, colsize );
compress_vector( row_mapping, rowsize );
rowranges = matrix.getRowRanges();
rowvalues = matrix.getValues();
columns = matrix.getColumns();
for( int i = 0; i < nrows; ++i )
{
REQUIRE( rowranges[i].end - rowranges[i].start == rowsize[i] );
double* row = rowvalues + rowranges[i].start;
int* rowcols = columns + rowranges[i].start;
switch( i )
{
case 0:
REQUIRE( row[0] == 1.0 );
REQUIRE( row[1] == 2.0 );
REQUIRE( rowcols[0] == 0 );
REQUIRE( rowcols[1] == 1 );
break;
case 1:
REQUIRE( row[0] == 3.0 );
REQUIRE( row[1] == 4.0 );
REQUIRE( row[2] == 5.0 );
REQUIRE( row[3] == 6.0 );
REQUIRE( row[4] == 7.0 );
REQUIRE( rowcols[0] == 1 );
REQUIRE( rowcols[1] == 2 );
REQUIRE( rowcols[2] == 3 );
REQUIRE( rowcols[3] == 4 );
REQUIRE( rowcols[4] == 5 );
break;
case 2:
REQUIRE( row[0] == 8.0 );
REQUIRE( rowcols[0] == 1 );
break;
case 3:
REQUIRE( row[0] == 9.0 );
REQUIRE( row[1] == 10.0 );
REQUIRE( row[2] == 11.0 );
REQUIRE( row[3] == 12.0 );
REQUIRE( row[4] == 13.0 );
REQUIRE( rowcols[0] == 0 );
REQUIRE( rowcols[1] == 1 );
REQUIRE( rowcols[2] == 2 );
REQUIRE( rowcols[3] == 6 );
REQUIRE( rowcols[4] == 7 );
}
// todo check the rowvalues and columns are correct
}
colranges = transpose.getRowRanges();
colvalues = transpose.getValues();
rows = transpose.getColumns();
for( int i = 0; i < ncols; ++i )
{
REQUIRE( colranges[i].end - colranges[i].start == colsize[i] );
double* col = colvalues + colranges[i].start;
int* colrows = rows + colranges[i].start;
switch( i )
{
case 0:
REQUIRE( col[0] == 1.0 );
REQUIRE( col[1] == 9.0 );
REQUIRE( colrows[0] == 0 );
REQUIRE( colrows[1] == 3 );
break;
case 1:
REQUIRE( col[0] == 2.0 );
REQUIRE( col[1] == 3.0 );
REQUIRE( col[2] == 8.0 );
REQUIRE( col[3] == 10.0 );
REQUIRE( colrows[0] == 0 );
REQUIRE( colrows[1] == 1 );
REQUIRE( colrows[2] == 2 );
REQUIRE( colrows[3] == 3 );
break;
case 2:
REQUIRE( col[0] == 4.0 );
REQUIRE( col[1] == 11.0 );
REQUIRE( colrows[0] == 1 );
REQUIRE( colrows[1] == 3 );
break;
case 3:
REQUIRE( col[0] == 5.0 );
REQUIRE( colrows[0] == 1 );
break;
case 4:
REQUIRE( col[0] == 6.0 );
REQUIRE( colrows[0] == 1 );
break;
case 5:
REQUIRE( col[0] == 7.0 );
REQUIRE( colrows[0] == 1 );
break;
case 6:
REQUIRE( col[0] == 12.0 );
REQUIRE( colrows[0] == 3 );
break;
case 7:
REQUIRE( col[0] == 13.0 );
REQUIRE( colrows[0] == 3 );
break;
}
}
}
| 10,201
|
C++
|
.cpp
| 288
| 28.145833
| 79
| 0.470244
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,672
|
PapiloLib.cpp
|
lgottwald_PaPILO/test/PapiloLib.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilolib.h"
#include "catch/catch.hpp"
#include "papilo/misc/fmt.hpp"
TEST_CASE( "papilolib", "[C-API]" )
{
constexpr int num_facilities = 25;
constexpr int num_customers = 50;
double facility_fixcost[] = {
7500.0, 7500.0, 7500.0, 7500.0, 7500.0, 7500.0, 7500.0, 7500.0, 7500.0,
7500.0, 0.0, 7500.0, 7500.0, 7500.0, 7500.0, 7500.0, 7500.0, 7500.0,
7500.0, 7500.0, 7500.0, 7500.0, 7500.0, 7500.0, 7500.0};
double facility_capacity[] = {58268.0, 58268.0, 58268.0, 58268.0, 58268.0,
58268.0, 58268.0, 58268.0, 58268.0, 58268.0,
58268.0, 58268.0, 58268.0, 58268.0, 58268.0,
58268.0, 58268.0, 58268.0, 58268.0, 58268.0,
58268.0, 58268.0, 58268.0, 58268.0, 58268.0};
double customer_demand[] = {
146.0, 87.0, 672.0, 1337.0, 31.0, 559.0, 2370.0, 1089.0, 33.0,
32.0, 5495.0, 904.0, 1466.0, 143.0, 615.0, 564.0, 226.0, 3016.0,
253.0, 195.0, 38.0, 807.0, 551.0, 304.0, 814.0, 337.0, 4368.0,
577.0, 482.0, 495.0, 231.0, 322.0, 685.0, 12912.0, 325.0, 366.0,
3671.0, 2213.0, 705.0, 328.0, 1681.0, 1117.0, 275.0, 500.0, 2241.0,
733.0, 222.0, 49.0, 1464.0, 222.0};
double facility_customer_service_cost[num_facilities][num_customers] = {
{6739.72500, 3204.86250, 4914.00000, 32372.11250, 1715.46250,
6421.51250, 81972.37500, 33391.46250, 2020.83750, 1459.60000,
141015.43750, 17684.50000, 38207.62500, 1953.73750, 17181.56250,
25640.85000, 7031.42500, 78453.70000, 9452.71250, 8597.06250,
1581.27500, 23170.98750, 12087.56250, 4883.00000, 24063.87500,
4124.03750, 281463.00000, 11056.76250, 8585.62500, 12480.18750,
3727.76250, 4673.02500, 13451.68750, 372672.60000, 9745.93750,
12055.12500, 97602.71250, 60774.51250, 54470.06250, 7146.30000,
38011.61250, 39723.31250, 16111.56250, 16981.25000, 168663.26250,
57109.86250, 15576.07500, 2542.48750, 34056.30000, 7095.67500},
{10355.05000, 5457.07500, 26409.60000, 29982.22500, 2152.17500,
23701.60000, 28499.25000, 26544.37500, 2480.77500, 1995.20000,
205925.12500, 32069.40000, 42477.35000, 5044.32500, 36054.37500,
35602.50000, 10492.05000, 92515.80000, 12441.27500, 14113.12500,
2030.15000, 48702.45000, 19877.32500, 12851.60000, 39682.50000,
12148.85000, 406770.00000, 22113.52500, 22449.15000, 25455.37500,
11116.87500, 13346.90000, 35106.25000, 229188.00000, 18070.00000,
18181.05000, 73603.55000, 63568.42500, 65177.25000, 8618.20000,
70728.07500, 52917.87500, 20714.37500, 32575.00000, 210766.05000,
66703.00000, 18481.50000, 3928.57500, 34221.00000, 11999.10000},
{7650.40000, 3845.40000, 19622.40000, 21024.32500, 1577.90000,
16197.02500, 43134.00000, 6370.65000, 1869.45000, 1402.40000,
104130.25000, 15322.80000, 15319.70000, 4089.80000, 25399.50000,
25154.40000, 6305.40000, 36644.40000, 7754.45000, 10500.75000,
1326.20000, 36072.90000, 9670.05000, 10822.40000, 24603.15000,
8180.67500, 325852.80000, 11424.60000, 14122.60000, 22151.25000,
8229.37500, 7880.95000, 25927.25000, 203364.00000, 12049.37500,
11400.90000, 59561.97500, 27330.55000, 52117.12500, 6428.80000,
39587.55000, 32225.45000, 15620.00000, 23312.50000, 169251.52500,
53124.17500, 14368.95000, 3020.85000, 24448.80000, 7886.55000},
{5219.50000, 2396.85000, 13876.80000, 29681.40000, 1061.75000,
10383.42500, 65767.50000, 16770.60000, 1324.95000, 869.60000,
12638.50000, 8429.80000, 15832.80000, 3428.42500, 16297.50000,
15763.80000, 2542.50000, 27445.60000, 3542.00000, 7254.00000,
693.50000, 26166.97500, 3801.90000, 8930.00000, 11050.05000,
5611.05000, 253234.80000, 5582.47500, 7458.95000, 19069.87500,
5826.97500, 4330.90000, 17347.62500, 322800.00000, 7198.75000,
5307.00000, 83331.70000, 30982.00000, 40378.87500, 7822.80000,
15801.40000, 13627.40000, 11041.25000, 16250.00000, 131938.87500,
40919.72500, 10672.65000, 2205.00000, 31329.60000, 4190.25000},
{5776.12500, 2628.48750, 9147.60000, 21275.01250, 1250.46250,
7483.61250, 58805.62500, 13571.66250, 1525.83750, 1050.80000,
46089.31250, 1231.70000, 11526.42500, 2289.78750, 15828.56250,
18421.65000, 3918.27500, 23562.50000, 5082.13750, 7875.56250,
924.82500, 23493.78750, 2252.21250, 6798.20000, 13644.67500,
2952.96250, 264755.40000, 2430.61250, 6609.42500, 15598.68750,
4628.66250, 2861.77500, 15249.81250, 261306.60000, 7592.81250,
7379.47500, 65940.33750, 20497.91250, 44494.31250, 5211.10000,
16494.81250, 20427.13750, 12598.43750, 16268.75000, 144628.53750,
45381.86250, 12024.07500, 2361.18750, 21905.10000, 4847.92500},
{6641.17500, 3220.08750, 14977.20000, 20071.71250, 1363.61250,
12332.93750, 48555.37500, 8861.73750, 1646.28750, 1181.20000,
66146.06250, 9073.90000, 5185.97500, 3530.31250, 21148.31250,
21255.75000, 4743.17500, 23034.70000, 6005.58750, 9152.81250,
1063.52500, 30494.51250, 5847.48750, 9435.40000, 18976.37500,
5851.16250, 294457.80000, 7436.08750, 10790.77500, 19892.81250,
6632.58750, 5655.12500, 21192.18750, 229995.00000, 9802.81250,
8870.92500, 56946.38750, 15076.06250, 47243.81250, 5621.10000,
27925.61250, 24504.18750, 13719.06250, 19856.25000, 153760.61250,
48057.31250, 12834.37500, 2682.13750, 20807.10000, 6351.97500},
{4374.52500, 1838.96250, 21848.40000, 64292.98750, 1524.03750,
15840.66250, 138615.37500, 51550.53750, 1817.06250, 1133.20000,
198300.81250, 32781.30000, 62653.17500, 5553.76250, 7310.81250,
18478.05000, 6856.27500, 126332.70000, 10274.96250, 5467.31250,
1628.77500, 14919.41250, 19650.03750, 11943.40000, 20197.37500,
11613.86250, 211356.60000, 19279.01250, 11525.82500, 23976.56250,
6476.66250, 9623.77500, 16808.18750, 681269.40000, 5780.93750,
10865.62500, 185247.83750, 97731.61250, 47631.56250, 15256.10000,
49862.66250, 41119.56250, 12502.18750, 9331.25000, 134768.13750,
52583.58750, 14205.22500, 1756.03750, 69009.30000, 4903.42500},
{3847.10000, 2266.35000, 35330.40000, 80186.57500, 955.57500,
27251.25000, 155294.25000, 57907.57500, 1211.92500, 546.40000,
220212.12500, 41335.40000, 71210.95000, 8308.30000, 21709.50000,
8135.70000, 7119.00000, 141375.00000, 10214.87500, 6371.62500,
1619.75000, 33813.30000, 23844.52500, 18148.80000, 24684.55000,
17111.17500, 210756.00000, 25460.12500, 20448.85000, 34080.75000,
11884.95000, 14610.75000, 32845.75000, 810550.80000, 10692.50000,
10202.25000, 222003.72500, 114578.07500, 34351.12500, 19762.00000,
62659.27500, 40854.27500, 7885.62500, 20750.00000, 109304.77500,
39050.57500, 10134.30000, 1983.27500, 86632.20000, 6421.35000},
{6429.47500, 3117.86250, 15111.60000, 25921.08750, 1318.66250,
12444.73750, 53176.87500, 10985.28750, 1593.48750, 1134.80000,
58178.31250, 9254.70000, 11563.07500, 3558.91250, 20779.31250,
20437.95000, 4415.47500, 11423.10000, 5638.73750, 8870.06250,
1008.42500, 30655.91250, 6260.73750, 9496.20000, 17796.07500,
5918.56250, 289434.60000, 7551.48750, 10887.17500, 19991.81250,
6678.78750, 5719.52500, 21329.18750, 258078.60000, 9607.81250,
8340.22500, 73007.01250, 24757.93750, 46820.81250, 7047.90000,
26917.01250, 22884.53750, 13320.31250, 19556.25000, 150511.16250,
46994.46250, 12512.47500, 2611.08750, 27212.10000, 6030.07500},
{5396.52500, 2582.81250, 23679.60000, 69206.46250, 1789.08750,
17769.21250, 147325.12500, 57376.68750, 2099.21250, 1406.80000,
241573.93750, 37595.10000, 70496.27500, 5947.01250, 12569.06250,
23300.25000, 8788.57500, 144881.10000, 12438.11250, 6729.93750,
1953.67500, 11166.86250, 22873.38750, 11616.60000, 27157.07500,
12852.33750, 239639.40000, 22351.53750, 14092.47500, 23444.43750,
6101.28750, 11338.42500, 15695.06250, 728398.20000, 8559.68750,
13994.92500, 198738.76250, 109515.83750, 53659.31250, 16305.70000,
61965.86250, 50669.91250, 14853.43750, 9543.75000, 149278.61250,
58814.08750, 16103.32500, 2073.31250, 74352.90000, 6801.52500},
{5219.50000, 2296.80000, 9828.00000, 23096.67500, 1133.05000,
7029.42500, 56998.50000, 12741.30000, 1395.90000, 928.80000,
25277.00000, 2463.40000, 10371.95000, 2434.57500, 14621.62500,
16271.40000, 3062.30000, 22846.20000, 4123.90000, 7312.50000,
780.90000, 22333.72500, 0.00000, 7106.00000, 10541.30000,
3268.90000, 248102.40000, 1601.17500, 5916.55000, 16099.87500,
4440.97500, 2398.90000, 14693.25000, 261790.80000, 6353.75000,
5984.10000, 65986.22500, 20525.57500, 42775.87500, 5658.00000,
10086.00000, 16196.50000, 11550.00000, 14550.00000, 136084.72500,
42605.62500, 11183.25000, 2174.37500, 23899.80000, 4001.55000},
{4182.90000, 1779.15000, 19303.20000, 48700.22500, 1015.25000,
13919.10000, 102384.00000, 33595.65000, 1275.45000, 768.80000,
97536.25000, 19775.00000, 38482.50000, 4897.75000, 11931.00000,
12619.50000, 2712.00000, 74042.80000, 5635.57500, 5869.50000,
931.95000, 20982.00000, 10703.17500, 10898.40000, 5270.65000,
9073.72500, 222222.00000, 11698.67500, 8953.15000, 22275.00000,
6843.37500, 6931.05000, 19385.50000, 512606.40000, 4891.25000,
4154.10000, 137295.40000, 63513.10000, 39250.87500, 11939.20000,
22567.42500, 20636.57500, 10071.87500, 13087.50000, 124879.72500,
40553.22500, 10561.65000, 1857.10000, 51935.40000, 2614.05000},
{7391.25000, 5115.60000, 57472.80000, 135170.70000, 2005.70000,
45474.65000, 259515.00000, 105796.35000, 1940.40000, 1950.40000,
461992.12500, 79235.60000, 135275.15000, 13134.55000, 39913.50000,
35094.90000, 17458.50000, 274079.00000, 21789.62500, 9506.25000,
3066.60000, 56025.97500, 46945.20000, 28226.40000, 59259.20000,
29479.07500, 124051.20000, 49650.85000, 37089.90000, 50490.00000,
18722.55000, 26701.85000, 53121.75000, 1361570.40000, 21336.25000,
26946.75000, 378755.42500, 209073.17500, 40960.50000, 32644.20000,
133135.20000, 91957.02500, 13193.12500, 32087.50000, 89976.15000,
45922.45000, 14940.60000, 2006.55000, 147937.20000, 14979.45000},
{5038.82500, 2189.13750, 11180.40000, 40527.81250, 1379.88750,
6966.53750, 96429.37500, 32220.78750, 1663.61250, 1145.20000,
106122.18750, 16712.70000, 36631.67500, 3283.63750, 11169.93750,
19253.55000, 5031.32500, 75211.50000, 8073.86250, 6695.81250,
1298.17500, 17380.76250, 10145.28750, 7117.40000, 14845.32500,
5623.68750, 238875.00000, 9022.83750, 2958.27500, 16118.43750,
3693.11250, 3900.22500, 10951.43750, 451435.80000, 5951.56250,
8459.17500, 119995.81250, 58395.53750, 48318.93750, 9417.70000,
23134.76250, 31401.66250, 13052.18750, 12481.25000, 142499.58750,
49175.13750, 13172.92500, 2064.73750, 42986.70000, 4503.82500},
{10349.57500, 5399.43750, 22957.20000, 60515.96250, 2512.93750,
20326.63750, 131920.12500, 60071.96250, 2869.76250, 2314.80000,
288418.81250, 41956.90000, 77569.72500, 4634.98750, 32479.68750,
39867.75000, 13093.87500, 159433.30000, 16239.43750, 13554.93750,
2600.62500, 40178.51250, 26881.91250, 7725.40000, 44597.02500,
13172.48750, 392519.40000, 26549.21250, 20575.37500, 8049.93750,
8596.08750, 13310.67500, 27888.06250, 644793.00000, 17830.31250,
21470.47500, 174969.03750, 114439.76250, 73399.31250, 13583.30000,
81255.33750, 69686.83750, 23103.43750, 27518.75000, 224408.13750,
75966.28750, 21287.02500, 3788.31250, 64873.50000, 12617.92500},
{6051.70000, 2838.37500, 15489.60000, 52911.77500, 1823.57500,
10956.40000, 118381.50000, 46527.52500, 2135.92500, 1500.80000,
185456.25000, 28589.00000, 55891.25000, 4204.20000, 14375.62500,
24957.00000, 8294.20000, 114834.20000, 11726.55000, 7707.37500,
1846.80000, 15978.60000, 17728.42500, 7911.60000, 26495.70000,
8745.15000, 261534.00000, 16963.80000, 9917.15000, 17411.62500,
3285.97500, 7961.45000, 7346.62500, 575875.20000, 9514.37500,
13697.55000, 155375.07500, 87468.82500, 55712.62500, 12308.20000,
47404.20000, 47528.35000, 15654.37500, 12525.00000, 160511.62500,
61003.92500, 16755.45000, 2318.92500, 56510.40000, 7448.10000},
{9568.47500, 4940.51250, 21294.00000, 19804.31250, 2008.41250,
19446.21250, 37594.12500, 21820.83750, 2327.73750, 1846.80000,
180442.06250, 26227.30000, 35788.72500, 3955.73750, 31372.68750,
32986.95000, 9443.97500, 79433.90000, 11267.98750, 13238.06250,
1853.92500, 42538.98750, 16757.28750, 10537.40000, 35297.07500,
9583.43750, 380835.00000, 18384.66250, 18779.92500, 21687.18750,
9358.38750, 10895.67500, 30148.56250, 130895.40000, 16229.68750,
16483.72500, 45566.28750, 46721.96250, 61907.81250, 6121.30000,
61209.41250, 47737.78750, 19439.06250, 28893.75000, 200373.41250,
63303.71250, 17451.97500, 3664.58750, 23076.30000, 10753.12500},
{9064.77500, 4642.53750, 18992.40000, 15191.66250, 1901.46250,
17517.66250, 40319.62500, 21085.76250, 2218.83750, 1736.40000,
161484.31250, 23131.10000, 30731.02500, 3465.96250, 29250.93750,
31041.15000, 8664.27500, 75663.90000, 10401.46250, 12428.81250,
1722.82500, 39775.01250, 14856.33750, 9496.20000, 32488.77500,
8420.78750, 365874.60000, 16408.43750, 17129.07500, 19991.81250,
8567.21250, 9784.77500, 27802.43750, 145421.40000, 15116.56250,
15221.02500, 32993.11250, 39142.43750, 59475.56250, 4997.90000,
55409.96250, 43884.13750, 18490.31250, 27181.25000, 192641.96250,
60774.86250, 16686.07500, 3495.53750, 18025.50000, 9987.22500},
{7159.47500, 3507.18750, 16657.20000, 17163.73750, 1497.68750,
13730.43750, 50569.87500, 12128.73750, 1789.01250, 1318.80000,
89774.56250, 11333.90000, 11599.72500, 3423.06250, 22701.18750,
23680.95000, 5714.97500, 36305.10000, 7099.81250, 9845.06250,
1227.87500, 32512.01250, 7665.78750, 9405.00000, 21866.07500,
6693.66250, 308872.20000, 8878.58750, 11995.77500, 19843.31250,
7210.08750, 6460.12500, 22904.68750, 201588.60000, 10875.31250,
10444.72500, 48961.96250, 10262.78750, 50292.93750, 4907.70000,
33472.91250, 29335.21250, 14901.56250, 21506.25000, 163396.91250,
51227.53750, 13794.52500, 2856.08750, 17622.90000, 7090.12500},
{4781.50000, 2035.80000, 12297.60000, 34762.00000, 1108.25000,
8371.02500, 78328.50000, 22542.30000, 1374.45000, 832.80000,
55499.50000, 10350.80000, 23565.95000, 3406.97500, 12776.62500,
14579.40000, 2599.00000, 45918.60000, 5350.95000, 6547.12500,
889.20000, 21002.17500, 4959.00000, 7881.20000, 8099.30000,
5560.50000, 234998.40000, 5683.45000, 5121.25000, 17362.12500,
4435.20000, 3574.20000, 14025.37500, 377998.80000, 5378.75000,
4886.10000, 99025.22500, 40442.57500, 40660.87500, 8519.80000,
5043.00000, 19379.95000, 10725.00000, 13050.00000, 129361.72500,
42752.22500, 11227.65000, 2072.70000, 36673.20000, 3335.55000},
{6033.45000, 2890.57500, 23856.00000, 49569.27500, 908.30000,
18684.57500, 100962.00000, 32942.25000, 1156.65000, 916.00000,
94239.25000, 21854.20000, 37602.90000, 5551.97500, 19787.62500,
16581.60000, 3101.85000, 72233.20000, 2795.65000, 8360.62500,
505.40000, 31291.42500, 11984.25000, 13444.40000, 15669.50000,
10615.50000, 267212.40000, 14150.92500, 14086.45000, 26420.62500,
8731.80000, 9112.60000, 26766.37500, 514543.20000, 9051.25000,
5837.70000, 137846.05000, 63900.37500, 36889.12500, 12693.60000,
36309.60000, 8098.25000, 11440.00000, 19475.00000, 135188.32500,
37291.37500, 9573.75000, 2483.07500, 53106.60000, 5450.10000},
{6661.25000, 3943.27500, 48568.80000, 105288.75000, 1169.47500,
38375.35000, 199791.00000, 78353.55000, 1050.22500, 1087.20000,
323380.75000, 59166.80000, 98735.10000, 11125.40000, 33563.62500,
19881.00000, 11362.15000, 198000.40000, 14964.95000, 10130.25000,
2041.55000, 49368.22500, 34713.00000, 24198.40000, 41636.10000,
23935.42500, 177231.60000, 36827.02500, 30040.65000, 43931.25000,
16331.70000, 21992.60000, 46032.00000, 1052973.60000, 16956.87500,
17073.90000, 290926.75000, 156127.15000, 30385.50000, 26231.80000,
95817.00000, 61825.95000, 5775.00000, 30675.00000, 93057.52500,
34927.45000, 9046.50000, 2603.12500, 114118.80000, 10694.85000},
{8845.77500, 5984.51250, 66066.00000, 142841.73750, 2040.18750,
52622.86250, 266358.37500, 108940.83750, 1977.11250, 1986.00000,
477721.56250, 84557.90000, 139911.37500, 14963.16250, 48346.68750,
36497.85000, 17709.92500, 282712.30000, 22071.08750, 12180.18750,
3108.87500, 67091.96250, 50189.21250, 31946.60000, 64804.57500,
33148.16250, 183947.40000, 53033.51250, 42325.62500, 56547.56250,
21757.31250, 30199.57500, 62514.81250, 1415639.40000, 24582.18750,
27353.92500, 394035.96250, 218284.78750, 34060.31250, 35444.50000,
143032.08750, 93199.68750, 13994.06250, 38943.75000, 68042.36250,
38748.21250, 12767.77500, 2678.46250, 155275.50000, 17196.67500},
{11656.27500, 6919.76250, 66973.20000, 137025.78750, 1600.76250,
53852.66250, 256048.87500, 104203.68750, 1509.33750, 2088.40000,
453818.31250, 81009.70000, 133534.27500, 15041.81250, 54681.18750,
38302.65000, 17551.72500, 269592.70000, 18497.46250, 16314.18750,
2532.22500, 77038.23750, 48040.31250, 32615.40000, 63420.77500,
32667.93750, 276549.00000, 52629.61250, 43386.02500, 57636.56250,
23235.71250, 29780.97500, 69570.31250, 1359472.20000, 28075.93750,
27097.72500, 378067.11250, 208713.56250, 23696.81250, 34157.10000,
141855.38750, 81191.93750, 15320.93750, 47856.25000, 115551.56250,
21302.81250, 8172.37500, 3717.26250, 148907.10000, 18323.32500},
{8663.27500, 4385.88750, 16203.60000, 12183.41250, 1836.36250,
15197.81250, 46244.62500, 20704.61250, 2144.58750, 1668.40000,
149807.43750, 19673.30000, 27615.77500, 2868.93750, 26698.68750,
29842.65000, 8184.02500, 69254.90000, 9863.83750, 11614.68750,
1643.02500, 36405.78750, 13492.61250, 8227.00000, 30250.27500,
7022.23750, 352989.00000, 14201.41250, 15128.77500, 17925.18750,
7608.56250, 8448.47500, 24685.68750, 178024.20000, 14222.81250,
14443.27500, 42170.61250, 34439.81250, 59070.18750, 3636.70000,
50787.21250, 41538.43750, 17905.93750, 25093.75000, 187935.86250,
59235.56250, 16219.87500, 3300.76250, 11949.90000, 9376.72500}};
constexpr int nvars = num_facilities * num_customers + num_facilities;
constexpr int nrows = num_facilities + num_customers;
unsigned char integral[nvars];
double lbs[nvars];
double ubs[nvars];
double obj[nvars];
double rowsides[nrows];
unsigned char rowtypes[nrows];
std::vector<std::string> names;
names.reserve( nvars + num_customers + num_facilities );
const char* colnames[nvars];
const char* rownames[num_customers + num_facilities];
// all vars binary
int nassignvars = nvars - num_facilities;
int i = 0;
for( ; i != nassignvars; ++i )
{
integral[i] = 1;
lbs[i] = 0;
ubs[i] = 1;
int f = i / num_customers;
int c = i - num_customers * f;
obj[i] = facility_customer_service_cost[f][c];
names.emplace_back( fmt::format( "x#{}#{}", f + 1, c + 1 ) );
colnames[i] = names.back().c_str();
}
for( ; i != nvars; ++i )
{
integral[i] = 1;
lbs[i] = 0;
ubs[i] = 1;
int f = i - nassignvars;
assert( 0 <= f && f < num_facilities );
obj[i] = facility_fixcost[f];
names.emplace_back( fmt::format( "y#{}", f + 1 ) );
colnames[i] = names.back().c_str();
}
for( i = 0; i != num_customers; ++i )
{
rowtypes[i] = PAPILO_ROW_TYPE_EQUAL;
rowsides[i] = 1;
names.emplace_back( fmt::format( "assign_{}", i + 1 ) );
rownames[i] = names.back().c_str();
}
for( ; i != nrows; ++i )
{
rowtypes[i] = PAPILO_ROW_TYPE_LESSER;
rowsides[i] = 0;
names.emplace_back( fmt::format( "capac_{}", i - num_customers + 1 ) );
rownames[i] = names.back().c_str();
}
PAPILO_PROBLEM* prob = papilo_problem_create(
1e30, "sscflp_cap101",
num_facilities + 2 * num_customers * num_facilities, nrows, nvars );
papilo_problem_add_cols( prob, nvars, lbs, ubs, integral, obj, colnames );
papilo_problem_add_simple_rows( prob, nrows, rowtypes, rowsides, rownames );
double assign_nonzeros[num_facilities];
for( i = 0; i != num_facilities; ++i )
assign_nonzeros[i] = 1.0;
int assign_nonzero_inds[num_facilities];
for( i = 0; i != num_customers; ++i )
{
for( int j = 0; j != num_facilities; ++j )
assign_nonzero_inds[j] = i + j * num_customers;
papilo_problem_add_nonzeros_row( prob, i, num_facilities,
assign_nonzero_inds, assign_nonzeros );
}
int capacity_nonzero_inds[num_customers + 1];
for( ; i != nrows; ++i )
{
int f = i - num_customers;
for( int j = 0; j != num_customers; ++j )
capacity_nonzero_inds[j] = j + f * num_customers;
capacity_nonzero_inds[num_customers] = nassignvars + f;
papilo_problem_add_nonzeros_row( prob, i, num_customers,
capacity_nonzero_inds, customer_demand );
papilo_problem_add_nonzero( prob, i, nassignvars + f,
-facility_capacity[f] );
}
PAPILO_SOLVER* solver = papilo_solver_create();
papilo_solver_load_problem( solver, prob );
papilo_problem_free( prob );
PAPILO_PARAM_RESULT paramRes =
papilo_solver_set_param_real( solver, "message.verbosity", 4 );
REQUIRE( paramRes == PAPILO_PARAM_WRONG_TYPE );
paramRes = papilo_solver_set_param_int( solver, "message.verbosity", 5 );
REQUIRE( paramRes == PAPILO_PARAM_INVALID_VALUE );
paramRes = papilo_solver_set_param_int( solver, "message.verbosity", 4 );
REQUIRE( paramRes == PAPILO_PARAM_CHANGED );
paramRes =
papilo_solver_set_mip_param_int( solver, "presolving/maxrounds", 0 );
REQUIRE( paramRes == PAPILO_PARAM_CHANGED );
paramRes = papilo_solver_set_mip_param_int64(
solver, "heuristics/dins/nwaitingnodes", 20 );
REQUIRE( paramRes == PAPILO_PARAM_CHANGED );
paramRes = papilo_solver_set_mip_param_bool( solver, "lp/presolving", 0 );
REQUIRE( paramRes == PAPILO_PARAM_CHANGED );
paramRes = papilo_solver_set_param_real( solver, "presolve.tlimsoft", 10.0 );
REQUIRE( paramRes == PAPILO_PARAM_CHANGED );
paramRes =
papilo_solver_set_lp_param_int( solver, "factor_update_max", 500 );
REQUIRE( paramRes == PAPILO_PARAM_CHANGED );
paramRes = papilo_solver_set_lp_param_int( solver, "displayfreq", 10000 );
REQUIRE( paramRes == PAPILO_PARAM_CHANGED );
paramRes = papilo_solver_set_lp_param_int( solver, "simplifier", 0 );
REQUIRE( paramRes == PAPILO_PARAM_CHANGED );
paramRes = papilo_solver_set_lp_param_int( solver, "scaler", 6 );
REQUIRE( paramRes == PAPILO_PARAM_CHANGED );
paramRes = papilo_solver_set_lp_param_int( solver, "pricer", 3 );
REQUIRE( paramRes == PAPILO_PARAM_CHANGED );
// papilo_solver_set_num_threads(solver, 1);
PAPILO_SOLVING_INFO* result = papilo_solver_start( solver );
REQUIRE( result->solve_result == PAPILO_SOLVE_RESULT_OPTIMAL );
REQUIRE( result->bestsol_obj == Approx( 796648.4375 ) );
REQUIRE( result->dualbound == Approx( 796648.4375 ) );
REQUIRE( result->bestsol_intviol >= 0.0 );
REQUIRE( result->bestsol_boundviol >= 0.0 );
REQUIRE( result->bestsol_consviol >= 0.0 );
REQUIRE( result->bestsol_intviol <= 1e-9 );
REQUIRE( result->bestsol_boundviol <= 1e-9 );
REQUIRE( result->bestsol_consviol <= 1e-9 );
const double* sol = result->bestsol;
REQUIRE( sol != nullptr );
double objval = 0;
for( int i = 0; i != nvars; ++i )
objval += obj[i] * sol[i];
REQUIRE( objval == Approx( 796648.4375 ) );
papilo_solver_free( solver );
}
TEST_CASE( "papilolib-no-rows", "[C-API]" )
{
PAPILO_PROBLEM* prob =
papilo_problem_create( 1e30, "no_constraints", 0, 0, 2 );
double lbs[2];
double ubs[2];
double obj[2];
unsigned char integral[2];
lbs[0] = ubs[0] = obj[0] = 1;
lbs[1] = ubs[1] = obj[1] = 1;
integral[0] = 1;
integral[1] = 1;
papilo_problem_add_cols( prob, 2, lbs, ubs, integral, obj, NULL );
PAPILO_SOLVER* solver = papilo_solver_create();
papilo_solver_load_problem( solver, prob );
papilo_problem_free( prob );
PAPILO_SOLVING_INFO* result = papilo_solver_start( solver );
REQUIRE( result->solve_result == PAPILO_SOLVE_RESULT_OPTIMAL );
REQUIRE( result->dualbound == 2.0 );
REQUIRE( result->bestsol_obj == 2.0 );
REQUIRE( result->bestsol_intviol == 0.0 );
REQUIRE( result->bestsol_consviol == 0.0 );
REQUIRE( result->bestsol_boundviol == 0.0 );
REQUIRE( result->bestsol != nullptr );
REQUIRE( result->bestsol[0] == 1.0 );
REQUIRE( result->bestsol[1] == 1.0 );
papilo_solver_free( solver );
}
| 28,701
|
C++
|
.cpp
| 453
| 55.88521
| 80
| 0.624428
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,673
|
VectorUtils.cpp
|
lgottwald_PaPILO/test/VectorUtils.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/misc/VectorUtils.hpp"
#include "catch/catch.hpp"
using namespace papilo;
TEST_CASE( "vector-comparisons", "[misc]" )
{
Vec<double> vec_double{1.0, -1.0, 2.0, -2.0, 3.0, -3.0, 4.0, -4.0};
Num<double> num;
bool vectors_same = compareVectors( vec_double, vec_double, num );
REQUIRE( vectors_same );
auto vec_different = vec_double;
vec_different[0] = 7;
bool vectors_different = compareVectors( vec_double, vec_different, num );
REQUIRE( !vectors_different );
}
TEST_CASE( "matrix-comparisons", "[misc]" )
{
// build the triplets for the following matrix:
// 1 2 0 0 0 0 0 0 0
// 0 3 4 5 6 7 0 0 0
// 0 8 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0
// 9 10 11 0 0 0 0 12 13
int nrows = 5;
int ncols = 9;
Vec<Triplet<double>> triplets = {
Triplet<double>{0, 0, 1.0}, Triplet<double>{0, 1, 2.0},
Triplet<double>{1, 1, 3.0}, Triplet<double>{1, 2, 4.0},
Triplet<double>{1, 3, 5.0}, Triplet<double>{1, 4, 6.0},
Triplet<double>{1, 5, 7.0}, Triplet<double>{2, 1, 8.0},
Triplet<double>{4, 0, 9.0}, Triplet<double>{4, 1, 10.0},
Triplet<double>{4, 2, 11.0}, Triplet<double>{4, 7, 12.0},
Triplet<double>{4, 8, 13.0}};
Vec<int> rowsize = {2, 5, 1, -1, 5};
Vec<int> colsize = {2, 4, 2, 1, 1, 1, -1, 1, 1};
SparseStorage<double> matrix{triplets, nrows, ncols, true};
SparseStorage<double> transpose = matrix.getTranspose();
// matrix
Num<double> num;
bool result = compareMatrices( matrix, matrix, num );
REQUIRE( result );
result = compareMatrices( matrix, transpose, num );
REQUIRE( !result );
result = compareMatrixToTranspose( matrix, transpose, num );
REQUIRE( result );
transpose.getColumns()[3] = 7;
result = compareMatrixToTranspose( matrix, transpose, num );
REQUIRE( !result );
}
TEST_CASE( "problem-comparisons", "[misc]" )
{
Problem<double> problem;
Vec<double> obj_vec{0, 1, 2, 3};
problem.setObjective( std::move( obj_vec ) );
Vec<double> lower_bounds{0, 0, 0, 0};
Vec<double> upper_bounds{0, 0, 0, 0};
ColFlags flag;
Vec<ColFlags> col_flags( 4, flag );
problem.setVariableDomains( lower_bounds, upper_bounds, col_flags );
// build the triplets for the following matrix:
// 1 2 0 0
// 0 3 4 5
// 0 8 0 1
int nrows = 3;
int ncols = 4;
Vec<Triplet<double>> triplets = {
Triplet<double>{0, 0, 1.0}, Triplet<double>{0, 1, 2.0},
Triplet<double>{1, 1, 3.0}, Triplet<double>{1, 2, 4.0},
Triplet<double>{1, 3, 5.0}, Triplet<double>{2, 1, 8.0},
Triplet<double>{2, 3, 1.0}};
Vec<int> rowsize = {2, 3, 2};
Vec<int> colsize = {1, 3, 1, 2};
SparseStorage<double> matrix{triplets, nrows, ncols, true};
Vec<double> lhs{0, 1, 2};
Vec<double> rhs{1, 2, 3};
RowFlags rflag;
Vec<RowFlags> row_flags( 3, rflag );
problem.setConstraintMatrix( matrix, lhs, rhs, row_flags );
// problem.setVariableNames( std::move( parser.colnames ) );
problem.setName( "test" );
// problem.setConstraintNames( std::move( parser.rownames ) );
Num<double> num;
bool result = compareProblems( problem, problem, num );
REQUIRE( result );
auto different_problem = problem;
Vec<double> obj{0, 0, 0, 3};
different_problem.setObjective( std::move( obj ) );
result = compareProblems( problem, different_problem, num );
REQUIRE( !result );
}
| 5,208
|
C++
|
.cpp
| 111
| 43.252252
| 79
| 0.537628
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,674
|
NumericalStatistics.cpp
|
lgottwald_PaPILO/test/NumericalStatistics.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/misc/NumericalStatistics.hpp"
#include "../test/instances/Instances.hpp"
#include "catch/catch.hpp"
#include "papilo/misc/fmt.hpp"
using namespace papilo;
TEST_CASE( "accurate-numerical-statistics", "[misc]" )
{
/// Check if statistics are printed correctly
// bell5
Problem<double> prob = instances::bell5();
NumericalStatistics<double> nstats( prob );
const Num_stats<double>& stats = nstats.getNum_stats();
REQUIRE( fmt::format( "{:.0e}", double( stats.matrixMin ) ) == "8e-05" );
REQUIRE( fmt::format( "{:.0e}", stats.matrixMax ) == "1e+03" );
REQUIRE( fmt::format( "{:.0e}", stats.objMin ) == "2e-01" );
REQUIRE( fmt::format( "{:.0e}", stats.objMax ) == "6e+04" );
REQUIRE( fmt::format( "{:.0e}", stats.boundsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats.boundsMax ) == "1e+04" );
REQUIRE( fmt::format( "{:.0e}", stats.rhsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats.rhsMax ) == "7e+03" );
// blend2
Problem<double> prob1 = instances::blend2();
NumericalStatistics<double> nstats1( prob1 );
const Num_stats<double>& stats1 = nstats1.getNum_stats();
REQUIRE( fmt::format( "{:.0e}", stats1.matrixMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats1.matrixMax ) == "7e+03" );
REQUIRE( fmt::format( "{:.0e}", stats1.objMin ) == "5e-01" );
REQUIRE( fmt::format( "{:.0e}", stats1.objMax ) == "2e+01" );
REQUIRE( fmt::format( "{:.0e}", stats1.boundsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats1.boundsMax ) == "2e+04" );
REQUIRE( fmt::format( "{:.0e}", stats1.rhsMin ) == "9e+00" );
REQUIRE( fmt::format( "{:.0e}", stats1.rhsMax ) == "1e+03" );
// dcmulti
Problem<double> prob2 = instances::dcmulti();
NumericalStatistics<double> nstats2( prob2 );
const Num_stats<double>& stats2 = nstats2.getNum_stats();
REQUIRE( fmt::format( "{:.0e}", stats2.matrixMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats2.matrixMax ) == "6e+02" );
REQUIRE( fmt::format( "{:.0e}", stats2.objMin ) == "4e-01" );
REQUIRE( fmt::format( "{:.0e}", stats2.objMax ) == "2e+03" );
REQUIRE( fmt::format( "{:.0e}", stats2.boundsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats2.boundsMax ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats2.rhsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats2.rhsMax ) == "3e+02" );
// egout
Problem<double> prob3 = instances::egout();
NumericalStatistics<double> nstats3( prob3 );
const Num_stats<double>& stats3 = nstats3.getNum_stats();
REQUIRE( fmt::format( "{:.0e}", stats3.matrixMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats3.matrixMax ) == "1e+02" );
REQUIRE( fmt::format( "{:.0e}", stats3.objMin ) == "1e-03" );
REQUIRE( fmt::format( "{:.0e}", stats3.objMax ) == "4e+01" );
REQUIRE( fmt::format( "{:.0e}", stats3.boundsMin ) == "7e-02" );
REQUIRE( fmt::format( "{:.0e}", stats3.boundsMax ) == "2e+01" );
REQUIRE( fmt::format( "{:.0e}", stats3.rhsMin ) == "0e+00" );
REQUIRE( fmt::format( "{:.0e}", stats3.rhsMax ) == "0e+00" );
// enigma
Problem<double> prob4 = instances::enigma();
NumericalStatistics<double> nstats4( prob4 );
const Num_stats<double>& stats4 = nstats4.getNum_stats();
REQUIRE( fmt::format( "{:.0e}", stats4.matrixMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats4.matrixMax ) == "9e+05" );
REQUIRE( fmt::format( "{:.0e}", stats4.objMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats4.objMax ) == "9e+00" );
REQUIRE( fmt::format( "{:.0e}", stats4.boundsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats4.boundsMax ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats4.rhsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats4.rhsMax ) == "1e+00" );
// flugpl
Problem<double> prob5 = instances::flugpl();
NumericalStatistics<double> nstats5( prob5 );
const Num_stats<double>& stats5 = nstats5.getNum_stats();
REQUIRE( fmt::format( "{:.0e}", stats5.matrixMin ) == "9e-01" );
REQUIRE( fmt::format( "{:.0e}", stats5.matrixMax ) == "2e+02" );
REQUIRE( fmt::format( "{:.0e}", stats5.objMin ) == "3e+01" );
REQUIRE( fmt::format( "{:.0e}", stats5.objMax ) == "3e+03" );
REQUIRE( fmt::format( "{:.0e}", stats5.boundsMin ) == "2e+01" );
REQUIRE( fmt::format( "{:.0e}", stats5.boundsMax ) == "8e+01" );
REQUIRE( fmt::format( "{:.0e}", stats5.rhsMin ) == "6e+01" );
REQUIRE( fmt::format( "{:.0e}", stats5.rhsMax ) == "1e+04" );
REQUIRE( fmt::format( "{:.0e}", stats5.colDynamism ) == "2e+02" );
REQUIRE( fmt::format( "{:.0e}", stats5.rowDynamism ) == "2e+02" );
// gt2
Problem<double> prob6 = instances::gt2();
NumericalStatistics<double> nstats6( prob6 );
const Num_stats<double>& stats6 = nstats6.getNum_stats();
REQUIRE( fmt::format( "{:.0e}", stats6.matrixMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats6.matrixMax ) == "3e+03" );
REQUIRE( fmt::format( "{:.0e}", stats6.objMin ) == "1e+03" );
REQUIRE( fmt::format( "{:.0e}", stats6.objMax ) == "8e+03" );
REQUIRE( fmt::format( "{:.0e}", stats6.boundsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats6.boundsMax ) == "2e+01" );
REQUIRE( fmt::format( "{:.0e}", stats6.rhsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats6.rhsMax ) == "6e+03" );
// lseu
Problem<double> prob7 = instances::lseu();
NumericalStatistics<double> nstats7( prob7 );
const Num_stats<double>& stats7 = nstats7.getNum_stats();
REQUIRE( fmt::format( "{:.0e}", stats7.matrixMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats7.matrixMax ) == "5e+02" );
REQUIRE( fmt::format( "{:.0e}", stats7.objMin ) == "6e+00" );
REQUIRE( fmt::format( "{:.0e}", stats7.objMax ) == "5e+02" );
REQUIRE( fmt::format( "{:.0e}", stats7.boundsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats7.boundsMax ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats7.rhsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats7.rhsMax ) == "3e+03" );
// misc03
Problem<double> prob8 = instances::misc03();
NumericalStatistics<double> nstats8( prob8 );
const Num_stats<double>& stats8 = nstats8.getNum_stats();
REQUIRE( fmt::format( "{:.0e}", stats8.matrixMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats8.matrixMax ) == "1e+03" );
REQUIRE( fmt::format( "{:.0e}", stats8.objMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats8.objMax ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats8.boundsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats8.boundsMax ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats8.rhsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats8.rhsMax ) == "2e+02" );
// p0548
Problem<double> prob9 = instances::p0548();
NumericalStatistics<double> nstats9( prob9 );
const Num_stats<double>& stats9 = nstats9.getNum_stats();
REQUIRE( fmt::format( "{:.0e}", stats9.matrixMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats9.matrixMax ) == "1e+04" );
REQUIRE( fmt::format( "{:.0e}", stats9.objMin ) == "5e+00" );
REQUIRE( fmt::format( "{:.0e}", stats9.objMax ) == "1e+04" );
REQUIRE( fmt::format( "{:.0e}", stats9.boundsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats9.boundsMax ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats9.rhsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats9.rhsMax ) == "1e+04" );
// rgn
Problem<double> prob10 = instances::rgn();
NumericalStatistics<double> nstats10( prob10 );
const Num_stats<double>& stats10 = nstats10.getNum_stats();
REQUIRE( fmt::format( "{:.0e}", stats10.matrixMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats10.matrixMax ) == "5e+00" );
REQUIRE( fmt::format( "{:.0e}", stats10.objMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats10.objMax ) == "3e+00" );
REQUIRE( fmt::format( "{:.0e}", stats10.boundsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats10.boundsMax ) == "1e+02" );
REQUIRE( fmt::format( "{:.0e}", stats10.rhsMin ) == "1e+00" );
REQUIRE( fmt::format( "{:.0e}", stats10.rhsMax ) == "4e+00" );
}
| 9,917
|
C++
|
.cpp
| 165
| 56.563636
| 79
| 0.550421
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,675
|
Aggregation.cpp
|
lgottwald_PaPILO/test/Aggregation.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#define CATCH_CONFIG_MAIN
#include "catch/catch.hpp"
#include "papilo/core/Presolve.hpp"
#include "papilo/core/PresolveMethod.hpp"
#include "papilo/core/Problem.hpp"
#include "papilo/misc/compress_vector.hpp"
#include "papilo/presolvers/FreeVarSubstitution.hpp"
#include <tuple>
static bool
operator==( const Reductions<float>::Reduction& lhs,
const Reductions<float>::Reduction& rhs )
{
float max = std::max( float{1.0}, std::max( std::fabs( lhs.newval ),
std::fabs( rhs.newval ) ) );
bool equalityCheck = std::fabs( lhs.newval - rhs.newval ) <=
( std::numeric_limits<float>::epsilon() * max );
return equalityCheck && ( lhs.row == rhs.row ) && ( lhs.col == rhs.col );
}
TEST_CASE( "test free variable detection ", "[core]" )
{
// 2*x1 + x2 >= 1
// x1 + x3 <= 2
// x1 + x4 - x5 = 1
// -3 <= x1 <= +3; x2 <= 1; 0 <= x3
Problem<float> problem;
Vec<float> lhs_values( 3 );
Vec<float> rhs_values( 3 );
lhs_values[0] = 1.0;
rhs_values[0] = infinity<float>();
lhs_values[1] = -infinity<float>();
rhs_values[1] = 2.0;
lhs_values[2] = 1.0;
rhs_values[2] = 1.0;
Vec<Triplet<float>> entries( 7 );
entries[0] = std::make_tuple( 0, 0, 2.0 );
entries[1] = std::make_tuple( 0, 1, 1.0 );
entries[2] = std::make_tuple( 1, 0, 1.0 );
entries[3] = std::make_tuple( 1, 2, 1.0 );
entries[4] = std::make_tuple( 2, 0, 1.0 );
entries[5] = std::make_tuple( 2, 3, 1.0 );
entries[6] = std::make_tuple( 2, 4, -1.0 );
problem.setConstraintMatrix( SparseStorage<float>( entries, 3, 5, 1.0 ),
lhs_values, rhs_values );
Vec<float> lower_bounds( 5 );
Vec<float> upper_bounds( 5 );
boost::dynamic_bitset<> integral( 5 );
lower_bounds[0] = -3;
upper_bounds[0] = 3;
lower_bounds[1] = -infinity<float>();
upper_bounds[1] = 1.0;
lower_bounds[2] = 0.0;
upper_bounds[2] = infinity<float>();
lower_bounds[3] = -infinity<float>();
upper_bounds[3] = infinity<float>();
lower_bounds[4] = -infinity<float>();
upper_bounds[4] = infinity<float>();
integral[0] = 0;
integral[1] = 0;
integral[2] = 0;
integral[3] = 0;
integral[4] = 0;
problem.setVariableDomains( lower_bounds, upper_bounds, integral );
auto& activities = problem.getRowActivities();
activities = Vec<RowActivity<float>>( 3 );
activities[0].min = -6.0;
activities[0].max = 7.0;
activities[0].ninfmin = 1;
activities[0].ninfmax = 0;
activities[1].min = -3.0;
activities[1].max = 3.0;
activities[1].ninfmin = 0;
activities[1].ninfmax = 1;
activities[2].min = 0.0;
activities[2].max = 1.0;
activities[2].ninfmin = 2;
activities[2].ninfmax = 2;
problem.setObjective( Vec<float>( 5, 1.0 ) );
// now we test the presolver and then the core functions involved
Reductions<float> reductions;
Substitution<float> presolver;
Presolve<float> presolve;
auto& constMatrix = problem.getConstraintMatrix();
// test the presolver; make sure it add a reduction
PresolveResult result = presolver.execute( problem, reductions );
REQUIRE( reductions.size() == 5 );
// the equality row is locked
const Reductions<float>::Reduction& reduction = reductions.getReduction( 0 );
REQUIRE( reduction == Reductions<float>::Reduction( 0.0, 2, -4 ) );
// the free column has locks on the bounds
const Reductions<float>::Reduction& reduction1 =
reductions.getReduction( 1 );
REQUIRE( reduction1 == Reductions<float>::Reduction( 0.0, -8, 0 ) );
// the origin row of the implied lower bounds is locked
const Reductions<float>::Reduction& reduction2 =
reductions.getReduction( 2 );
REQUIRE( reduction2 == Reductions<float>::Reduction( 0.0, 0, -4 ) );
// the origin row of the implied upper bounds is locked
const Reductions<float>::Reduction& reduction3 =
reductions.getReduction( 3 );
REQUIRE( reduction3 == Reductions<float>::Reduction( 0.0, 1, -4 ) );
// the substitution reduction is passed
const Reductions<float>::Reduction& reduction4 =
reductions.getReduction( 4 );
REQUIRE( reduction4 ==
Reductions<float>::Reduction( static_cast<float>( 2 ), -7, 0 ) );
auto colsorted_changed_coefs = Vec<Triplet<float>>( 0 );
auto changed_coefs =
constMatrix.getSubstitutionChanges( 0, 2, colsorted_changed_coefs );
// test the row sorted coefficient changes
REQUIRE( changed_coefs.size() == 6 );
REQUIRE( changed_coefs[0] == std::make_tuple( 0, 0, 0.0 ) );
REQUIRE( changed_coefs[1] == std::make_tuple( 0, 3, -2.0 ) );
REQUIRE( changed_coefs[2] == std::make_tuple( 0, 4, 2.0 ) );
REQUIRE( changed_coefs[3] == std::make_tuple( 1, 0, 0.0 ) );
REQUIRE( changed_coefs[4] == std::make_tuple( 1, 3, -1.0 ) );
REQUIRE( changed_coefs[5] == std::make_tuple( 1, 4, 1.0 ) );
// test the column sorted coefficient changes
REQUIRE( colsorted_changed_coefs.size() == 6 );
REQUIRE( colsorted_changed_coefs[0] == std::make_tuple( 0, 0, 0.0 ) );
REQUIRE( colsorted_changed_coefs[1] == std::make_tuple( 1, 0, 0.0 ) );
REQUIRE( colsorted_changed_coefs[2] == std::make_tuple( 0, 3, -2.0 ) );
REQUIRE( colsorted_changed_coefs[3] == std::make_tuple( 1, 3, -1.0 ) );
REQUIRE( colsorted_changed_coefs[4] == std::make_tuple( 0, 4, 2.0 ) );
REQUIRE( colsorted_changed_coefs[5] == std::make_tuple( 1, 4, 1.0 ) );
// test constraint bound changes
auto& lhs = problem.getConstraintMatrix().getLeftHandSides();
auto& rhs = problem.getConstraintMatrix().getRightHandSides();
REQUIRE( lhs[0] == -1.0 );
REQUIRE( rhs[1] == 1.0 );
problem.substituteVarInObj( 0, 2 );
// test objective changes
auto& obj = problem.getObjective();
REQUIRE( obj.coefficients.size() == 5 );
REQUIRE( obj.coefficients == Vec<float>{0.0, 1.0, 1.0, 0.0, 2.0} );
REQUIRE( obj.offset == 1.0 );
}
| 7,749
|
C++
|
.cpp
| 158
| 44.664557
| 80
| 0.572961
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,824
|
duplicates.cpp
|
lgottwald_PaPILO/src/duplicates.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/core/ConstraintMatrix.hpp"
#include "papilo/core/Objective.hpp"
#include "papilo/core/Problem.hpp"
#include "papilo/core/VariableDomains.hpp"
#include "papilo/io/MpsParser.hpp"
#include "papilo/misc/Hash.hpp"
#include "papilo/misc/NumericalStatistics.hpp"
#include "papilo/misc/Vec.hpp"
#include "papilo/misc/fmt.hpp"
#include "papilo/misc/tbb.hpp"
#include "pdqsort/pdqsort.h"
#include "tbb/concurrent_unordered_set.h"
#include <algorithm>
#include <sys/stat.h>
using namespace papilo;
bool
fileExists( const std::string& name )
{
struct stat buff;
return ( stat( name.c_str(), &buff ) == 0 );
}
static std::pair<Vec<int>, Vec<int>>
compute_row_and_column_permutation( const Problem<double>& prob, bool verbose )
{
const ConstraintMatrix<double>& consmatrix = prob.getConstraintMatrix();
if( verbose )
fmt::print( "Computing Permutation for {}\n", prob.getName() );
// const Vec<String> rnames = prob.getConstraintNames();
// const Vec<String> cnames = prob.getVariableNames();
std::pair<Vec<int>, Vec<int>> retval;
Vec<uint64_t> rowhashes;
Vec<uint64_t> colhashes;
auto obj = [&]( int col ) {
double tmp = prob.getObjective().coefficients[col];
uint64_t val;
std::memcpy( &val, &tmp, sizeof( double ) );
return val;
};
auto lb = [&]( int col ) {
double tmp = prob.getColFlags()[col].test( ColFlag::kLbInf )
? std::numeric_limits<double>::lowest()
: prob.getLowerBounds()[col];
uint64_t val;
std::memcpy( &val, &tmp, sizeof( double ) );
return val;
};
auto ub = [&]( int col ) {
double tmp = prob.getColFlags()[col].test( ColFlag::kUbInf )
? std::numeric_limits<double>::max()
: prob.getUpperBounds()[col];
uint64_t val;
std::memcpy( &val, &tmp, sizeof( double ) );
return val;
};
auto lhs = [&]( int row ) {
double tmp = consmatrix.getRowFlags()[row].test( RowFlag::kLhsInf )
? std::numeric_limits<double>::lowest()
: consmatrix.getLeftHandSides()[row];
uint64_t val;
std::memcpy( &val, &tmp, sizeof( double ) );
return val;
};
auto rhs = [&]( int row ) {
double tmp = consmatrix.getRowFlags()[row].test( RowFlag::kRhsInf )
? std::numeric_limits<double>::max()
: consmatrix.getRightHandSides()[row];
uint64_t val;
std::memcpy( &val, &tmp, sizeof( double ) );
return val;
};
auto col_is_integral = [&]( int col ) {
return static_cast<uint64_t>(
prob.getColFlags()[col].test( ColFlag::kIntegral ) );
};
int ncols = prob.getNCols();
int nrows = prob.getNRows();
colhashes.resize( ncols + 2 );
rowhashes.resize( nrows + 4 );
const int LHS = ncols;
const int RHS = ncols + 1;
colhashes[LHS] = UINT64_MAX;
colhashes[RHS] = UINT64_MAX - 1;
const int OBJ = nrows;
const int INTEGRAL = nrows + 1;
const int LB = nrows + 2;
const int UB = nrows + 3;
rowhashes[OBJ] = UINT64_MAX - 2;
rowhashes[INTEGRAL] = UINT64_MAX - 3;
rowhashes[LB] = UINT64_MAX - 4;
rowhashes[UB] = UINT64_MAX - 5;
Vec<std::pair<uint64_t, int>> csrvals;
Vec<int> csrstarts;
csrstarts.resize( nrows + 1 );
csrvals.reserve( consmatrix.getNnz() + 2 * nrows );
for( int i = 0; i < nrows; ++i )
{
csrstarts[i] = csrvals.size();
auto rowvec = consmatrix.getRowCoefficients( i );
for( int k = 0; k < rowvec.getLength(); ++k )
{
uint64_t coef;
std::memcpy( &coef, rowvec.getValues() + k, sizeof( double ) );
csrvals.emplace_back( coef, rowvec.getIndices()[k] );
}
csrvals.emplace_back( lhs( i ), LHS );
csrvals.emplace_back( rhs( i ), RHS );
}
csrstarts[nrows] = csrvals.size();
Vec<std::pair<uint64_t, int>> cscvals;
Vec<int> cscstarts;
cscstarts.resize( ncols + 1 );
cscvals.reserve( consmatrix.getNnz() + 4 * ncols );
for( int i = 0; i < ncols; ++i )
{
cscstarts[i] = cscvals.size();
auto colvec = consmatrix.getColumnCoefficients( i );
for( int k = 0; k < colvec.getLength(); ++k )
{
uint64_t coef;
std::memcpy( &coef, colvec.getValues() + k, sizeof( double ) );
cscvals.emplace_back( coef, colvec.getIndices()[k] );
}
cscvals.emplace_back( obj( i ), OBJ );
cscvals.emplace_back( col_is_integral( i ), INTEGRAL );
cscvals.emplace_back( lb( i ), LB );
cscvals.emplace_back( ub( i ), UB );
}
cscstarts[ncols] = cscvals.size();
auto comp_rowvals = [&]( const std::pair<uint64_t, int>& a,
const std::pair<uint64_t, int>& b ) {
return std::make_pair( a.first, colhashes[a.second] ) <
std::make_pair( b.first, colhashes[b.second] );
};
auto comp_colvals = [&]( const std::pair<uint64_t, int>& a,
const std::pair<uint64_t, int>& b ) {
return std::make_pair( a.first, rowhashes[a.second] ) <
std::make_pair( b.first, rowhashes[b.second] );
};
int iters = 0;
size_t lastncols = -1;
HashMap<uint64_t, size_t> distinct_hashes( ncols );
size_t lastnrows = -1;
HashMap<uint64_t, size_t> distinct_row_hashes( nrows );
Vec<int>& colperm = retval.second;
colperm.resize( ncols );
for( int i = 0; i < ncols; ++i )
colperm[i] = i;
Vec<int>& rowperm = retval.first;
rowperm.resize( nrows );
for( int i = 0; i < nrows; ++i )
rowperm[i] = i;
size_t nrows2 = nrows;
size_t ncols2 = ncols;
while( nrows2 != 0 )
{
tbb::parallel_for(
tbb::blocked_range<int>( 0, nrows2 ),
[&]( const tbb::blocked_range<int>& r ) {
for( int i = r.begin(); i != r.end(); ++i )
{
int row = rowperm[i];
int start = csrstarts[row];
int end = csrstarts[row + 1];
pdqsort( &csrvals[start], &csrvals[end], comp_rowvals );
Hasher<uint64_t> hasher( end - start );
for( int k = start; k < end; ++k )
{
hasher.addValue( csrvals[k].first );
hasher.addValue( colhashes[csrvals[k].second] );
}
rowhashes[row] = hasher.getHash() >> 1;
}
} );
distinct_row_hashes.clear();
for( size_t i = 0; i < nrows2; ++i )
distinct_row_hashes[rowhashes[rowperm[i]]] += 1;
pdqsort( rowperm.begin(), rowperm.begin() + nrows2, [&]( int a, int b ) {
return std::make_tuple( -distinct_row_hashes[rowhashes[a]],
rowhashes[a], a ) <
std::make_tuple( -distinct_row_hashes[rowhashes[b]],
rowhashes[b], b );
} );
lastnrows = nrows2;
nrows2 = 0;
while( nrows2 < lastnrows )
{
uint64_t hashval = rowhashes[rowperm[nrows2]];
size_t partitionsize = distinct_row_hashes[hashval];
if( partitionsize <= 1 )
break;
nrows2 += partitionsize;
}
for( size_t i = nrows2; i < lastnrows; ++i )
{
rowhashes[rowperm[i]] = i;
}
if( nrows2 == lastnrows )
{
--nrows2;
std::swap( rowperm[0], rowperm[nrows2] );
rowhashes[rowperm[nrows2]] = nrows2;
}
if( ncols2 == 0 )
break;
tbb::parallel_for(
tbb::blocked_range<int>( 0, ncols2 ),
[&]( const tbb::blocked_range<int>& r ) {
for( int i = r.begin(); i != r.end(); ++i )
{
int col = colperm[i];
int start = cscstarts[col];
int end = cscstarts[col + 1];
pdqsort( &cscvals[start], &cscvals[end], comp_colvals );
Hasher<uint64_t> hasher( end - start );
for( int k = start; k < end; ++k )
{
hasher.addValue( cscvals[k].first );
hasher.addValue( rowhashes[cscvals[k].second] );
}
colhashes[col] = hasher.getHash() >> 1;
}
} );
distinct_hashes.clear();
for( size_t i = 0; i < ncols2; ++i )
distinct_hashes[colhashes[colperm[i]]] += 1;
pdqsort( colperm.begin(), colperm.begin() + ncols2, [&]( int a, int b ) {
return std::make_pair( -distinct_hashes[colhashes[a]], colhashes[a] ) <
std::make_pair( -distinct_hashes[colhashes[b]], colhashes[b] );
} );
lastncols = ncols2;
ncols2 = 0;
while( ncols2 < lastncols )
{
uint64_t hashval = colhashes[colperm[ncols2]];
size_t partitionsize = distinct_hashes[hashval];
if( partitionsize <= 1 )
break;
ncols2 += partitionsize;
}
for( size_t i = ncols2; i < lastncols; ++i )
{
colhashes[colperm[i]] = i;
}
++iters;
if( verbose )
fmt::print(
"iter {:3}: {:6} non unit col partitions and {:6} non unit row "
"partitions\n",
iters, ncols2, nrows2 );
}
return retval;
}
/// Tries to compute a permutation for columns
static bool
guess_permutation_col( const Problem<double>& prob1,
const Problem<double>& prob2, Vec<int>& out_perm1,
Vec<int>& out_perm2 )
{
// for every col I want to find another matching one
return false;
}
/// Outputs array of length n representing no permutation
static void
fill_identity_permutation( Vec<int>& out_perm )
{
int n = out_perm.size();
for( int i = 0; i < n; ++i )
out_perm[i] = i;
}
/// Returns True if variables in given permutation have same attributes
static bool
check_cols( const Problem<double>& prob1, const Problem<double>& prob2,
Vec<int> perm1, const Vec<int> perm2 )
{
assert( perm1.size() == perm2.size() );
int ncols = perm1.size();
const VariableDomains<double>& vd1 = prob1.getVariableDomains();
const VariableDomains<double>& vd2 = prob2.getVariableDomains();
const Vec<String> cnames1 = prob1.getVariableNames();
const Vec<String> cnames2 = prob2.getVariableNames();
auto printVarsAndIndex = [&]( int i1, int i2 ) {
fmt::print( "Differing Variables: Problem 1: {:6} at index {:<5} vs ",
cnames1[i1], i1 );
fmt::print( "Problem 2: {:6} at index {:<5}\n", cnames2[i2], i2 );
};
for( int i = 0; i < ncols; ++i )
{
int i1 = perm1[i];
int i2 = perm2[i];
if( vd1.flags[i1].test( ColFlag::kIntegral ) !=
vd2.flags[i2].test( ColFlag::kIntegral ) )
{
// kein duplikat: eine variable ist ganzzahlig die andere nicht
fmt::print( "Variable is integer the other not!\n" );
printVarsAndIndex( i1, i2 );
return false;
}
if( vd1.flags[i1].test( ColFlag::kUbInf ) !=
vd2.flags[i2].test( ColFlag::kUbInf ) )
{
// kein duplikat: ein upper bound ist +infinity, der andere nicht
fmt::print(
"Variable's Upper Bound is +infty and the others is not!\n" );
printVarsAndIndex( i1, i2 );
return false;
}
if( vd1.flags[i1].test( ColFlag::kLbInf ) !=
vd2.flags[i2].test( ColFlag::kLbInf ) )
{
// kein duplikat: ein lower bound ist -infinity, der andere nicht
fmt::print(
"Variable's Lower Bound is -infty and the others is not! " );
printVarsAndIndex( i1, i2 );
return false;
}
if( !vd1.flags[i1].test( ColFlag::kLbInf ) &&
vd1.lower_bounds[i1] != vd2.lower_bounds[i2] )
{
assert( !vd2.flags[i2].test( ColFlag::kLbInf ) );
// kein duplikat: lower bounds sind endlich aber unterschiedlich
fmt::print( "Lower Bounds are different!\n" );
printVarsAndIndex( i1, i2 );
return false;
}
if( !vd1.flags[i1].test( ColFlag::kUbInf ) &&
vd1.upper_bounds[i1] != vd2.upper_bounds[i2] )
{
assert( !vd2.flags[i2].test( ColFlag::kUbInf ) );
// kein duplikat: upper bounds sind endlich aber unterschiedlich
fmt::print( "Upper Bounds are different!\n" );
printVarsAndIndex( i1, i2 );
return false;
}
}
return true;
}
/// Returns True if rows in given Permutation are same for also given variable
/// permutation
static bool
check_rows( const Problem<double>& prob1, const Problem<double>& prob2,
Vec<int> permrow1, Vec<int> permrow2, Vec<int> permcol1,
Vec<int> permcol2 )
{
assert( permrow1.size() == permrow2.size() );
assert( permcol1.size() == permcol2.size() );
const ConstraintMatrix<double>& cm1 = prob1.getConstraintMatrix();
const ConstraintMatrix<double>& cm2 = prob2.getConstraintMatrix();
int nrows = permrow1.size();
int ncols = permcol1.size();
// Row flags
const Vec<RowFlags>& rflags1 = cm1.getRowFlags();
const Vec<RowFlags>& rflags2 = cm2.getRowFlags();
// Get sides
const Vec<double>& lhs1 = cm1.getLeftHandSides();
const Vec<double>& lhs2 = cm2.getLeftHandSides();
const Vec<double>& rhs1 = cm1.getRightHandSides();
const Vec<double>& rhs2 = cm2.getRightHandSides();
HashMap<int, double> coefmap;
const Vec<String> cnames1 = prob1.getVariableNames();
const Vec<String> cnames2 = prob2.getVariableNames();
const Vec<String> rnames1 = prob1.getConstraintNames();
const Vec<String> rnames2 = prob2.getConstraintNames();
auto printConstraintsAndIndex = [&]( int i1, int i2 ) {
fmt::print( "Differing Constraints: Problem 1: {:6} at index {:<5} vs ",
rnames1[i1], i1 );
fmt::print( "Problem 2: {:6} at index {:<5}\n", rnames2[i2], i2 );
};
auto findcol = []( int col, Vec<int> perm ) {
return std::distance( perm.begin(),
std::find( perm.begin(), perm.end(), col ) );
};
for( int i = 0; i < nrows; ++i )
{
int i1row = permrow1[i];
int i2row = permrow2[i];
// Check Row flags for dissimilarities
if( rflags1[i1row].test( RowFlag::kLhsInf ) !=
rflags2[i2row].test( RowFlag::kLhsInf ) )
{
fmt::print( "Row has infinite LHS in only one of both problems!\n" );
printConstraintsAndIndex( i1row, i2row );
return false;
}
if( rflags1[i1row].test( RowFlag::kRhsInf ) !=
rflags2[i2row].test( RowFlag::kRhsInf ) )
{
fmt::print( "Row has infinite RHS in only one of both problems!\n" );
printConstraintsAndIndex( i1row, i2row );
return false;
}
if( rflags1[i1row].test( RowFlag::kEquation ) !=
rflags2[i2row].test( RowFlag::kEquation ) )
{
fmt::print( "Row is equation in only one of both problems!\n" );
printConstraintsAndIndex( i1row, i2row );
return false;
}
if( rflags1[i1row].test( RowFlag::kIntegral ) !=
rflags2[i2row].test( RowFlag::kIntegral ) )
{
fmt::print( "Row is Integral in only one of both problems!\n" );
printConstraintsAndIndex( i1row, i2row );
return false;
}
// needed? probably not
if( rflags1[i1row].test( RowFlag::kRedundant ) !=
rflags2[i2row].test( RowFlag::kRedundant ) )
{
fmt::print( "Row is redundant in only one of both problems!\n" );
printConstraintsAndIndex( i1row, i2row );
return false;
}
// Check Row LHS values
if( rflags1[i1row].test( RowFlag::kLhsInf ) &&
lhs1[i1row] != lhs2[i2row] )
{
assert( rflags2[i2row].test( RowFlag::kLhsInf ) );
fmt::print( "Row has different LHS in both problems!\n" );
printConstraintsAndIndex( i1row, i2row );
return false;
}
// Check Row RHS values
if( rflags1[i1row].test( RowFlag::kRhsInf ) &&
rhs1[i1row] != rhs2[i2row] )
{
assert( rflags2[i2row].test( RowFlag::kRhsInf ) );
fmt::print( "Row has different RHS in both problems!\n" );
printConstraintsAndIndex( i1row, i2row );
return false;
}
// Check Row coefficients
const SparseVectorView<double> row1 = cm1.getRowCoefficients( i1row );
const SparseVectorView<double> row2 = cm2.getRowCoefficients( i2row );
// Assume: If there is different amounts of variables in constraint it is
// not the same (not entirely true)
const int curr_ncols = row1.getLength();
if( curr_ncols != row2.getLength() )
{
fmt::print( "Row has different amounts of variables!\n" );
printConstraintsAndIndex( i1row, i2row );
return false;
}
const int* inds1 = row1.getIndices();
const int* inds2 = row2.getIndices();
const double* vals1 = row1.getValues();
const double* vals2 = row2.getValues();
for( int x = 0; x < curr_ncols; ++x )
{
int col = findcol( inds1[x], permcol1 );
coefmap[col] = vals1[x];
}
for( int x = 0; x < curr_ncols; ++x )
{
int final_index2 = findcol( inds2[x], permcol2 );
// Check if same variables are defined for row
if( coefmap.count( final_index2 ) == 0 )
{
fmt::print( "Row has different variables!\n" );
printConstraintsAndIndex( i1row, i2row );
fmt::print( "Variable `{}` at index {} is defined for Problem 2, "
"but not for Problem1",
cnames2[i], i );
return false;
}
// Check if values are same
if( coefmap[final_index2] != vals2[x] )
{
fmt::print( "Row has different coefficients for variable!\n" );
printConstraintsAndIndex( i1row, i2row );
fmt::print( "Variables: Problem1: {} at {} vs Problem2: {} at {}\n",
coefmap[final_index2], permrow1[final_index2], vals2[x],
inds2[x] );
return false;
}
}
// clear map for next row
coefmap.clear();
}
return true;
}
static bool
check_duplicates( const Problem<double>& prob1, const Problem<double>& prob2 )
{
// Check for columns
int ncols = prob1.getNCols();
if( ncols != prob2.getNCols() )
{
// kein duplikat: unterschiedlich viele variablen
fmt::print( "not same number of variables\n" );
return false;
}
// Check for rows
// First assume for being same you need to have same rows (even though not
// true)
int nrows = prob1.getNRows();
if( nrows != prob2.getNRows() )
{
fmt::print( "not same number of rows: prob1:{} prob2:{}\n", nrows,
prob2.getNRows() );
return false;
}
std::pair<Vec<int>, Vec<int>> perms1 =
compute_row_and_column_permutation( prob1, true );
std::pair<Vec<int>, Vec<int>> perms2 =
compute_row_and_column_permutation( prob2, true );
Vec<int>& perm_col1 = perms1.second;
Vec<int>& perm_col2 = perms2.second;
Vec<int>& perm_row1 = perms1.first;
Vec<int>& perm_row2 = perms2.first;
if( !check_cols( prob1, prob2, perm_col1, perm_col2 ) )
return false;
if( !check_rows( prob1, prob2, perm_row1, perm_row2, perm_col1, perm_col2 ) )
return false;
// All checks passed
return true;
}
static uint64_t
compute_instancehash( const Problem<double>& prob )
{
const int MAX_HASH_ITERS = 5;
const ConstraintMatrix<double> cm = prob.getConstraintMatrix();
int nrows = cm.getNRows();
int ncols = cm.getNCols();
int nnz = cm.getNnz();
auto obj = [&]( int col ) {
double tmp = prob.getObjective().coefficients[col];
uint64_t val;
std::memcpy( &val, &tmp, sizeof( double ) );
return val;
};
auto lb = [&]( int col ) {
double tmp = prob.getColFlags()[col].test( ColFlag::kLbInf )
? std::numeric_limits<double>::lowest()
: prob.getLowerBounds()[col];
uint64_t val;
std::memcpy( &val, &tmp, sizeof( double ) );
return val;
};
auto ub = [&]( int col ) {
double tmp = prob.getColFlags()[col].test( ColFlag::kUbInf )
? std::numeric_limits<double>::max()
: prob.getUpperBounds()[col];
uint64_t val;
std::memcpy( &val, &tmp, sizeof( double ) );
return val;
};
auto col_is_integral = [&]( int col ) {
return static_cast<uint64_t>(
prob.getColFlags()[col].test( ColFlag::kIntegral ) );
};
auto lhs = [&]( int row ) {
double tmp = cm.getRowFlags()[row].test( RowFlag::kLhsInf )
? std::numeric_limits<double>::lowest()
: cm.getLeftHandSides()[row];
uint64_t val;
std::memcpy( &val, &tmp, sizeof( double ) );
return val;
};
auto rhs = [&]( int row ) {
double tmp = cm.getRowFlags()[row].test( RowFlag::kRhsInf )
? std::numeric_limits<double>::max()
: cm.getRightHandSides()[row];
uint64_t val;
std::memcpy( &val, &tmp, sizeof( double ) );
return val;
};
// Setup rowhashes and colhashes
Vec<uint64_t> rowhashes;
Vec<uint64_t> colhashes;
colhashes.resize( ncols + 2 );
rowhashes.resize( nrows + 4 );
const int LHS = ncols;
const int RHS = ncols + 1;
colhashes[LHS] = UINT64_MAX;
colhashes[RHS] = UINT64_MAX - 1;
const int OBJ = nrows;
const int INTEGRAL = nrows + 1;
const int LB = nrows + 2;
const int UB = nrows + 3;
rowhashes[OBJ] = UINT64_MAX - 2;
rowhashes[INTEGRAL] = UINT64_MAX - 3;
rowhashes[LB] = UINT64_MAX - 4;
rowhashes[UB] = UINT64_MAX - 5;
// Datastructure to save coefficients columnwise
Vec<std::pair<uint64_t, int>> csrvals;
Vec<int> csrstarts;
csrstarts.resize( nrows + 1 );
csrvals.reserve( nnz + 2 * nrows );
for( int i = 0; i < nrows; ++i )
{
csrstarts[i] = csrvals.size();
auto rowvec = cm.getRowCoefficients( i );
for( int k = 0; k < rowvec.getLength(); ++k )
{
uint64_t coef;
std::memcpy( &coef, rowvec.getValues() + k, sizeof( double ) );
csrvals.emplace_back( coef, rowvec.getIndices()[k] );
}
csrvals.emplace_back( lhs( i ), LHS );
csrvals.emplace_back( rhs( i ), RHS );
}
csrstarts[nrows] = csrvals.size();
// Datastructure to save coefficients rowwise
Vec<std::pair<uint64_t, int>> cscvals;
Vec<int> cscstarts;
cscstarts.resize( ncols + 1 );
cscvals.reserve( nnz + 4 * ncols );
for( int i = 0; i < ncols; ++i )
{
cscstarts[i] = cscvals.size();
auto colvec = cm.getColumnCoefficients( i );
for( int k = 0; k < colvec.getLength(); ++k )
{
uint64_t coef;
std::memcpy( &coef, colvec.getValues() + k, sizeof( double ) );
cscvals.emplace_back( coef, colvec.getIndices()[k] );
}
cscvals.emplace_back( obj( i ), OBJ );
cscvals.emplace_back( col_is_integral( i ), INTEGRAL );
cscvals.emplace_back( lb( i ), LB );
cscvals.emplace_back( ub( i ), UB );
}
cscstarts[ncols] = cscvals.size();
auto comp_rowvals = [&]( const std::pair<uint64_t, int>& a,
const std::pair<uint64_t, int>& b ) {
return std::make_pair( a.first, colhashes[a.second] ) <
std::make_pair( b.first, colhashes[b.second] );
};
auto comp_colvals = [&]( const std::pair<uint64_t, int>& a,
const std::pair<uint64_t, int>& b ) {
return std::make_pair( a.first, rowhashes[a.second] ) <
std::make_pair( b.first, rowhashes[b.second] );
};
// Prepare permutation to not compute all hashes in each step newly
Vec<int> colperm;
colperm.resize( ncols );
for( int i = 0; i < ncols; ++i )
colperm[i] = i;
Vec<int> rowperm;
rowperm.resize( nrows );
for( int i = 0; i < nrows; ++i )
rowperm[i] = i;
int iters = 0;
int ncols2 = ncols;
size_t lastncols = -1;
HashMap<uint64_t, size_t> distinct_col_hashes( ncols );
int nrows2 = nrows;
size_t lastnrows = -1;
HashMap<uint64_t, size_t> distinct_row_hashes( nrows );
// Compute column and row hashes
while( nrows2 != 0 && iters <= MAX_HASH_ITERS )
{
tbb::parallel_for(
tbb::blocked_range<int>( 0, nrows2 ),
[&]( const tbb::blocked_range<int>& r ) {
for( int i = r.begin(); i != r.end(); ++i )
{
int row = rowperm[i];
int start = csrstarts[row];
int end = csrstarts[row + 1];
pdqsort( &csrvals[start], &csrvals[end], comp_rowvals );
Hasher<uint64_t> hasher( end - start );
for( int k = start; k < end; ++k )
{
hasher.addValue( csrvals[k].first );
hasher.addValue( colhashes[csrvals[k].second] );
}
rowhashes[row] = hasher.getHash() >> 1;
}
} );
distinct_row_hashes.clear();
for( size_t i = 0; i < nrows2; ++i )
distinct_row_hashes[rowhashes[rowperm[i]]] += 1;
pdqsort( rowperm.begin(), rowperm.begin() + nrows2, [&]( int a, int b ) {
return std::make_tuple( -distinct_row_hashes[rowhashes[a]],
rowhashes[a], a ) <
std::make_tuple( -distinct_row_hashes[rowhashes[b]],
rowhashes[b], b );
} );
lastnrows = nrows2;
nrows2 = 0;
while( nrows2 < lastnrows )
{
uint64_t hashval = rowhashes[rowperm[nrows2]];
size_t partitionsize = distinct_row_hashes[hashval];
if( partitionsize <= 1 )
break;
nrows2 += partitionsize;
}
for( size_t i = nrows2; i < lastnrows; ++i )
{
rowhashes[rowperm[i]] = i;
}
if( nrows2 == lastnrows )
{
--nrows2;
std::swap( rowperm[0], rowperm[nrows2] );
rowhashes[rowperm[nrows2]] = nrows2;
}
if( ncols2 == 0 )
break;
tbb::parallel_for(
tbb::blocked_range<int>( 0, ncols2 ),
[&]( const tbb::blocked_range<int>& r ) {
for( int i = r.begin(); i != r.end(); ++i )
{
int col = colperm[i];
int start = cscstarts[col];
int end = cscstarts[col + 1];
pdqsort( &cscvals[start], &cscvals[end], comp_colvals );
Hasher<uint64_t> hasher( end - start );
for( int k = start; k < end; ++k )
{
hasher.addValue( cscvals[k].first );
hasher.addValue( rowhashes[cscvals[k].second] );
}
colhashes[col] = hasher.getHash() >> 1;
}
} );
distinct_col_hashes.clear();
for( size_t i = 0; i < ncols2; ++i )
distinct_col_hashes[colhashes[colperm[i]]] += 1;
pdqsort( colperm.begin(), colperm.begin() + ncols2, [&]( int a, int b ) {
return std::make_pair( -distinct_col_hashes[colhashes[a]],
colhashes[a] ) <
std::make_pair( -distinct_col_hashes[colhashes[b]],
colhashes[b] );
} );
lastncols = ncols2;
ncols2 = 0;
while( ncols2 < lastncols )
{
uint64_t hashval = colhashes[colperm[ncols2]];
size_t partitionsize = distinct_col_hashes[hashval];
if( partitionsize <= 1 )
break;
ncols2 += partitionsize;
}
for( size_t i = ncols2; i < lastncols; ++i )
{
colhashes[colperm[i]] = i;
}
++iters;
}
// Sort hashes
pdqsort( rowhashes.begin(), rowhashes.end(),
[]( uint64_t a, uint64_t b ) { return a < b; } );
pdqsort( colhashes.begin(), colhashes.end(),
[]( uint64_t a, uint64_t b ) { return a < b; } );
// Put all values in the hasher
Hasher<uint64_t> hasher( nnz );
hasher.addValue( nrows );
hasher.addValue( ncols );
hasher.addValue( prob.getNumIntegralCols() );
hasher.addValue( prob.getNumContinuousCols() );
for( uint64_t hash : rowhashes )
hasher.addValue( hash );
for( uint64_t hash : colhashes )
hasher.addValue( hash );
return hasher.getHash();
}
int
main( int argc, char* argv[] )
{
if( argc != 2 && argc != 3 )
{
fmt::print( "usage:\n" );
fmt::print( "./check_duplicates instance1.mps instance2.mps - check for "
"duplicates\n" );
fmt::print( "./check_duplicates instance1.mps - compute "
"unique hash for instance" );
return 1;
}
assert( argc == 2 || argc == 3 );
// Load and check problem 1
if( !fileExists( argv[1] ) )
{
fmt::print( "Error: Can not find instance at `{}`\n", argv[1] );
return 1;
}
boost::optional<Problem<double>> prob1t =
MpsParser<double>::loadProblem( argv[1] );
if( !prob1t )
{
fmt::print( "error loading problem {}\n", argv[1] );
return 1;
}
Problem<double> prob1 = *prob1t;
if( argc == 2 )
{
uint64_t result = compute_instancehash( prob1 );
fmt::print( "{}\n", result );
}
else
{
// Load and check problem 2
if( !fileExists( argv[2] ) )
{
fmt::print( "Error: Can not find instance at `{}`\n", argv[2] );
return 1;
}
boost::optional<Problem<double>> prob2t =
MpsParser<double>::loadProblem( argv[2] );
if( !prob2t )
{
fmt::print( "error loading problem {}\n", argv[1] );
return 1;
}
Problem<double> prob2 = *prob2t;
fmt::print( "duplicates: {}\n", check_duplicates( prob1, prob2 ) );
}
return 0;
}
| 31,896
|
C++
|
.cpp
| 835
| 30.160479
| 80
| 0.55183
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,825
|
papilo.cpp
|
lgottwald_PaPILO/src/papilo.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/Config.hpp"
#include "papilo/core/ConstraintMatrix.hpp"
#include "papilo/core/Objective.hpp"
#include "papilo/core/Presolve.hpp"
#include "papilo/core/VariableDomains.hpp"
#include "papilo/io/MpsParser.hpp"
#include "papilo/io/MpsWriter.hpp"
#include "papilo/io/SolParser.hpp"
#include "papilo/misc/MultiPrecision.hpp"
#include "papilo/misc/OptionsParser.hpp"
#include "papilo/misc/Wrappers.hpp"
#include "papilo/misc/tbb.hpp"
#include <boost/program_options.hpp>
#include <cassert>
#include <fstream>
#ifdef PAPILO_HAVE_SCIP
#include "papilo/interfaces/ScipInterface.hpp"
#include "scip/scipdefplugins.h"
static void
setupscip( SCIP* scip, void* usrdata )
{
papilo::OptionsInfo* optInfo =
reinterpret_cast<papilo::OptionsInfo*>( usrdata );
SCIP_CALL_ABORT( SCIPincludeDefaultPlugins( scip ) );
if( !optInfo->scip_settings_file.empty() )
{
SCIP_CALL_ABORT(
SCIPreadParams( scip, optInfo->scip_settings_file.c_str() ) );
}
}
template <typename REAL>
static std::unique_ptr<papilo::SolverFactory<REAL>>
get_mip_solver_factory( papilo::OptionsInfo& optionsInfo )
{
return papilo::ScipFactory<REAL>::create( setupscip, &optionsInfo );
}
#else
template <typename REAL>
static std::unique_ptr<papilo::SolverFactory<REAL>>
get_mip_solver_factory( papilo::OptionsInfo& optionsInfo )
{
return nullptr;
}
#endif
#ifdef PAPILO_HAVE_HIGHS
#include "papilo/interfaces/HighsInterface.hpp"
template <typename REAL>
static std::unique_ptr<papilo::SolverFactory<REAL>>
get_lp_solver_factory( papilo::OptionsInfo& optionsInfo )
{
return papilo::HighsFactory<REAL>::create();
}
#elif defined( PAPILO_HAVE_SOPLEX )
#include "papilo/interfaces/SoplexInterface.hpp"
static void
setupsoplex( soplex::SoPlex& spx, void* usrdata )
{
papilo::OptionsInfo* optInfo =
reinterpret_cast<papilo::OptionsInfo*>( usrdata );
if( !optInfo->soplex_settings_file.empty() )
spx.loadSettingsFile( optInfo->soplex_settings_file.c_str() );
}
template <typename REAL>
static std::unique_ptr<papilo::SolverFactory<REAL>>
get_lp_solver_factory( papilo::OptionsInfo& optionsInfo )
{
return papilo::SoplexFactory<REAL>::create( setupsoplex, &optionsInfo );
}
#else
template <typename REAL>
static std::unique_ptr<papilo::SolverFactory<REAL>>
get_lp_solver_factory( papilo::OptionsInfo& optionsInfo )
{
return nullptr;
}
#endif
int
main( int argc, char* argv[] )
{
using namespace papilo;
// get the options passed by the user
OptionsInfo optionsInfo;
try
{
optionsInfo = parseOptions( argc, argv );
}
catch( const boost::program_options::error& ex )
{
std::cerr << "Error while parsing the options.\n" << '\n';
std::cerr << ex.what() << '\n';
return 1;
}
if( !optionsInfo.is_complete )
return 0;
// run the command passed as argument
switch( optionsInfo.command )
{
case Command::kNone:
return 1;
case Command::kPresolve:
case Command::kSolve:
switch( optionsInfo.arithmetic_type )
{
case ArithmeticType::kDouble:
if( presolve_and_solve<double>(
optionsInfo, get_lp_solver_factory<double>( optionsInfo ),
get_mip_solver_factory<double>( optionsInfo ) ) !=
ResultStatus::kOk )
return 1;
break;
case ArithmeticType::kQuad:
if( presolve_and_solve<Quad>(
optionsInfo, get_lp_solver_factory<Quad>( optionsInfo ),
get_mip_solver_factory<Quad>( optionsInfo ) ) !=
ResultStatus::kOk )
return 1;
break;
case ArithmeticType::kRational:
if( presolve_and_solve<Rational>(
optionsInfo, get_lp_solver_factory<Rational>( optionsInfo ),
get_mip_solver_factory<Rational>( optionsInfo ) ) !=
ResultStatus::kOk )
return 1;
}
break;
case Command::kPostsolve:
switch( optionsInfo.arithmetic_type )
{
case ArithmeticType::kDouble:
postsolve<double>( optionsInfo );
break;
case ArithmeticType::kQuad:
postsolve<Quad>( optionsInfo );
break;
case ArithmeticType::kRational:
postsolve<Rational>( optionsInfo );
}
}
return 0;
}
| 6,064
|
C++
|
.cpp
| 162
| 33.141975
| 79
| 0.59653
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,826
|
papilolib.cpp
|
lgottwald_PaPILO/src/papilolib.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilolib.h"
#include "scip/pub_message.h"
#include "scip/scipdefplugins.h"
#include <cassert>
#include <cstdlib>
#include <new>
static void*
malloc_default_cb( size_t size, void* )
{
return std::malloc( size );
}
static void
free_default_cb( void* ptr, void* )
{
std::free( ptr );
}
static void* alloc_usrdata = nullptr;
static void* ( *malloccb )( size_t size, void* usrptr ) = malloc_default_cb;
static void ( *freecb )( void* ptr, void* usrptr ) = free_default_cb;
template <class T>
struct CallbackAllocator
{
typedef T value_type;
CallbackAllocator() noexcept {}
template <class U>
CallbackAllocator( const CallbackAllocator<U>& ) noexcept
{
}
template <class U>
bool
operator==( const CallbackAllocator<U>& ) const noexcept
{
return true;
}
template <class U>
bool
operator!=( const CallbackAllocator<U>& ) const noexcept
{
return false;
}
T*
allocate( const size_t n ) const
{
if( n == 0 )
{
return nullptr;
}
if( n > static_cast<size_t>( -1 ) / sizeof( T ) )
{
throw std::bad_array_new_length();
}
void* const pv = malloccb( n * sizeof( T ), alloc_usrdata );
if( !pv )
{
throw std::bad_alloc();
}
return static_cast<T*>( pv );
}
void
deallocate( T* const p, size_t ) const noexcept
{
freecb( p, alloc_usrdata );
}
};
#include "papilo/misc/Alloc.hpp"
using namespace papilo;
namespace papilo
{
template <typename T>
struct AllocatorTraits<T>
{
using type = std::allocator<T>;
};
} // namespace papilo
#include "papilo/core/ConstraintMatrix.hpp"
#include "papilo/core/Objective.hpp"
#include "papilo/core/Presolve.hpp"
#include "papilo/core/ProblemBuilder.hpp"
#include "papilo/core/VariableDomains.hpp"
#include "papilo/interfaces/ScipInterface.hpp"
#include "papilo/interfaces/SoplexInterface.hpp"
#include "papilo/misc/MultiPrecision.hpp"
#include "papilo/misc/tbb.hpp"
#ifdef PAPILO_MPS_WRITER
#include "papilo/io/MpsWriter.hpp"
#endif
#include <boost/program_options.hpp>
#include <cassert>
#include <fstream>
struct Papilo_Problem
{
ProblemBuilder<double> problemBuilder;
double infinity;
};
PAPILO_PROBLEM*
papilo_problem_create( double infinity, const char* name, int nnz_hint,
int row_hint, int col_hint )
{
assert( nnz_hint >= 0 );
// allocate memory and construct with placement new
PAPILO_PROBLEM* prob = new( Allocator<PAPILO_PROBLEM>().allocate( 1 ) )
PAPILO_PROBLEM{ ProblemBuilder<double>(), infinity };
// allocate memory for given number of nonzeros
prob->problemBuilder.reserve( nnz_hint, row_hint, col_hint );
if( name == nullptr )
prob->problemBuilder.setProblemName( "problem" );
else
prob->problemBuilder.setProblemName( name );
return prob;
}
int
papilo_problem_add_cols( PAPILO_PROBLEM* problem, int num, const double* lb,
const double* ub, const unsigned char* integral,
const double* obj, const char** colnames )
{
assert( num >= 0 );
if( num == 0 )
return -1;
int ncols = problem->problemBuilder.getNumCols();
problem->problemBuilder.setNumCols( ncols + num );
for( int i = 0; i != num; ++i )
{
int col = ncols + i;
problem->problemBuilder.setObj( col, obj[i] );
bool isLbInf = lb[i] <= -problem->infinity;
bool isUbInf = ub[i] >= problem->infinity;
problem->problemBuilder.setColLbInf( col, isLbInf );
problem->problemBuilder.setColUbInf( col, isUbInf );
if( !isLbInf )
problem->problemBuilder.setColLb( col, lb[i] );
if( !isUbInf )
problem->problemBuilder.setColUb( col, ub[i] );
problem->problemBuilder.setColIntegral( col, integral[i] );
if( colnames != nullptr )
problem->problemBuilder.setColName( col, colnames[i] );
else
problem->problemBuilder.setColName(
col, fmt::format( "x{}", col ).c_str() );
}
return ncols;
}
int
papilo_problem_add_col( PAPILO_PROBLEM* problem, double lb, double ub,
unsigned char integral, double obj,
const char* colname )
{
int ncols = problem->problemBuilder.getNumCols();
problem->problemBuilder.setNumCols( ncols + 1 );
int col = ncols;
problem->problemBuilder.setObj( col, obj );
bool isLbInf = lb <= -problem->infinity;
bool isUbInf = ub >= problem->infinity;
problem->problemBuilder.setColLbInf( col, isLbInf );
problem->problemBuilder.setColUbInf( col, isUbInf );
if( !isLbInf )
problem->problemBuilder.setColLb( col, lb );
if( !isUbInf )
problem->problemBuilder.setColUb( col, ub );
problem->problemBuilder.setColIntegral( col, integral );
if( colname != nullptr )
problem->problemBuilder.setColName( col, colname );
else
problem->problemBuilder.setColName( col,
fmt::format( "x{}", col ).c_str() );
return ncols;
}
int
papilo_problem_get_num_cols( PAPILO_PROBLEM* problem )
{
return problem->problemBuilder.getNumCols();
}
int
papilo_problem_get_num_rows( PAPILO_PROBLEM* problem )
{
return problem->problemBuilder.getNumRows();
}
int
papilo_problem_get_num_nonzeros( PAPILO_PROBLEM* problem )
{
// todo
return 0;
}
void
papilo_problem_change_col_lb( PAPILO_PROBLEM* problem, int col, double lb )
{
problem->problemBuilder.setColLb( col, lb );
}
void
papilo_problem_change_col_ub( PAPILO_PROBLEM* problem, int col, double ub )
{
problem->problemBuilder.setColUb( col, ub );
}
void
papilo_problem_change_col_integral( PAPILO_PROBLEM* problem, int col,
unsigned char integral )
{
problem->problemBuilder.setColIntegral( col, integral );
}
void
papilo_problem_change_col_obj( PAPILO_PROBLEM* problem, int col, double obj )
{
problem->problemBuilder.setObj( col, obj );
}
int
papilo_problem_add_simple_rows( PAPILO_PROBLEM* problem, int num,
const unsigned char* rowtypes,
const double* side, const char** rownames )
{
assert( num >= 0 );
if( num == 0 )
return -1;
int nrows = problem->problemBuilder.getNumRows();
problem->problemBuilder.setNumRows( nrows + num );
for( int i = 0; i != num; ++i )
{
int row = nrows + i;
switch( rowtypes[i] )
{
case PAPILO_ROW_TYPE_GREATER:
problem->problemBuilder.setRowRhsInf( row, true );
problem->problemBuilder.setRowLhsInf( row, false );
problem->problemBuilder.setRowLhs( row, side[i] );
break;
case PAPILO_ROW_TYPE_LESSER:
problem->problemBuilder.setRowRhsInf( row, false );
problem->problemBuilder.setRowLhsInf( row, true );
problem->problemBuilder.setRowRhs( row, side[i] );
break;
case PAPILO_ROW_TYPE_EQUAL:
problem->problemBuilder.setRowRhsInf( row, false );
problem->problemBuilder.setRowLhsInf( row, false );
problem->problemBuilder.setRowLhs( row, side[i] );
problem->problemBuilder.setRowRhs( row, side[i] );
}
if( rownames != nullptr )
problem->problemBuilder.setRowName( row, rownames[i] );
else
problem->problemBuilder.setRowName(
row, fmt::format( "c{}", row ).c_str() );
}
return nrows;
}
int
papilo_problem_add_generic_rows( PAPILO_PROBLEM* problem, int num,
const double* lhs, const double* rhs,
const char** rownames )
{
assert( num >= 0 );
if( num == 0 )
return -1;
int nrows = problem->problemBuilder.getNumRows();
problem->problemBuilder.setNumRows( nrows + num );
for( int i = 0; i != num; ++i )
{
int row = nrows + i;
bool isLhsInf = lhs[i] <= -problem->infinity;
bool isRhsInf = rhs[i] >= problem->infinity;
problem->problemBuilder.setRowRhsInf( row, isRhsInf );
if( isLhsInf )
problem->problemBuilder.setRowLhsInf( row, true );
else
problem->problemBuilder.setRowLhs( row, lhs[i] );
if( isRhsInf )
problem->problemBuilder.setRowRhsInf( row, true );
else
problem->problemBuilder.setRowRhs( row, rhs[i] );
if( rownames != nullptr )
problem->problemBuilder.setRowName( row, rownames[i] );
else
problem->problemBuilder.setRowName(
row, fmt::format( "c{}", row ).c_str() );
}
return nrows;
}
int
papilo_problem_add_simple_row( PAPILO_PROBLEM* problem, unsigned char rowtype,
double side, const char* rowname )
{
int nrows = problem->problemBuilder.getNumRows();
problem->problemBuilder.setNumRows( nrows + 1 );
int row = nrows;
switch( rowtype )
{
case PAPILO_ROW_TYPE_GREATER:
problem->problemBuilder.setRowRhsInf( row, true );
problem->problemBuilder.setRowLhsInf( row, false );
problem->problemBuilder.setRowLhs( row, side );
break;
case PAPILO_ROW_TYPE_LESSER:
problem->problemBuilder.setRowRhsInf( row, false );
problem->problemBuilder.setRowLhsInf( row, true );
problem->problemBuilder.setRowRhs( row, side );
break;
case PAPILO_ROW_TYPE_EQUAL:
problem->problemBuilder.setRowRhsInf( row, false );
problem->problemBuilder.setRowLhsInf( row, false );
problem->problemBuilder.setRowLhs( row, side );
problem->problemBuilder.setRowRhs( row, side );
}
if( rowname != nullptr )
problem->problemBuilder.setRowName( row, rowname );
else
problem->problemBuilder.setRowName( row,
fmt::format( "c{}", row ).c_str() );
return nrows;
}
int
papilo_problem_add_generic_row( PAPILO_PROBLEM* problem, double lhs, double rhs,
const char* rowname )
{
int nrows = problem->problemBuilder.getNumRows();
problem->problemBuilder.setNumRows( nrows + 1 );
int row = nrows;
bool isLhsInf = lhs <= -problem->infinity;
bool isRhsInf = rhs >= problem->infinity;
if( isLhsInf )
problem->problemBuilder.setRowLhsInf( row, true );
else
problem->problemBuilder.setRowLhs( row, lhs );
if( isRhsInf )
problem->problemBuilder.setRowRhsInf( row, true );
else
problem->problemBuilder.setRowRhs( row, rhs );
if( rowname != nullptr )
problem->problemBuilder.setRowName( row, rowname );
else
problem->problemBuilder.setRowName( row,
fmt::format( "c{}", row ).c_str() );
return nrows;
}
void
papilo_problem_free( PAPILO_PROBLEM* prob )
{
// call destructor
prob->~Papilo_Problem();
// deallocate memory
Allocator<PAPILO_PROBLEM>().deallocate( prob, 1 );
}
void
papilo_problem_add_nonzero( PAPILO_PROBLEM* problem, int row, int col,
double val )
{
problem->problemBuilder.addEntry( row, col, val );
}
void
papilo_problem_add_nonzeros_row( PAPILO_PROBLEM* problem, int row, int num,
const int* cols, const double* vals )
{
problem->problemBuilder.addRowEntries( row, num, cols, vals );
}
void
papilo_problem_add_nonzeros_col( PAPILO_PROBLEM* problem, int col, int num,
const int* rows, const double* vals )
{
problem->problemBuilder.addColEntries( col, num, rows, vals );
}
void
papilo_problem_add_nonzeros_csr( PAPILO_PROBLEM* problem, const int* rowstart,
const int* cols, const double* vals )
{
for( int row = 0; row != problem->problemBuilder.getNumRows(); ++row )
problem->problemBuilder.addRowEntries(
row, rowstart[row + 1] - rowstart[row], cols + rowstart[row],
vals + rowstart[row] );
}
void
papilo_problem_add_nonzeros_csc( PAPILO_PROBLEM* problem, const int* colstart,
const int* rows, const double* vals )
{
for( int col = 0; col != problem->problemBuilder.getNumCols(); ++col )
problem->problemBuilder.addColEntries(
col, colstart[col + 1] - colstart[col], rows + colstart[col],
vals + colstart[col] );
}
enum class SolverState
{
INIT,
PROBLEM_LOADED,
PROBLEM_PRESOLVED,
PROBLEM_SOLVED
};
class MessageStreambuf : public std::stringbuf
{
const Message& msg;
public:
MessageStreambuf( const Message& msg ) : msg( msg ) {}
int
sync() override
{
msg.info( this->str() );
this->str( "" );
return 0;
}
};
class MessageStream : public std::ostream
{
MessageStreambuf messageStreambuf;
public:
MessageStream( const Message& msg )
: messageStreambuf( msg ), std::ostream( &messageStreambuf )
{
}
};
struct Papilo_Solver
{
SolverState state;
Problem<double> problem;
Presolve<double> presolve;
ParameterSet paramSet;
PresolveResult<double> presolveResult;
std::unique_ptr<MessageStream> messageStream;
std::unique_ptr<SolverInterface<double>> mipSolver;
ParameterSet mipParamSet;
std::unique_ptr<SolverInterface<double>> lpSolver;
ParameterSet lpParamSet;
Solution<double> solution;
double tlimsoft;
PAPILO_SOLVING_INFO solveinfo;
};
static void
PrintSCIPMessage( SCIP_MESSAGEHDLR* handler, FILE* file, const char* message,
VerbosityLevel level )
{
if( file && file != stdout )
{
fputs( message, file );
fflush( file );
}
else
{
Message* msg =
reinterpret_cast<Message*>( SCIPmessagehdlrGetData( handler ) );
msg->print( level, message );
}
}
static SCIP_DECL_ERRORPRINTING( messageError )
{
SCIP_MESSAGEHDLR* messagehdlr = static_cast<SCIP_MESSAGEHDLR*>( data );
PrintSCIPMessage( messagehdlr, NULL, msg, VerbosityLevel::kError );
}
static SCIP_DECL_MESSAGEWARNING( messageWarning )
{
PrintSCIPMessage( messagehdlr, file, msg, VerbosityLevel::kWarning );
}
static SCIP_DECL_MESSAGEINFO( messageInfo )
{
PrintSCIPMessage( messagehdlr, file, msg, VerbosityLevel::kInfo );
}
static SCIP_DECL_MESSAGEDIALOG( messageDialog )
{
PrintSCIPMessage( messagehdlr, file, msg, VerbosityLevel::kInfo );
}
static void
setupscip( SCIP* scip, void* usrdata )
{
PAPILO_SOLVER* solver = reinterpret_cast<PAPILO_SOLVER*>( usrdata );
SCIP_RETCODE retcode = SCIPincludeDefaultPlugins( scip );
if( retcode != SCIP_OKAY )
{
// todo
assert( false );
}
SCIP_MESSAGEHDLR* msghdlr;
retcode = SCIPmessagehdlrCreate(
&msghdlr, false, NULL, false, messageWarning, messageDialog, messageInfo,
NULL,
reinterpret_cast<SCIP_MESSAGEHDLRDATA*>( &solver->presolve.message() ) );
if( retcode != SCIP_OKAY )
{
// todo
assert( false );
}
SCIPmessageSetErrorPrinting( messageError, msghdlr );
SCIPsetMessagehdlr( scip, msghdlr );
// copy settings from main solver if further instances are created, e.g. for
// components
ScipInterface<double>* mainscip =
static_cast<ScipInterface<double>*>( solver->mipSolver.get() );
if( mainscip )
{
retcode = SCIPcopyParamSettings( mainscip->getSCIP(), scip );
if( retcode != SCIP_OKAY )
{
// todo
assert( false );
}
}
}
static void
setupsoplex( soplex::SoPlex& spx, void* usrdata )
{
PAPILO_SOLVER* solver = reinterpret_cast<PAPILO_SOLVER*>( usrdata );
spx.spxout.setStream( soplex::SPxOut::ERROR, *solver->messageStream );
spx.spxout.setStream( soplex::SPxOut::WARNING, *solver->messageStream );
spx.spxout.setStream( soplex::SPxOut::DEBUG, *solver->messageStream );
spx.spxout.setStream( soplex::SPxOut::INFO1, *solver->messageStream );
spx.spxout.setStream( soplex::SPxOut::INFO2, *solver->messageStream );
spx.spxout.setStream( soplex::SPxOut::INFO3, *solver->messageStream );
// copy settings from main solver if further instances are created, e.g. for
// components
SoplexInterface<double>* mainspx =
static_cast<SoplexInterface<double>*>( solver->lpSolver.get() );
if( mainspx )
{
spx.setSettings( mainspx->getSoPlex().settings() );
}
}
PAPILO_SOLVER*
papilo_solver_create()
{
PAPILO_SOLVER* solver =
new( Allocator<PAPILO_SOLVER>().allocate( 1 ) ) PAPILO_SOLVER();
solver->messageStream = std::unique_ptr<MessageStream>(
new MessageStream( solver->presolve.message() ) );
solver->presolve.addDefaultPresolvers();
solver->presolve.setLPSolverFactory( SoplexFactory<double>::create(
setupsoplex, reinterpret_cast<void*>( solver ) ) );
solver->presolve.setMIPSolverFactory( ScipFactory<double>::create(
setupscip, reinterpret_cast<void*>( solver ) ) );
solver->paramSet = solver->presolve.getParameters();
solver->mipSolver = solver->presolve.getMIPSolverFactory()->newSolver();
solver->lpSolver = solver->presolve.getLPSolverFactory()->newSolver();
solver->mipSolver->addParameters( solver->mipParamSet );
solver->lpSolver->addParameters( solver->lpParamSet );
solver->state = SolverState::INIT;
solver->solveinfo.solvingtime = 0.0;
solver->tlimsoft = std::numeric_limits<double>::max();
solver->paramSet.addParameter(
"presolve.tlimsoft",
"soft time limit that is only set after a solution has been found",
solver->tlimsoft, 0.0 );
return solver;
}
void
papilo_solver_set_trace_callback( PAPILO_SOLVER* solver,
void ( *thetracecb )( int level,
const char* data,
size_t size,
void* usrptr ),
void* usrptr )
{
solver->presolve.message().setOutputCallback( thetracecb, usrptr );
}
void
papilo_solver_free( PAPILO_SOLVER* solver )
{
// call destructor
solver->~Papilo_Solver();
// deallocate
Allocator<PAPILO_SOLVER>().deallocate( solver, 1 );
}
/// Set bool parameter with given key to the given value
PAPILO_PARAM_RESULT
papilo_solver_set_param_bool( PAPILO_SOLVER* solver, const char* key,
unsigned int val )
{
try
{
solver->paramSet.setParameter( key, static_cast<bool>( val ) );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_param_real( PAPILO_SOLVER* solver, const char* key,
double val )
{
try
{
solver->paramSet.setParameter( key, val );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_param_int( PAPILO_SOLVER* solver, const char* key, int val )
{
try
{
solver->paramSet.setParameter( key, val );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_param_char( PAPILO_SOLVER* solver, const char* key, char val )
{
try
{
solver->paramSet.setParameter( key, val );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_param_string( PAPILO_SOLVER* solver, const char* key,
const char* val )
{
try
{
solver->paramSet.setParameter( key, val );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_mip_param_real( PAPILO_SOLVER* solver, const char* key,
double val )
{
try
{
solver->mipParamSet.setParameter( key, val );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_mip_param_int( PAPILO_SOLVER* solver, const char* key,
int val )
{
try
{
solver->mipParamSet.setParameter( key, val );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_mip_param_bool( PAPILO_SOLVER* solver, const char* key,
unsigned int val )
{
try
{
solver->mipParamSet.setParameter( key, static_cast<bool>( val ) );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_mip_param_int64( PAPILO_SOLVER* solver, const char* key,
int64_t val )
{
try
{
solver->mipParamSet.setParameter( key, val );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_mip_param_char( PAPILO_SOLVER* solver, const char* key,
char val )
{
try
{
solver->mipParamSet.setParameter( key, val );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_mip_param_string( PAPILO_SOLVER* solver, const char* key,
const char* val )
{
try
{
solver->mipParamSet.setParameter( key, val );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_lp_param_real( PAPILO_SOLVER* solver, const char* key,
double val )
{
try
{
solver->lpParamSet.setParameter( key, val );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_lp_param_int( PAPILO_SOLVER* solver, const char* key,
int val )
{
try
{
solver->lpParamSet.setParameter( key, val );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_lp_param_bool( PAPILO_SOLVER* solver, const char* key,
unsigned int val )
{
try
{
solver->lpParamSet.setParameter( key, static_cast<bool>( val ) );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_lp_param_int64( PAPILO_SOLVER* solver, const char* key,
int64_t val )
{
try
{
solver->lpParamSet.setParameter( key, val );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_lp_param_char( PAPILO_SOLVER* solver, const char* key,
char val )
{
try
{
solver->lpParamSet.setParameter( key, val );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
PAPILO_PARAM_RESULT
papilo_solver_set_lp_param_string( PAPILO_SOLVER* solver, const char* key,
const char* val )
{
try
{
solver->lpParamSet.setParameter( key, val );
}
catch( const std::invalid_argument& )
{
return PAPILO_PARAM_NOT_FOUND;
}
catch( const std::domain_error& )
{
return PAPILO_PARAM_WRONG_TYPE;
}
catch( const std::out_of_range& )
{
return PAPILO_PARAM_INVALID_VALUE;
}
return PAPILO_PARAM_CHANGED;
}
void
papilo_solver_load_problem( PAPILO_SOLVER* solver, PAPILO_PROBLEM* problem )
{
assert( solver->state == SolverState::INIT );
solver->problem = problem->problemBuilder.build();
solver->solveinfo.dualbound = -problem->infinity;
solver->solveinfo.bestsol_obj = problem->infinity;
solver->solveinfo.bestsol_boundviol = problem->infinity;
solver->solveinfo.bestsol_consviol = problem->infinity;
solver->solveinfo.bestsol_intviol = problem->infinity;
solver->solveinfo.solve_result = PAPILO_SOLVE_RESULT_STOPPED;
solver->solveinfo.solvingtime = 0.0;
solver->solveinfo.presolvetime = 0.0;
solver->state = SolverState::PROBLEM_LOADED;
}
void
papilo_solver_write_mps( PAPILO_SOLVER* solver, const char* filename )
{
assert( solver->state == SolverState::PROBLEM_LOADED );
#ifdef PAPILO_MPS_WRITER
Vec<int> rowmapping( solver->problem.getNRows() );
for( int i = 0; i != solver->problem.getNRows(); ++i )
rowmapping[i] = i;
Vec<int> colmapping( solver->problem.getNCols() );
for( int i = 0; i != solver->problem.getNCols(); ++i )
colmapping[i] = i;
MpsWriter<double>::writeProb( filename, solver->problem, rowmapping,
colmapping );
#else
solver->presolve.message().warn(
"cannot write problem to {}: MPS writer not available\n", filename );
#endif
}
void
papilo_solver_set_num_threads( PAPILO_SOLVER* solver, int numthreads )
{
solver->presolve.getPresolveOptions().threads = std::max( 0, numthreads );
}
PAPILO_SOLVING_INFO*
papilo_solver_start( PAPILO_SOLVER* solver )
{
switch( solver->state )
{
default:
case SolverState::INIT:
assert( false );
break;
case SolverState::PROBLEM_LOADED:
solver->presolveResult = solver->presolve.apply( solver->problem );
solver->state = SolverState::PROBLEM_PRESOLVED;
solver->solveinfo.presolvetime =
solver->presolve.getStatistics().presolvetime;
solver->presolve.message().info(
"presolving finished after {:.3f} seconds\n\n",
solver->solveinfo.presolvetime );
case SolverState::PROBLEM_PRESOLVED:
switch( solver->presolveResult.status )
{
case PresolveStatus::kUnchanged:
case PresolveStatus::kReduced:
break;
case PresolveStatus::kInfeasible:
solver->solveinfo.solve_result = PAPILO_SOLVE_RESULT_INFEASIBLE;
return &solver->solveinfo;
case PresolveStatus::kUnbndOrInfeas:
solver->solveinfo.solve_result = PAPILO_SOLVE_RESULT_UNBND_OR_INFEAS;
return &solver->solveinfo;
case PresolveStatus::kUnbounded:
solver->solveinfo.solve_result = PAPILO_SOLVE_RESULT_UNBOUNDED;
return &solver->solveinfo;
}
case SolverState::PROBLEM_SOLVED:
SolverStatus status;
SolverInterface<double>* solverInterface = nullptr;
if( solver->problem.getNCols() > 0 )
{
if( solver->presolveResult.postsolve.getOriginalProblem()
.getNumIntegralCols() == 0 )
solverInterface = solver->lpSolver.get();
else
solverInterface = solver->mipSolver.get();
if( solverInterface == nullptr )
{
solver->presolve.message().error(
"no solver available for solving\n" );
solver->solveinfo.solve_result = PAPILO_SOLVE_RESULT_STOPPED;
break;
}
solverInterface->setVerbosity( solver->presolve.getVerbosityLevel() );
if( solver->presolve.getPresolveOptions().tlim !=
std::numeric_limits<double>::max() )
{
double tlim = solver->presolve.getPresolveOptions().tlim -
solver->solveinfo.presolvetime;
if( tlim <= 0 )
{
solver->presolve.message().info(
"time limit reached in presolving\n" );
solver->solveinfo.solve_result = PAPILO_SOLVE_RESULT_STOPPED;
break;
}
solverInterface->setTimeLimit( tlim );
}
if( solver->tlimsoft != std::numeric_limits<double>::max() )
{
solverInterface->setSoftTimeLimit( std::max(
0.0, solver->tlimsoft - solver->solveinfo.presolvetime ) );
}
solver->state = SolverState::PROBLEM_SOLVED;
{
Timer t( solver->solveinfo.solvingtime );
solverInterface->setUp(
solver->problem,
solver->presolveResult.postsolve.origrow_mapping,
solver->presolveResult.postsolve.origcol_mapping );
solverInterface->solve();
if( static_cast<int>( solver->presolve.getVerbosityLevel() ) >=
static_cast<int>( VerbosityLevel::kInfo ) )
solverInterface->printDetails();
}
status = solverInterface->getStatus();
solver->presolve.message().info(
"\nsolving finished after {:.3f} seconds\n\n",
solver->solveinfo.solvingtime + solver->solveinfo.presolvetime );
}
else
{
status = SolverStatus::kOptimal;
solver->presolve.message().info( "problem solved in presolving\n" );
}
Solution<double> solution;
switch( status )
{
case SolverStatus::kOptimal:
solver->solveinfo.solve_result = PAPILO_SOLVE_RESULT_STOPPED;
if( solverInterface != nullptr &&
!solverInterface->getSolution( solution ) )
break;
if( solver->presolveResult.postsolve.undo(
solution, solver->solution ) == PostsolveStatus::kOk )
{
solver->solveinfo.bestsol = solver->solution.primal.data();
solver->solveinfo.solve_result = PAPILO_SOLVE_RESULT_OPTIMAL;
// compute objective
solver->solveinfo.bestsol_obj =
solver->presolveResult.postsolve.problem.computeSolObjective(
solver->solution.primal );
solver->solveinfo.dualbound = solverInterface == nullptr
? solver->solveinfo.bestsol_obj
: solverInterface->getDualBound();
// compute violations
solver->presolveResult.postsolve.problem.computeSolViolations(
solver->presolveResult.postsolve.num, solver->solution.primal,
solver->solveinfo.bestsol_boundviol,
solver->solveinfo.bestsol_consviol,
solver->solveinfo.bestsol_intviol );
}
break;
case SolverStatus::kInterrupted:
solver->solveinfo.solve_result = PAPILO_SOLVE_RESULT_STOPPED;
if( solverInterface != nullptr )
solver->solveinfo.dualbound = solverInterface->getDualBound();
if( solverInterface != nullptr &&
!solverInterface->getSolution( solution ) )
break;
if( solver->presolveResult.postsolve.undo(
solution, solver->solution ) == PostsolveStatus::kOk )
{
solver->solveinfo.bestsol = solver->solution.primal.data();
solver->solveinfo.solve_result = PAPILO_SOLVE_RESULT_FEASIBLE;
// compute objective
solver->solveinfo.bestsol_obj =
solver->presolveResult.postsolve.problem.computeSolObjective(
solver->solution.primal );
// compute violations
solver->presolveResult.postsolve.problem.computeSolViolations(
solver->presolveResult.postsolve.num, solver->solution.primal,
solver->solveinfo.bestsol_boundviol,
solver->solveinfo.bestsol_consviol,
solver->solveinfo.bestsol_intviol );
}
break;
case SolverStatus::kInfeasible:
solver->solveinfo.solve_result = PAPILO_SOLVE_RESULT_INFEASIBLE;
break;
case SolverStatus::kUnbounded:
solver->solveinfo.solve_result = PAPILO_SOLVE_RESULT_UNBOUNDED;
break;
case SolverStatus::kUnbndOrInfeas:
solver->solveinfo.solve_result = PAPILO_SOLVE_RESULT_UNBND_OR_INFEAS;
break;
case SolverStatus::kInit:
assert( false );
case SolverStatus::kError:
solver->presolve.message().error(
"solver terminated with an error\n" );
solver->solveinfo.solve_result = PAPILO_SOLVE_RESULT_STOPPED;
}
}
return &solver->solveinfo;
}
| 37,032
|
C++
|
.cpp
| 1,147
| 26.013078
| 80
| 0.626803
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,827
|
convMPS.cpp
|
lgottwald_PaPILO/src/convMPS.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* A file which takes a papilo problem as input,
* and creates code for papilo to recreate that problem file
* without having the actual .mps file.
*/
#include "papilo/core/ConstraintMatrix.hpp"
#include "papilo/core/Objective.hpp"
#include "papilo/core/Problem.hpp"
#include "papilo/core/VariableDomains.hpp"
#include "papilo/io/MpsParser.hpp"
#include "papilo/misc/Hash.hpp"
#include "papilo/misc/Vec.hpp"
#include "papilo/misc/fmt.hpp"
#include "papilo/misc/tbb.hpp"
#include "pdqsort/pdqsort.h"
#include "tbb/concurrent_unordered_set.h"
#include <algorithm>
using namespace papilo;
static void
convMPS( const Problem<double>& prob )
{
/*
* This file can be compiled using `make convMPS`
* Prints code to create an object of class Problem in PaPILO
* Copy console output in your desired file
* You will need to include
* "papilo/core/Problem.hpp"
* "papilo/core/ProblemBuilder.hpp"
*/
// Get all relevant data
int nCols = prob.getNCols();
int nRows = prob.getNRows();
const Objective<double>& obj = prob.getObjective();
const ConstraintMatrix<double>& cm = prob.getConstraintMatrix();
Vec<double> rowlhs = cm.getLeftHandSides();
Vec<double> rowrhs = cm.getRightHandSides();
Vec<RowFlags> row_flags = cm.getRowFlags();
const int nnz = cm.getNnz();
const VariableDomains<double> vd = prob.getVariableDomains();
const Vec<std::string> cnames = prob.getVariableNames();
const Vec<std::string> rnames = prob.getConstraintNames();
fmt::print( " ///PROBLEM BUILDER CODE\n" );
// Set Variables
// Obj
fmt::print( " Vec<double> coeffobj{{" );
for( double coeff : obj.coefficients )
fmt::print( "{},", coeff );
fmt::print( "}};\n" );
// Columns
fmt::print( " Vec<double> lbs{{" );
for( int c = 0; c < nCols; ++c )
fmt::print( "{},", vd.lower_bounds[c] );
fmt::print( "}};\n" );
fmt::print( " Vec<uint8_t> lbInf{{" );
for( int c = 0; c < nCols; ++c )
fmt::print( "{},", vd.flags[c].test( ColFlag::kLbInf ) ? 1 : 0 );
fmt::print( "}};\n" );
fmt::print( " Vec<double> ubs{{" );
for( int c = 0; c < nCols; ++c )
fmt::print( "{},", vd.upper_bounds[c] );
fmt::print( "}};\n" );
fmt::print( " Vec<uint8_t> ubInf{{" );
for( int c = 0; c < nCols; ++c )
fmt::print( "{},", vd.flags[c].test( ColFlag::kUbInf ) ? 1 : 0 );
fmt::print( "}};\n" );
fmt::print( " Vec<uint8_t> isIntegral{{" );
for( int c = 0; c < nCols; ++c )
fmt::print( "{},", vd.flags[c].test( ColFlag::kIntegral ) ? 1 : 0 );
fmt::print( "}};\n" );
// Rows
fmt::print( " Vec<uint8_t> lhsIsInf{{" );
for( int r = 0; r < nRows; ++r )
fmt::print( "{},", row_flags[r].test( RowFlag::kLhsInf ) ? 1 : 0 );
fmt::print( "}};\n" );
fmt::print( " Vec<double> lhs{{" );
for( int r = 0; r < nRows; ++r )
fmt::print( "{},", rowlhs[r] );
fmt::print( "}};\n" );
fmt::print( " Vec<uint8_t> rhsIsInf{{" );
for( int r = 0; r < nRows; ++r )
fmt::print( "{},", row_flags[r].test( RowFlag::kRhsInf ) ? 1 : 0 );
fmt::print( "}};\n" );
fmt::print( " Vec<double> rhs{{" );
for( int r = 0; r < nRows; ++r )
fmt::print( "{},", rowrhs[r] );
fmt::print( "}};\n" );
// Entries ( Nonzero Matrix values )
fmt::print( " Vec<std::tuple<int, int, double>> entries{{" );
for( int r = 0; r < nRows; ++r )
{
const SparseVectorView<double>& rc = cm.getRowCoefficients( r );
const int len = rc.getLength();
const int* indices = rc.getIndices();
const double* vals = rc.getValues();
for( int i = 0; i < len; ++i )
fmt::print( "std::tuple<int, int, double>{{{},{},{}}},", r,
*( indices + i ), *( vals + i ) );
}
fmt::print( "}};\n" );
// Names
fmt::print( " Vec<std::string> rnames{{" );
for( int r = 0; r < nRows; ++r )
fmt::print( "\"{}\",", rnames[r] );
fmt::print( "}};\n" );
fmt::print( " Vec<std::string> cnames{{" );
for( int c = 0; c < nCols; ++c )
fmt::print( "\"{}\",", cnames[c] );
fmt::print( "}};\n" );
// Set problem Builder
fmt::print( " int nCols = {}; int nRows = {};\n", nCols, nRows );
fmt::print( " ProblemBuilder<double> pb;\n" );
fmt::print( " pb.reserve( {},{},{} );\n", nnz, nRows, nCols );
fmt::print( " pb.setNumRows( nRows );\n" );
fmt::print( " pb.setNumCols( nCols );\n" );
fmt::print( " pb.setObjAll( coeffobj );\n" );
fmt::print( " pb.setObjOffset( {} );\n", obj.offset );
fmt::print( " pb.setColLbAll( lbs );\n" );
fmt::print( " pb.setColLbInfAll( lbInf );\n" );
fmt::print( " pb.setColUbAll( ubs );\n" );
fmt::print( " pb.setColUbInfAll( ubInf );\n" );
fmt::print( " pb.setColIntegralAll( isIntegral );\n" );
fmt::print( " pb.setRowLhsInfAll( lhsIsInf );\n" );
fmt::print( " pb.setRowRhsInfAll( rhsIsInf );\n" );
fmt::print( " pb.setRowLhsAll( lhs );\n" );
fmt::print( " pb.setRowRhsAll( rhs );\n" );
fmt::print( " pb.setRowNameAll( rnames );\n" );
fmt::print( " pb.addEntryAll( entries );\n" );
fmt::print( " pb.setColNameAll( cnames );\n" );
fmt::print( " pb.setProblemName( \"{}\" );\n", prob.getName() );
// Build the Problem
fmt::print( " Problem<double> problem = pb.build();\n" );
fmt::print( " ///PROBLEM BUILDER CODE END\n" );
}
int
main( int argc, char* argv[] )
{
if( argc != 2 )
{
fmt::print( "usage:\n" );
fmt::print( "./convMPS instance1.mps - create array of cpp code "
"to load instance.mps to papilo\n" );
return 1;
}
assert( argc == 2 );
Problem<double> prob = MpsParser<double>::loadProblem( argv[1] );
convMPS( prob );
return 0;
}
| 7,516
|
C++
|
.cpp
| 170
| 40.358824
| 79
| 0.523375
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,828
|
VariableDomains.cpp
|
lgottwald_PaPILO/src/papilo/core/VariableDomains.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/core/VariableDomains.hpp"
namespace papilo
{
template struct VariableDomains<double>;
template struct VariableDomains<Quad>;
template struct VariableDomains<Rational>;
} // namespace papilo
| 1,970
|
C++
|
.cpp
| 29
| 66.827586
| 79
| 0.425181
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,829
|
ConstraintMatrix.cpp
|
lgottwald_PaPILO/src/papilo/core/ConstraintMatrix.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/core/ConstraintMatrix.hpp"
namespace papilo
{
template class ConstraintMatrix<double>;
template class ConstraintMatrix<Quad>;
template class ConstraintMatrix<Rational>;
} // namespace papilo
| 1,971
|
C++
|
.cpp
| 29
| 66.862069
| 79
| 0.425477
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,830
|
SparseStorage.cpp
|
lgottwald_PaPILO/src/papilo/core/SparseStorage.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/core/SparseStorage.hpp"
namespace papilo
{
template class SparseStorage<double>;
template class SparseStorage<Quad>;
template class SparseStorage<Rational>;
} // namespace papilo
| 1,959
|
C++
|
.cpp
| 29
| 66.448276
| 79
| 0.421899
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,831
|
ProbingView.cpp
|
lgottwald_PaPILO/src/papilo/core/ProbingView.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/core/ProbingView.hpp"
namespace papilo
{
template class ProbingView<double>;
template class ProbingView<Quad>;
template class ProbingView<Rational>;
} // namespace papilo
| 1,951
|
C++
|
.cpp
| 29
| 66.172414
| 79
| 0.419489
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,832
|
ProblemUpdate.cpp
|
lgottwald_PaPILO/src/papilo/core/ProblemUpdate.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/core/ProblemUpdate.hpp"
namespace papilo
{
template class ProblemUpdate<double>;
template class ProblemUpdate<Quad>;
template class ProblemUpdate<Rational>;
} // namespace papilo
| 1,959
|
C++
|
.cpp
| 29
| 66.448276
| 79
| 0.421899
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,833
|
Postsolve.cpp
|
lgottwald_PaPILO/src/papilo/core/Postsolve.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/core/Postsolve.hpp"
namespace papilo
{
template class Postsolve<double>;
template class Postsolve<Quad>;
template class Postsolve<Rational>;
} // namespace papilo
| 1,943
|
C++
|
.cpp
| 29
| 65.896552
| 79
| 0.417059
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,834
|
Presolve.cpp
|
lgottwald_PaPILO/src/papilo/core/Presolve.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/core/Presolve.hpp"
namespace papilo
{
template class Presolve<double>;
template class Presolve<Quad>;
template class Presolve<Rational>;
} // namespace papilo
| 1,939
|
C++
|
.cpp
| 29
| 65.758621
| 79
| 0.415836
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,835
|
FreeVarSubstitution.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/FreeVarSubstitution.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/FreeVarSubstitution.hpp"
namespace papilo
{
template class Substitution<double>;
template class Substitution<Quad>;
template class Substitution<Rational>;
} // namespace papilo
| 1,968
|
C++
|
.cpp
| 29
| 66.758621
| 79
| 0.424587
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,836
|
Probing.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/Probing.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/Probing.hpp"
namespace papilo
{
template class Probing<double>;
template class Probing<Quad>;
template class Probing<Rational>;
} // namespace papilo
| 1,941
|
C++
|
.cpp
| 29
| 65.827586
| 79
| 0.416448
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,837
|
SimplifyInequalities.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/SimplifyInequalities.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/SimplifyInequalities.hpp"
namespace papilo
{
template class SimplifyInequalities<double>;
template class SimplifyInequalities<Quad>;
template class SimplifyInequalities<Rational>;
} // namespace papilo
| 1,993
|
C++
|
.cpp
| 29
| 67.62069
| 79
| 0.431922
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,838
|
SimpleProbing.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/SimpleProbing.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/SimpleProbing.hpp"
namespace papilo
{
template class SimpleProbing<double>;
template class SimpleProbing<Quad>;
template class SimpleProbing<Rational>;
} // namespace papilo
| 1,965
|
C++
|
.cpp
| 29
| 66.655172
| 79
| 0.423694
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,839
|
ParallelRowDetection.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/ParallelRowDetection.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/ParallelRowDetection.hpp"
namespace papilo
{
template class ParallelRowDetection<double>;
template class ParallelRowDetection<Quad>;
template class ParallelRowDetection<Rational>;
} // namespace papilo
| 1,993
|
C++
|
.cpp
| 29
| 67.62069
| 79
| 0.431922
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,840
|
DominatedCols.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/DominatedCols.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/DominatedCols.hpp"
namespace papilo
{
template class DominatedCols<double>;
template class DominatedCols<Quad>;
template class DominatedCols<Rational>;
} // namespace papilo
| 1,965
|
C++
|
.cpp
| 29
| 66.655172
| 79
| 0.423694
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,841
|
DualInfer.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/DualInfer.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/DualInfer.hpp"
namespace papilo
{
template class DualInfer<double>;
template class DualInfer<Quad>;
template class DualInfer<Rational>;
} // namespace papilo
| 1,949
|
C++
|
.cpp
| 29
| 66.103448
| 79
| 0.418884
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,842
|
FixContinuous.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/FixContinuous.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/FixContinuous.hpp"
namespace papilo
{
template class FixContinuous<double>;
template class FixContinuous<Quad>;
template class FixContinuous<Rational>;
} // namespace papilo
| 1,965
|
C++
|
.cpp
| 29
| 66.655172
| 79
| 0.423694
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,843
|
ImplIntDetection.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/ImplIntDetection.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/ImplIntDetection.hpp"
namespace papilo
{
template class ImplIntDetection<double>;
template class ImplIntDetection<Quad>;
template class ImplIntDetection<Rational>;
} // namespace papilo
| 1,977
|
C++
|
.cpp
| 29
| 67.068966
| 79
| 0.427249
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,844
|
SingletonCols.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/SingletonCols.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/SingletonCols.hpp"
namespace papilo
{
template class SingletonCols<double>;
template class SingletonCols<Quad>;
template class SingletonCols<Rational>;
} // namespace papilo
| 1,965
|
C++
|
.cpp
| 29
| 66.655172
| 79
| 0.423694
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,845
|
Sparsify.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/Sparsify.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/Sparsify.hpp"
namespace papilo
{
template class Sparsify<double>;
template class Sparsify<Quad>;
template class Sparsify<Rational>;
} // namespace papilo
| 1,945
|
C++
|
.cpp
| 29
| 65.965517
| 79
| 0.417669
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,846
|
SimpleSubstitution.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/SimpleSubstitution.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/SimpleSubstitution.hpp"
namespace papilo
{
template class SimpleSubstitution<double>;
template class SimpleSubstitution<Quad>;
template class SimpleSubstitution<Rational>;
} // namespace papilo
| 1,985
|
C++
|
.cpp
| 29
| 67.344828
| 79
| 0.429595
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,847
|
CoefficientStrengthening.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/CoefficientStrengthening.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/CoefficientStrengthening.hpp"
namespace papilo
{
template class CoefficientStrengthening<double>;
template class CoefficientStrengthening<Quad>;
template class CoefficientStrengthening<Rational>;
} // namespace papilo
| 2,009
|
C++
|
.cpp
| 29
| 68.172414
| 79
| 0.43652
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,848
|
ParallelColDetection.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/ParallelColDetection.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/ParallelColDetection.hpp"
namespace papilo
{
template class ParallelColDetection<double>;
template class ParallelColDetection<Quad>;
template class ParallelColDetection<Rational>;
} // namespace papilo
| 1,993
|
C++
|
.cpp
| 29
| 67.62069
| 79
| 0.431922
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,849
|
SingletonStuffing.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/SingletonStuffing.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/SingletonStuffing.hpp"
namespace papilo
{
template class SingletonStuffing<double>;
template class SingletonStuffing<Quad>;
template class SingletonStuffing<Rational>;
} // namespace papilo
| 1,981
|
C++
|
.cpp
| 29
| 67.206897
| 79
| 0.428425
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,850
|
DualFix.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/DualFix.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/DualFix.hpp"
namespace papilo
{
template class DualFix<double>;
template class DualFix<Quad>;
template class DualFix<Rational>;
} // namespace papilo
| 1,941
|
C++
|
.cpp
| 29
| 65.827586
| 79
| 0.416448
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,851
|
ConstraintPropagation.cpp
|
lgottwald_PaPILO/src/papilo/presolvers/ConstraintPropagation.cpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "papilo/presolvers/ConstraintPropagation.hpp"
namespace papilo
{
template class ConstraintPropagation<double>;
template class ConstraintPropagation<Quad>;
template class ConstraintPropagation<Rational>;
} // namespace papilo
| 1,997
|
C++
|
.cpp
| 29
| 67.758621
| 79
| 0.433079
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,852
|
egout.hpp
|
lgottwald_PaPILO/test/instances/egout.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef PAPILO_TEST_INSTANCES_EGOUT
#define PAPILO_TEST_INSTANCES_EGOUT
#include "papilo/core/Problem.hpp"
#include "papilo/core/ProblemBuilder.hpp"
namespace papilo
{
namespace instances
{
Problem<double>
egout()
{
/// PROBLEM BUILDER CODE
Vec<double> coeffobj{
28.21, 18.57, 8.45, 21.16, 28.38, 9.8, 23.29, 5.07, 6.78, 2.9,
27.89, 10.03, 14.74, 6.19, 22.1, 15.82, 11.33, 5.79, 3.9, 24.79,
16.36, 3.45, 2.26, 3.86, 8.41, 26.46, 16.01, 16.73, 11.75, 3.25,
27.41, 5.98, 21.88, 43.71, 11.42, 23.4, 7.5, 6.73, 5.92, 9.7,
12.67, 26.45, 2.71, 5.89, 9.85, 8.5, 9.0, 2.27, 6.37, 16.2,
23.58, 29.93, 6.73, 20.66, 30.92, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.979, 0.034, 0.016, 0.914,
0.057, 0.016, 0.969, 0.006, 0.01, 0.002, 0.976, 0.017, 0.027, 0.009,
0.964, 0.025, 0.015, 0.01, 0.006, 0.97, 0.022, 0.003, 0.002, 0.004,
0.969, 0.021, 0.026, 0.022, 0.005, 0.971, 0.004, 0.054, 0.054, 1.017,
0.02, 0.967, 0.011, 0.012, 0.004, 0.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0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
};
Vec<std::tuple<int, int, double>> entries{
std::tuple<int, int, double>{ 0, 55, 1.0 },
std::tuple<int, int, double>{ 0, 56, 1.0 },
std::tuple<int, int, double>{ 0, 57, 1.0 },
std::tuple<int, int, double>{ 0, 58, 1.0 },
std::tuple<int, int, double>{ 0, 59, 1.0 },
std::tuple<int, int, double>{ 0, 60, 1.0 },
std::tuple<int, int, double>{ 0, 61, 1.0 },
std::tuple<int, int, double>{ 0, 62, 1.0 },
std::tuple<int, int, double>{ 0, 63, 1.0 },
std::tuple<int, int, double>{ 0, 64, 1.0 },
std::tuple<int, int, double>{ 0, 65, 1.0 },
std::tuple<int, int, double>{ 0, 66, 1.0 },
std::tuple<int, int, double>{ 0, 67, 1.0 },
std::tuple<int, int, double>{ 0, 68, 1.0 },
std::tuple<int, int, double>{ 0, 69, 1.0 },
std::tuple<int, int, double>{ 0, 70, 1.0 },
std::tuple<int, int, double>{ 0, 71, 1.0 },
std::tuple<int, int, double>{ 0, 72, 1.0 },
std::tuple<int, int, double>{ 0, 73, 1.0 },
std::tuple<int, int, double>{ 0, 74, 1.0 },
std::tuple<int, int, double>{ 0, 75, 1.0 },
std::tuple<int, int, double>{ 0, 76, 1.0 },
std::tuple<int, int, double>{ 0, 77, 1.0 },
std::tuple<int, int, double>{ 0, 78, 1.0 },
std::tuple<int, int, double>{ 0, 79, 1.0 },
std::tuple<int, int, double>{ 0, 80, 1.0 },
std::tuple<int, int, double>{ 0, 81, 1.0 },
std::tuple<int, int, double>{ 0, 82, 1.0 },
std::tuple<int, int, double>{ 0, 83, 1.0 },
std::tuple<int, int, double>{ 0, 84, 1.0 },
std::tuple<int, int, double>{ 0, 85, 1.0 },
std::tuple<int, int, double>{ 0, 86, -1.0 },
std::tuple<int, int, double>{ 0, 89, -1.0 },
std::tuple<int, int, double>{ 0, 92, -1.0 },
std::tuple<int, int, double>{ 0, 96, -1.0 },
std::tuple<int, int, double>{ 0, 100, -1.0 },
std::tuple<int, int, double>{ 0, 105, -1.0 },
std::tuple<int, int, double>{ 0, 111, -1.0 },
std::tuple<int, int, double>{ 0, 116, -1.0 },
std::tuple<int, int, double>{ 0, 119, -1.0 },
std::tuple<int, int, double>{ 0, 121, -1.0 },
std::tuple<int, int, double>{ 0, 127, -1.0 },
std::tuple<int, int, double>{ 0, 136, -1.0 },
std::tuple<int, int, double>{ 0, 137, -1.0 },
std::tuple<int, int, double>{ 0, 140, -1.0 },
std::tuple<int, int, double>{ 1, 55, -1.0 },
std::tuple<int, int, double>{ 1, 86, 1.0 },
std::tuple<int, int, double>{ 1, 87, 1.0 },
std::tuple<int, int, double>{ 2, 56, -1.0 },
std::tuple<int, int, double>{ 2, 88, 1.0 },
std::tuple<int, int, double>{ 2, 89, 1.0 },
std::tuple<int, int, double>{ 3, 57, -1.0 },
std::tuple<int, int, double>{ 3, 91, 1.0 },
std::tuple<int, int, double>{ 3, 92, 1.0 },
std::tuple<int, int, double>{ 4, 58, -1.0 },
std::tuple<int, int, double>{ 4, 94, 1.0 },
std::tuple<int, int, double>{ 5, 59, -1.0 },
std::tuple<int, int, double>{ 5, 93, -1.0 },
std::tuple<int, int, double>{ 5, 94, -1.0 },
std::tuple<int, int, double>{ 5, 95, 1.0 },
std::tuple<int, int, double>{ 6, 60, -1.0 },
std::tuple<int, int, double>{ 6, 97, -1.0 },
std::tuple<int, int, double>{ 6, 108, 1.0 },
std::tuple<int, int, double>{ 7, 61, -1.0 },
std::tuple<int, int, double>{ 7, 98, 1.0 },
std::tuple<int, int, double>{ 8, 62, -1.0 },
std::tuple<int, int, double>{ 8, 99, 1.0 },
std::tuple<int, int, double>{ 9, 63, -1.0 },
std::tuple<int, int, double>{ 9, 101, -1.0 },
std::tuple<int, int, double>{ 9, 102, 1.0 },
std::tuple<int, int, double>{ 10, 64, -1.0 },
std::tuple<int, int, double>{ 10, 103, 1.0 },
std::tuple<int, int, double>{ 11, 65, -1.0 },
std::tuple<int, int, double>{ 11, 103, -1.0 },
std::tuple<int, int, double>{ 11, 104, 1.0 },
std::tuple<int, int, double>{ 12, 66, -1.0 },
std::tuple<int, int, double>{ 12, 106, -1.0 },
std::tuple<int, int, double>{ 12, 107, 1.0 },
std::tuple<int, int, double>{ 13, 67, -1.0 },
std::tuple<int, int, double>{ 13, 109, -1.0 },
std::tuple<int, int, double>{ 13, 110, 1.0 },
std::tuple<int, int, double>{ 14, 68, -1.0 },
std::tuple<int, int, double>{ 14, 114, 1.0 },
std::tuple<int, int, double>{ 15, 69, -1.0 },
std::tuple<int, int, double>{ 15, 115, 1.0 },
std::tuple<int, int, double>{ 16, 70, -1.0 },
std::tuple<int, int, double>{ 16, 112, 1.0 },
std::tuple<int, int, double>{ 16, 113, -1.0 },
std::tuple<int, int, double>{ 17, 71, -1.0 },
std::tuple<int, int, double>{ 17, 118, 1.0 },
std::tuple<int, int, double>{ 17, 119, 1.0 },
std::tuple<int, int, double>{ 18, 72, -1.0 },
std::tuple<int, int, double>{ 18, 117, -1.0 },
std::tuple<int, int, double>{ 18, 118, -1.0 },
std::tuple<int, int, double>{ 18, 120, 1.0 },
std::tuple<int, int, double>{ 19, 73, -1.0 },
std::tuple<int, int, double>{ 19, 126, 1.0 },
std::tuple<int, int, double>{ 19, 127, 1.0 },
std::tuple<int, int, double>{ 20, 74, -1.0 },
std::tuple<int, int, double>{ 20, 125, 1.0 },
std::tuple<int, int, double>{ 20, 126, -1.0 },
std::tuple<int, int, double>{ 21, 75, -1.0 },
std::tuple<int, int, double>{ 21, 123, 1.0 },
std::tuple<int, int, double>{ 22, 76, -1.0 },
std::tuple<int, int, double>{ 22, 123, -1.0 },
std::tuple<int, int, double>{ 22, 124, 1.0 },
std::tuple<int, int, double>{ 22, 125, -1.0 },
std::tuple<int, int, double>{ 23, 77, -1.0 },
std::tuple<int, int, double>{ 23, 128, -1.0 },
std::tuple<int, int, double>{ 23, 129, 1.0 },
std::tuple<int, int, double>{ 24, 78, -1.0 },
std::tuple<int, int, double>{ 24, 131, 1.0 },
std::tuple<int, int, double>{ 25, 79, -1.0 },
std::tuple<int, int, double>{ 25, 132, 1.0 },
std::tuple<int, int, double>{ 26, 80, -1.0 },
std::tuple<int, int, double>{ 26, 130, 1.0 },
std::tuple<int, int, double>{ 26, 131, -1.0 },
std::tuple<int, int, double>{ 26, 132, -1.0 },
std::tuple<int, int, double>{ 27, 81, -1.0 },
std::tuple<int, int, double>{ 27, 133, -1.0 },
std::tuple<int, int, double>{ 27, 134, 1.0 },
std::tuple<int, int, double>{ 28, 82, -1.0 },
std::tuple<int, int, double>{ 28, 135, 1.0 },
std::tuple<int, int, double>{ 29, 83, -1.0 },
std::tuple<int, int, double>{ 29, 134, -1.0 },
std::tuple<int, int, double>{ 29, 135, -1.0 },
std::tuple<int, int, double>{ 29, 136, 1.0 },
std::tuple<int, int, double>{ 29, 138, 1.0 },
std::tuple<int, int, double>{ 30, 84, -1.0 },
std::tuple<int, int, double>{ 30, 137, 1.0 },
std::tuple<int, int, double>{ 30, 138, -1.0 },
std::tuple<int, int, double>{ 30, 139, 1.0 },
std::tuple<int, int, double>{ 31, 85, -1.0 },
std::tuple<int, int, double>{ 31, 139, -1.0 },
std::tuple<int, int, double>{ 31, 140, 1.0 },
std::tuple<int, int, double>{ 32, 87, -1.0 },
std::tuple<int, int, double>{ 32, 88, -1.0 },
std::tuple<int, int, double>{ 32, 90, 1.0 },
std::tuple<int, int, double>{ 33, 90, -1.0 },
std::tuple<int, int, double>{ 33, 91, -1.0 },
std::tuple<int, int, double>{ 33, 93, 1.0 },
std::tuple<int, int, double>{ 34, 95, -1.0 },
std::tuple<int, int, double>{ 34, 96, 1.0 },
std::tuple<int, int, double>{ 34, 97, 1.0 },
std::tuple<int, int, double>{ 35, 98, -1.0 },
std::tuple<int, int, double>{ 35, 99, -1.0 },
std::tuple<int, int, double>{ 35, 100, 1.0 },
std::tuple<int, int, double>{ 35, 101, 1.0 },
std::tuple<int, int, double>{ 36, 102, -1.0 },
std::tuple<int, int, double>{ 36, 104, -1.0 },
std::tuple<int, int, double>{ 36, 105, 1.0 },
std::tuple<int, int, double>{ 36, 106, 1.0 },
std::tuple<int, int, double>{ 37, 107, -1.0 },
std::tuple<int, int, double>{ 37, 108, -1.0 },
std::tuple<int, int, double>{ 37, 109, 1.0 },
std::tuple<int, int, double>{ 38, 110, -1.0 },
std::tuple<int, int, double>{ 38, 111, 1.0 },
std::tuple<int, int, double>{ 38, 112, -1.0 },
std::tuple<int, int, double>{ 38, 117, 1.0 },
std::tuple<int, int, double>{ 39, 113, 1.0 },
std::tuple<int, int, double>{ 39, 114, -1.0 },
std::tuple<int, int, double>{ 39, 115, -1.0 },
std::tuple<int, int, double>{ 39, 116, 1.0 },
std::tuple<int, int, double>{ 40, 120, -1.0 },
std::tuple<int, int, double>{ 40, 121, 1.0 },
std::tuple<int, int, double>{ 40, 122, 1.0 },
std::tuple<int, int, double>{ 41, 122, -1.0 },
std::tuple<int, int, double>{ 41, 124, -1.0 },
std::tuple<int, int, double>{ 41, 128, 1.0 },
std::tuple<int, int, double>{ 42, 129, -1.0 },
std::tuple<int, int, double>{ 42, 130, -1.0 },
std::tuple<int, int, double>{ 42, 133, 1.0 },
std::tuple<int, int, double>{ 43, 0, -117.04 },
std::tuple<int, int, double>{ 43, 86, 1.0 },
std::tuple<int, int, double>{ 44, 1, -117.04 },
std::tuple<int, int, double>{ 44, 87, 1.0 },
std::tuple<int, int, double>{ 45, 2, -117.04 },
std::tuple<int, int, double>{ 45, 88, 1.0 },
std::tuple<int, int, double>{ 46, 3, -117.04 },
std::tuple<int, int, double>{ 46, 89, 1.0 },
std::tuple<int, int, double>{ 47, 4, -117.04 },
std::tuple<int, int, double>{ 47, 90, 1.0 },
std::tuple<int, int, double>{ 48, 5, -117.04 },
std::tuple<int, int, double>{ 48, 91, 1.0 },
std::tuple<int, int, double>{ 49, 6, -117.04 },
std::tuple<int, int, double>{ 49, 92, 1.0 },
std::tuple<int, int, double>{ 50, 7, -117.04 },
std::tuple<int, int, double>{ 50, 93, 1.0 },
std::tuple<int, int, double>{ 51, 8, -117.04 },
std::tuple<int, int, double>{ 51, 94, 1.0 },
std::tuple<int, int, double>{ 52, 9, -117.04 },
std::tuple<int, int, double>{ 52, 95, 1.0 },
std::tuple<int, int, double>{ 53, 10, -117.04 },
std::tuple<int, int, double>{ 53, 96, 1.0 },
std::tuple<int, int, double>{ 54, 11, -117.04 },
std::tuple<int, int, double>{ 54, 97, 1.0 },
std::tuple<int, int, double>{ 55, 12, -117.04 },
std::tuple<int, int, double>{ 55, 98, 1.0 },
std::tuple<int, int, double>{ 56, 13, -117.04 },
std::tuple<int, int, double>{ 56, 99, 1.0 },
std::tuple<int, int, double>{ 57, 14, -117.04 },
std::tuple<int, int, double>{ 57, 100, 1.0 },
std::tuple<int, int, double>{ 58, 15, -117.04 },
std::tuple<int, int, double>{ 58, 101, 1.0 },
std::tuple<int, int, double>{ 59, 16, -117.04 },
std::tuple<int, int, double>{ 59, 102, 1.0 },
std::tuple<int, int, double>{ 60, 17, -117.04 },
std::tuple<int, int, double>{ 60, 103, 1.0 },
std::tuple<int, int, double>{ 61, 18, -117.04 },
std::tuple<int, int, double>{ 61, 104, 1.0 },
std::tuple<int, int, double>{ 62, 19, -117.04 },
std::tuple<int, int, double>{ 62, 105, 1.0 },
std::tuple<int, int, double>{ 63, 20, -117.04 },
std::tuple<int, int, double>{ 63, 106, 1.0 },
std::tuple<int, int, double>{ 64, 21, -117.04 },
std::tuple<int, int, double>{ 64, 107, 1.0 },
std::tuple<int, int, double>{ 65, 22, -117.04 },
std::tuple<int, int, double>{ 65, 108, 1.0 },
std::tuple<int, int, double>{ 66, 23, -117.04 },
std::tuple<int, int, double>{ 66, 109, 1.0 },
std::tuple<int, int, double>{ 67, 24, -117.04 },
std::tuple<int, int, double>{ 67, 110, 1.0 },
std::tuple<int, int, double>{ 68, 25, -117.04 },
std::tuple<int, int, double>{ 68, 111, 1.0 },
std::tuple<int, int, double>{ 69, 26, -117.04 },
std::tuple<int, int, double>{ 69, 112, 1.0 },
std::tuple<int, int, double>{ 70, 27, -117.04 },
std::tuple<int, int, double>{ 70, 113, 1.0 },
std::tuple<int, int, double>{ 71, 28, -117.04 },
std::tuple<int, int, double>{ 71, 114, 1.0 },
std::tuple<int, int, double>{ 72, 29, -117.04 },
std::tuple<int, int, double>{ 72, 115, 1.0 },
std::tuple<int, int, double>{ 73, 30, -117.04 },
std::tuple<int, int, double>{ 73, 116, 1.0 },
std::tuple<int, int, double>{ 74, 31, -117.04 },
std::tuple<int, int, double>{ 74, 117, 1.0 },
std::tuple<int, int, double>{ 75, 32, -117.04 },
std::tuple<int, int, double>{ 75, 118, 1.0 },
std::tuple<int, int, double>{ 76, 33, -117.04 },
std::tuple<int, int, double>{ 76, 119, 1.0 },
std::tuple<int, int, double>{ 77, 34, -117.04 },
std::tuple<int, int, double>{ 77, 120, 1.0 },
std::tuple<int, int, double>{ 78, 35, -117.04 },
std::tuple<int, int, double>{ 78, 121, 1.0 },
std::tuple<int, int, double>{ 79, 36, -117.04 },
std::tuple<int, int, double>{ 79, 122, 1.0 },
std::tuple<int, int, double>{ 80, 37, -117.04 },
std::tuple<int, int, double>{ 80, 123, 1.0 },
std::tuple<int, int, double>{ 81, 38, -117.04 },
std::tuple<int, int, double>{ 81, 124, 1.0 },
std::tuple<int, int, double>{ 82, 39, -117.04 },
std::tuple<int, int, double>{ 82, 125, 1.0 },
std::tuple<int, int, double>{ 83, 40, -117.04 },
std::tuple<int, int, double>{ 83, 126, 1.0 },
std::tuple<int, int, double>{ 84, 41, -117.04 },
std::tuple<int, int, double>{ 84, 127, 1.0 },
std::tuple<int, int, double>{ 85, 42, -117.04 },
std::tuple<int, int, double>{ 85, 128, 1.0 },
std::tuple<int, int, double>{ 86, 43, -117.04 },
std::tuple<int, int, double>{ 86, 129, 1.0 },
std::tuple<int, int, double>{ 87, 44, -117.04 },
std::tuple<int, int, double>{ 87, 130, 1.0 },
std::tuple<int, int, double>{ 88, 45, -117.04 },
std::tuple<int, int, double>{ 88, 131, 1.0 },
std::tuple<int, int, double>{ 89, 46, -117.04 },
std::tuple<int, int, double>{ 89, 132, 1.0 },
std::tuple<int, int, double>{ 90, 47, -117.04 },
std::tuple<int, int, double>{ 90, 133, 1.0 },
std::tuple<int, int, double>{ 91, 48, -117.04 },
std::tuple<int, int, double>{ 91, 134, 1.0 },
std::tuple<int, int, double>{ 92, 49, -117.04 },
std::tuple<int, int, double>{ 92, 135, 1.0 },
std::tuple<int, int, double>{ 93, 50, -117.04 },
std::tuple<int, int, double>{ 93, 136, 1.0 },
std::tuple<int, int, double>{ 94, 51, -117.04 },
std::tuple<int, int, double>{ 94, 137, 1.0 },
std::tuple<int, int, double>{ 95, 52, -117.04 },
std::tuple<int, int, double>{ 95, 138, 1.0 },
std::tuple<int, int, double>{ 96, 53, -117.04 },
std::tuple<int, int, double>{ 96, 139, 1.0 },
std::tuple<int, int, double>{ 97, 54, -117.04 },
std::tuple<int, int, double>{ 97, 140, 1.0 },
};
Vec<std::string> rnames{
"...", "001", "002", "004", "006", "007",
"009", "010", "011", "013", "014", "015",
"017", "019", "020", "021", "023", "025",
"026", "028", "029", "030", "031", "033",
"034", "035", "036", "038", "039", "040",
"041", "042", "003", "005", "008", "012",
"016", "018", "024", "022", "027", "032",
"037", "U.001...", "U.001003", "U.002003", "U.002...", "U.003005",
"U.004005", "U.004...", "U.005007", "U.006007", "U.007008", "U.008...",
"U.008009", "U.010012", "U.011012", "U.012...", "U.012013", "U.013016",
"U.014015", "U.015016", "U.016...", "U.016017", "U.017018", "U.009018",
"U.018019", "U.019024", "U.024...", "U.023024", "U.022023", "U.020022",
"U.021022", "U.022...", "U.024026", "U.025026", "U.025...", "U.026027",
"U.027...", "U.027032", "U.030031", "U.031032", "U.029031", "U.028029",
"U.028...", "U.032033", "U.033037", "U.036037", "U.034036", "U.035036",
"U.037038", "U.038040", "U.039040", "U.040...", "U.041...", "U.040041",
"U.041042", "U.042...",
};
Vec<std::string> cnames{
"I.001...", "I.001003", "I.002003", "I.002...", "I.003005", "I.004005",
"I.004...", "I.005007", "I.006007", "I.007008", "I.008...", "I.008009",
"I.010012", "I.011012", "I.012...", "I.012013", "I.013016", "I.014015",
"I.015016", "I.016...", "I.016017", "I.017018", "I.009018", "I.018019",
"I.019024", "I.024...", "I.023024", "I.022023", "I.020022", "I.021022",
"I.022...", "I.024026", "I.025026", "I.025...", "I.026027", "I.027...",
"I.027032", "I.030031", "I.031032", "I.029031", "I.028029", "I.028...",
"I.032033", "I.033037", "I.036037", "I.034036", "I.035036", "I.037038",
"I.038040", "I.039040", "I.040...", "I.041...", "I.040041", "I.041042",
"I.042...", "F....001", "F....002", "F....004", "F....006", "F....007",
"F....009", "F....010", "F....011", "F....013", "F....014", "F....015",
"F....017", "F....019", "F....020", "F....021", "F....023", "F....025",
"F....026", "F....028", "F....029", "F....030", "F....031", "F....033",
"F....034", "F....035", "F....036", "F....038", "F....039", "F....040",
"F....041", "F....042", "F.001...", "F.001003", "F.002003", "F.002...",
"F.003005", "F.004005", "F.004...", "F.005007", "F.006007", "F.007008",
"F.008...", "F.008009", "F.010012", "F.011012", "F.012...", "F.012013",
"F.013016", "F.014015", "F.015016", "F.016...", "F.016017", "F.017018",
"F.009018", "F.018019", "F.019024", "F.024...", "F.023024", "F.022023",
"F.020022", "F.021022", "F.022...", "F.024026", "F.025026", "F.025...",
"F.026027", "F.027...", "F.027032", "F.030031", "F.031032", "F.029031",
"F.028029", "F.028...", "F.032033", "F.033037", "F.036037", "F.034036",
"F.035036", "F.037038", "F.038040", "F.039040", "F.040...", "F.041...",
"F.040041", "F.041042", "F.042...",
};
int nCols = 141;
int nRows = 98;
ProblemBuilder<double> pb;
pb.reserve( 282, 98, 141 );
pb.setNumRows( nRows );
pb.setNumCols( nCols );
pb.setObjAll( coeffobj );
pb.setObjOffset( 0.0 );
pb.setColLbAll( lbs );
pb.setColLbInfAll( lbInf );
pb.setColUbAll( ubs );
pb.setColUbInfAll( ubInf );
pb.setColIntegralAll( isIntegral );
pb.setRowLhsInfAll( lhsIsInf );
pb.setRowRhsInfAll( rhsIsInf );
pb.setRowLhsAll( lhs );
pb.setRowRhsAll( rhs );
pb.setRowNameAll( rnames );
pb.addEntryAll( entries );
pb.setColNameAll( cnames );
pb.setProblemName( "egout.hpp" );
Problem<double> problem = pb.build();
/// PROBLEM BUILDER CODE END
return problem;
}
} // namespace instances
} // namespace papilo
#endif
| 27,460
|
C++
|
.h
| 494
| 48.510121
| 79
| 0.46274
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,853
|
dcmulti.hpp
|
lgottwald_PaPILO/test/instances/dcmulti.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef PAPILO_TEST_INSTANCES_DCMULTI
#define PAPILO_TEST_INSTANCES_DCMULTI
#include "papilo/core/Problem.hpp"
#include "papilo/core/ProblemBuilder.hpp"
namespace papilo
{
namespace instances
{
Problem<double>
dcmulti()
{
/// PROBLEM BUILDER CODE
Vec<double> coeffobj{
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 300.0, 350.0, 250.0, 375.0, 200.0, 1000.0, 410.0, 320.0,
270.0, 240.0, 1500.0, 1200.0, 1125.0, 1800.0, 1050.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 300.0,
350.0, 250.0, 375.0, 200.0, 1000.0, 410.0, 320.0, 270.0, 240.0,
1000.0, 800.0, 750.0, 1200.0, 700.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 300.0, 350.0, 250.0,
375.0, 200.0, 1000.0, 410.0, 320.0, 270.0, 40.0, 500.0, 400.0,
375.0, 600.0, 350.0, 6.0, 8.0, 10.1, 13.0, 15.5, 12.9,
6.2, 5.0, 9.6, 4.9, 12.2, 12.3, 8.3, 4.2, 5.2,
2.3, 6.7, 12.0, 4.5, 8.0, 12.5, 9.8, 12.0, 15.5,
7.3, 4.2, 5.7, 6.0, 1.5, 4.3, 8.9, 6.7, 7.6,
8.0, 7.3, 9.6, 3.5, 2.4, 7.0, 5.0, 4.1, 7.9,
9.5, 12.0, 15.0, 4.4, 8.2, 12.8, 2.7, 7.5, 12.5,
17.8, 12.8, 14.3, 7.9, 7.4, 10.0, 3.4, 2.5, 7.2,
12.0, 16.0, 20.2, 26.0, 31.0, 25.8, 12.4, 10.0, 19.2,
9.8, 24.4, 24.6, 16.6, 8.4, 10.4, 4.6, 13.4, 24.0,
9.0, 16.0, 25.0, 19.6, 24.0, 31.0, 14.6, 8.4, 11.4,
12.0, 3.0, 8.6, 17.8, 13.4, 15.2, 16.0, 14.6, 19.2,
7.0, 4.8, 14.0, 10.0, 8.2, 15.8, 19.0, 24.0, 30.0,
8.8, 16.4, 25.6, 5.4, 15.0, 25.0, 35.6, 25.6, 28.6,
15.8, 14.8, 20.0, 6.8, 5.0, 14.4, 50.0, 60.0, 70.0,
105.0, 95.0, 133.0, 2.0, 1.7, 4.0, 3.4, 2.0, 1.7,
4.0, 3.4, 2.0, 1.7, 4.0, 3.4, 2.0, 1.7, 4.0,
3.4, 2.0, 1.7, 4.0, 3.4, 1.5, 1.6, 1.4, 1.2,
2.3, 9.0, 9.0, 9.0, 9.0, 9.0, 15.0, 15.0, 15.0,
15.0, 15.0, 6.0, 8.0, 10.1, 13.0, 15.5, 12.9, 6.2,
5.0, 9.6, 4.9, 12.2, 2.3, 8.3, 4.2, 5.2, 2.3,
6.7, 12.0, 4.5, 8.0, 12.5, 9.8, 12.0, 15.5, 7.3,
4.2, 5.7, 6.0, 1.5, 4.3, 8.9, 6.7, 7.6, 8.0,
7.3, 9.6, 3.5, 2.4, 7.0, 5.0, 4.1, 7.9, 9.5,
12.0, 15.0, 4.4, 8.2, 12.8, 2.7, 7.5, 12.5, 17.8,
12.8, 14.3, 7.9, 7.4, 10.0, 3.4, 2.5, 7.2, 12.0,
16.0, 20.2, 26.0, 31.0, 25.8, 12.4, 10.0, 19.2, 9.8,
24.4, 24.6, 16.6, 8.4, 0.4, 4.6, 13.4, 24.0, 9.0,
16.0, 25.0, 19.6, 24.0, 31.0, 14.6, 8.4, 11.4, 12.0,
3.0, 8.6, 17.8, 13.4, 15.2, 16.0, 14.6, 19.2, 7.0,
4.8, 14.0, 10.0, 8.2, 15.8, 19.0, 24.0, 30.0, 8.8,
16.4, 25.6, 5.4, 15.0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0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 230.0, 265.0, 207.0, 140.0,
110.0, 135.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0,
};
Vec<std::tuple<int, int, double>> entries{
std::tuple<int, int, double>{ 0, 75, 1.0 },
std::tuple<int, int, double>{ 0, 76, 1.0 },
std::tuple<int, int, double>{ 0, 77, 1.0 },
std::tuple<int, int, double>{ 0, 78, 1.0 },
std::tuple<int, int, double>{ 0, 79, 1.0 },
std::tuple<int, int, double>{ 0, 195, -1.0 },
std::tuple<int, int, double>{ 1, 135, 1.0 },
std::tuple<int, int, double>{ 1, 136, 1.0 },
std::tuple<int, int, double>{ 1, 137, 1.0 },
std::tuple<int, int, double>{ 1, 138, 1.0 },
std::tuple<int, int, double>{ 1, 139, 1.0 },
std::tuple<int, int, double>{ 1, 198, -1.0 },
std::tuple<int, int, double>{ 2, 80, 1.0 },
std::tuple<int, int, double>{ 2, 81, 1.0 },
std::tuple<int, int, double>{ 2, 82, 1.0 },
std::tuple<int, int, double>{ 2, 83, 1.0 },
std::tuple<int, int, double>{ 2, 84, 1.0 },
std::tuple<int, int, double>{ 2, 196, -1.0 },
std::tuple<int, int, double>{ 3, 140, 1.0 },
std::tuple<int, int, double>{ 3, 141, 1.0 },
std::tuple<int, int, double>{ 3, 142, 1.0 },
std::tuple<int, int, double>{ 3, 143, 1.0 },
std::tuple<int, int, double>{ 3, 144, 1.0 },
std::tuple<int, int, double>{ 3, 199, -1.0 },
std::tuple<int, int, double>{ 4, 85, 1.0 },
std::tuple<int, int, double>{ 4, 86, 1.0 },
std::tuple<int, int, double>{ 4, 87, 1.0 },
std::tuple<int, int, double>{ 4, 88, 1.0 },
std::tuple<int, int, double>{ 4, 89, 1.0 },
std::tuple<int, int, double>{ 4, 197, -1.0 },
std::tuple<int, int, double>{ 5, 145, 1.0 },
std::tuple<int, int, double>{ 5, 146, 1.0 },
std::tuple<int, int, double>{ 5, 147, 1.0 },
std::tuple<int, int, double>{ 5, 148, 1.0 },
std::tuple<int, int, double>{ 5, 149, 1.0 },
std::tuple<int, int, double>{ 5, 200, -1.0 },
std::tuple<int, int, double>{ 6, 195, 1.0 },
std::tuple<int, int, double>{ 7, 196, 1.0 },
std::tuple<int, int, double>{ 8, 197, 1.0 },
std::tuple<int, int, double>{ 9, 198, 1.0 },
std::tuple<int, int, double>{ 10, 199, 1.0 },
std::tuple<int, int, double>{ 11, 200, 1.0 },
std::tuple<int, int, double>{ 12, 75, 1.0 },
std::tuple<int, int, double>{ 12, 80, 1.0 },
std::tuple<int, int, double>{ 12, 85, 1.0 },
std::tuple<int, int, double>{ 12, 90, -1.0 },
std::tuple<int, int, double>{ 12, 91, -1.0 },
std::tuple<int, int, double>{ 12, 92, -1.0 },
std::tuple<int, int, double>{ 12, 93, -1.0 },
std::tuple<int, int, double>{ 12, 94, -1.0 },
std::tuple<int, int, double>{ 12, 95, -1.0 },
std::tuple<int, int, double>{ 12, 96, -1.0 },
std::tuple<int, int, double>{ 12, 97, -1.0 },
std::tuple<int, int, double>{ 12, 98, -1.0 },
std::tuple<int, int, double>{ 12, 226, -1.0 },
std::tuple<int, int, double>{ 13, 135, 1.0 },
std::tuple<int, int, double>{ 13, 140, 1.0 },
std::tuple<int, int, double>{ 13, 145, 1.0 },
std::tuple<int, int, double>{ 13, 150, -1.0 },
std::tuple<int, int, double>{ 13, 151, -1.0 },
std::tuple<int, int, double>{ 13, 152, -1.0 },
std::tuple<int, int, double>{ 13, 153, -1.0 },
std::tuple<int, int, double>{ 13, 154, -1.0 },
std::tuple<int, int, double>{ 13, 155, -1.0 },
std::tuple<int, int, double>{ 13, 156, -1.0 },
std::tuple<int, int, double>{ 13, 157, -1.0 },
std::tuple<int, int, double>{ 13, 158, -1.0 },
std::tuple<int, int, double>{ 13, 231, -1.0 },
std::tuple<int, int, double>{ 14, 76, 1.0 },
std::tuple<int, int, double>{ 14, 81, 1.0 },
std::tuple<int, int, double>{ 14, 86, 1.0 },
std::tuple<int, int, double>{ 14, 99, -1.0 },
std::tuple<int, int, double>{ 14, 100, -1.0 },
std::tuple<int, int, double>{ 14, 101, -1.0 },
std::tuple<int, int, double>{ 14, 102, -1.0 },
std::tuple<int, int, double>{ 14, 103, -1.0 },
std::tuple<int, int, double>{ 14, 104, -1.0 },
std::tuple<int, int, double>{ 14, 105, -1.0 },
std::tuple<int, int, double>{ 14, 106, -1.0 },
std::tuple<int, int, double>{ 14, 107, -1.0 },
std::tuple<int, int, double>{ 14, 227, -1.0 },
std::tuple<int, int, double>{ 15, 136, 1.0 },
std::tuple<int, int, double>{ 15, 141, 1.0 },
std::tuple<int, int, double>{ 15, 146, 1.0 },
std::tuple<int, int, double>{ 15, 159, -1.0 },
std::tuple<int, int, double>{ 15, 160, -1.0 },
std::tuple<int, int, double>{ 15, 161, -1.0 },
std::tuple<int, int, double>{ 15, 162, -1.0 },
std::tuple<int, int, double>{ 15, 163, -1.0 },
std::tuple<int, int, double>{ 15, 164, -1.0 },
std::tuple<int, int, double>{ 15, 165, -1.0 },
std::tuple<int, int, double>{ 15, 166, -1.0 },
std::tuple<int, int, double>{ 15, 167, -1.0 },
std::tuple<int, int, double>{ 15, 232, -1.0 },
std::tuple<int, int, double>{ 16, 77, 1.0 },
std::tuple<int, int, double>{ 16, 82, 1.0 },
std::tuple<int, int, double>{ 16, 87, 1.0 },
std::tuple<int, int, double>{ 16, 108, -1.0 },
std::tuple<int, int, double>{ 16, 109, -1.0 },
std::tuple<int, int, double>{ 16, 110, -1.0 },
std::tuple<int, int, double>{ 16, 111, -1.0 },
std::tuple<int, int, double>{ 16, 112, -1.0 },
std::tuple<int, int, double>{ 16, 113, -1.0 },
std::tuple<int, int, double>{ 16, 114, -1.0 },
std::tuple<int, int, double>{ 16, 115, -1.0 },
std::tuple<int, int, double>{ 16, 116, -1.0 },
std::tuple<int, int, double>{ 16, 228, -1.0 },
std::tuple<int, int, double>{ 17, 137, 1.0 },
std::tuple<int, int, double>{ 17, 142, 1.0 },
std::tuple<int, int, double>{ 17, 147, 1.0 },
std::tuple<int, int, double>{ 17, 168, -1.0 },
std::tuple<int, int, double>{ 17, 169, -1.0 },
std::tuple<int, int, double>{ 17, 170, -1.0 },
std::tuple<int, int, double>{ 17, 171, -1.0 },
std::tuple<int, int, double>{ 17, 172, -1.0 },
std::tuple<int, int, double>{ 17, 173, -1.0 },
std::tuple<int, int, double>{ 17, 174, -1.0 },
std::tuple<int, int, double>{ 17, 175, -1.0 },
std::tuple<int, int, double>{ 17, 176, -1.0 },
std::tuple<int, int, double>{ 17, 233, -1.0 },
std::tuple<int, int, double>{ 18, 78, 1.0 },
std::tuple<int, int, double>{ 18, 83, 1.0 },
std::tuple<int, int, double>{ 18, 88, 1.0 },
std::tuple<int, int, double>{ 18, 117, -1.0 },
std::tuple<int, int, double>{ 18, 118, -1.0 },
std::tuple<int, int, double>{ 18, 119, -1.0 },
std::tuple<int, int, double>{ 18, 120, -1.0 },
std::tuple<int, int, double>{ 18, 121, -1.0 },
std::tuple<int, int, double>{ 18, 122, -1.0 },
std::tuple<int, int, double>{ 18, 123, -1.0 },
std::tuple<int, int, double>{ 18, 124, -1.0 },
std::tuple<int, int, double>{ 18, 125, -1.0 },
std::tuple<int, int, double>{ 18, 229, -1.0 },
std::tuple<int, int, double>{ 19, 138, 1.0 },
std::tuple<int, int, double>{ 19, 143, 1.0 },
std::tuple<int, int, double>{ 19, 148, 1.0 },
std::tuple<int, int, double>{ 19, 177, -1.0 },
std::tuple<int, int, double>{ 19, 178, -1.0 },
std::tuple<int, int, double>{ 19, 179, -1.0 },
std::tuple<int, int, double>{ 19, 180, -1.0 },
std::tuple<int, int, double>{ 19, 181, -1.0 },
std::tuple<int, int, double>{ 19, 182, -1.0 },
std::tuple<int, int, double>{ 19, 183, -1.0 },
std::tuple<int, int, double>{ 19, 184, -1.0 },
std::tuple<int, int, double>{ 19, 185, -1.0 },
std::tuple<int, int, double>{ 19, 234, -1.0 },
std::tuple<int, int, double>{ 20, 79, 1.0 },
std::tuple<int, int, double>{ 20, 84, 1.0 },
std::tuple<int, int, double>{ 20, 89, 1.0 },
std::tuple<int, int, double>{ 20, 126, -1.0 },
std::tuple<int, int, double>{ 20, 127, -1.0 },
std::tuple<int, int, double>{ 20, 128, -1.0 },
std::tuple<int, int, double>{ 20, 129, -1.0 },
std::tuple<int, int, double>{ 20, 130, -1.0 },
std::tuple<int, int, double>{ 20, 131, -1.0 },
std::tuple<int, int, double>{ 20, 132, -1.0 },
std::tuple<int, int, double>{ 20, 133, -1.0 },
std::tuple<int, int, double>{ 20, 134, -1.0 },
std::tuple<int, int, double>{ 20, 230, -1.0 },
std::tuple<int, int, double>{ 21, 139, 1.0 },
std::tuple<int, int, double>{ 21, 144, 1.0 },
std::tuple<int, int, double>{ 21, 149, 1.0 },
std::tuple<int, int, double>{ 21, 186, -1.0 },
std::tuple<int, int, double>{ 21, 187, -1.0 },
std::tuple<int, int, double>{ 21, 188, -1.0 },
std::tuple<int, int, double>{ 21, 189, -1.0 },
std::tuple<int, int, double>{ 21, 190, -1.0 },
std::tuple<int, int, double>{ 21, 191, -1.0 },
std::tuple<int, int, double>{ 21, 192, -1.0 },
std::tuple<int, int, double>{ 21, 193, -1.0 },
std::tuple<int, int, double>{ 21, 194, -1.0 },
std::tuple<int, int, double>{ 21, 235, -1.0 },
std::tuple<int, int, double>{ 22, 75, -1.0 },
std::tuple<int, int, double>{ 22, 80, -1.0 },
std::tuple<int, int, double>{ 22, 85, -1.0 },
std::tuple<int, int, double>{ 22, 201, 1.0 },
std::tuple<int, int, double>{ 22, 202, 1.0 },
std::tuple<int, int, double>{ 23, 135, -1.0 },
std::tuple<int, int, double>{ 23, 140, -1.0 },
std::tuple<int, int, double>{ 23, 145, -1.0 },
std::tuple<int, int, double>{ 23, 203, 1.0 },
std::tuple<int, int, double>{ 23, 204, 1.0 },
std::tuple<int, int, double>{ 24, 0, -600.0 },
std::tuple<int, int, double>{ 24, 202, 1.0 },
std::tuple<int, int, double>{ 25, 0, 180.0 },
std::tuple<int, int, double>{ 25, 201, -1.0 },
std::tuple<int, int, double>{ 26, 1, -300.0 },
std::tuple<int, int, double>{ 26, 204, 1.0 },
std::tuple<int, int, double>{ 27, 1, 80.0 },
std::tuple<int, int, double>{ 27, 203, -1.0 },
std::tuple<int, int, double>{ 28, 201, -1.0 },
std::tuple<int, int, double>{ 28, 202, -1.0 },
std::tuple<int, int, double>{ 28, 203, -2.0 },
std::tuple<int, int, double>{ 28, 204, -2.0 },
std::tuple<int, int, double>{ 28, 221, 1.0 },
std::tuple<int, int, double>{ 29, 10, -350.0 },
std::tuple<int, int, double>{ 29, 221, 1.0 },
std::tuple<int, int, double>{ 30, 10, -200.0 },
std::tuple<int, int, double>{ 30, 221, 1.0 },
std::tuple<int, int, double>{ 31, 10, 1.0 },
std::tuple<int, int, double>{ 31, 20, -1.0 },
std::tuple<int, int, double>{ 32, 76, -1.0 },
std::tuple<int, int, double>{ 32, 81, -1.0 },
std::tuple<int, int, double>{ 32, 86, -1.0 },
std::tuple<int, int, double>{ 32, 205, 1.0 },
std::tuple<int, int, double>{ 32, 206, 1.0 },
std::tuple<int, int, double>{ 33, 136, -1.0 },
std::tuple<int, int, double>{ 33, 141, -1.0 },
std::tuple<int, int, double>{ 33, 146, -1.0 },
std::tuple<int, int, double>{ 33, 207, 1.0 },
std::tuple<int, int, double>{ 33, 208, 1.0 },
std::tuple<int, int, double>{ 34, 2, -600.0 },
std::tuple<int, int, double>{ 34, 206, 1.0 },
std::tuple<int, int, double>{ 35, 2, 180.0 },
std::tuple<int, int, double>{ 35, 205, -1.0 },
std::tuple<int, int, double>{ 36, 3, -300.0 },
std::tuple<int, int, double>{ 36, 208, 1.0 },
std::tuple<int, int, double>{ 37, 3, 80.0 },
std::tuple<int, int, double>{ 37, 207, -1.0 },
std::tuple<int, int, double>{ 38, 205, -1.0 },
std::tuple<int, int, double>{ 38, 206, -1.0 },
std::tuple<int, int, double>{ 38, 207, -2.0 },
std::tuple<int, int, double>{ 38, 208, -2.0 },
std::tuple<int, int, double>{ 38, 222, 1.0 },
std::tuple<int, int, double>{ 39, 11, -500.0 },
std::tuple<int, int, double>{ 39, 222, 1.0 },
std::tuple<int, int, double>{ 40, 11, -350.0 },
std::tuple<int, int, double>{ 40, 222, 1.0 },
std::tuple<int, int, double>{ 41, 11, 1.0 },
std::tuple<int, int, double>{ 41, 21, -1.0 },
std::tuple<int, int, double>{ 42, 77, -1.0 },
std::tuple<int, int, double>{ 42, 82, -1.0 },
std::tuple<int, int, double>{ 42, 87, -1.0 },
std::tuple<int, int, double>{ 42, 209, 1.0 },
std::tuple<int, int, double>{ 42, 210, 1.0 },
std::tuple<int, int, double>{ 43, 137, -1.0 },
std::tuple<int, int, double>{ 43, 142, -1.0 },
std::tuple<int, int, double>{ 43, 147, -1.0 },
std::tuple<int, int, double>{ 43, 211, 1.0 },
std::tuple<int, int, double>{ 43, 212, 1.0 },
std::tuple<int, int, double>{ 44, 4, -600.0 },
std::tuple<int, int, double>{ 44, 210, 1.0 },
std::tuple<int, int, double>{ 45, 4, 180.0 },
std::tuple<int, int, double>{ 45, 209, -1.0 },
std::tuple<int, int, double>{ 46, 5, -300.0 },
std::tuple<int, int, double>{ 46, 212, 1.0 },
std::tuple<int, int, double>{ 47, 5, 80.0 },
std::tuple<int, int, double>{ 47, 211, -1.0 },
std::tuple<int, int, double>{ 48, 209, -1.0 },
std::tuple<int, int, double>{ 48, 210, -1.0 },
std::tuple<int, int, double>{ 48, 211, -2.0 },
std::tuple<int, int, double>{ 48, 212, -2.0 },
std::tuple<int, int, double>{ 48, 223, 1.0 },
std::tuple<int, int, double>{ 49, 12, -225.0 },
std::tuple<int, int, double>{ 49, 223, 1.0 },
std::tuple<int, int, double>{ 50, 12, -100.0 },
std::tuple<int, int, double>{ 50, 223, 1.0 },
std::tuple<int, int, double>{ 51, 12, 1.0 },
std::tuple<int, int, double>{ 51, 22, -1.0 },
std::tuple<int, int, double>{ 52, 78, -1.0 },
std::tuple<int, int, double>{ 52, 83, -1.0 },
std::tuple<int, int, double>{ 52, 88, -1.0 },
std::tuple<int, int, double>{ 52, 213, 1.0 },
std::tuple<int, int, double>{ 52, 214, 1.0 },
std::tuple<int, int, double>{ 53, 138, -1.0 },
std::tuple<int, int, double>{ 53, 143, -1.0 },
std::tuple<int, int, double>{ 53, 148, -1.0 },
std::tuple<int, int, double>{ 53, 215, 1.0 },
std::tuple<int, int, double>{ 53, 216, 1.0 },
std::tuple<int, int, double>{ 54, 6, -600.0 },
std::tuple<int, int, double>{ 54, 214, 1.0 },
std::tuple<int, int, double>{ 55, 6, 180.0 },
std::tuple<int, int, double>{ 55, 213, -1.0 },
std::tuple<int, int, double>{ 56, 7, -300.0 },
std::tuple<int, int, double>{ 56, 216, 1.0 },
std::tuple<int, int, double>{ 57, 7, 80.0 },
std::tuple<int, int, double>{ 57, 215, -1.0 },
std::tuple<int, int, double>{ 58, 213, -1.0 },
std::tuple<int, int, double>{ 58, 214, -1.0 },
std::tuple<int, int, double>{ 58, 215, -2.0 },
std::tuple<int, int, double>{ 58, 216, -2.0 },
std::tuple<int, int, double>{ 58, 224, 1.0 },
std::tuple<int, int, double>{ 59, 13, -410.0 },
std::tuple<int, int, double>{ 59, 224, 1.0 },
std::tuple<int, int, double>{ 60, 13, -200.0 },
std::tuple<int, int, double>{ 60, 224, 1.0 },
std::tuple<int, int, double>{ 61, 13, 1.0 },
std::tuple<int, int, double>{ 61, 23, -1.0 },
std::tuple<int, int, double>{ 62, 79, -1.0 },
std::tuple<int, int, double>{ 62, 84, -1.0 },
std::tuple<int, int, double>{ 62, 89, -1.0 },
std::tuple<int, int, double>{ 62, 217, 1.0 },
std::tuple<int, int, double>{ 62, 218, 1.0 },
std::tuple<int, int, double>{ 63, 139, -1.0 },
std::tuple<int, int, double>{ 63, 144, -1.0 },
std::tuple<int, int, double>{ 63, 149, -1.0 },
std::tuple<int, int, double>{ 63, 219, 1.0 },
std::tuple<int, int, double>{ 63, 220, 1.0 },
std::tuple<int, int, double>{ 64, 8, -600.0 },
std::tuple<int, int, double>{ 64, 218, 1.0 },
std::tuple<int, int, double>{ 65, 8, 180.0 },
std::tuple<int, int, double>{ 65, 217, -1.0 },
std::tuple<int, int, double>{ 66, 9, -300.0 },
std::tuple<int, int, double>{ 66, 220, 1.0 },
std::tuple<int, int, double>{ 67, 9, 80.0 },
std::tuple<int, int, double>{ 67, 219, -1.0 },
std::tuple<int, int, double>{ 68, 217, -1.0 },
std::tuple<int, int, double>{ 68, 218, -1.0 },
std::tuple<int, int, double>{ 68, 219, -2.0 },
std::tuple<int, int, double>{ 68, 220, -2.0 },
std::tuple<int, int, double>{ 68, 225, 1.0 },
std::tuple<int, int, double>{ 69, 14, -320.0 },
std::tuple<int, int, double>{ 69, 225, 1.0 },
std::tuple<int, int, double>{ 70, 14, -100.0 },
std::tuple<int, int, double>{ 70, 225, 1.0 },
std::tuple<int, int, double>{ 71, 14, 1.0 },
std::tuple<int, int, double>{ 71, 24, -1.0 },
std::tuple<int, int, double>{ 72, 10, -1.0 },
std::tuple<int, int, double>{ 72, 11, -1.0 },
std::tuple<int, int, double>{ 72, 12, -1.0 },
std::tuple<int, int, double>{ 72, 13, -1.0 },
std::tuple<int, int, double>{ 72, 14, -1.0 },
std::tuple<int, int, double>{ 72, 15, 1.0 },
std::tuple<int, int, double>{ 72, 16, 1.0 },
std::tuple<int, int, double>{ 72, 17, 1.0 },
std::tuple<int, int, double>{ 72, 18, 1.0 },
std::tuple<int, int, double>{ 72, 19, 1.0 },
std::tuple<int, int, double>{ 73, 15, -1.0 },
std::tuple<int, int, double>{ 73, 16, 1.0 },
std::tuple<int, int, double>{ 74, 16, -1.0 },
std::tuple<int, int, double>{ 74, 17, 1.0 },
std::tuple<int, int, double>{ 75, 17, -1.0 },
std::tuple<int, int, double>{ 75, 18, 1.0 },
std::tuple<int, int, double>{ 76, 18, -1.0 },
std::tuple<int, int, double>{ 76, 19, 1.0 },
std::tuple<int, int, double>{ 77, 90, 1.0 },
std::tuple<int, int, double>{ 77, 99, 1.0 },
std::tuple<int, int, double>{ 77, 108, 1.0 },
std::tuple<int, int, double>{ 77, 117, 1.0 },
std::tuple<int, int, double>{ 77, 126, 1.0 },
std::tuple<int, int, double>{ 78, 150, 1.0 },
std::tuple<int, int, double>{ 78, 159, 1.0 },
std::tuple<int, int, double>{ 78, 168, 1.0 },
std::tuple<int, int, double>{ 78, 177, 1.0 },
std::tuple<int, int, double>{ 78, 186, 1.0 },
std::tuple<int, int, double>{ 79, 91, 1.0 },
std::tuple<int, int, double>{ 79, 100, 1.0 },
std::tuple<int, int, double>{ 79, 109, 1.0 },
std::tuple<int, int, double>{ 79, 118, 1.0 },
std::tuple<int, int, double>{ 79, 127, 1.0 },
std::tuple<int, int, double>{ 80, 151, 1.0 },
std::tuple<int, int, double>{ 80, 160, 1.0 },
std::tuple<int, int, double>{ 80, 169, 1.0 },
std::tuple<int, int, double>{ 80, 178, 1.0 },
std::tuple<int, int, double>{ 80, 187, 1.0 },
std::tuple<int, int, double>{ 81, 92, 1.0 },
std::tuple<int, int, double>{ 81, 101, 1.0 },
std::tuple<int, int, double>{ 81, 110, 1.0 },
std::tuple<int, int, double>{ 81, 119, 1.0 },
std::tuple<int, int, double>{ 81, 128, 1.0 },
std::tuple<int, int, double>{ 82, 152, 1.0 },
std::tuple<int, int, double>{ 82, 161, 1.0 },
std::tuple<int, int, double>{ 82, 170, 1.0 },
std::tuple<int, int, double>{ 82, 179, 1.0 },
std::tuple<int, int, double>{ 82, 188, 1.0 },
std::tuple<int, int, double>{ 83, 93, 1.0 },
std::tuple<int, int, double>{ 83, 102, 1.0 },
std::tuple<int, int, double>{ 83, 111, 1.0 },
std::tuple<int, int, double>{ 83, 120, 1.0 },
std::tuple<int, int, double>{ 83, 129, 1.0 },
std::tuple<int, int, double>{ 84, 153, 1.0 },
std::tuple<int, int, double>{ 84, 162, 1.0 },
std::tuple<int, int, double>{ 84, 171, 1.0 },
std::tuple<int, int, double>{ 84, 180, 1.0 },
std::tuple<int, int, double>{ 84, 189, 1.0 },
std::tuple<int, int, double>{ 85, 94, 1.0 },
std::tuple<int, int, double>{ 85, 103, 1.0 },
std::tuple<int, int, double>{ 85, 112, 1.0 },
std::tuple<int, int, double>{ 85, 121, 1.0 },
std::tuple<int, int, double>{ 85, 130, 1.0 },
std::tuple<int, int, double>{ 86, 154, 1.0 },
std::tuple<int, int, double>{ 86, 163, 1.0 },
std::tuple<int, int, double>{ 86, 172, 1.0 },
std::tuple<int, int, double>{ 86, 181, 1.0 },
std::tuple<int, int, double>{ 86, 190, 1.0 },
std::tuple<int, int, double>{ 87, 95, 1.0 },
std::tuple<int, int, double>{ 87, 104, 1.0 },
std::tuple<int, int, double>{ 87, 113, 1.0 },
std::tuple<int, int, double>{ 87, 122, 1.0 },
std::tuple<int, int, double>{ 87, 131, 1.0 },
std::tuple<int, int, double>{ 88, 155, 1.0 },
std::tuple<int, int, double>{ 88, 164, 1.0 },
std::tuple<int, int, double>{ 88, 173, 1.0 },
std::tuple<int, int, double>{ 88, 182, 1.0 },
std::tuple<int, int, double>{ 88, 191, 1.0 },
std::tuple<int, int, double>{ 89, 96, 1.0 },
std::tuple<int, int, double>{ 89, 105, 1.0 },
std::tuple<int, int, double>{ 89, 114, 1.0 },
std::tuple<int, int, double>{ 89, 123, 1.0 },
std::tuple<int, int, double>{ 89, 132, 1.0 },
std::tuple<int, int, double>{ 90, 156, 1.0 },
std::tuple<int, int, double>{ 90, 165, 1.0 },
std::tuple<int, int, double>{ 90, 174, 1.0 },
std::tuple<int, int, double>{ 90, 183, 1.0 },
std::tuple<int, int, double>{ 90, 192, 1.0 },
std::tuple<int, int, double>{ 91, 97, 1.0 },
std::tuple<int, int, double>{ 91, 106, 1.0 },
std::tuple<int, int, double>{ 91, 115, 1.0 },
std::tuple<int, int, double>{ 91, 124, 1.0 },
std::tuple<int, int, double>{ 91, 133, 1.0 },
std::tuple<int, int, double>{ 92, 157, 1.0 },
std::tuple<int, int, double>{ 92, 166, 1.0 },
std::tuple<int, int, double>{ 92, 175, 1.0 },
std::tuple<int, int, double>{ 92, 184, 1.0 },
std::tuple<int, int, double>{ 92, 193, 1.0 },
std::tuple<int, int, double>{ 93, 98, 1.0 },
std::tuple<int, int, double>{ 93, 107, 1.0 },
std::tuple<int, int, double>{ 93, 116, 1.0 },
std::tuple<int, int, double>{ 93, 125, 1.0 },
std::tuple<int, int, double>{ 93, 134, 1.0 },
std::tuple<int, int, double>{ 94, 158, 1.0 },
std::tuple<int, int, double>{ 94, 167, 1.0 },
std::tuple<int, int, double>{ 94, 176, 1.0 },
std::tuple<int, int, double>{ 94, 185, 1.0 },
std::tuple<int, int, double>{ 94, 194, 1.0 },
std::tuple<int, int, double>{ 95, 236, 1.0 },
std::tuple<int, int, double>{ 95, 237, 1.0 },
std::tuple<int, int, double>{ 95, 238, 1.0 },
std::tuple<int, int, double>{ 95, 239, 1.0 },
std::tuple<int, int, double>{ 95, 240, 1.0 },
std::tuple<int, int, double>{ 95, 356, -1.0 },
std::tuple<int, int, double>{ 96, 296, 1.0 },
std::tuple<int, int, double>{ 96, 297, 1.0 },
std::tuple<int, int, double>{ 96, 298, 1.0 },
std::tuple<int, int, double>{ 96, 299, 1.0 },
std::tuple<int, int, double>{ 96, 300, 1.0 },
std::tuple<int, int, double>{ 96, 359, -1.0 },
std::tuple<int, int, double>{ 97, 241, 1.0 },
std::tuple<int, int, double>{ 97, 242, 1.0 },
std::tuple<int, int, double>{ 97, 243, 1.0 },
std::tuple<int, int, double>{ 97, 244, 1.0 },
std::tuple<int, int, double>{ 97, 245, 1.0 },
std::tuple<int, int, double>{ 97, 357, -1.0 },
std::tuple<int, int, double>{ 98, 301, 1.0 },
std::tuple<int, int, double>{ 98, 302, 1.0 },
std::tuple<int, int, double>{ 98, 303, 1.0 },
std::tuple<int, int, double>{ 98, 304, 1.0 },
std::tuple<int, int, double>{ 98, 305, 1.0 },
std::tuple<int, int, double>{ 98, 360, -1.0 },
std::tuple<int, int, double>{ 99, 246, 1.0 },
std::tuple<int, int, double>{ 99, 247, 1.0 },
std::tuple<int, int, double>{ 99, 248, 1.0 },
std::tuple<int, int, double>{ 99, 249, 1.0 },
std::tuple<int, int, double>{ 99, 250, 1.0 },
std::tuple<int, int, double>{ 99, 358, -1.0 },
std::tuple<int, int, double>{ 100, 306, 1.0 },
std::tuple<int, int, double>{ 100, 307, 1.0 },
std::tuple<int, int, double>{ 100, 308, 1.0 },
std::tuple<int, int, double>{ 100, 309, 1.0 },
std::tuple<int, int, double>{ 100, 310, 1.0 },
std::tuple<int, int, double>{ 100, 361, -1.0 },
std::tuple<int, int, double>{ 101, 356, 1.0 },
std::tuple<int, int, double>{ 102, 357, 1.0 },
std::tuple<int, int, double>{ 103, 358, 1.0 },
std::tuple<int, int, double>{ 104, 359, 1.0 },
std::tuple<int, int, double>{ 105, 360, 1.0 },
std::tuple<int, int, double>{ 106, 361, 1.0 },
std::tuple<int, int, double>{ 107, 226, 1.0 },
std::tuple<int, int, double>{ 107, 236, 1.0 },
std::tuple<int, int, double>{ 107, 241, 1.0 },
std::tuple<int, int, double>{ 107, 246, 1.0 },
std::tuple<int, int, double>{ 107, 251, -1.0 },
std::tuple<int, int, double>{ 107, 252, -1.0 },
std::tuple<int, int, double>{ 107, 253, -1.0 },
std::tuple<int, int, double>{ 107, 254, -1.0 },
std::tuple<int, int, double>{ 107, 255, -1.0 },
std::tuple<int, int, double>{ 107, 256, -1.0 },
std::tuple<int, int, double>{ 107, 257, -1.0 },
std::tuple<int, int, double>{ 107, 258, -1.0 },
std::tuple<int, int, double>{ 107, 259, -1.0 },
std::tuple<int, int, double>{ 107, 387, -1.0 },
std::tuple<int, int, double>{ 108, 231, 1.0 },
std::tuple<int, int, double>{ 108, 296, 1.0 },
std::tuple<int, int, double>{ 108, 301, 1.0 },
std::tuple<int, int, double>{ 108, 306, 1.0 },
std::tuple<int, int, double>{ 108, 311, -1.0 },
std::tuple<int, int, double>{ 108, 312, -1.0 },
std::tuple<int, int, double>{ 108, 313, -1.0 },
std::tuple<int, int, double>{ 108, 314, -1.0 },
std::tuple<int, int, double>{ 108, 315, -1.0 },
std::tuple<int, int, double>{ 108, 316, -1.0 },
std::tuple<int, int, double>{ 108, 317, -1.0 },
std::tuple<int, int, double>{ 108, 318, -1.0 },
std::tuple<int, int, double>{ 108, 319, -1.0 },
std::tuple<int, int, double>{ 108, 392, -1.0 },
std::tuple<int, int, double>{ 109, 227, 1.0 },
std::tuple<int, int, double>{ 109, 237, 1.0 },
std::tuple<int, int, double>{ 109, 242, 1.0 },
std::tuple<int, int, double>{ 109, 247, 1.0 },
std::tuple<int, int, double>{ 109, 260, -1.0 },
std::tuple<int, int, double>{ 109, 261, -1.0 },
std::tuple<int, int, double>{ 109, 262, -1.0 },
std::tuple<int, int, double>{ 109, 263, -1.0 },
std::tuple<int, int, double>{ 109, 264, -1.0 },
std::tuple<int, int, double>{ 109, 265, -1.0 },
std::tuple<int, int, double>{ 109, 266, -1.0 },
std::tuple<int, int, double>{ 109, 267, -1.0 },
std::tuple<int, int, double>{ 109, 268, -1.0 },
std::tuple<int, int, double>{ 109, 388, -1.0 },
std::tuple<int, int, double>{ 110, 232, 1.0 },
std::tuple<int, int, double>{ 110, 297, 1.0 },
std::tuple<int, int, double>{ 110, 302, 1.0 },
std::tuple<int, int, double>{ 110, 307, 1.0 },
std::tuple<int, int, double>{ 110, 320, -1.0 },
std::tuple<int, int, double>{ 110, 321, -1.0 },
std::tuple<int, int, double>{ 110, 322, -1.0 },
std::tuple<int, int, double>{ 110, 323, -1.0 },
std::tuple<int, int, double>{ 110, 324, -1.0 },
std::tuple<int, int, double>{ 110, 325, -1.0 },
std::tuple<int, int, double>{ 110, 326, -1.0 },
std::tuple<int, int, double>{ 110, 327, -1.0 },
std::tuple<int, int, double>{ 110, 328, -1.0 },
std::tuple<int, int, double>{ 110, 393, -1.0 },
std::tuple<int, int, double>{ 111, 228, 1.0 },
std::tuple<int, int, double>{ 111, 238, 1.0 },
std::tuple<int, int, double>{ 111, 243, 1.0 },
std::tuple<int, int, double>{ 111, 248, 1.0 },
std::tuple<int, int, double>{ 111, 269, -1.0 },
std::tuple<int, int, double>{ 111, 270, -1.0 },
std::tuple<int, int, double>{ 111, 271, -1.0 },
std::tuple<int, int, double>{ 111, 272, -1.0 },
std::tuple<int, int, double>{ 111, 273, -1.0 },
std::tuple<int, int, double>{ 111, 274, -1.0 },
std::tuple<int, int, double>{ 111, 275, -1.0 },
std::tuple<int, int, double>{ 111, 276, -1.0 },
std::tuple<int, int, double>{ 111, 277, -1.0 },
std::tuple<int, int, double>{ 111, 389, -1.0 },
std::tuple<int, int, double>{ 112, 233, 1.0 },
std::tuple<int, int, double>{ 112, 298, 1.0 },
std::tuple<int, int, double>{ 112, 303, 1.0 },
std::tuple<int, int, double>{ 112, 308, 1.0 },
std::tuple<int, int, double>{ 112, 329, -1.0 },
std::tuple<int, int, double>{ 112, 330, -1.0 },
std::tuple<int, int, double>{ 112, 331, -1.0 },
std::tuple<int, int, double>{ 112, 332, -1.0 },
std::tuple<int, int, double>{ 112, 333, -1.0 },
std::tuple<int, int, double>{ 112, 334, -1.0 },
std::tuple<int, int, double>{ 112, 335, -1.0 },
std::tuple<int, int, double>{ 112, 336, -1.0 },
std::tuple<int, int, double>{ 112, 337, -1.0 },
std::tuple<int, int, double>{ 112, 394, -1.0 },
std::tuple<int, int, double>{ 113, 229, 1.0 },
std::tuple<int, int, double>{ 113, 239, 1.0 },
std::tuple<int, int, double>{ 113, 244, 1.0 },
std::tuple<int, int, double>{ 113, 249, 1.0 },
std::tuple<int, int, double>{ 113, 278, -1.0 },
std::tuple<int, int, double>{ 113, 279, -1.0 },
std::tuple<int, int, double>{ 113, 280, -1.0 },
std::tuple<int, int, double>{ 113, 281, -1.0 },
std::tuple<int, int, double>{ 113, 282, -1.0 },
std::tuple<int, int, double>{ 113, 283, -1.0 },
std::tuple<int, int, double>{ 113, 284, -1.0 },
std::tuple<int, int, double>{ 113, 285, -1.0 },
std::tuple<int, int, double>{ 113, 286, -1.0 },
std::tuple<int, int, double>{ 113, 390, -1.0 },
std::tuple<int, int, double>{ 114, 234, 1.0 },
std::tuple<int, int, double>{ 114, 299, 1.0 },
std::tuple<int, int, double>{ 114, 304, 1.0 },
std::tuple<int, int, double>{ 114, 309, 1.0 },
std::tuple<int, int, double>{ 114, 338, -1.0 },
std::tuple<int, int, double>{ 114, 339, -1.0 },
std::tuple<int, int, double>{ 114, 340, -1.0 },
std::tuple<int, int, double>{ 114, 341, -1.0 },
std::tuple<int, int, double>{ 114, 342, -1.0 },
std::tuple<int, int, double>{ 114, 343, -1.0 },
std::tuple<int, int, double>{ 114, 344, -1.0 },
std::tuple<int, int, double>{ 114, 345, -1.0 },
std::tuple<int, int, double>{ 114, 346, -1.0 },
std::tuple<int, int, double>{ 114, 395, -1.0 },
std::tuple<int, int, double>{ 115, 230, 1.0 },
std::tuple<int, int, double>{ 115, 240, 1.0 },
std::tuple<int, int, double>{ 115, 245, 1.0 },
std::tuple<int, int, double>{ 115, 250, 1.0 },
std::tuple<int, int, double>{ 115, 287, -1.0 },
std::tuple<int, int, double>{ 115, 288, -1.0 },
std::tuple<int, int, double>{ 115, 289, -1.0 },
std::tuple<int, int, double>{ 115, 290, -1.0 },
std::tuple<int, int, double>{ 115, 291, -1.0 },
std::tuple<int, int, double>{ 115, 292, -1.0 },
std::tuple<int, int, double>{ 115, 293, -1.0 },
std::tuple<int, int, double>{ 115, 294, -1.0 },
std::tuple<int, int, double>{ 115, 295, -1.0 },
std::tuple<int, int, double>{ 115, 391, -1.0 },
std::tuple<int, int, double>{ 116, 235, 1.0 },
std::tuple<int, int, double>{ 116, 300, 1.0 },
std::tuple<int, int, double>{ 116, 305, 1.0 },
std::tuple<int, int, double>{ 116, 310, 1.0 },
std::tuple<int, int, double>{ 116, 347, -1.0 },
std::tuple<int, int, double>{ 116, 348, -1.0 },
std::tuple<int, int, double>{ 116, 349, -1.0 },
std::tuple<int, int, double>{ 116, 350, -1.0 },
std::tuple<int, int, double>{ 116, 351, -1.0 },
std::tuple<int, int, double>{ 116, 352, -1.0 },
std::tuple<int, int, double>{ 116, 353, -1.0 },
std::tuple<int, int, double>{ 116, 354, -1.0 },
std::tuple<int, int, double>{ 116, 355, -1.0 },
std::tuple<int, int, double>{ 116, 396, -1.0 },
std::tuple<int, int, double>{ 117, 236, -1.0 },
std::tuple<int, int, double>{ 117, 241, -1.0 },
std::tuple<int, int, double>{ 117, 246, -1.0 },
std::tuple<int, int, double>{ 117, 362, 1.0 },
std::tuple<int, int, double>{ 117, 363, 1.0 },
std::tuple<int, int, double>{ 118, 296, -1.0 },
std::tuple<int, int, double>{ 118, 301, -1.0 },
std::tuple<int, int, double>{ 118, 306, -1.0 },
std::tuple<int, int, double>{ 118, 364, 1.0 },
std::tuple<int, int, double>{ 118, 365, 1.0 },
std::tuple<int, int, double>{ 119, 25, -600.0 },
std::tuple<int, int, double>{ 119, 363, 1.0 },
std::tuple<int, int, double>{ 120, 25, 180.0 },
std::tuple<int, int, double>{ 120, 362, -1.0 },
std::tuple<int, int, double>{ 121, 26, -300.0 },
std::tuple<int, int, double>{ 121, 365, 1.0 },
std::tuple<int, int, double>{ 122, 26, 80.0 },
std::tuple<int, int, double>{ 122, 364, -1.0 },
std::tuple<int, int, double>{ 123, 362, -1.0 },
std::tuple<int, int, double>{ 123, 363, -1.0 },
std::tuple<int, int, double>{ 123, 364, -2.0 },
std::tuple<int, int, double>{ 123, 365, -2.0 },
std::tuple<int, int, double>{ 123, 382, 1.0 },
std::tuple<int, int, double>{ 124, 35, -350.0 },
std::tuple<int, int, double>{ 124, 382, 1.0 },
std::tuple<int, int, double>{ 125, 35, -200.0 },
std::tuple<int, int, double>{ 125, 382, 1.0 },
std::tuple<int, int, double>{ 126, 20, -1.0 },
std::tuple<int, int, double>{ 126, 35, 1.0 },
std::tuple<int, int, double>{ 126, 45, -1.0 },
std::tuple<int, int, double>{ 127, 237, -1.0 },
std::tuple<int, int, double>{ 127, 242, -1.0 },
std::tuple<int, int, double>{ 127, 247, -1.0 },
std::tuple<int, int, double>{ 127, 366, 1.0 },
std::tuple<int, int, double>{ 127, 367, 1.0 },
std::tuple<int, int, double>{ 128, 297, -1.0 },
std::tuple<int, int, double>{ 128, 302, -1.0 },
std::tuple<int, int, double>{ 128, 307, -1.0 },
std::tuple<int, int, double>{ 128, 368, 1.0 },
std::tuple<int, int, double>{ 128, 369, 1.0 },
std::tuple<int, int, double>{ 129, 27, -600.0 },
std::tuple<int, int, double>{ 129, 367, 1.0 },
std::tuple<int, int, double>{ 130, 27, 180.0 },
std::tuple<int, int, double>{ 130, 366, -1.0 },
std::tuple<int, int, double>{ 131, 28, -300.0 },
std::tuple<int, int, double>{ 131, 369, 1.0 },
std::tuple<int, int, double>{ 132, 28, 80.0 },
std::tuple<int, int, double>{ 132, 368, -1.0 },
std::tuple<int, int, double>{ 133, 366, -1.0 },
std::tuple<int, int, double>{ 133, 367, -1.0 },
std::tuple<int, int, double>{ 133, 368, -2.0 },
std::tuple<int, int, double>{ 133, 369, -2.0 },
std::tuple<int, int, double>{ 133, 383, 1.0 },
std::tuple<int, int, double>{ 134, 36, -500.0 },
std::tuple<int, int, double>{ 134, 383, 1.0 },
std::tuple<int, int, double>{ 135, 36, -350.0 },
std::tuple<int, int, double>{ 135, 383, 1.0 },
std::tuple<int, int, double>{ 136, 21, -1.0 },
std::tuple<int, int, double>{ 136, 36, 1.0 },
std::tuple<int, int, double>{ 136, 46, -1.0 },
std::tuple<int, int, double>{ 137, 238, -1.0 },
std::tuple<int, int, double>{ 137, 243, -1.0 },
std::tuple<int, int, double>{ 137, 248, -1.0 },
std::tuple<int, int, double>{ 137, 370, 1.0 },
std::tuple<int, int, double>{ 137, 371, 1.0 },
std::tuple<int, int, double>{ 138, 298, -1.0 },
std::tuple<int, int, double>{ 138, 303, -1.0 },
std::tuple<int, int, double>{ 138, 308, -1.0 },
std::tuple<int, int, double>{ 138, 372, 1.0 },
std::tuple<int, int, double>{ 138, 373, 1.0 },
std::tuple<int, int, double>{ 139, 29, -600.0 },
std::tuple<int, int, double>{ 139, 371, 1.0 },
std::tuple<int, int, double>{ 140, 29, 180.0 },
std::tuple<int, int, double>{ 140, 370, -1.0 },
std::tuple<int, int, double>{ 141, 30, -300.0 },
std::tuple<int, int, double>{ 141, 373, 1.0 },
std::tuple<int, int, double>{ 142, 30, 80.0 },
std::tuple<int, int, double>{ 142, 372, -1.0 },
std::tuple<int, int, double>{ 143, 370, -1.0 },
std::tuple<int, int, double>{ 143, 371, -1.0 },
std::tuple<int, int, double>{ 143, 372, -2.0 },
std::tuple<int, int, double>{ 143, 373, -2.0 },
std::tuple<int, int, double>{ 143, 384, 1.0 },
std::tuple<int, int, double>{ 144, 37, -225.0 },
std::tuple<int, int, double>{ 144, 384, 1.0 },
std::tuple<int, int, double>{ 145, 37, -100.0 },
std::tuple<int, int, double>{ 145, 384, 1.0 },
std::tuple<int, int, double>{ 146, 22, -1.0 },
std::tuple<int, int, double>{ 146, 37, 1.0 },
std::tuple<int, int, double>{ 146, 47, -1.0 },
std::tuple<int, int, double>{ 147, 239, -1.0 },
std::tuple<int, int, double>{ 147, 244, -1.0 },
std::tuple<int, int, double>{ 147, 249, -1.0 },
std::tuple<int, int, double>{ 147, 374, 1.0 },
std::tuple<int, int, double>{ 147, 375, 1.0 },
std::tuple<int, int, double>{ 148, 299, -1.0 },
std::tuple<int, int, double>{ 148, 304, -1.0 },
std::tuple<int, int, double>{ 148, 309, -1.0 },
std::tuple<int, int, double>{ 148, 376, 1.0 },
std::tuple<int, int, double>{ 148, 377, 1.0 },
std::tuple<int, int, double>{ 149, 31, -600.0 },
std::tuple<int, int, double>{ 149, 375, 1.0 },
std::tuple<int, int, double>{ 150, 31, 180.0 },
std::tuple<int, int, double>{ 150, 374, -1.0 },
std::tuple<int, int, double>{ 151, 32, -300.0 },
std::tuple<int, int, double>{ 151, 377, 1.0 },
std::tuple<int, int, double>{ 152, 32, 80.0 },
std::tuple<int, int, double>{ 152, 376, -1.0 },
std::tuple<int, int, double>{ 153, 374, -1.0 },
std::tuple<int, int, double>{ 153, 375, -1.0 },
std::tuple<int, int, double>{ 153, 376, -2.0 },
std::tuple<int, int, double>{ 153, 377, -2.0 },
std::tuple<int, int, double>{ 153, 385, 1.0 },
std::tuple<int, int, double>{ 154, 38, -410.0 },
std::tuple<int, int, double>{ 154, 385, 1.0 },
std::tuple<int, int, double>{ 155, 38, -200.0 },
std::tuple<int, int, double>{ 155, 385, 1.0 },
std::tuple<int, int, double>{ 156, 23, -1.0 },
std::tuple<int, int, double>{ 156, 38, 1.0 },
std::tuple<int, int, double>{ 156, 48, -1.0 },
std::tuple<int, int, double>{ 157, 240, -1.0 },
std::tuple<int, int, double>{ 157, 245, -1.0 },
std::tuple<int, int, double>{ 157, 250, -1.0 },
std::tuple<int, int, double>{ 157, 378, 1.0 },
std::tuple<int, int, double>{ 157, 379, 1.0 },
std::tuple<int, int, double>{ 158, 300, -1.0 },
std::tuple<int, int, double>{ 158, 305, -1.0 },
std::tuple<int, int, double>{ 158, 310, -1.0 },
std::tuple<int, int, double>{ 158, 380, 1.0 },
std::tuple<int, int, double>{ 158, 381, 1.0 },
std::tuple<int, int, double>{ 159, 33, -600.0 },
std::tuple<int, int, double>{ 159, 379, 1.0 },
std::tuple<int, int, double>{ 160, 33, 180.0 },
std::tuple<int, int, double>{ 160, 378, -1.0 },
std::tuple<int, int, double>{ 161, 34, -300.0 },
std::tuple<int, int, double>{ 161, 381, 1.0 },
std::tuple<int, int, double>{ 162, 34, 80.0 },
std::tuple<int, int, double>{ 162, 380, -1.0 },
std::tuple<int, int, double>{ 163, 378, -1.0 },
std::tuple<int, int, double>{ 163, 379, -1.0 },
std::tuple<int, int, double>{ 163, 380, -2.0 },
std::tuple<int, int, double>{ 163, 381, -2.0 },
std::tuple<int, int, double>{ 163, 386, 1.0 },
std::tuple<int, int, double>{ 164, 39, -320.0 },
std::tuple<int, int, double>{ 164, 386, 1.0 },
std::tuple<int, int, double>{ 165, 39, -100.0 },
std::tuple<int, int, double>{ 165, 386, 1.0 },
std::tuple<int, int, double>{ 166, 24, -1.0 },
std::tuple<int, int, double>{ 166, 39, 1.0 },
std::tuple<int, int, double>{ 166, 49, -1.0 },
std::tuple<int, int, double>{ 167, 35, -1.0 },
std::tuple<int, int, double>{ 167, 36, -1.0 },
std::tuple<int, int, double>{ 167, 37, -1.0 },
std::tuple<int, int, double>{ 167, 38, -1.0 },
std::tuple<int, int, double>{ 167, 39, -1.0 },
std::tuple<int, int, double>{ 167, 40, 1.0 },
std::tuple<int, int, double>{ 167, 41, 1.0 },
std::tuple<int, int, double>{ 167, 42, 1.0 },
std::tuple<int, int, double>{ 167, 43, 1.0 },
std::tuple<int, int, double>{ 167, 44, 1.0 },
std::tuple<int, int, double>{ 168, 40, -1.0 },
std::tuple<int, int, double>{ 168, 41, 1.0 },
std::tuple<int, int, double>{ 169, 41, -1.0 },
std::tuple<int, int, double>{ 169, 42, 1.0 },
std::tuple<int, int, double>{ 170, 42, -1.0 },
std::tuple<int, int, double>{ 170, 43, 1.0 },
std::tuple<int, int, double>{ 171, 43, -1.0 },
std::tuple<int, int, double>{ 171, 44, 1.0 },
std::tuple<int, int, double>{ 172, 251, 1.0 },
std::tuple<int, int, double>{ 172, 260, 1.0 },
std::tuple<int, int, double>{ 172, 269, 1.0 },
std::tuple<int, int, double>{ 172, 278, 1.0 },
std::tuple<int, int, double>{ 172, 287, 1.0 },
std::tuple<int, int, double>{ 173, 311, 1.0 },
std::tuple<int, int, double>{ 173, 320, 1.0 },
std::tuple<int, int, double>{ 173, 329, 1.0 },
std::tuple<int, int, double>{ 173, 338, 1.0 },
std::tuple<int, int, double>{ 173, 347, 1.0 },
std::tuple<int, int, double>{ 174, 252, 1.0 },
std::tuple<int, int, double>{ 174, 261, 1.0 },
std::tuple<int, int, double>{ 174, 270, 1.0 },
std::tuple<int, int, double>{ 174, 279, 1.0 },
std::tuple<int, int, double>{ 174, 288, 1.0 },
std::tuple<int, int, double>{ 175, 312, 1.0 },
std::tuple<int, int, double>{ 175, 321, 1.0 },
std::tuple<int, int, double>{ 175, 330, 1.0 },
std::tuple<int, int, double>{ 175, 339, 1.0 },
std::tuple<int, int, double>{ 175, 348, 1.0 },
std::tuple<int, int, double>{ 176, 253, 1.0 },
std::tuple<int, int, double>{ 176, 262, 1.0 },
std::tuple<int, int, double>{ 176, 271, 1.0 },
std::tuple<int, int, double>{ 176, 280, 1.0 },
std::tuple<int, int, double>{ 176, 289, 1.0 },
std::tuple<int, int, double>{ 177, 313, 1.0 },
std::tuple<int, int, double>{ 177, 322, 1.0 },
std::tuple<int, int, double>{ 177, 331, 1.0 },
std::tuple<int, int, double>{ 177, 340, 1.0 },
std::tuple<int, int, double>{ 177, 349, 1.0 },
std::tuple<int, int, double>{ 178, 254, 1.0 },
std::tuple<int, int, double>{ 178, 263, 1.0 },
std::tuple<int, int, double>{ 178, 272, 1.0 },
std::tuple<int, int, double>{ 178, 281, 1.0 },
std::tuple<int, int, double>{ 178, 290, 1.0 },
std::tuple<int, int, double>{ 179, 314, 1.0 },
std::tuple<int, int, double>{ 179, 323, 1.0 },
std::tuple<int, int, double>{ 179, 332, 1.0 },
std::tuple<int, int, double>{ 179, 341, 1.0 },
std::tuple<int, int, double>{ 179, 350, 1.0 },
std::tuple<int, int, double>{ 180, 255, 1.0 },
std::tuple<int, int, double>{ 180, 264, 1.0 },
std::tuple<int, int, double>{ 180, 273, 1.0 },
std::tuple<int, int, double>{ 180, 282, 1.0 },
std::tuple<int, int, double>{ 180, 291, 1.0 },
std::tuple<int, int, double>{ 181, 315, 1.0 },
std::tuple<int, int, double>{ 181, 324, 1.0 },
std::tuple<int, int, double>{ 181, 333, 1.0 },
std::tuple<int, int, double>{ 181, 342, 1.0 },
std::tuple<int, int, double>{ 181, 351, 1.0 },
std::tuple<int, int, double>{ 182, 256, 1.0 },
std::tuple<int, int, double>{ 182, 265, 1.0 },
std::tuple<int, int, double>{ 182, 274, 1.0 },
std::tuple<int, int, double>{ 182, 283, 1.0 },
std::tuple<int, int, double>{ 182, 292, 1.0 },
std::tuple<int, int, double>{ 183, 316, 1.0 },
std::tuple<int, int, double>{ 183, 325, 1.0 },
std::tuple<int, int, double>{ 183, 334, 1.0 },
std::tuple<int, int, double>{ 183, 343, 1.0 },
std::tuple<int, int, double>{ 183, 352, 1.0 },
std::tuple<int, int, double>{ 184, 257, 1.0 },
std::tuple<int, int, double>{ 184, 266, 1.0 },
std::tuple<int, int, double>{ 184, 275, 1.0 },
std::tuple<int, int, double>{ 184, 284, 1.0 },
std::tuple<int, int, double>{ 184, 293, 1.0 },
std::tuple<int, int, double>{ 185, 317, 1.0 },
std::tuple<int, int, double>{ 185, 326, 1.0 },
std::tuple<int, int, double>{ 185, 335, 1.0 },
std::tuple<int, int, double>{ 185, 344, 1.0 },
std::tuple<int, int, double>{ 185, 353, 1.0 },
std::tuple<int, int, double>{ 186, 258, 1.0 },
std::tuple<int, int, double>{ 186, 267, 1.0 },
std::tuple<int, int, double>{ 186, 276, 1.0 },
std::tuple<int, int, double>{ 186, 285, 1.0 },
std::tuple<int, int, double>{ 186, 294, 1.0 },
std::tuple<int, int, double>{ 187, 318, 1.0 },
std::tuple<int, int, double>{ 187, 327, 1.0 },
std::tuple<int, int, double>{ 187, 336, 1.0 },
std::tuple<int, int, double>{ 187, 345, 1.0 },
std::tuple<int, int, double>{ 187, 354, 1.0 },
std::tuple<int, int, double>{ 188, 259, 1.0 },
std::tuple<int, int, double>{ 188, 268, 1.0 },
std::tuple<int, int, double>{ 188, 277, 1.0 },
std::tuple<int, int, double>{ 188, 286, 1.0 },
std::tuple<int, int, double>{ 188, 295, 1.0 },
std::tuple<int, int, double>{ 189, 319, 1.0 },
std::tuple<int, int, double>{ 189, 328, 1.0 },
std::tuple<int, int, double>{ 189, 337, 1.0 },
std::tuple<int, int, double>{ 189, 346, 1.0 },
std::tuple<int, int, double>{ 189, 355, 1.0 },
std::tuple<int, int, double>{ 190, 397, 1.0 },
std::tuple<int, int, double>{ 190, 398, 1.0 },
std::tuple<int, int, double>{ 190, 399, 1.0 },
std::tuple<int, int, double>{ 190, 400, 1.0 },
std::tuple<int, int, double>{ 190, 401, 1.0 },
std::tuple<int, int, double>{ 190, 517, -1.0 },
std::tuple<int, int, double>{ 191, 457, 1.0 },
std::tuple<int, int, double>{ 191, 458, 1.0 },
std::tuple<int, int, double>{ 191, 459, 1.0 },
std::tuple<int, int, double>{ 191, 460, 1.0 },
std::tuple<int, int, double>{ 191, 461, 1.0 },
std::tuple<int, int, double>{ 191, 520, -1.0 },
std::tuple<int, int, double>{ 192, 402, 1.0 },
std::tuple<int, int, double>{ 192, 403, 1.0 },
std::tuple<int, int, double>{ 192, 404, 1.0 },
std::tuple<int, int, double>{ 192, 405, 1.0 },
std::tuple<int, int, double>{ 192, 406, 1.0 },
std::tuple<int, int, double>{ 192, 518, -1.0 },
std::tuple<int, int, double>{ 193, 462, 1.0 },
std::tuple<int, int, double>{ 193, 463, 1.0 },
std::tuple<int, int, double>{ 193, 464, 1.0 },
std::tuple<int, int, double>{ 193, 465, 1.0 },
std::tuple<int, int, double>{ 193, 466, 1.0 },
std::tuple<int, int, double>{ 193, 521, -1.0 },
std::tuple<int, int, double>{ 194, 407, 1.0 },
std::tuple<int, int, double>{ 194, 408, 1.0 },
std::tuple<int, int, double>{ 194, 409, 1.0 },
std::tuple<int, int, double>{ 194, 410, 1.0 },
std::tuple<int, int, double>{ 194, 411, 1.0 },
std::tuple<int, int, double>{ 194, 519, -1.0 },
std::tuple<int, int, double>{ 195, 467, 1.0 },
std::tuple<int, int, double>{ 195, 468, 1.0 },
std::tuple<int, int, double>{ 195, 469, 1.0 },
std::tuple<int, int, double>{ 195, 470, 1.0 },
std::tuple<int, int, double>{ 195, 471, 1.0 },
std::tuple<int, int, double>{ 195, 522, -1.0 },
std::tuple<int, int, double>{ 196, 517, 1.0 },
std::tuple<int, int, double>{ 197, 518, 1.0 },
std::tuple<int, int, double>{ 198, 519, 1.0 },
std::tuple<int, int, double>{ 199, 520, 1.0 },
std::tuple<int, int, double>{ 200, 521, 1.0 },
std::tuple<int, int, double>{ 201, 522, 1.0 },
std::tuple<int, int, double>{ 202, 387, 1.0 },
std::tuple<int, int, double>{ 202, 397, 1.0 },
std::tuple<int, int, double>{ 202, 402, 1.0 },
std::tuple<int, int, double>{ 202, 407, 1.0 },
std::tuple<int, int, double>{ 202, 412, -1.0 },
std::tuple<int, int, double>{ 202, 413, -1.0 },
std::tuple<int, int, double>{ 202, 414, -1.0 },
std::tuple<int, int, double>{ 202, 415, -1.0 },
std::tuple<int, int, double>{ 202, 416, -1.0 },
std::tuple<int, int, double>{ 202, 417, -1.0 },
std::tuple<int, int, double>{ 202, 418, -1.0 },
std::tuple<int, int, double>{ 202, 419, -1.0 },
std::tuple<int, int, double>{ 202, 420, -1.0 },
std::tuple<int, int, double>{ 203, 392, 1.0 },
std::tuple<int, int, double>{ 203, 457, 1.0 },
std::tuple<int, int, double>{ 203, 462, 1.0 },
std::tuple<int, int, double>{ 203, 467, 1.0 },
std::tuple<int, int, double>{ 203, 472, -1.0 },
std::tuple<int, int, double>{ 203, 473, -1.0 },
std::tuple<int, int, double>{ 203, 474, -1.0 },
std::tuple<int, int, double>{ 203, 475, -1.0 },
std::tuple<int, int, double>{ 203, 476, -1.0 },
std::tuple<int, int, double>{ 203, 477, -1.0 },
std::tuple<int, int, double>{ 203, 478, -1.0 },
std::tuple<int, int, double>{ 203, 479, -1.0 },
std::tuple<int, int, double>{ 203, 480, -1.0 },
std::tuple<int, int, double>{ 204, 388, 1.0 },
std::tuple<int, int, double>{ 204, 398, 1.0 },
std::tuple<int, int, double>{ 204, 403, 1.0 },
std::tuple<int, int, double>{ 204, 408, 1.0 },
std::tuple<int, int, double>{ 204, 421, -1.0 },
std::tuple<int, int, double>{ 204, 422, -1.0 },
std::tuple<int, int, double>{ 204, 423, -1.0 },
std::tuple<int, int, double>{ 204, 424, -1.0 },
std::tuple<int, int, double>{ 204, 425, -1.0 },
std::tuple<int, int, double>{ 204, 426, -1.0 },
std::tuple<int, int, double>{ 204, 427, -1.0 },
std::tuple<int, int, double>{ 204, 428, -1.0 },
std::tuple<int, int, double>{ 204, 429, -1.0 },
std::tuple<int, int, double>{ 205, 393, 1.0 },
std::tuple<int, int, double>{ 205, 458, 1.0 },
std::tuple<int, int, double>{ 205, 463, 1.0 },
std::tuple<int, int, double>{ 205, 468, 1.0 },
std::tuple<int, int, double>{ 205, 481, -1.0 },
std::tuple<int, int, double>{ 205, 482, -1.0 },
std::tuple<int, int, double>{ 205, 483, -1.0 },
std::tuple<int, int, double>{ 205, 484, -1.0 },
std::tuple<int, int, double>{ 205, 485, -1.0 },
std::tuple<int, int, double>{ 205, 486, -1.0 },
std::tuple<int, int, double>{ 205, 487, -1.0 },
std::tuple<int, int, double>{ 205, 488, -1.0 },
std::tuple<int, int, double>{ 205, 489, -1.0 },
std::tuple<int, int, double>{ 206, 389, 1.0 },
std::tuple<int, int, double>{ 206, 399, 1.0 },
std::tuple<int, int, double>{ 206, 404, 1.0 },
std::tuple<int, int, double>{ 206, 409, 1.0 },
std::tuple<int, int, double>{ 206, 430, -1.0 },
std::tuple<int, int, double>{ 206, 431, -1.0 },
std::tuple<int, int, double>{ 206, 432, -1.0 },
std::tuple<int, int, double>{ 206, 433, -1.0 },
std::tuple<int, int, double>{ 206, 434, -1.0 },
std::tuple<int, int, double>{ 206, 435, -1.0 },
std::tuple<int, int, double>{ 206, 436, -1.0 },
std::tuple<int, int, double>{ 206, 437, -1.0 },
std::tuple<int, int, double>{ 206, 438, -1.0 },
std::tuple<int, int, double>{ 207, 394, 1.0 },
std::tuple<int, int, double>{ 207, 459, 1.0 },
std::tuple<int, int, double>{ 207, 464, 1.0 },
std::tuple<int, int, double>{ 207, 469, 1.0 },
std::tuple<int, int, double>{ 207, 490, -1.0 },
std::tuple<int, int, double>{ 207, 491, -1.0 },
std::tuple<int, int, double>{ 207, 492, -1.0 },
std::tuple<int, int, double>{ 207, 493, -1.0 },
std::tuple<int, int, double>{ 207, 494, -1.0 },
std::tuple<int, int, double>{ 207, 495, -1.0 },
std::tuple<int, int, double>{ 207, 496, -1.0 },
std::tuple<int, int, double>{ 207, 497, -1.0 },
std::tuple<int, int, double>{ 207, 498, -1.0 },
std::tuple<int, int, double>{ 208, 390, 1.0 },
std::tuple<int, int, double>{ 208, 400, 1.0 },
std::tuple<int, int, double>{ 208, 405, 1.0 },
std::tuple<int, int, double>{ 208, 410, 1.0 },
std::tuple<int, int, double>{ 208, 439, -1.0 },
std::tuple<int, int, double>{ 208, 440, -1.0 },
std::tuple<int, int, double>{ 208, 441, -1.0 },
std::tuple<int, int, double>{ 208, 442, -1.0 },
std::tuple<int, int, double>{ 208, 443, -1.0 },
std::tuple<int, int, double>{ 208, 444, -1.0 },
std::tuple<int, int, double>{ 208, 445, -1.0 },
std::tuple<int, int, double>{ 208, 446, -1.0 },
std::tuple<int, int, double>{ 208, 447, -1.0 },
std::tuple<int, int, double>{ 209, 395, 1.0 },
std::tuple<int, int, double>{ 209, 460, 1.0 },
std::tuple<int, int, double>{ 209, 465, 1.0 },
std::tuple<int, int, double>{ 209, 470, 1.0 },
std::tuple<int, int, double>{ 209, 499, -1.0 },
std::tuple<int, int, double>{ 209, 500, -1.0 },
std::tuple<int, int, double>{ 209, 501, -1.0 },
std::tuple<int, int, double>{ 209, 502, -1.0 },
std::tuple<int, int, double>{ 209, 503, -1.0 },
std::tuple<int, int, double>{ 209, 504, -1.0 },
std::tuple<int, int, double>{ 209, 505, -1.0 },
std::tuple<int, int, double>{ 209, 506, -1.0 },
std::tuple<int, int, double>{ 209, 507, -1.0 },
std::tuple<int, int, double>{ 210, 391, 1.0 },
std::tuple<int, int, double>{ 210, 401, 1.0 },
std::tuple<int, int, double>{ 210, 406, 1.0 },
std::tuple<int, int, double>{ 210, 411, 1.0 },
std::tuple<int, int, double>{ 210, 448, -1.0 },
std::tuple<int, int, double>{ 210, 449, -1.0 },
std::tuple<int, int, double>{ 210, 450, -1.0 },
std::tuple<int, int, double>{ 210, 451, -1.0 },
std::tuple<int, int, double>{ 210, 452, -1.0 },
std::tuple<int, int, double>{ 210, 453, -1.0 },
std::tuple<int, int, double>{ 210, 454, -1.0 },
std::tuple<int, int, double>{ 210, 455, -1.0 },
std::tuple<int, int, double>{ 210, 456, -1.0 },
std::tuple<int, int, double>{ 211, 396, 1.0 },
std::tuple<int, int, double>{ 211, 461, 1.0 },
std::tuple<int, int, double>{ 211, 466, 1.0 },
std::tuple<int, int, double>{ 211, 471, 1.0 },
std::tuple<int, int, double>{ 211, 508, -1.0 },
std::tuple<int, int, double>{ 211, 509, -1.0 },
std::tuple<int, int, double>{ 211, 510, -1.0 },
std::tuple<int, int, double>{ 211, 511, -1.0 },
std::tuple<int, int, double>{ 211, 512, -1.0 },
std::tuple<int, int, double>{ 211, 513, -1.0 },
std::tuple<int, int, double>{ 211, 514, -1.0 },
std::tuple<int, int, double>{ 211, 515, -1.0 },
std::tuple<int, int, double>{ 211, 516, -1.0 },
std::tuple<int, int, double>{ 212, 397, -1.0 },
std::tuple<int, int, double>{ 212, 402, -1.0 },
std::tuple<int, int, double>{ 212, 407, -1.0 },
std::tuple<int, int, double>{ 212, 523, 1.0 },
std::tuple<int, int, double>{ 212, 524, 1.0 },
std::tuple<int, int, double>{ 213, 457, -1.0 },
std::tuple<int, int, double>{ 213, 462, -1.0 },
std::tuple<int, int, double>{ 213, 467, -1.0 },
std::tuple<int, int, double>{ 213, 525, 1.0 },
std::tuple<int, int, double>{ 213, 526, 1.0 },
std::tuple<int, int, double>{ 214, 50, -600.0 },
std::tuple<int, int, double>{ 214, 524, 1.0 },
std::tuple<int, int, double>{ 215, 50, 180.0 },
std::tuple<int, int, double>{ 215, 523, -1.0 },
std::tuple<int, int, double>{ 216, 51, -300.0 },
std::tuple<int, int, double>{ 216, 526, 1.0 },
std::tuple<int, int, double>{ 217, 51, 80.0 },
std::tuple<int, int, double>{ 217, 525, -1.0 },
std::tuple<int, int, double>{ 218, 523, -1.0 },
std::tuple<int, int, double>{ 218, 524, -1.0 },
std::tuple<int, int, double>{ 218, 525, -2.0 },
std::tuple<int, int, double>{ 218, 526, -2.0 },
std::tuple<int, int, double>{ 218, 543, 1.0 },
std::tuple<int, int, double>{ 219, 60, -350.0 },
std::tuple<int, int, double>{ 219, 543, 1.0 },
std::tuple<int, int, double>{ 220, 60, -200.0 },
std::tuple<int, int, double>{ 220, 543, 1.0 },
std::tuple<int, int, double>{ 221, 20, -1.0 },
std::tuple<int, int, double>{ 221, 45, -1.0 },
std::tuple<int, int, double>{ 221, 60, 1.0 },
std::tuple<int, int, double>{ 221, 70, -1.0 },
std::tuple<int, int, double>{ 222, 398, -1.0 },
std::tuple<int, int, double>{ 222, 403, -1.0 },
std::tuple<int, int, double>{ 222, 408, -1.0 },
std::tuple<int, int, double>{ 222, 527, 1.0 },
std::tuple<int, int, double>{ 222, 528, 1.0 },
std::tuple<int, int, double>{ 223, 458, -1.0 },
std::tuple<int, int, double>{ 223, 463, -1.0 },
std::tuple<int, int, double>{ 223, 468, -1.0 },
std::tuple<int, int, double>{ 223, 529, 1.0 },
std::tuple<int, int, double>{ 223, 530, 1.0 },
std::tuple<int, int, double>{ 224, 52, -600.0 },
std::tuple<int, int, double>{ 224, 528, 1.0 },
std::tuple<int, int, double>{ 225, 52, 180.0 },
std::tuple<int, int, double>{ 225, 527, -1.0 },
std::tuple<int, int, double>{ 226, 53, -300.0 },
std::tuple<int, int, double>{ 226, 530, 1.0 },
std::tuple<int, int, double>{ 227, 53, 80.0 },
std::tuple<int, int, double>{ 227, 529, -1.0 },
std::tuple<int, int, double>{ 228, 527, -1.0 },
std::tuple<int, int, double>{ 228, 528, -1.0 },
std::tuple<int, int, double>{ 228, 529, -2.0 },
std::tuple<int, int, double>{ 228, 530, -2.0 },
std::tuple<int, int, double>{ 228, 544, 1.0 },
std::tuple<int, int, double>{ 229, 61, -500.0 },
std::tuple<int, int, double>{ 229, 544, 1.0 },
std::tuple<int, int, double>{ 230, 61, -350.0 },
std::tuple<int, int, double>{ 230, 544, 1.0 },
std::tuple<int, int, double>{ 231, 21, -1.0 },
std::tuple<int, int, double>{ 231, 46, -1.0 },
std::tuple<int, int, double>{ 231, 61, 1.0 },
std::tuple<int, int, double>{ 231, 71, -1.0 },
std::tuple<int, int, double>{ 232, 399, -1.0 },
std::tuple<int, int, double>{ 232, 404, -1.0 },
std::tuple<int, int, double>{ 232, 409, -1.0 },
std::tuple<int, int, double>{ 232, 531, 1.0 },
std::tuple<int, int, double>{ 232, 532, 1.0 },
std::tuple<int, int, double>{ 233, 459, -1.0 },
std::tuple<int, int, double>{ 233, 464, -1.0 },
std::tuple<int, int, double>{ 233, 469, -1.0 },
std::tuple<int, int, double>{ 233, 533, 1.0 },
std::tuple<int, int, double>{ 233, 534, 1.0 },
std::tuple<int, int, double>{ 234, 54, -600.0 },
std::tuple<int, int, double>{ 234, 532, 1.0 },
std::tuple<int, int, double>{ 235, 54, 180.0 },
std::tuple<int, int, double>{ 235, 531, -1.0 },
std::tuple<int, int, double>{ 236, 55, -300.0 },
std::tuple<int, int, double>{ 236, 534, 1.0 },
std::tuple<int, int, double>{ 237, 55, 80.0 },
std::tuple<int, int, double>{ 237, 533, -1.0 },
std::tuple<int, int, double>{ 238, 531, -1.0 },
std::tuple<int, int, double>{ 238, 532, -1.0 },
std::tuple<int, int, double>{ 238, 533, -2.0 },
std::tuple<int, int, double>{ 238, 534, -2.0 },
std::tuple<int, int, double>{ 238, 545, 1.0 },
std::tuple<int, int, double>{ 239, 62, -225.0 },
std::tuple<int, int, double>{ 239, 545, 1.0 },
std::tuple<int, int, double>{ 240, 62, -100.0 },
std::tuple<int, int, double>{ 240, 545, 1.0 },
std::tuple<int, int, double>{ 241, 22, -1.0 },
std::tuple<int, int, double>{ 241, 47, -1.0 },
std::tuple<int, int, double>{ 241, 62, 1.0 },
std::tuple<int, int, double>{ 241, 72, -1.0 },
std::tuple<int, int, double>{ 242, 400, -1.0 },
std::tuple<int, int, double>{ 242, 405, -1.0 },
std::tuple<int, int, double>{ 242, 410, -1.0 },
std::tuple<int, int, double>{ 242, 535, 1.0 },
std::tuple<int, int, double>{ 242, 536, 1.0 },
std::tuple<int, int, double>{ 243, 460, -1.0 },
std::tuple<int, int, double>{ 243, 465, -1.0 },
std::tuple<int, int, double>{ 243, 470, -1.0 },
std::tuple<int, int, double>{ 243, 537, 1.0 },
std::tuple<int, int, double>{ 243, 538, 1.0 },
std::tuple<int, int, double>{ 244, 56, -600.0 },
std::tuple<int, int, double>{ 244, 536, 1.0 },
std::tuple<int, int, double>{ 245, 56, 180.0 },
std::tuple<int, int, double>{ 245, 535, -1.0 },
std::tuple<int, int, double>{ 246, 57, -300.0 },
std::tuple<int, int, double>{ 246, 538, 1.0 },
std::tuple<int, int, double>{ 247, 57, 80.0 },
std::tuple<int, int, double>{ 247, 537, -1.0 },
std::tuple<int, int, double>{ 248, 535, -1.0 },
std::tuple<int, int, double>{ 248, 536, -1.0 },
std::tuple<int, int, double>{ 248, 537, -2.0 },
std::tuple<int, int, double>{ 248, 538, -2.0 },
std::tuple<int, int, double>{ 248, 546, 1.0 },
std::tuple<int, int, double>{ 249, 63, -410.0 },
std::tuple<int, int, double>{ 249, 546, 1.0 },
std::tuple<int, int, double>{ 250, 63, -200.0 },
std::tuple<int, int, double>{ 250, 546, 1.0 },
std::tuple<int, int, double>{ 251, 23, -1.0 },
std::tuple<int, int, double>{ 251, 48, -1.0 },
std::tuple<int, int, double>{ 251, 63, 1.0 },
std::tuple<int, int, double>{ 251, 73, -1.0 },
std::tuple<int, int, double>{ 252, 401, -1.0 },
std::tuple<int, int, double>{ 252, 406, -1.0 },
std::tuple<int, int, double>{ 252, 411, -1.0 },
std::tuple<int, int, double>{ 252, 539, 1.0 },
std::tuple<int, int, double>{ 252, 540, 1.0 },
std::tuple<int, int, double>{ 253, 461, -1.0 },
std::tuple<int, int, double>{ 253, 466, -1.0 },
std::tuple<int, int, double>{ 253, 471, -1.0 },
std::tuple<int, int, double>{ 253, 541, 1.0 },
std::tuple<int, int, double>{ 253, 542, 1.0 },
std::tuple<int, int, double>{ 254, 58, -600.0 },
std::tuple<int, int, double>{ 254, 540, 1.0 },
std::tuple<int, int, double>{ 255, 58, 180.0 },
std::tuple<int, int, double>{ 255, 539, -1.0 },
std::tuple<int, int, double>{ 256, 59, -300.0 },
std::tuple<int, int, double>{ 256, 542, 1.0 },
std::tuple<int, int, double>{ 257, 59, 80.0 },
std::tuple<int, int, double>{ 257, 541, -1.0 },
std::tuple<int, int, double>{ 258, 539, -1.0 },
std::tuple<int, int, double>{ 258, 540, -1.0 },
std::tuple<int, int, double>{ 258, 541, -2.0 },
std::tuple<int, int, double>{ 258, 542, -2.0 },
std::tuple<int, int, double>{ 258, 547, 1.0 },
std::tuple<int, int, double>{ 259, 64, -320.0 },
std::tuple<int, int, double>{ 259, 547, 1.0 },
std::tuple<int, int, double>{ 260, 64, -100.0 },
std::tuple<int, int, double>{ 260, 547, 1.0 },
std::tuple<int, int, double>{ 261, 24, -1.0 },
std::tuple<int, int, double>{ 261, 49, -1.0 },
std::tuple<int, int, double>{ 261, 64, 1.0 },
std::tuple<int, int, double>{ 261, 74, -1.0 },
std::tuple<int, int, double>{ 262, 60, -1.0 },
std::tuple<int, int, double>{ 262, 61, -1.0 },
std::tuple<int, int, double>{ 262, 62, -1.0 },
std::tuple<int, int, double>{ 262, 63, -1.0 },
std::tuple<int, int, double>{ 262, 64, -1.0 },
std::tuple<int, int, double>{ 262, 65, 1.0 },
std::tuple<int, int, double>{ 262, 66, 1.0 },
std::tuple<int, int, double>{ 262, 67, 1.0 },
std::tuple<int, int, double>{ 262, 68, 1.0 },
std::tuple<int, int, double>{ 262, 69, 1.0 },
std::tuple<int, int, double>{ 263, 65, -1.0 },
std::tuple<int, int, double>{ 263, 66, 1.0 },
std::tuple<int, int, double>{ 264, 66, -1.0 },
std::tuple<int, int, double>{ 264, 67, 1.0 },
std::tuple<int, int, double>{ 265, 67, -1.0 },
std::tuple<int, int, double>{ 265, 68, 1.0 },
std::tuple<int, int, double>{ 266, 68, -1.0 },
std::tuple<int, int, double>{ 266, 69, 1.0 },
std::tuple<int, int, double>{ 267, 412, 1.0 },
std::tuple<int, int, double>{ 267, 421, 1.0 },
std::tuple<int, int, double>{ 267, 430, 1.0 },
std::tuple<int, int, double>{ 267, 439, 1.0 },
std::tuple<int, int, double>{ 267, 448, 1.0 },
std::tuple<int, int, double>{ 268, 472, 1.0 },
std::tuple<int, int, double>{ 268, 481, 1.0 },
std::tuple<int, int, double>{ 268, 490, 1.0 },
std::tuple<int, int, double>{ 268, 499, 1.0 },
std::tuple<int, int, double>{ 268, 508, 1.0 },
std::tuple<int, int, double>{ 269, 413, 1.0 },
std::tuple<int, int, double>{ 269, 422, 1.0 },
std::tuple<int, int, double>{ 269, 431, 1.0 },
std::tuple<int, int, double>{ 269, 440, 1.0 },
std::tuple<int, int, double>{ 269, 449, 1.0 },
std::tuple<int, int, double>{ 270, 473, 1.0 },
std::tuple<int, int, double>{ 270, 482, 1.0 },
std::tuple<int, int, double>{ 270, 491, 1.0 },
std::tuple<int, int, double>{ 270, 500, 1.0 },
std::tuple<int, int, double>{ 270, 509, 1.0 },
std::tuple<int, int, double>{ 271, 414, 1.0 },
std::tuple<int, int, double>{ 271, 423, 1.0 },
std::tuple<int, int, double>{ 271, 432, 1.0 },
std::tuple<int, int, double>{ 271, 441, 1.0 },
std::tuple<int, int, double>{ 271, 450, 1.0 },
std::tuple<int, int, double>{ 272, 474, 1.0 },
std::tuple<int, int, double>{ 272, 483, 1.0 },
std::tuple<int, int, double>{ 272, 492, 1.0 },
std::tuple<int, int, double>{ 272, 501, 1.0 },
std::tuple<int, int, double>{ 272, 510, 1.0 },
std::tuple<int, int, double>{ 273, 415, 1.0 },
std::tuple<int, int, double>{ 273, 424, 1.0 },
std::tuple<int, int, double>{ 273, 433, 1.0 },
std::tuple<int, int, double>{ 273, 442, 1.0 },
std::tuple<int, int, double>{ 273, 451, 1.0 },
std::tuple<int, int, double>{ 274, 475, 1.0 },
std::tuple<int, int, double>{ 274, 484, 1.0 },
std::tuple<int, int, double>{ 274, 493, 1.0 },
std::tuple<int, int, double>{ 274, 502, 1.0 },
std::tuple<int, int, double>{ 274, 511, 1.0 },
std::tuple<int, int, double>{ 275, 416, 1.0 },
std::tuple<int, int, double>{ 275, 425, 1.0 },
std::tuple<int, int, double>{ 275, 434, 1.0 },
std::tuple<int, int, double>{ 275, 443, 1.0 },
std::tuple<int, int, double>{ 275, 452, 1.0 },
std::tuple<int, int, double>{ 276, 476, 1.0 },
std::tuple<int, int, double>{ 276, 485, 1.0 },
std::tuple<int, int, double>{ 276, 494, 1.0 },
std::tuple<int, int, double>{ 276, 503, 1.0 },
std::tuple<int, int, double>{ 276, 512, 1.0 },
std::tuple<int, int, double>{ 277, 417, 1.0 },
std::tuple<int, int, double>{ 277, 426, 1.0 },
std::tuple<int, int, double>{ 277, 435, 1.0 },
std::tuple<int, int, double>{ 277, 444, 1.0 },
std::tuple<int, int, double>{ 277, 453, 1.0 },
std::tuple<int, int, double>{ 278, 477, 1.0 },
std::tuple<int, int, double>{ 278, 486, 1.0 },
std::tuple<int, int, double>{ 278, 495, 1.0 },
std::tuple<int, int, double>{ 278, 504, 1.0 },
std::tuple<int, int, double>{ 278, 513, 1.0 },
std::tuple<int, int, double>{ 279, 418, 1.0 },
std::tuple<int, int, double>{ 279, 427, 1.0 },
std::tuple<int, int, double>{ 279, 436, 1.0 },
std::tuple<int, int, double>{ 279, 445, 1.0 },
std::tuple<int, int, double>{ 279, 454, 1.0 },
std::tuple<int, int, double>{ 280, 478, 1.0 },
std::tuple<int, int, double>{ 280, 487, 1.0 },
std::tuple<int, int, double>{ 280, 496, 1.0 },
std::tuple<int, int, double>{ 280, 505, 1.0 },
std::tuple<int, int, double>{ 280, 514, 1.0 },
std::tuple<int, int, double>{ 281, 419, 1.0 },
std::tuple<int, int, double>{ 281, 428, 1.0 },
std::tuple<int, int, double>{ 281, 437, 1.0 },
std::tuple<int, int, double>{ 281, 446, 1.0 },
std::tuple<int, int, double>{ 281, 455, 1.0 },
std::tuple<int, int, double>{ 282, 479, 1.0 },
std::tuple<int, int, double>{ 282, 488, 1.0 },
std::tuple<int, int, double>{ 282, 497, 1.0 },
std::tuple<int, int, double>{ 282, 506, 1.0 },
std::tuple<int, int, double>{ 282, 515, 1.0 },
std::tuple<int, int, double>{ 283, 420, 1.0 },
std::tuple<int, int, double>{ 283, 429, 1.0 },
std::tuple<int, int, double>{ 283, 438, 1.0 },
std::tuple<int, int, double>{ 283, 447, 1.0 },
std::tuple<int, int, double>{ 283, 456, 1.0 },
std::tuple<int, int, double>{ 284, 480, 1.0 },
std::tuple<int, int, double>{ 284, 489, 1.0 },
std::tuple<int, int, double>{ 284, 498, 1.0 },
std::tuple<int, int, double>{ 284, 507, 1.0 },
std::tuple<int, int, double>{ 284, 516, 1.0 },
std::tuple<int, int, double>{ 285, 20, 1.0 },
std::tuple<int, int, double>{ 285, 45, 1.0 },
std::tuple<int, int, double>{ 285, 70, 1.0 },
std::tuple<int, int, double>{ 286, 21, 1.0 },
std::tuple<int, int, double>{ 286, 46, 1.0 },
std::tuple<int, int, double>{ 286, 71, 1.0 },
std::tuple<int, int, double>{ 287, 22, 1.0 },
std::tuple<int, int, double>{ 287, 47, 1.0 },
std::tuple<int, int, double>{ 287, 72, 1.0 },
std::tuple<int, int, double>{ 288, 23, 1.0 },
std::tuple<int, int, double>{ 288, 48, 1.0 },
std::tuple<int, int, double>{ 288, 73, 1.0 },
std::tuple<int, int, double>{ 289, 24, 1.0 },
std::tuple<int, int, double>{ 289, 49, 1.0 },
std::tuple<int, int, double>{ 289, 74, 1.0 },
};
Vec<std::string> rnames{
"2", "3", "4", "5", "6", "7", "8", "9", "10", "11",
"12", "13", "14", "15", "16", "17", "18", "19", "20", "21",
"22", "23", "24", "25", "26", "27", "28", "29", "30", "31",
"32", "33", "34", "35", "36", "37", "38", "39", "40", "41",
"42", "43", "44", "45", "46", "47", "48", "49", "50", "51",
"52", "53", "54", "55", "56", "57", "58", "59", "60", "61",
"62", "63", "64", "65", "66", "67", "68", "69", "70", "71",
"72", "73", "74", "75", "76", "77", "78", "79", "80", "81",
"82", "83", "84", "85", "86", "87", "88", "89", "90", "91",
"92", "93", "94", "95", "96", "97", "98", "99", "100", "101",
"102", "103", "104", "105", "106", "107", "108", "109", "110", "111",
"112", "113", "114", "115", "116", "117", "118", "119", "120", "121",
"122", "123", "124", "125", "126", "127", "128", "129", "130", "131",
"132", "133", "134", "135", "136", "137", "138", "139", "140", "141",
"142", "143", "144", "145", "146", "147", "148", "149", "150", "151",
"152", "153", "154", "155", "156", "157", "158", "159", "160", "161",
"162", "163", "164", "165", "166", "167", "168", "169", "170", "171",
"172", "173", "174", "175", "176", "177", "178", "179", "180", "181",
"182", "183", "184", "185", "186", "187", "188", "189", "190", "191",
"192", "193", "194", "195", "196", "197", "198", "199", "200", "201",
"202", "203", "204", "205", "206", "207", "208", "209", "210", "211",
"212", "213", "214", "215", "216", "217", "218", "219", "220", "221",
"222", "223", "224", "225", "226", "227", "228", "229", "230", "231",
"232", "233", "234", "235", "236", "237", "238", "239", "240", "241",
"242", "243", "244", "245", "246", "247", "248", "249", "250", "251",
"252", "253", "254", "255", "256", "257", "258", "259", "260", "261",
"262", "263", "264", "265", "266", "267", "268", "269", "270", "271",
"272", "273", "274", "275", "276", "277", "278", "279", "280", "281",
"282", "283", "284", "285", "286", "287", "288", "289", "290", "291",
};
Vec<std::string> cnames{
"D111", "D121", "D211", "D221", "D311", "D321", "D411", "D421",
"D511", "D521", "G11", "G21", "G31", "G41", "G51", "H11",
"H21", "H31", "H41", "H51", "B11", "B21", "B31", "B41",
"B51", "D112", "D122", "D212", "D222", "D312", "D322", "D412",
"D422", "D512", "D522", "G12", "G22", "G32", "G42", "G52",
"H12", "H22", "H32", "H42", "H52", "B12", "B22", "B32",
"B42", "B52", "D113", "D123", "D213", "D223", "D313", "D323",
"D413", "D423", "D513", "D523", "G13", "G23", "G33", "G43",
"G53", "H13", "H23", "H33", "H43", "H53", "B13", "B23",
"B33", "B43", "B53", "X1111", "X1211", "X1311", "X1411", "X1511",
"X2111", "X2211", "X2311", "X2411", "X2511", "X3111", "X3211", "X3311",
"X3411", "X3511", "Y1111", "Y1211", "Y1311", "Y1411", "Y1511", "Y1611",
"Y1711", "Y1811", "Y1911", "Y2111", "Y2211", "Y2311", "Y2411", "Y2511",
"Y2611", "Y2711", "Y2811", "Y2911", "Y3111", "Y3211", "Y3311", "Y3411",
"Y3511", "Y3611", "Y3711", "Y3811", "Y3911", "Y4111", "Y4211", "Y4311",
"Y4411", "Y4511", "Y4611", "Y4711", "Y4811", "Y4911", "Y5111", "Y5211",
"Y5311", "Y5411", "Y5511", "Y5611", "Y5711", "Y5811", "Y5911", "X1121",
"X1221", "X1321", "X1421", "X1521", "X2121", "X2221", "X2321", "X2421",
"X2521", "X3121", "X3221", "X3321", "X3421", "X3521", "Y1121", "Y1221",
"Y1321", "Y1421", "Y1521", "Y1621", "Y1721", "Y1821", "Y1921", "Y2121",
"Y2221", "Y2321", "Y2421", "Y2521", "Y2621", "Y2721", "Y2821", "Y2921",
"Y3121", "Y3221", "Y3321", "Y3421", "Y3521", "Y3621", "Y3721", "Y3821",
"Y3921", "Y4121", "Y4221", "Y4321", "Y4421", "Y4521", "Y4621", "Y4721",
"Y4821", "Y4921", "Y5121", "Y5221", "Y5321", "Y5421", "Y5521", "Y5621",
"Y5721", "Y5821", "Y5921", "S111", "S211", "S311", "S121", "S221",
"S321", "Z1111", "Z1121", "Z1211", "Z1221", "Z2111", "Z2121", "Z2211",
"Z2221", "Z3111", "Z3121", "Z3211", "Z3221", "Z4111", "Z4121", "Z4211",
"Z4221", "Z5111", "Z5121", "Z5211", "Z5221", "W11", "W21", "W31",
"W41", "W51", "Q111", "Q211", "Q311", "Q411", "Q511", "Q121",
"Q221", "Q321", "Q421", "Q521", "X1112", "X1212", "X1312", "X1412",
"X1512", "X2112", "X2212", "X2312", "X2412", "X2512", "X3112", "X3212",
"X3312", "X3412", "X3512", "Y1112", "Y1212", "Y1312", "Y1412", "Y1512",
"Y1612", "Y1712", "Y1812", "Y1912", "Y2112", "Y2212", "Y2312", "Y2412",
"Y2512", "Y2612", "Y2712", "Y2812", "Y2912", "Y3112", "Y3212", "Y3312",
"Y3412", "Y3512", "Y3612", "Y3712", "Y3812", "Y3912", "Y4112", "Y4212",
"Y4312", "Y4412", "Y4512", "Y4612", "Y4712", "Y4812", "Y4912", "Y5112",
"Y5212", "Y5312", "Y5412", "Y5512", "Y5612", "Y5712", "Y5812", "Y5912",
"X1122", "X1222", "X1322", "X1422", "X1522", "X2122", "X2222", "X2322",
"X2422", "X2522", "X3122", "X3222", "X3322", "X3422", "X3522", "Y1122",
"Y1222", "Y1322", "Y1422", "Y1522", "Y1622", "Y1722", "Y1822", "Y1922",
"Y2122", "Y2222", "Y2322", "Y2422", "Y2522", "Y2622", "Y2722", "Y2822",
"Y2922", "Y3122", "Y3222", "Y3322", "Y3422", "Y3522", "Y3622", "Y3722",
"Y3822", "Y3922", "Y4122", "Y4222", "Y4322", "Y4422", "Y4522", "Y4622",
"Y4722", "Y4822", "Y4922", "Y5122", "Y5222", "Y5322", "Y5422", "Y5522",
"Y5622", "Y5722", "Y5822", "Y5922", "S112", "S212", "S312", "S122",
"S222", "S322", "Z1112", "Z1122", "Z1212", "Z1222", "Z2112", "Z2122",
"Z2212", "Z2222", "Z3112", "Z3122", "Z3212", "Z3222", "Z4112", "Z4122",
"Z4212", "Z4222", "Z5112", "Z5122", "Z5212", "Z5222", "W12", "W22",
"W32", "W42", "W52", "Q112", "Q212", "Q312", "Q412", "Q512",
"Q122", "Q222", "Q322", "Q422", "Q522", "X1113", "X1213", "X1313",
"X1413", "X1513", "X2113", "X2213", "X2313", "X2413", "X2513", "X3113",
"X3213", "X3313", "X3413", "X3513", "Y1113", "Y1213", "Y1313", "Y1413",
"Y1513", "Y1613", "Y1713", "Y1813", "Y1913", "Y2113", "Y2213", "Y2313",
"Y2413", "Y2513", "Y2613", "Y2713", "Y2813", "Y2913", "Y3113", "Y3213",
"Y3313", "Y3413", "Y3513", "Y3613", "Y3713", "Y3813", "Y3913", "Y4113",
"Y4213", "Y4313", "Y4413", "Y4513", "Y4613", "Y4713", "Y4813", "Y4913",
"Y5113", "Y5213", "Y5313", "Y5413", "Y5513", "Y5613", "Y5713", "Y5813",
"Y5913", "X1123", "X1223", "X1323", "X1423", "X1523", "X2123", "X2223",
"X2323", "X2423", "X2523", "X3123", "X3223", "X3323", "X3423", "X3523",
"Y1123", "Y1223", "Y1323", "Y1423", "Y1523", "Y1623", "Y1723", "Y1823",
"Y1923", "Y2123", "Y2223", "Y2323", "Y2423", "Y2523", "Y2623", "Y2723",
"Y2823", "Y2923", "Y3123", "Y3223", "Y3323", "Y3423", "Y3523", "Y3623",
"Y3723", "Y3823", "Y3923", "Y4123", "Y4223", "Y4323", "Y4423", "Y4523",
"Y4623", "Y4723", "Y4823", "Y4923", "Y5123", "Y5223", "Y5323", "Y5423",
"Y5523", "Y5623", "Y5723", "Y5823", "Y5923", "S113", "S213", "S313",
"S123", "S223", "S323", "Z1113", "Z1123", "Z1213", "Z1223", "Z2113",
"Z2123", "Z2213", "Z2223", "Z3113", "Z3123", "Z3213", "Z3223", "Z4113",
"Z4123", "Z4213", "Z4223", "Z5113", "Z5123", "Z5213", "Z5223", "W13",
"W23", "W33", "W43", "W53",
};
int nCols = 548;
int nRows = 290;
ProblemBuilder<double> pb;
pb.reserve( 1315, 290, 548 );
pb.setNumRows( nRows );
pb.setNumCols( nCols );
pb.setObjAll( coeffobj );
pb.setObjOffset( 0.0 );
pb.setColLbAll( lbs );
pb.setColLbInfAll( lbInf );
pb.setColUbAll( ubs );
pb.setColUbInfAll( ubInf );
pb.setColIntegralAll( isIntegral );
pb.setRowLhsInfAll( lhsIsInf );
pb.setRowRhsInfAll( rhsIsInf );
pb.setRowLhsAll( lhs );
pb.setRowRhsAll( rhs );
pb.setRowNameAll( rnames );
pb.addEntryAll( entries );
pb.setColNameAll( cnames );
pb.setProblemName( "dcmulti.hpp" );
Problem<double> problem = pb.build();
/// PROBLEM BUILDER CODE END
return problem;
}
} // namespace instances
} // namespace papilo
#endif
| 103,796
|
C++
|
.h
| 1,791
| 50.208822
| 79
| 0.472235
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,854
|
flugpl.hpp
|
lgottwald_PaPILO/test/instances/flugpl.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef PAPILO_TEST_INSTANCES_FLUGPL
#define PAPILO_TEST_INSTANCES_FLUGPL
#include "papilo/core/Problem.hpp"
#include "papilo/core/ProblemBuilder.hpp"
namespace papilo
{
namespace instances
{
Problem<double>
flugpl()
{
/// PROBLEM BUILDER CODE
Vec<double> coeffobj{
2700.0, 1500.0, 30.0, 2700.0, 1500.0, 30.0, 2700.0, 1500.0, 30.0,
2700.0, 1500.0, 30.0, 2700.0, 1500.0, 30.0, 2700.0, 1500.0, 30.0,
};
Vec<double> lbs{
0.0, 0.0, 0.0, 57.0, 0.0, 0.0, 57.0, 0.0, 0.0,
57.0, 0.0, 0.0, 57.0, 0.0, 0.0, 57.0, 0.0, 0.0,
};
Vec<uint8_t> lbInf{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
Vec<double> ubs{
0.0, 18.0, 0.0, 75.0, 18.0, 0.0, 75.0, 18.0, 0.0,
75.0, 18.0, 0.0, 75.0, 18.0, 0.0, 75.0, 18.0, 0.0,
};
Vec<uint8_t> ubInf{
1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1,
};
Vec<uint8_t> isIntegral{
0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0,
};
Vec<uint8_t> lhsIsInf{
0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1,
};
Vec<double> lhs{
60.0, 8000.0, 0.0, 0.0, 9000.0, 0.0, 0.0, 8000.0, 0.0,
0.0, 10000.0, 0.0, 0.0, 9000.0, 0.0, 0.0, 12000.0, 0.0,
};
Vec<uint8_t> rhsIsInf{
0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0,
};
Vec<double> rhs{
60.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
};
Vec<std::tuple<int, int, double>> entries{
std::tuple<int, int, double>{ 0, 0, 1.0 },
std::tuple<int, int, double>{ 1, 0, 150.0 },
std::tuple<int, int, double>{ 1, 1, -100.0 },
std::tuple<int, int, double>{ 1, 2, 1.0 },
std::tuple<int, int, double>{ 2, 0, -20.0 },
std::tuple<int, int, double>{ 2, 2, 1.0 },
std::tuple<int, int, double>{ 3, 0, 0.9 },
std::tuple<int, int, double>{ 3, 1, 1.0 },
std::tuple<int, int, double>{ 3, 3, -1.0 },
std::tuple<int, int, double>{ 4, 3, 150.0 },
std::tuple<int, int, double>{ 4, 4, -100.0 },
std::tuple<int, int, double>{ 4, 5, 1.0 },
std::tuple<int, int, double>{ 5, 3, -20.0 },
std::tuple<int, int, double>{ 5, 5, 1.0 },
std::tuple<int, int, double>{ 6, 3, 0.9 },
std::tuple<int, int, double>{ 6, 4, 1.0 },
std::tuple<int, int, double>{ 6, 6, -1.0 },
std::tuple<int, int, double>{ 7, 6, 150.0 },
std::tuple<int, int, double>{ 7, 7, -100.0 },
std::tuple<int, int, double>{ 7, 8, 1.0 },
std::tuple<int, int, double>{ 8, 6, -20.0 },
std::tuple<int, int, double>{ 8, 8, 1.0 },
std::tuple<int, int, double>{ 9, 6, 0.9 },
std::tuple<int, int, double>{ 9, 7, 1.0 },
std::tuple<int, int, double>{ 9, 9, -1.0 },
std::tuple<int, int, double>{ 10, 9, 150.0 },
std::tuple<int, int, double>{ 10, 10, -100.0 },
std::tuple<int, int, double>{ 10, 11, 1.0 },
std::tuple<int, int, double>{ 11, 9, -20.0 },
std::tuple<int, int, double>{ 11, 11, 1.0 },
std::tuple<int, int, double>{ 12, 9, 0.9 },
std::tuple<int, int, double>{ 12, 10, 1.0 },
std::tuple<int, int, double>{ 12, 12, -1.0 },
std::tuple<int, int, double>{ 13, 12, 150.0 },
std::tuple<int, int, double>{ 13, 13, -100.0 },
std::tuple<int, int, double>{ 13, 14, 1.0 },
std::tuple<int, int, double>{ 14, 12, -20.0 },
std::tuple<int, int, double>{ 14, 14, 1.0 },
std::tuple<int, int, double>{ 15, 12, 0.9 },
std::tuple<int, int, double>{ 15, 13, 1.0 },
std::tuple<int, int, double>{ 15, 15, -1.0 },
std::tuple<int, int, double>{ 16, 15, 150.0 },
std::tuple<int, int, double>{ 16, 16, -100.0 },
std::tuple<int, int, double>{ 16, 17, 1.0 },
std::tuple<int, int, double>{ 17, 15, -20.0 },
std::tuple<int, int, double>{ 17, 17, 1.0 },
};
Vec<std::string> rnames{
"ANZ1", "STD1", "UEB1", "ANZ2", "STD2", "UEB2", "ANZ3", "STD3", "UEB3",
"ANZ4", "STD4", "UEB4", "ANZ5", "STD5", "UEB5", "ANZ6", "STD6", "UEB6",
};
Vec<std::string> cnames{
"STM1", "ANM1", "UE1", "STM2", "ANM2", "UE2", "STM3", "ANM3", "UE3",
"STM4", "ANM4", "UE4", "STM5", "ANM5", "UE5", "STM6", "ANM6", "UE6",
};
int nCols = 18;
int nRows = 18;
ProblemBuilder<double> pb;
pb.reserve( 46, 18, 18 );
pb.setNumRows( nRows );
pb.setNumCols( nCols );
pb.setObjAll( coeffobj );
pb.setObjOffset( 0.0 );
pb.setColLbAll( lbs );
pb.setColLbInfAll( lbInf );
pb.setColUbAll( ubs );
pb.setColUbInfAll( ubInf );
pb.setColIntegralAll( isIntegral );
pb.setRowLhsInfAll( lhsIsInf );
pb.setRowRhsInfAll( rhsIsInf );
pb.setRowLhsAll( lhs );
pb.setRowRhsAll( rhs );
pb.setRowNameAll( rnames );
pb.addEntryAll( entries );
pb.setColNameAll( cnames );
pb.setProblemName( "flugpl.hpp" );
Problem<double> problem = pb.build();
/// PROBLEM BUILDER CODE END
return problem;
}
} // namespace instances
} // namespace papilo
#endif
| 6,794
|
C++
|
.h
| 153
| 39.385621
| 79
| 0.485228
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,855
|
misc03.hpp
|
lgottwald_PaPILO/test/instances/misc03.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef PAPILO_TEST_INSTANCES_MISC03
#define PAPILO_TEST_INSTANCES_MISC03
#include "papilo/core/Problem.hpp"
#include "papilo/core/ProblemBuilder.hpp"
namespace papilo
{
namesp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1.0, 200.0, 200.0, 200.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
};
Vec<std::tuple<int, int, double>> entries{
std::tuple<int, int, double>{ 0, 3, -205.0 },
std::tuple<int, int, double>{ 0, 4, -205.0 },
std::tuple<int, int, double>{ 0, 5, -205.0 },
std::tuple<int, int, double>{ 0, 6, -550.0 },
std::tuple<int, int, double>{ 0, 7, -550.0 },
std::tuple<int, int, double>{ 0, 8, -550.0 },
std::tuple<int, int, double>{ 0, 9, -490.0 },
std::tuple<int, int, double>{ 0, 10, -490.0 },
std::tuple<int, int, double>{ 0, 11, -490.0 },
std::tuple<int, int, double>{ 0, 12, -660.0 },
std::tuple<int, int, double>{ 0, 13, -660.0 },
std::tuple<int, int, double>{ 0, 14, -660.0 },
std::tuple<int, int, double>{ 0, 15, -425.0 },
std::tuple<int, int, double>{ 0, 16, -425.0 },
std::tuple<int, int, double>{ 0, 17, -425.0 },
std::tuple<int, int, double>{ 0, 18, -425.0 },
std::tuple<int, int, double>{ 0, 19, -425.0 },
std::tuple<int, int, double>{ 0, 20, -425.0 },
std::tuple<int, int, double>{ 0, 21, -205.0 },
std::tuple<int, int, double>{ 0, 22, -205.0 },
std::tuple<int, int, double>{ 0, 23, -205.0 },
std::tuple<int, int, double>{ 0, 27, -350.0 },
std::tuple<int, int, double>{ 0, 28, -350.0 },
std::tuple<int, int, double>{ 0, 29, -350.0 },
std::tuple<int, int, double>{ 0, 30, -500.0 },
std::tuple<int, int, double>{ 0, 31, -500.0 },
std::tuple<int, int, double>{ 0, 32, -500.0 },
std::tuple<int, int, double>{ 0, 33, -760.0 },
std::tuple<int, int, double>{ 0, 34, -760.0 },
std::tuple<int, int, double>{ 0, 35, -760.0 },
std::tuple<int, int, double>{ 0, 36, -570.0 },
std::tuple<int, int, double>{ 0, 37, -570.0 },
std::tuple<int, int, double>{ 0, 38, -570.0 },
std::tuple<int, int, double>{ 0, 39, -285.0 },
std::tuple<int, int, double>{ 0, 40, -285.0 },
std::tuple<int, int, double>{ 0, 41, -285.0 },
std::tuple<int, int, double>{ 0, 42, -550.0 },
std::tuple<int, int, double>{ 0, 43, -550.0 },
std::tuple<int, int, double>{ 0, 44, -550.0 },
std::tuple<int, int, double>{ 0, 45, -350.0 },
std::tuple<int, int, double>{ 0, 46, -350.0 },
std::tuple<int, int, double>{ 0, 47, -350.0 },
std::tuple<int, int, double>{ 0, 51, -610.0 },
std::tuple<int, int, double>{ 0, 52, -610.0 },
std::tuple<int, int, double>{ 0, 53, -610.0 },
std::tuple<int, int, double>{ 0, 54, -955.0 },
std::tuple<int, int, double>{ 0, 55, -955.0 },
std::tuple<int, int, double>{ 0, 56, -955.0 },
std::tuple<int, int, double>{ 0, 57, -830.0 },
std::tuple<int, int, double>{ 0, 58, -830.0 },
std::tuple<int, int, double>{ 0, 59, -830.0 },
std::tuple<int, int, double>{ 0, 60, -250.0 },
std::tuple<int, int, double>{ 0, 61, -250.0 },
std::tuple<int, int, double>{ 0, 62, -250.0 },
std::tuple<int, int, double>{ 0, 63, -490.0 },
std::tuple<int, int, double>{ 0, 64, -490.0 },
std::tuple<int, int, double>{ 0, 65, -490.0 },
std::tuple<int, int, double>{ 0, 66, -500.0 },
std::tuple<int, int, double>{ 0, 67, -500.0 },
std::tuple<int, int, double>{ 0, 68, -500.0 },
std::tuple<int, int, double>{ 0, 69, -610.0 },
std::tuple<int, int, double>{ 0, 70, -610.0 },
std::tuple<int, int, double>{ 0, 71, -610.0 },
std::tuple<int, int, double>{ 0, 75, -360.0 },
std::tuple<int, int, double>{ 0, 76, -360.0 },
std::tuple<int, int, double>{ 0, 77, -360.0 },
std::tuple<int, int, double>{ 0, 78, -355.0 },
std::tuple<int, int, double>{ 0, 79, -355.0 },
std::tuple<int, int, double>{ 0, 80, -355.0 },
std::tuple<int, int, double>{ 0, 81, -360.0 },
std::tuple<int, int, double>{ 0, 82, -360.0 },
std::tuple<int, int, double>{ 0, 83, -360.0 },
std::tuple<int, int, double>{ 0, 84, -660.0 },
std::tuple<int, int, double>{ 0, 85, -660.0 },
std::tuple<int, int, double>{ 0, 86, -660.0 },
std::tuple<int, int, double>{ 0, 87, -760.0 },
std::tuple<int, int, double>{ 0, 88, -760.0 },
std::tuple<int, int, double>{ 0, 89, -760.0 },
std::tuple<int, int, double>{ 0, 90, -955.0 },
std::tuple<int, int, double>{ 0, 91, -955.0 },
std::tuple<int, int, double>{ 0, 92, -955.0 },
std::tuple<int, int, double>{ 0, 93, -360.0 },
std::tuple<int, int, double>{ 0, 94, -360.0 },
std::tuple<int, int, double>{ 0, 95, -360.0 },
std::tuple<int, int, double>{ 0, 99, -255.0 },
std::tuple<int, int, double>{ 0, 100, -255.0 },
std::tuple<int, int, double>{ 0, 101, -255.0 },
std::tuple<int, int, double>{ 0, 102, -705.0 },
std::tuple<int, int, double>{ 0, 103, -705.0 },
std::tuple<int, int, double>{ 0, 104, -705.0 },
std::tuple<int, int, double>{ 0, 105, -425.0 },
std::tuple<int, int, double>{ 0, 106, -425.0 },
std::tuple<int, int, double>{ 0, 107, -425.0 },
std::tuple<int, int, double>{ 0, 108, -570.0 },
std::tuple<int, int, double>{ 0, 109, -570.0 },
std::tuple<int, int, double>{ 0, 110, -570.0 },
std::tuple<int, int, double>{ 0, 111, -830.0 },
std::tuple<int, int, double>{ 0, 112, -830.0 },
std::tuple<int, int, double>{ 0, 113, -830.0 },
std::tuple<int, int, double>{ 0, 114, -355.0 },
std::tuple<int, int, double>{ 0, 115, -355.0 },
std::tuple<int, int, double>{ 0, 116, -355.0 },
std::tuple<int, int, double>{ 0, 117, -255.0 },
std::tuple<int, int, double>{ 0, 118, -255.0 },
std::tuple<int, int, double>{ 0, 119, -255.0 },
std::tuple<int, int, double>{ 0, 123, -605.0 },
std::tuple<int, int, double>{ 0, 124, -605.0 },
std::tuple<int, int, double>{ 0, 125, -605.0 },
std::tuple<int, int, double>{ 0, 126, -425.0 },
std::tuple<int, int, double>{ 0, 127, -425.0 },
std::tuple<int, int, double>{ 0, 128, -425.0 },
std::tuple<int, int, double>{ 0, 129, -285.0 },
std::tuple<int, int, double>{ 0, 130, -285.0 },
std::tuple<int, int, double>{ 0, 131, -285.0 },
std::tuple<int, int, double>{ 0, 132, -250.0 },
std::tuple<int, int, double>{ 0, 133, -250.0 },
std::tuple<int, int, double>{ 0, 134, -250.0 },
std::tuple<int, int, double>{ 0, 135, -360.0 },
std::tuple<int, int, double>{ 0, 136, -360.0 },
std::tuple<int, int, double>{ 0, 137, -360.0 },
std::tuple<int, int, double>{ 0, 138, -705.0 },
std::tuple<int, int, double>{ 0, 139, -705.0 },
std::tuple<int, int, double>{ 0, 140, -705.0 },
std::tuple<int, int, double>{ 0, 141, -605.0 },
std::tuple<int, int, double>{ 0, 142, -605.0 },
std::tuple<int, int, double>{ 0, 143, -605.0 },
std::tuple<int, int, double>{ 0, 147, -300.0 },
std::tuple<int, int, double>{ 0, 148, -300.0 },
std::tuple<int, int, double>{ 0, 149, -75.0 },
std::tuple<int, int, double>{ 0, 150, -75.0 },
std::tuple<int, int, double>{ 0, 151, -75.0 },
std::tuple<int, int, double>{ 0, 152, -75.0 },
std::tuple<int, int, double>{ 0, 153, -75.0 },
std::tuple<int, int, double>{ 0, 154, -75.0 },
std::tuple<int, int, double>{ 0, 155, -75.0 },
std::tuple<int, int, double>{ 0, 156, -75.0 },
std::tuple<int, int, double>{ 0, 157, -75.0 },
std::tuple<int, int, double>{ 0, 158, -75.0 },
std::tuple<int, int, double>{ 0, 159, 1.0 },
std::tuple<int, int, double>{ 1, 0, 1.0 },
std::tuple<int, int, double>{ 1, 1, 1.0 },
std::tuple<int, int, double>{ 1, 2, 1.0 },
std::tuple<int, int, double>{ 1, 3, 1.0 },
std::tuple<int, int, double>{ 1, 4, 1.0 },
std::tuple<int, int, double>{ 1, 5, 1.0 },
std::tuple<int, int, double>{ 1, 6, 1.0 },
std::tuple<int, int, double>{ 1, 7, 1.0 },
std::tuple<int, int, double>{ 1, 8, 1.0 },
std::tuple<int, int, double>{ 1, 9, 1.0 },
std::tuple<int, int, double>{ 1, 10, 1.0 },
std::tuple<int, int, double>{ 1, 11, 1.0 },
std::tuple<int, int, double>{ 1, 12, 1.0 },
std::tuple<int, int, double>{ 1, 13, 1.0 },
std::tuple<int, int, double>{ 1, 14, 1.0 },
std::tuple<int, int, double>{ 1, 15, 1.0 },
std::tuple<int, int, double>{ 1, 16, 1.0 },
std::tuple<int, int, double>{ 1, 17, 1.0 },
std::tuple<int, int, double>{ 1, 18, 1.0 },
std::tuple<int, int, double>{ 1, 19, 1.0 },
std::tuple<int, int, double>{ 1, 20, 1.0 },
std::tuple<int, int, double>{ 2, 21, 1.0 },
std::tuple<int, int, double>{ 2, 22, 1.0 },
std::tuple<int, int, double>{ 2, 23, 1.0 },
std::tuple<int, int, double>{ 2, 24, 1.0 },
std::tuple<int, int, double>{ 2, 25, 1.0 },
std::tuple<int, int, double>{ 2, 26, 1.0 },
std::tuple<int, int, double>{ 2, 27, 1.0 },
std::tuple<int, int, double>{ 2, 28, 1.0 },
std::tuple<int, int, double>{ 2, 29, 1.0 },
std::tuple<int, int, double>{ 2, 30, 1.0 },
std::tuple<int, int, double>{ 2, 31, 1.0 },
std::tuple<int, int, double>{ 2, 32, 1.0 },
std::tuple<int, int, double>{ 2, 33, 1.0 },
std::tuple<int, int, double>{ 2, 34, 1.0 },
std::tuple<int, int, double>{ 2, 35, 1.0 },
std::tuple<int, int, double>{ 2, 36, 1.0 },
std::tuple<int, int, double>{ 2, 37, 1.0 },
std::tuple<int, int, double>{ 2, 38, 1.0 },
std::tuple<int, int, double>{ 2, 39, 1.0 },
std::tuple<int, int, double>{ 2, 40, 1.0 },
std::tuple<int, int, double>{ 2, 41, 1.0 },
std::tuple<int, int, double>{ 3, 42, 1.0 },
std::tuple<int, int, double>{ 3, 43, 1.0 },
std::tuple<int, int, double>{ 3, 44, 1.0 },
std::tuple<int, int, double>{ 3, 45, 1.0 },
std::tuple<int, int, double>{ 3, 46, 1.0 },
std::tuple<int, int, double>{ 3, 47, 1.0 },
std::tuple<int, int, double>{ 3, 48, 1.0 },
std::tuple<int, int, double>{ 3, 49, 1.0 },
std::tuple<int, int, double>{ 3, 50, 1.0 },
std::tuple<int, int, double>{ 3, 51, 1.0 },
std::tuple<int, int, double>{ 3, 52, 1.0 },
std::tuple<int, int, double>{ 3, 53, 1.0 },
std::tuple<int, int, double>{ 3, 54, 1.0 },
std::tuple<int, int, double>{ 3, 55, 1.0 },
std::tuple<int, int, double>{ 3, 56, 1.0 },
std::tuple<int, int, double>{ 3, 57, 1.0 },
std::tuple<int, int, double>{ 3, 58, 1.0 },
std::tuple<int, int, double>{ 3, 59, 1.0 },
std::tuple<int, int, double>{ 3, 60, 1.0 },
std::tuple<int, int, double>{ 3, 61, 1.0 },
std::tuple<int, int, double>{ 3, 62, 1.0 },
std::tuple<int, int, double>{ 4, 63, 1.0 },
std::tuple<int, int, double>{ 4, 64, 1.0 },
std::tuple<int, int, double>{ 4, 65, 1.0 },
std::tuple<int, int, double>{ 4, 66, 1.0 },
std::tuple<int, int, double>{ 4, 67, 1.0 },
std::tuple<int, int, double>{ 4, 68, 1.0 },
std::tuple<int, int, double>{ 4, 69, 1.0 },
std::tuple<int, int, double>{ 4, 70, 1.0 },
std::tuple<int, int, double>{ 4, 71, 1.0 },
std::tuple<int, int, double>{ 4, 72, 1.0 },
std::tuple<int, int, double>{ 4, 73, 1.0 },
std::tuple<int, int, double>{ 4, 74, 1.0 },
std::tuple<int, int, double>{ 4, 75, 1.0 },
std::tuple<int, int, double>{ 4, 76, 1.0 },
std::tuple<int, int, double>{ 4, 77, 1.0 },
std::tuple<int, int, double>{ 4, 78, 1.0 },
std::tuple<int, int, double>{ 4, 79, 1.0 },
std::tuple<int, int, double>{ 4, 80, 1.0 },
std::tuple<int, int, double>{ 4, 81, 1.0 },
std::tuple<int, int, double>{ 4, 82, 1.0 },
std::tuple<int, int, double>{ 4, 83, 1.0 },
std::tuple<int, int, double>{ 5, 84, 1.0 },
std::tuple<int, int, double>{ 5, 85, 1.0 },
std::tuple<int, int, double>{ 5, 86, 1.0 },
std::tuple<int, int, double>{ 5, 87, 1.0 },
std::tuple<int, int, double>{ 5, 88, 1.0 },
std::tuple<int, int, double>{ 5, 89, 1.0 },
std::tuple<int, int, double>{ 5, 90, 1.0 },
std::tuple<int, int, double>{ 5, 91, 1.0 },
std::tuple<int, int, double>{ 5, 92, 1.0 },
std::tuple<int, int, double>{ 5, 93, 1.0 },
std::tuple<int, int, double>{ 5, 94, 1.0 },
std::tuple<int, int, double>{ 5, 95, 1.0 },
std::tuple<int, int, double>{ 5, 96, 1.0 },
std::tuple<int, int, double>{ 5, 97, 1.0 },
std::tuple<int, int, double>{ 5, 98, 1.0 },
std::tuple<int, int, double>{ 5, 99, 1.0 },
std::tuple<int, int, double>{ 5, 100, 1.0 },
std::tuple<int, int, double>{ 5, 101, 1.0 },
std::tuple<int, int, double>{ 5, 102, 1.0 },
std::tuple<int, int, double>{ 5, 103, 1.0 },
std::tuple<int, int, double>{ 5, 104, 1.0 },
std::tuple<int, int, double>{ 6, 0, 100.0 },
std::tuple<int, int, double>{ 6, 3, 100.0 },
std::tuple<int, int, double>{ 6, 6, 100.0 },
std::tuple<int, int, double>{ 6, 9, 100.0 },
std::tuple<int, int, double>{ 6, 12, 100.0 },
std::tuple<int, int, double>{ 6, 15, 100.0 },
std::tuple<int, int, double>{ 6, 18, 100.0 },
std::tuple<int, int, double>{ 6, 21, 100.0 },
std::tuple<int, int, double>{ 6, 24, 100.0 },
std::tuple<int, int, double>{ 6, 27, 100.0 },
std::tuple<int, int, double>{ 6, 30, 100.0 },
std::tuple<int, int, double>{ 6, 33, 100.0 },
std::tuple<int, int, double>{ 6, 36, 100.0 },
std::tuple<int, int, double>{ 6, 39, 100.0 },
std::tuple<int, int, double>{ 6, 42, 100.0 },
std::tuple<int, int, double>{ 6, 45, 100.0 },
std::tuple<int, int, double>{ 6, 48, 100.0 },
std::tuple<int, int, double>{ 6, 51, 100.0 },
std::tuple<int, int, double>{ 6, 54, 100.0 },
std::tuple<int, int, double>{ 6, 57, 100.0 },
std::tuple<int, int, double>{ 6, 60, 100.0 },
std::tuple<int, int, double>{ 6, 63, 100.0 },
std::tuple<int, int, double>{ 6, 66, 100.0 },
std::tuple<int, int, double>{ 6, 69, 100.0 },
std::tuple<int, int, double>{ 6, 72, 100.0 },
std::tuple<int, int, double>{ 6, 75, 100.0 },
std::tuple<int, int, double>{ 6, 78, 100.0 },
std::tuple<int, int, double>{ 6, 81, 100.0 },
std::tuple<int, int, double>{ 6, 84, 100.0 },
std::tuple<int, int, double>{ 6, 87, 100.0 },
std::tuple<int, int, double>{ 6, 90, 100.0 },
std::tuple<int, int, double>{ 6, 93, 100.0 },
std::tuple<int, int, double>{ 6, 96, 100.0 },
std::tuple<int, int, double>{ 6, 99, 100.0 },
std::tuple<int, int, double>{ 6, 102, 100.0 },
std::tuple<int, int, double>{ 7, 1, 100.0 },
std::tuple<int, int, double>{ 7, 4, 100.0 },
std::tuple<int, int, double>{ 7, 7, 100.0 },
std::tuple<int, int, double>{ 7, 10, 100.0 },
std::tuple<int, int, double>{ 7, 13, 100.0 },
std::tuple<int, int, double>{ 7, 16, 100.0 },
std::tuple<int, int, double>{ 7, 19, 100.0 },
std::tuple<int, int, double>{ 7, 22, 100.0 },
std::tuple<int, int, double>{ 7, 25, 100.0 },
std::tuple<int, int, double>{ 7, 28, 100.0 },
std::tuple<int, int, double>{ 7, 31, 100.0 },
std::tuple<int, int, double>{ 7, 34, 100.0 },
std::tuple<int, int, double>{ 7, 37, 100.0 },
std::tuple<int, int, double>{ 7, 40, 100.0 },
std::tuple<int, int, double>{ 7, 43, 100.0 },
std::tuple<int, int, double>{ 7, 46, 100.0 },
std::tuple<int, int, double>{ 7, 49, 100.0 },
std::tuple<int, int, double>{ 7, 52, 100.0 },
std::tuple<int, int, double>{ 7, 55, 100.0 },
std::tuple<int, int, double>{ 7, 58, 100.0 },
std::tuple<int, int, double>{ 7, 61, 100.0 },
std::tuple<int, int, double>{ 7, 64, 100.0 },
std::tuple<int, int, double>{ 7, 67, 100.0 },
std::tuple<int, int, double>{ 7, 70, 100.0 },
std::tuple<int, int, double>{ 7, 73, 100.0 },
std::tuple<int, int, double>{ 7, 76, 100.0 },
std::tuple<int, int, double>{ 7, 79, 100.0 },
std::tuple<int, int, double>{ 7, 82, 100.0 },
std::tuple<int, int, double>{ 7, 85, 100.0 },
std::tuple<int, int, double>{ 7, 88, 100.0 },
std::tuple<int, int, double>{ 7, 91, 100.0 },
std::tuple<int, int, double>{ 7, 94, 100.0 },
std::tuple<int, int, double>{ 7, 97, 100.0 },
std::tuple<int, int, double>{ 7, 100, 100.0 },
std::tuple<int, int, double>{ 7, 103, 100.0 },
std::tuple<int, int, double>{ 8, 2, 100.0 },
std::tuple<int, int, double>{ 8, 5, 100.0 },
std::tuple<int, int, double>{ 8, 8, 100.0 },
std::tuple<int, int, double>{ 8, 11, 100.0 },
std::tuple<int, int, double>{ 8, 14, 100.0 },
std::tuple<int, int, double>{ 8, 17, 100.0 },
std::tuple<int, int, double>{ 8, 20, 100.0 },
std::tuple<int, int, double>{ 8, 23, 100.0 },
std::tuple<int, int, double>{ 8, 26, 100.0 },
std::tuple<int, int, double>{ 8, 29, 100.0 },
std::tuple<int, int, double>{ 8, 32, 100.0 },
std::tuple<int, int, double>{ 8, 35, 100.0 },
std::tuple<int, int, double>{ 8, 38, 100.0 },
std::tuple<int, int, double>{ 8, 41, 100.0 },
std::tuple<int, int, double>{ 8, 44, 100.0 },
std::tuple<int, int, double>{ 8, 47, 100.0 },
std::tuple<int, int, double>{ 8, 50, 100.0 },
std::tuple<int, int, double>{ 8, 53, 100.0 },
std::tuple<int, int, double>{ 8, 56, 100.0 },
std::tuple<int, int, double>{ 8, 59, 100.0 },
std::tuple<int, int, double>{ 8, 62, 100.0 },
std::tuple<int, int, double>{ 8, 65, 100.0 },
std::tuple<int, int, double>{ 8, 68, 100.0 },
std::tuple<int, int, double>{ 8, 71, 100.0 },
std::tuple<int, int, double>{ 8, 74, 100.0 },
std::tuple<int, int, double>{ 8, 77, 100.0 },
std::tuple<int, int, double>{ 8, 80, 100.0 },
std::tuple<int, int, double>{ 8, 83, 100.0 },
std::tuple<int, int, double>{ 8, 86, 100.0 },
std::tuple<int, int, double>{ 8, 89, 100.0 },
std::tuple<int, int, double>{ 8, 92, 100.0 },
std::tuple<int, int, double>{ 8, 95, 100.0 },
std::tuple<int, int, double>{ 8, 98, 100.0 },
std::tuple<int, int, double>{ 8, 101, 100.0 },
std::tuple<int, int, double>{ 8, 104, 100.0 },
std::tuple<int, int, double>{ 9, 3, 1.0 },
std::tuple<int, int, double>{ 9, 4, 1.0 },
std::tuple<int, int, double>{ 9, 5, 1.0 },
std::tuple<int, int, double>{ 9, 6, 1.0 },
std::tuple<int, int, double>{ 9, 7, 1.0 },
std::tuple<int, int, double>{ 9, 8, 1.0 },
std::tuple<int, int, double>{ 9, 9, 1.0 },
std::tuple<int, int, double>{ 9, 10, 1.0 },
std::tuple<int, int, double>{ 9, 11, 1.0 },
std::tuple<int, int, double>{ 9, 12, 1.0 },
std::tuple<int, int, double>{ 9, 13, 1.0 },
std::tuple<int, int, double>{ 9, 14, 1.0 },
std::tuple<int, int, double>{ 9, 108, 1.0 },
std::tuple<int, int, double>{ 9, 109, 1.0 },
std::tuple<int, int, double>{ 9, 110, 1.0 },
std::tuple<int, int, double>{ 9, 111, 1.0 },
std::tuple<int, int, double>{ 9, 112, 1.0 },
std::tuple<int, int, double>{ 9, 113, 1.0 },
std::tuple<int, int, double>{ 9, 114, 1.0 },
std::tuple<int, int, double>{ 9, 115, 1.0 },
std::tuple<int, int, double>{ 9, 116, 1.0 },
std::tuple<int, int, double>{ 9, 117, 1.0 },
std::tuple<int, int, double>{ 9, 118, 1.0 },
std::tuple<int, int, double>{ 9, 119, 1.0 },
std::tuple<int, int, double>{ 9, 129, 1.0 },
std::tuple<int, int, double>{ 9, 130, 1.0 },
std::tuple<int, int, double>{ 9, 131, 1.0 },
std::tuple<int, int, double>{ 9, 132, 1.0 },
std::tuple<int, int, double>{ 9, 133, 1.0 },
std::tuple<int, int, double>{ 9, 134, 1.0 },
std::tuple<int, int, double>{ 9, 135, 1.0 },
std::tuple<int, int, double>{ 9, 136, 1.0 },
std::tuple<int, int, double>{ 9, 137, 1.0 },
std::tuple<int, int, double>{ 9, 138, 1.0 },
std::tuple<int, int, double>{ 9, 139, 1.0 },
std::tuple<int, int, double>{ 9, 140, 1.0 },
std::tuple<int, int, double>{ 10, 21, 1.0 },
std::tuple<int, int, double>{ 10, 22, 1.0 },
std::tuple<int, int, double>{ 10, 23, 1.0 },
std::tuple<int, int, double>{ 10, 27, 1.0 },
std::tuple<int, int, double>{ 10, 28, 1.0 },
std::tuple<int, int, double>{ 10, 29, 1.0 },
std::tuple<int, int, double>{ 10, 30, 1.0 },
std::tuple<int, int, double>{ 10, 31, 1.0 },
std::tuple<int, int, double>{ 10, 32, 1.0 },
std::tuple<int, int, double>{ 10, 33, 1.0 },
std::tuple<int, int, double>{ 10, 34, 1.0 },
std::tuple<int, int, double>{ 10, 35, 1.0 },
std::tuple<int, int, double>{ 10, 105, 1.0 },
std::tuple<int, int, double>{ 10, 106, 1.0 },
std::tuple<int, int, double>{ 10, 107, 1.0 },
std::tuple<int, int, double>{ 10, 111, 1.0 },
std::tuple<int, int, double>{ 10, 112, 1.0 },
std::tuple<int, int, double>{ 10, 113, 1.0 },
std::tuple<int, int, double>{ 10, 114, 1.0 },
std::tuple<int, int, double>{ 10, 115, 1.0 },
std::tuple<int, int, double>{ 10, 116, 1.0 },
std::tuple<int, int, double>{ 10, 117, 1.0 },
std::tuple<int, int, double>{ 10, 118, 1.0 },
std::tuple<int, int, double>{ 10, 119, 1.0 },
std::tuple<int, int, double>{ 10, 126, 1.0 },
std::tuple<int, int, double>{ 10, 127, 1.0 },
std::tuple<int, int, double>{ 10, 128, 1.0 },
std::tuple<int, int, double>{ 10, 132, 1.0 },
std::tuple<int, int, double>{ 10, 133, 1.0 },
std::tuple<int, int, double>{ 10, 134, 1.0 },
std::tuple<int, int, double>{ 10, 135, 1.0 },
std::tuple<int, int, double>{ 10, 136, 1.0 },
std::tuple<int, int, double>{ 10, 137, 1.0 },
std::tuple<int, int, double>{ 10, 138, 1.0 },
std::tuple<int, int, double>{ 10, 139, 1.0 },
std::tuple<int, int, double>{ 10, 140, 1.0 },
std::tuple<int, int, double>{ 11, 6, 1.0 },
std::tuple<int, int, double>{ 11, 7, 1.0 },
std::tuple<int, int, double>{ 11, 8, 1.0 },
std::tuple<int, int, double>{ 11, 9, 1.0 },
std::tuple<int, int, double>{ 11, 10, 1.0 },
std::tuple<int, int, double>{ 11, 11, 1.0 },
std::tuple<int, int, double>{ 11, 12, 1.0 },
std::tuple<int, int, double>{ 11, 13, 1.0 },
std::tuple<int, int, double>{ 11, 14, 1.0 },
std::tuple<int, int, double>{ 11, 27, 1.0 },
std::tuple<int, int, double>{ 11, 28, 1.0 },
std::tuple<int, int, double>{ 11, 29, 1.0 },
std::tuple<int, int, double>{ 11, 30, 1.0 },
std::tuple<int, int, double>{ 11, 31, 1.0 },
std::tuple<int, int, double>{ 11, 32, 1.0 },
std::tuple<int, int, double>{ 11, 33, 1.0 },
std::tuple<int, int, double>{ 11, 34, 1.0 },
std::tuple<int, int, double>{ 11, 35, 1.0 },
std::tuple<int, int, double>{ 11, 111, 1.0 },
std::tuple<int, int, double>{ 11, 112, 1.0 },
std::tuple<int, int, double>{ 11, 113, 1.0 },
std::tuple<int, int, double>{ 11, 114, 1.0 },
std::tuple<int, int, double>{ 11, 115, 1.0 },
std::tuple<int, int, double>{ 11, 116, 1.0 },
std::tuple<int, int, double>{ 11, 117, 1.0 },
std::tuple<int, int, double>{ 11, 118, 1.0 },
std::tuple<int, int, double>{ 11, 119, 1.0 },
std::tuple<int, int, double>{ 11, 132, 1.0 },
std::tuple<int, int, double>{ 11, 133, 1.0 },
std::tuple<int, int, double>{ 11, 134, 1.0 },
std::tuple<int, int, double>{ 11, 135, 1.0 },
std::tuple<int, int, double>{ 11, 136, 1.0 },
std::tuple<int, int, double>{ 11, 137, 1.0 },
std::tuple<int, int, double>{ 11, 138, 1.0 },
std::tuple<int, int, double>{ 11, 139, 1.0 },
std::tuple<int, int, double>{ 11, 140, 1.0 },
std::tuple<int, int, double>{ 12, 42, 1.0 },
std::tuple<int, int, double>{ 12, 43, 1.0 },
std::tuple<int, int, double>{ 12, 44, 1.0 },
std::tuple<int, int, double>{ 12, 45, 1.0 },
std::tuple<int, int, double>{ 12, 46, 1.0 },
std::tuple<int, int, double>{ 12, 47, 1.0 },
std::tuple<int, int, double>{ 12, 51, 1.0 },
std::tuple<int, int, double>{ 12, 52, 1.0 },
std::tuple<int, int, double>{ 12, 53, 1.0 },
std::tuple<int, int, double>{ 12, 54, 1.0 },
std::tuple<int, int, double>{ 12, 55, 1.0 },
std::tuple<int, int, double>{ 12, 56, 1.0 },
std::tuple<int, int, double>{ 12, 105, 1.0 },
std::tuple<int, int, double>{ 12, 106, 1.0 },
std::tuple<int, int, double>{ 12, 107, 1.0 },
std::tuple<int, int, double>{ 12, 108, 1.0 },
std::tuple<int, int, double>{ 12, 109, 1.0 },
std::tuple<int, int, double>{ 12, 110, 1.0 },
std::tuple<int, int, double>{ 12, 114, 1.0 },
std::tuple<int, int, double>{ 12, 115, 1.0 },
std::tuple<int, int, double>{ 12, 116, 1.0 },
std::tuple<int, int, double>{ 12, 117, 1.0 },
std::tuple<int, int, double>{ 12, 118, 1.0 },
std::tuple<int, int, double>{ 12, 119, 1.0 },
std::tuple<int, int, double>{ 12, 126, 1.0 },
std::tuple<int, int, double>{ 12, 127, 1.0 },
std::tuple<int, int, double>{ 12, 128, 1.0 },
std::tuple<int, int, double>{ 12, 129, 1.0 },
std::tuple<int, int, double>{ 12, 130, 1.0 },
std::tuple<int, int, double>{ 12, 131, 1.0 },
std::tuple<int, int, double>{ 12, 135, 1.0 },
std::tuple<int, int, double>{ 12, 136, 1.0 },
std::tuple<int, int, double>{ 12, 137, 1.0 },
std::tuple<int, int, double>{ 12, 138, 1.0 },
std::tuple<int, int, double>{ 12, 139, 1.0 },
std::tuple<int, int, double>{ 12, 140, 1.0 },
std::tuple<int, int, double>{ 13, 3, 1.0 },
std::tuple<int, int, double>{ 13, 4, 1.0 },
std::tuple<int, int, double>{ 13, 5, 1.0 },
std::tuple<int, int, double>{ 13, 9, 1.0 },
std::tuple<int, int, double>{ 13, 10, 1.0 },
std::tuple<int, int, double>{ 13, 11, 1.0 },
std::tuple<int, int, double>{ 13, 12, 1.0 },
std::tuple<int, int, double>{ 13, 13, 1.0 },
std::tuple<int, int, double>{ 13, 14, 1.0 },
std::tuple<int, int, double>{ 13, 45, 1.0 },
std::tuple<int, int, double>{ 13, 46, 1.0 },
std::tuple<int, int, double>{ 13, 47, 1.0 },
std::tuple<int, int, double>{ 13, 51, 1.0 },
std::tuple<int, int, double>{ 13, 52, 1.0 },
std::tuple<int, int, double>{ 13, 53, 1.0 },
std::tuple<int, int, double>{ 13, 54, 1.0 },
std::tuple<int, int, double>{ 13, 55, 1.0 },
std::tuple<int, int, double>{ 13, 56, 1.0 },
std::tuple<int, int, double>{ 13, 108, 1.0 },
std::tuple<int, int, double>{ 13, 109, 1.0 },
std::tuple<int, int, double>{ 13, 110, 1.0 },
std::tuple<int, int, double>{ 13, 114, 1.0 },
std::tuple<int, int, double>{ 13, 115, 1.0 },
std::tuple<int, int, double>{ 13, 116, 1.0 },
std::tuple<int, int, double>{ 13, 117, 1.0 },
std::tuple<int, int, double>{ 13, 118, 1.0 },
std::tuple<int, int, double>{ 13, 119, 1.0 },
std::tuple<int, int, double>{ 13, 129, 1.0 },
std::tuple<int, int, double>{ 13, 130, 1.0 },
std::tuple<int, int, double>{ 13, 131, 1.0 },
std::tuple<int, int, double>{ 13, 135, 1.0 },
std::tuple<int, int, double>{ 13, 136, 1.0 },
std::tuple<int, int, double>{ 13, 137, 1.0 },
std::tuple<int, int, double>{ 13, 138, 1.0 },
std::tuple<int, int, double>{ 13, 139, 1.0 },
std::tuple<int, int, double>{ 13, 140, 1.0 },
std::tuple<int, int, double>{ 14, 21, 1.0 },
std::tuple<int, int, double>{ 14, 22, 1.0 },
std::tuple<int, int, double>{ 14, 23, 1.0 },
std::tuple<int, int, double>{ 14, 30, 1.0 },
std::tuple<int, int, double>{ 14, 31, 1.0 },
std::tuple<int, int, double>{ 14, 32, 1.0 },
std::tuple<int, int, double>{ 14, 33, 1.0 },
std::tuple<int, int, double>{ 14, 34, 1.0 },
std::tuple<int, int, double>{ 14, 35, 1.0 },
std::tuple<int, int, double>{ 14, 42, 1.0 },
std::tuple<int, int, double>{ 14, 43, 1.0 },
std::tuple<int, int, double>{ 14, 44, 1.0 },
std::tuple<int, int, double>{ 14, 51, 1.0 },
std::tuple<int, int, double>{ 14, 52, 1.0 },
std::tuple<int, int, double>{ 14, 53, 1.0 },
std::tuple<int, int, double>{ 14, 54, 1.0 },
std::tuple<int, int, double>{ 14, 55, 1.0 },
std::tuple<int, int, double>{ 14, 56, 1.0 },
std::tuple<int, int, double>{ 14, 105, 1.0 },
std::tuple<int, int, double>{ 14, 106, 1.0 },
std::tuple<int, int, double>{ 14, 107, 1.0 },
std::tuple<int, int, double>{ 14, 114, 1.0 },
std::tuple<int, int, double>{ 14, 115, 1.0 },
std::tuple<int, int, double>{ 14, 116, 1.0 },
std::tuple<int, int, double>{ 14, 117, 1.0 },
std::tuple<int, int, double>{ 14, 118, 1.0 },
std::tuple<int, int, double>{ 14, 119, 1.0 },
std::tuple<int, int, double>{ 14, 126, 1.0 },
std::tuple<int, int, double>{ 14, 127, 1.0 },
std::tuple<int, int, double>{ 14, 128, 1.0 },
std::tuple<int, int, double>{ 14, 135, 1.0 },
std::tuple<int, int, double>{ 14, 136, 1.0 },
std::tuple<int, int, double>{ 14, 137, 1.0 },
std::tuple<int, int, double>{ 14, 138, 1.0 },
std::tuple<int, int, double>{ 14, 139, 1.0 },
std::tuple<int, int, double>{ 14, 140, 1.0 },
std::tuple<int, int, double>{ 15, 9, 1.0 },
std::tuple<int, int, double>{ 15, 10, 1.0 },
std::tuple<int, int, double>{ 15, 11, 1.0 },
std::tuple<int, int, double>{ 15, 12, 1.0 },
std::tuple<int, int, double>{ 15, 13, 1.0 },
std::tuple<int, int, double>{ 15, 14, 1.0 },
std::tuple<int, int, double>{ 15, 30, 1.0 },
std::tuple<int, int, double>{ 15, 31, 1.0 },
std::tuple<int, int, double>{ 15, 32, 1.0 },
std::tuple<int, int, double>{ 15, 33, 1.0 },
std::tuple<int, int, double>{ 15, 34, 1.0 },
std::tuple<int, int, double>{ 15, 35, 1.0 },
std::tuple<int, int, double>{ 15, 51, 1.0 },
std::tuple<int, int, double>{ 15, 52, 1.0 },
std::tuple<int, int, double>{ 15, 53, 1.0 },
std::tuple<int, int, double>{ 15, 54, 1.0 },
std::tuple<int, int, double>{ 15, 55, 1.0 },
std::tuple<int, int, double>{ 15, 56, 1.0 },
std::tuple<int, int, double>{ 15, 114, 1.0 },
std::tuple<int, int, double>{ 15, 115, 1.0 },
std::tuple<int, int, double>{ 15, 116, 1.0 },
std::tuple<int, int, double>{ 15, 117, 1.0 },
std::tuple<int, int, double>{ 15, 118, 1.0 },
std::tuple<int, int, double>{ 15, 119, 1.0 },
std::tuple<int, int, double>{ 15, 135, 1.0 },
std::tuple<int, int, double>{ 15, 136, 1.0 },
std::tuple<int, int, double>{ 15, 137, 1.0 },
std::tuple<int, int, double>{ 15, 138, 1.0 },
std::tuple<int, int, double>{ 15, 139, 1.0 },
std::tuple<int, int, double>{ 15, 140, 1.0 },
std::tuple<int, int, double>{ 16, 63, 1.0 },
std::tuple<int, int, double>{ 16, 64, 1.0 },
std::tuple<int, int, double>{ 16, 65, 1.0 },
std::tuple<int, int, double>{ 16, 66, 1.0 },
std::tuple<int, int, double>{ 16, 67, 1.0 },
std::tuple<int, int, double>{ 16, 68, 1.0 },
std::tuple<int, int, double>{ 16, 69, 1.0 },
std::tuple<int, int, double>{ 16, 70, 1.0 },
std::tuple<int, int, double>{ 16, 71, 1.0 },
std::tuple<int, int, double>{ 16, 75, 1.0 },
std::tuple<int, int, double>{ 16, 76, 1.0 },
std::tuple<int, int, double>{ 16, 77, 1.0 },
std::tuple<int, int, double>{ 16, 105, 1.0 },
std::tuple<int, int, double>{ 16, 106, 1.0 },
std::tuple<int, int, double>{ 16, 107, 1.0 },
std::tuple<int, int, double>{ 16, 108, 1.0 },
std::tuple<int, int, double>{ 16, 109, 1.0 },
std::tuple<int, int, double>{ 16, 110, 1.0 },
std::tuple<int, int, double>{ 16, 111, 1.0 },
std::tuple<int, int, double>{ 16, 112, 1.0 },
std::tuple<int, int, double>{ 16, 113, 1.0 },
std::tuple<int, int, double>{ 16, 117, 1.0 },
std::tuple<int, int, double>{ 16, 118, 1.0 },
std::tuple<int, int, double>{ 16, 119, 1.0 },
std::tuple<int, int, double>{ 16, 126, 1.0 },
std::tuple<int, int, double>{ 16, 127, 1.0 },
std::tuple<int, int, double>{ 16, 128, 1.0 },
std::tuple<int, int, double>{ 16, 129, 1.0 },
std::tuple<int, int, double>{ 16, 130, 1.0 },
std::tuple<int, int, double>{ 16, 131, 1.0 },
std::tuple<int, int, double>{ 16, 132, 1.0 },
std::tuple<int, int, double>{ 16, 133, 1.0 },
std::tuple<int, int, double>{ 16, 134, 1.0 },
std::tuple<int, int, double>{ 16, 138, 1.0 },
std::tuple<int, int, double>{ 16, 139, 1.0 },
std::tuple<int, int, double>{ 16, 140, 1.0 },
std::tuple<int, int, double>{ 17, 3, 1.0 },
std::tuple<int, int, double>{ 17, 4, 1.0 },
std::tuple<int, int, double>{ 17, 5, 1.0 },
std::tuple<int, int, double>{ 17, 6, 1.0 },
std::tuple<int, int, double>{ 17, 7, 1.0 },
std::tuple<int, int, double>{ 17, 8, 1.0 },
std::tuple<int, int, double>{ 17, 12, 1.0 },
std::tuple<int, int, double>{ 17, 13, 1.0 },
std::tuple<int, int, double>{ 17, 14, 1.0 },
std::tuple<int, int, double>{ 17, 66, 1.0 },
std::tuple<int, int, double>{ 17, 67, 1.0 },
std::tuple<int, int, double>{ 17, 68, 1.0 },
std::tuple<int, int, double>{ 17, 69, 1.0 },
std::tuple<int, int, double>{ 17, 70, 1.0 },
std::tuple<int, int, double>{ 17, 71, 1.0 },
std::tuple<int, int, double>{ 17, 75, 1.0 },
std::tuple<int, int, double>{ 17, 76, 1.0 },
std::tuple<int, int, double>{ 17, 77, 1.0 },
std::tuple<int, int, double>{ 17, 108, 1.0 },
std::tuple<int, int, double>{ 17, 109, 1.0 },
std::tuple<int, int, double>{ 17, 110, 1.0 },
std::tuple<int, int, double>{ 17, 111, 1.0 },
std::tuple<int, int, double>{ 17, 112, 1.0 },
std::tuple<int, int, double>{ 17, 113, 1.0 },
std::tuple<int, int, double>{ 17, 117, 1.0 },
std::tuple<int, int, double>{ 17, 118, 1.0 },
std::tuple<int, int, double>{ 17, 119, 1.0 },
std::tuple<int, int, double>{ 17, 129, 1.0 },
std::tuple<int, int, double>{ 17, 130, 1.0 },
std::tuple<int, int, double>{ 17, 131, 1.0 },
std::tuple<int, int, double>{ 17, 132, 1.0 },
std::tuple<int, int, double>{ 17, 133, 1.0 },
std::tuple<int, int, double>{ 17, 134, 1.0 },
std::tuple<int, int, double>{ 17, 138, 1.0 },
std::tuple<int, int, double>{ 17, 139, 1.0 },
std::tuple<int, int, double>{ 17, 140, 1.0 },
std::tuple<int, int, double>{ 18, 21, 1.0 },
std::tuple<int, int, double>{ 18, 22, 1.0 },
std::tuple<int, int, double>{ 18, 23, 1.0 },
std::tuple<int, int, double>{ 18, 27, 1.0 },
std::tuple<int, int, double>{ 18, 28, 1.0 },
std::tuple<int, int, double>{ 18, 29, 1.0 },
std::tuple<int, int, double>{ 18, 33, 1.0 },
std::tuple<int, int, double>{ 18, 34, 1.0 },
std::tuple<int, int, double>{ 18, 35, 1.0 },
std::tuple<int, int, double>{ 18, 63, 1.0 },
std::tuple<int, int, double>{ 18, 64, 1.0 },
std::tuple<int, int, double>{ 18, 65, 1.0 },
std::tuple<int, int, double>{ 18, 69, 1.0 },
std::tuple<int, int, double>{ 18, 70, 1.0 },
std::tuple<int, int, double>{ 18, 71, 1.0 },
std::tuple<int, int, double>{ 18, 75, 1.0 },
std::tuple<int, int, double>{ 18, 76, 1.0 },
std::tuple<int, int, double>{ 18, 77, 1.0 },
std::tuple<int, int, double>{ 18, 105, 1.0 },
std::tuple<int, int, double>{ 18, 106, 1.0 },
std::tuple<int, int, double>{ 18, 107, 1.0 },
std::tuple<int, int, double>{ 18, 111, 1.0 },
std::tuple<int, int, double>{ 18, 112, 1.0 },
std::tuple<int, int, double>{ 18, 113, 1.0 },
std::tuple<int, int, double>{ 18, 117, 1.0 },
std::tuple<int, int, double>{ 18, 118, 1.0 },
std::tuple<int, int, double>{ 18, 119, 1.0 },
std::tuple<int, int, double>{ 18, 126, 1.0 },
std::tuple<int, int, double>{ 18, 127, 1.0 },
std::tuple<int, int, double>{ 18, 128, 1.0 },
std::tuple<int, int, double>{ 18, 132, 1.0 },
std::tuple<int, int, double>{ 18, 133, 1.0 },
std::tuple<int, int, double>{ 18, 134, 1.0 },
std::tuple<int, int, double>{ 18, 138, 1.0 },
std::tuple<int, int, double>{ 18, 139, 1.0 },
std::tuple<int, int, double>{ 18, 140, 1.0 },
std::tuple<int, int, double>{ 19, 6, 1.0 },
std::tuple<int, int, double>{ 19, 7, 1.0 },
std::tuple<int, int, double>{ 19, 8, 1.0 },
std::tuple<int, int, double>{ 19, 12, 1.0 },
std::tuple<int, int, double>{ 19, 13, 1.0 },
std::tuple<int, int, double>{ 19, 14, 1.0 },
std::tuple<int, int, double>{ 19, 27, 1.0 },
std::tuple<int, int, double>{ 19, 28, 1.0 },
std::tuple<int, int, double>{ 19, 29, 1.0 },
std::tuple<int, int, double>{ 19, 33, 1.0 },
std::tuple<int, int, double>{ 19, 34, 1.0 },
std::tuple<int, int, double>{ 19, 35, 1.0 },
std::tuple<int, int, double>{ 19, 69, 1.0 },
std::tuple<int, int, double>{ 19, 70, 1.0 },
std::tuple<int, int, double>{ 19, 71, 1.0 },
std::tuple<int, int, double>{ 19, 75, 1.0 },
std::tuple<int, int, double>{ 19, 76, 1.0 },
std::tuple<int, int, double>{ 19, 77, 1.0 },
std::tuple<int, int, double>{ 19, 111, 1.0 },
std::tuple<int, int, double>{ 19, 112, 1.0 },
std::tuple<int, int, double>{ 19, 113, 1.0 },
std::tuple<int, int, double>{ 19, 117, 1.0 },
std::tuple<int, int, double>{ 19, 118, 1.0 },
std::tuple<int, int, double>{ 19, 119, 1.0 },
std::tuple<int, int, double>{ 19, 132, 1.0 },
std::tuple<int, int, double>{ 19, 133, 1.0 },
std::tuple<int, int, double>{ 19, 134, 1.0 },
std::tuple<int, int, double>{ 19, 138, 1.0 },
std::tuple<int, int, double>{ 19, 139, 1.0 },
std::tuple<int, int, double>{ 19, 140, 1.0 },
std::tuple<int, int, double>{ 20, 42, 1.0 },
std::tuple<int, int, double>{ 20, 43, 1.0 },
std::tuple<int, int, double>{ 20, 44, 1.0 },
std::tuple<int, int, double>{ 20, 45, 1.0 },
std::tuple<int, int, double>{ 20, 46, 1.0 },
std::tuple<int, int, double>{ 20, 47, 1.0 },
std::tuple<int, int, double>{ 20, 54, 1.0 },
std::tuple<int, int, double>{ 20, 55, 1.0 },
std::tuple<int, int, double>{ 20, 56, 1.0 },
std::tuple<int, int, double>{ 20, 63, 1.0 },
std::tuple<int, int, double>{ 20, 64, 1.0 },
std::tuple<int, int, double>{ 20, 65, 1.0 },
std::tuple<int, int, double>{ 20, 66, 1.0 },
std::tuple<int, int, double>{ 20, 67, 1.0 },
std::tuple<int, int, double>{ 20, 68, 1.0 },
std::tuple<int, int, double>{ 20, 75, 1.0 },
std::tuple<int, int, double>{ 20, 76, 1.0 },
std::tuple<int, int, double>{ 20, 77, 1.0 },
std::tuple<int, int, double>{ 20, 105, 1.0 },
std::tuple<int, int, double>{ 20, 106, 1.0 },
std::tuple<int, int, double>{ 20, 107, 1.0 },
std::tuple<int, int, double>{ 20, 108, 1.0 },
std::tuple<int, int, double>{ 20, 109, 1.0 },
std::tuple<int, int, double>{ 20, 110, 1.0 },
std::tuple<int, int, double>{ 20, 117, 1.0 },
std::tuple<int, int, double>{ 20, 118, 1.0 },
std::tuple<int, int, double>{ 20, 119, 1.0 },
std::tuple<int, int, double>{ 20, 126, 1.0 },
std::tuple<int, int, double>{ 20, 127, 1.0 },
std::tuple<int, int, double>{ 20, 128, 1.0 },
std::tuple<int, int, double>{ 20, 129, 1.0 },
std::tuple<int, int, double>{ 20, 130, 1.0 },
std::tuple<int, int, double>{ 20, 131, 1.0 },
std::tuple<int, int, double>{ 20, 138, 1.0 },
std::tuple<int, int, double>{ 20, 139, 1.0 },
std::tuple<int, int, double>{ 20, 140, 1.0 },
std::tuple<int, int, double>{ 21, 3, 1.0 },
std::tuple<int, int, double>{ 21, 4, 1.0 },
std::tuple<int, int, double>{ 21, 5, 1.0 },
std::tuple<int, int, double>{ 21, 12, 1.0 },
std::tuple<int, int, double>{ 21, 13, 1.0 },
std::tuple<int, int, double>{ 21, 14, 1.0 },
std::tuple<int, int, double>{ 21, 45, 1.0 },
std::tuple<int, int, double>{ 21, 46, 1.0 },
std::tuple<int, int, double>{ 21, 47, 1.0 },
std::tuple<int, int, double>{ 21, 54, 1.0 },
std::tuple<int, int, double>{ 21, 55, 1.0 },
std::tuple<int, int, double>{ 21, 56, 1.0 },
std::tuple<int, int, double>{ 21, 66, 1.0 },
std::tuple<int, int, double>{ 21, 67, 1.0 },
std::tuple<int, int, double>{ 21, 68, 1.0 },
std::tuple<int, int, double>{ 21, 75, 1.0 },
std::tuple<int, int, double>{ 21, 76, 1.0 },
std::tuple<int, int, double>{ 21, 77, 1.0 },
std::tuple<int, int, double>{ 21, 108, 1.0 },
std::tuple<int, int, double>{ 21, 109, 1.0 },
std::tuple<int, int, double>{ 21, 110, 1.0 },
std::tuple<int, int, double>{ 21, 117, 1.0 },
std::tuple<int, int, double>{ 21, 118, 1.0 },
std::tuple<int, int, double>{ 21, 119, 1.0 },
std::tuple<int, int, double>{ 21, 129, 1.0 },
std::tuple<int, int, double>{ 21, 130, 1.0 },
std::tuple<int, int, double>{ 21, 131, 1.0 },
std::tuple<int, int, double>{ 21, 138, 1.0 },
std::tuple<int, int, double>{ 21, 139, 1.0 },
std::tuple<int, int, double>{ 21, 140, 1.0 },
std::tuple<int, int, double>{ 22, 21, 1.0 },
std::tuple<int, int, double>{ 22, 22, 1.0 },
std::tuple<int, int, double>{ 22, 23, 1.0 },
std::tuple<int, int, double>{ 22, 33, 1.0 },
std::tuple<int, int, double>{ 22, 34, 1.0 },
std::tuple<int, int, double>{ 22, 35, 1.0 },
std::tuple<int, int, double>{ 22, 42, 1.0 },
std::tuple<int, int, double>{ 22, 43, 1.0 },
std::tuple<int, int, double>{ 22, 44, 1.0 },
std::tuple<int, int, double>{ 22, 54, 1.0 },
std::tuple<int, int, double>{ 22, 55, 1.0 },
std::tuple<int, int, double>{ 22, 56, 1.0 },
std::tuple<int, int, double>{ 22, 63, 1.0 },
std::tuple<int, int, double>{ 22, 64, 1.0 },
std::tuple<int, int, double>{ 22, 65, 1.0 },
std::tuple<int, int, double>{ 22, 75, 1.0 },
std::tuple<int, int, double>{ 22, 76, 1.0 },
std::tuple<int, int, double>{ 22, 77, 1.0 },
std::tuple<int, int, double>{ 22, 105, 1.0 },
std::tuple<int, int, double>{ 22, 106, 1.0 },
std::tuple<int, int, double>{ 22, 107, 1.0 },
std::tuple<int, int, double>{ 22, 117, 1.0 },
std::tuple<int, int, double>{ 22, 118, 1.0 },
std::tuple<int, int, double>{ 22, 119, 1.0 },
std::tuple<int, int, double>{ 22, 126, 1.0 },
std::tuple<int, int, double>{ 22, 127, 1.0 },
std::tuple<int, int, double>{ 22, 128, 1.0 },
std::tuple<int, int, double>{ 22, 138, 1.0 },
std::tuple<int, int, double>{ 22, 139, 1.0 },
std::tuple<int, int, double>{ 22, 140, 1.0 },
std::tuple<int, int, double>{ 23, 12, 1.0 },
std::tuple<int, int, double>{ 23, 13, 1.0 },
std::tuple<int, int, double>{ 23, 14, 1.0 },
std::tuple<int, int, double>{ 23, 33, 1.0 },
std::tuple<int, int, double>{ 23, 34, 1.0 },
std::tuple<int, int, double>{ 23, 35, 1.0 },
std::tuple<int, int, double>{ 23, 54, 1.0 },
std::tuple<int, int, double>{ 23, 55, 1.0 },
std::tuple<int, int, double>{ 23, 56, 1.0 },
std::tuple<int, int, double>{ 23, 75, 1.0 },
std::tuple<int, int, double>{ 23, 76, 1.0 },
std::tuple<int, int, double>{ 23, 77, 1.0 },
std::tuple<int, int, double>{ 23, 117, 1.0 },
std::tuple<int, int, double>{ 23, 118, 1.0 },
std::tuple<int, int, double>{ 23, 119, 1.0 },
std::tuple<int, int, double>{ 23, 138, 1.0 },
std::tuple<int, int, double>{ 23, 139, 1.0 },
std::tuple<int, int, double>{ 23, 140, 1.0 },
std::tuple<int, int, double>{ 24, 84, 1.0 },
std::tuple<int, int, double>{ 24, 85, 1.0 },
std::tuple<int, int, double>{ 24, 86, 1.0 },
std::tuple<int, int, double>{ 24, 87, 1.0 },
std::tuple<int, int, double>{ 24, 88, 1.0 },
std::tuple<int, int, double>{ 24, 89, 1.0 },
std::tuple<int, int, double>{ 24, 90, 1.0 },
std::tuple<int, int, double>{ 24, 91, 1.0 },
std::tuple<int, int, double>{ 24, 92, 1.0 },
std::tuple<int, int, double>{ 24, 93, 1.0 },
std::tuple<int, int, double>{ 24, 94, 1.0 },
std::tuple<int, int, double>{ 24, 95, 1.0 },
std::tuple<int, int, double>{ 24, 105, 1.0 },
std::tuple<int, int, double>{ 24, 106, 1.0 },
std::tuple<int, int, double>{ 24, 107, 1.0 },
std::tuple<int, int, double>{ 24, 108, 1.0 },
std::tuple<int, int, double>{ 24, 109, 1.0 },
std::tuple<int, int, double>{ 24, 110, 1.0 },
std::tuple<int, int, double>{ 24, 111, 1.0 },
std::tuple<int, int, double>{ 24, 112, 1.0 },
std::tuple<int, int, double>{ 24, 113, 1.0 },
std::tuple<int, int, double>{ 24, 114, 1.0 },
std::tuple<int, int, double>{ 24, 115, 1.0 },
std::tuple<int, int, double>{ 24, 116, 1.0 },
std::tuple<int, int, double>{ 24, 126, 1.0 },
std::tuple<int, int, double>{ 24, 127, 1.0 },
std::tuple<int, int, double>{ 24, 128, 1.0 },
std::tuple<int, int, double>{ 24, 129, 1.0 },
std::tuple<int, int, double>{ 24, 130, 1.0 },
std::tuple<int, int, double>{ 24, 131, 1.0 },
std::tuple<int, int, double>{ 24, 132, 1.0 },
std::tuple<int, int, double>{ 24, 133, 1.0 },
std::tuple<int, int, double>{ 24, 134, 1.0 },
std::tuple<int, int, double>{ 24, 135, 1.0 },
std::tuple<int, int, double>{ 24, 136, 1.0 },
std::tuple<int, int, double>{ 24, 137, 1.0 },
std::tuple<int, int, double>{ 25, 3, 1.0 },
std::tuple<int, int, double>{ 25, 4, 1.0 },
std::tuple<int, int, double>{ 25, 5, 1.0 },
std::tuple<int, int, double>{ 25, 6, 1.0 },
std::tuple<int, int, double>{ 25, 7, 1.0 },
std::tuple<int, int, double>{ 25, 8, 1.0 },
std::tuple<int, int, double>{ 25, 9, 1.0 },
std::tuple<int, int, double>{ 25, 10, 1.0 },
std::tuple<int, int, double>{ 25, 11, 1.0 },
std::tuple<int, int, double>{ 25, 87, 1.0 },
std::tuple<int, int, double>{ 25, 88, 1.0 },
std::tuple<int, int, double>{ 25, 89, 1.0 },
std::tuple<int, int, double>{ 25, 90, 1.0 },
std::tuple<int, int, double>{ 25, 91, 1.0 },
std::tuple<int, int, double>{ 25, 92, 1.0 },
std::tuple<int, int, double>{ 25, 93, 1.0 },
std::tuple<int, int, double>{ 25, 94, 1.0 },
std::tuple<int, int, double>{ 25, 95, 1.0 },
std::tuple<int, int, double>{ 25, 108, 1.0 },
std::tuple<int, int, double>{ 25, 109, 1.0 },
std::tuple<int, int, double>{ 25, 110, 1.0 },
std::tuple<int, int, double>{ 25, 111, 1.0 },
std::tuple<int, int, double>{ 25, 112, 1.0 },
std::tuple<int, int, double>{ 25, 113, 1.0 },
std::tuple<int, int, double>{ 25, 114, 1.0 },
std::tuple<int, int, double>{ 25, 115, 1.0 },
std::tuple<int, int, double>{ 25, 116, 1.0 },
std::tuple<int, int, double>{ 25, 129, 1.0 },
std::tuple<int, int, double>{ 25, 130, 1.0 },
std::tuple<int, int, double>{ 25, 131, 1.0 },
std::tuple<int, int, double>{ 25, 132, 1.0 },
std::tuple<int, int, double>{ 25, 133, 1.0 },
std::tuple<int, int, double>{ 25, 134, 1.0 },
std::tuple<int, int, double>{ 25, 135, 1.0 },
std::tuple<int, int, double>{ 25, 136, 1.0 },
std::tuple<int, int, double>{ 25, 137, 1.0 },
std::tuple<int, int, double>{ 26, 21, 1.0 },
std::tuple<int, int, double>{ 26, 22, 1.0 },
std::tuple<int, int, double>{ 26, 23, 1.0 },
std::tuple<int, int, double>{ 26, 27, 1.0 },
std::tuple<int, int, double>{ 26, 28, 1.0 },
std::tuple<int, int, double>{ 26, 29, 1.0 },
std::tuple<int, int, double>{ 26, 30, 1.0 },
std::tuple<int, int, double>{ 26, 31, 1.0 },
std::tuple<int, int, double>{ 26, 32, 1.0 },
std::tuple<int, int, double>{ 26, 84, 1.0 },
std::tuple<int, int, double>{ 26, 85, 1.0 },
std::tuple<int, int, double>{ 26, 86, 1.0 },
std::tuple<int, int, double>{ 26, 90, 1.0 },
std::tuple<int, int, double>{ 26, 91, 1.0 },
std::tuple<int, int, double>{ 26, 92, 1.0 },
std::tuple<int, int, double>{ 26, 93, 1.0 },
std::tuple<int, int, double>{ 26, 94, 1.0 },
std::tuple<int, int, double>{ 26, 95, 1.0 },
std::tuple<int, int, double>{ 26, 105, 1.0 },
std::tuple<int, int, double>{ 26, 106, 1.0 },
std::tuple<int, int, double>{ 26, 107, 1.0 },
std::tuple<int, int, double>{ 26, 111, 1.0 },
std::tuple<int, int, double>{ 26, 112, 1.0 },
std::tuple<int, int, double>{ 26, 113, 1.0 },
std::tuple<int, int, double>{ 26, 114, 1.0 },
std::tuple<int, int, double>{ 26, 115, 1.0 },
std::tuple<int, int, double>{ 26, 116, 1.0 },
std::tuple<int, int, double>{ 26, 126, 1.0 },
std::tuple<int, int, double>{ 26, 127, 1.0 },
std::tuple<int, int, double>{ 26, 128, 1.0 },
std::tuple<int, int, double>{ 26, 132, 1.0 },
std::tuple<int, int, double>{ 26, 133, 1.0 },
std::tuple<int, int, double>{ 26, 134, 1.0 },
std::tuple<int, int, double>{ 26, 135, 1.0 },
std::tuple<int, int, double>{ 26, 136, 1.0 },
std::tuple<int, int, double>{ 26, 137, 1.0 },
std::tuple<int, int, double>{ 27, 6, 1.0 },
std::tuple<int, int, double>{ 27, 7, 1.0 },
std::tuple<int, int, double>{ 27, 8, 1.0 },
std::tuple<int, int, double>{ 27, 9, 1.0 },
std::tuple<int, int, double>{ 27, 10, 1.0 },
std::tuple<int, int, double>{ 27, 11, 1.0 },
std::tuple<int, int, double>{ 27, 27, 1.0 },
std::tuple<int, int, double>{ 27, 28, 1.0 },
std::tuple<int, int, double>{ 27, 29, 1.0 },
std::tuple<int, int, double>{ 27, 30, 1.0 },
std::tuple<int, int, double>{ 27, 31, 1.0 },
std::tuple<int, int, double>{ 27, 32, 1.0 },
std::tuple<int, int, double>{ 27, 90, 1.0 },
std::tuple<int, int, double>{ 27, 91, 1.0 },
std::tuple<int, int, double>{ 27, 92, 1.0 },
std::tuple<int, int, double>{ 27, 93, 1.0 },
std::tuple<int, int, double>{ 27, 94, 1.0 },
std::tuple<int, int, double>{ 27, 95, 1.0 },
std::tuple<int, int, double>{ 27, 111, 1.0 },
std::tuple<int, int, double>{ 27, 112, 1.0 },
std::tuple<int, int, double>{ 27, 113, 1.0 },
std::tuple<int, int, double>{ 27, 114, 1.0 },
std::tuple<int, int, double>{ 27, 115, 1.0 },
std::tuple<int, int, double>{ 27, 116, 1.0 },
std::tuple<int, int, double>{ 27, 132, 1.0 },
std::tuple<int, int, double>{ 27, 133, 1.0 },
std::tuple<int, int, double>{ 27, 134, 1.0 },
std::tuple<int, int, double>{ 27, 135, 1.0 },
std::tuple<int, int, double>{ 27, 136, 1.0 },
std::tuple<int, int, double>{ 27, 137, 1.0 },
std::tuple<int, int, double>{ 28, 42, 1.0 },
std::tuple<int, int, double>{ 28, 43, 1.0 },
std::tuple<int, int, double>{ 28, 44, 1.0 },
std::tuple<int, int, double>{ 28, 45, 1.0 },
std::tuple<int, int, double>{ 28, 46, 1.0 },
std::tuple<int, int, double>{ 28, 47, 1.0 },
std::tuple<int, int, double>{ 28, 51, 1.0 },
std::tuple<int, int, double>{ 28, 52, 1.0 },
std::tuple<int, int, double>{ 28, 53, 1.0 },
std::tuple<int, int, double>{ 28, 84, 1.0 },
std::tuple<int, int, double>{ 28, 85, 1.0 },
std::tuple<int, int, double>{ 28, 86, 1.0 },
std::tuple<int, int, double>{ 28, 87, 1.0 },
std::tuple<int, int, double>{ 28, 88, 1.0 },
std::tuple<int, int, double>{ 28, 89, 1.0 },
std::tuple<int, int, double>{ 28, 93, 1.0 },
std::tuple<int, int, double>{ 28, 94, 1.0 },
std::tuple<int, int, double>{ 28, 95, 1.0 },
std::tuple<int, int, double>{ 28, 105, 1.0 },
std::tuple<int, int, double>{ 28, 106, 1.0 },
std::tuple<int, int, double>{ 28, 107, 1.0 },
std::tuple<int, int, double>{ 28, 108, 1.0 },
std::tuple<int, int, double>{ 28, 109, 1.0 },
std::tuple<int, int, double>{ 28, 110, 1.0 },
std::tuple<int, int, double>{ 28, 114, 1.0 },
std::tuple<int, int, double>{ 28, 115, 1.0 },
std::tuple<int, int, double>{ 28, 116, 1.0 },
std::tuple<int, int, double>{ 28, 126, 1.0 },
std::tuple<int, int, double>{ 28, 127, 1.0 },
std::tuple<int, int, double>{ 28, 128, 1.0 },
std::tuple<int, int, double>{ 28, 129, 1.0 },
std::tuple<int, int, double>{ 28, 130, 1.0 },
std::tuple<int, int, double>{ 28, 131, 1.0 },
std::tuple<int, int, double>{ 28, 135, 1.0 },
std::tuple<int, int, double>{ 28, 136, 1.0 },
std::tuple<int, int, double>{ 28, 137, 1.0 },
std::tuple<int, int, double>{ 29, 3, 1.0 },
std::tuple<int, int, double>{ 29, 4, 1.0 },
std::tuple<int, int, double>{ 29, 5, 1.0 },
std::tuple<int, int, double>{ 29, 9, 1.0 },
std::tuple<int, int, double>{ 29, 10, 1.0 },
std::tuple<int, int, double>{ 29, 11, 1.0 },
std::tuple<int, int, double>{ 29, 45, 1.0 },
std::tuple<int, int, double>{ 29, 46, 1.0 },
std::tuple<int, int, double>{ 29, 47, 1.0 },
std::tuple<int, int, double>{ 29, 51, 1.0 },
std::tuple<int, int, double>{ 29, 52, 1.0 },
std::tuple<int, int, double>{ 29, 53, 1.0 },
std::tuple<int, int, double>{ 29, 87, 1.0 },
std::tuple<int, int, double>{ 29, 88, 1.0 },
std::tuple<int, int, double>{ 29, 89, 1.0 },
std::tuple<int, int, double>{ 29, 93, 1.0 },
std::tuple<int, int, double>{ 29, 94, 1.0 },
std::tuple<int, int, double>{ 29, 95, 1.0 },
std::tuple<int, int, double>{ 29, 108, 1.0 },
std::tuple<int, int, double>{ 29, 109, 1.0 },
std::tuple<int, int, double>{ 29, 110, 1.0 },
std::tuple<int, int, double>{ 29, 114, 1.0 },
std::tuple<int, int, double>{ 29, 115, 1.0 },
std::tuple<int, int, double>{ 29, 116, 1.0 },
std::tuple<int, int, double>{ 29, 129, 1.0 },
std::tuple<int, int, double>{ 29, 130, 1.0 },
std::tuple<int, int, double>{ 29, 131, 1.0 },
std::tuple<int, int, double>{ 29, 135, 1.0 },
std::tuple<int, int, double>{ 29, 136, 1.0 },
std::tuple<int, int, double>{ 29, 137, 1.0 },
std::tuple<int, int, double>{ 30, 21, 1.0 },
std::tuple<int, int, double>{ 30, 22, 1.0 },
std::tuple<int, int, double>{ 30, 23, 1.0 },
std::tuple<int, int, double>{ 30, 30, 1.0 },
std::tuple<int, int, double>{ 30, 31, 1.0 },
std::tuple<int, int, double>{ 30, 32, 1.0 },
std::tuple<int, int, double>{ 30, 42, 1.0 },
std::tuple<int, int, double>{ 30, 43, 1.0 },
std::tuple<int, int, double>{ 30, 44, 1.0 },
std::tuple<int, int, double>{ 30, 51, 1.0 },
std::tuple<int, int, double>{ 30, 52, 1.0 },
std::tuple<int, int, double>{ 30, 53, 1.0 },
std::tuple<int, int, double>{ 30, 84, 1.0 },
std::tuple<int, int, double>{ 30, 85, 1.0 },
std::tuple<int, int, double>{ 30, 86, 1.0 },
std::tuple<int, int, double>{ 30, 93, 1.0 },
std::tuple<int, int, double>{ 30, 94, 1.0 },
std::tuple<int, int, double>{ 30, 95, 1.0 },
std::tuple<int, int, double>{ 30, 105, 1.0 },
std::tuple<int, int, double>{ 30, 106, 1.0 },
std::tuple<int, int, double>{ 30, 107, 1.0 },
std::tuple<int, int, double>{ 30, 114, 1.0 },
std::tuple<int, int, double>{ 30, 115, 1.0 },
std::tuple<int, int, double>{ 30, 116, 1.0 },
std::tuple<int, int, double>{ 30, 126, 1.0 },
std::tuple<int, int, double>{ 30, 127, 1.0 },
std::tuple<int, int, double>{ 30, 128, 1.0 },
std::tuple<int, int, double>{ 30, 135, 1.0 },
std::tuple<int, int, double>{ 30, 136, 1.0 },
std::tuple<int, int, double>{ 30, 137, 1.0 },
std::tuple<int, int, double>{ 31, 9, 1.0 },
std::tuple<int, int, double>{ 31, 10, 1.0 },
std::tuple<int, int, double>{ 31, 11, 1.0 },
std::tuple<int, int, double>{ 31, 30, 1.0 },
std::tuple<int, int, double>{ 31, 31, 1.0 },
std::tuple<int, int, double>{ 31, 32, 1.0 },
std::tuple<int, int, double>{ 31, 51, 1.0 },
std::tuple<int, int, double>{ 31, 52, 1.0 },
std::tuple<int, int, double>{ 31, 53, 1.0 },
std::tuple<int, int, double>{ 31, 93, 1.0 },
std::tuple<int, int, double>{ 31, 94, 1.0 },
std::tuple<int, int, double>{ 31, 95, 1.0 },
std::tuple<int, int, double>{ 31, 114, 1.0 },
std::tuple<int, int, double>{ 31, 115, 1.0 },
std::tuple<int, int, double>{ 31, 116, 1.0 },
std::tuple<int, int, double>{ 31, 135, 1.0 },
std::tuple<int, int, double>{ 31, 136, 1.0 },
std::tuple<int, int, double>{ 31, 137, 1.0 },
std::tuple<int, int, double>{ 32, 63, 1.0 },
std::tuple<int, int, double>{ 32, 64, 1.0 },
std::tuple<int, int, double>{ 32, 65, 1.0 },
std::tuple<int, int, double>{ 32, 66, 1.0 },
std::tuple<int, int, double>{ 32, 67, 1.0 },
std::tuple<int, int, double>{ 32, 68, 1.0 },
std::tuple<int, int, double>{ 32, 69, 1.0 },
std::tuple<int, int, double>{ 32, 70, 1.0 },
std::tuple<int, int, double>{ 32, 71, 1.0 },
std::tuple<int, int, double>{ 32, 84, 1.0 },
std::tuple<int, int, double>{ 32, 85, 1.0 },
std::tuple<int, int, double>{ 32, 86, 1.0 },
std::tuple<int, int, double>{ 32, 87, 1.0 },
std::tuple<int, int, double>{ 32, 88, 1.0 },
std::tuple<int, int, double>{ 32, 89, 1.0 },
std::tuple<int, int, double>{ 32, 90, 1.0 },
std::tuple<int, int, double>{ 32, 91, 1.0 },
std::tuple<int, int, double>{ 32, 92, 1.0 },
std::tuple<int, int, double>{ 32, 105, 1.0 },
std::tuple<int, int, double>{ 32, 106, 1.0 },
std::tuple<int, int, double>{ 32, 107, 1.0 },
std::tuple<int, int, double>{ 32, 108, 1.0 },
std::tuple<int, int, double>{ 32, 109, 1.0 },
std::tuple<int, int, double>{ 32, 110, 1.0 },
std::tuple<int, int, double>{ 32, 111, 1.0 },
std::tuple<int, int, double>{ 32, 112, 1.0 },
std::tuple<int, int, double>{ 32, 113, 1.0 },
std::tuple<int, int, double>{ 32, 126, 1.0 },
std::tuple<int, int, double>{ 32, 127, 1.0 },
std::tuple<int, int, double>{ 32, 128, 1.0 },
std::tuple<int, int, double>{ 32, 129, 1.0 },
std::tuple<int, int, double>{ 32, 130, 1.0 },
std::tuple<int, int, double>{ 32, 131, 1.0 },
std::tuple<int, int, double>{ 32, 132, 1.0 },
std::tuple<int, int, double>{ 32, 133, 1.0 },
std::tuple<int, int, double>{ 32, 134, 1.0 },
std::tuple<int, int, double>{ 33, 3, 1.0 },
std::tuple<int, int, double>{ 33, 4, 1.0 },
std::tuple<int, int, double>{ 33, 5, 1.0 },
std::tuple<int, int, double>{ 33, 6, 1.0 },
std::tuple<int, int, double>{ 33, 7, 1.0 },
std::tuple<int, int, double>{ 33, 8, 1.0 },
std::tuple<int, int, double>{ 33, 66, 1.0 },
std::tuple<int, int, double>{ 33, 67, 1.0 },
std::tuple<int, int, double>{ 33, 68, 1.0 },
std::tuple<int, int, double>{ 33, 69, 1.0 },
std::tuple<int, int, double>{ 33, 70, 1.0 },
std::tuple<int, int, double>{ 33, 71, 1.0 },
std::tuple<int, int, double>{ 33, 87, 1.0 },
std::tuple<int, int, double>{ 33, 88, 1.0 },
std::tuple<int, int, double>{ 33, 89, 1.0 },
std::tuple<int, int, double>{ 33, 90, 1.0 },
std::tuple<int, int, double>{ 33, 91, 1.0 },
std::tuple<int, int, double>{ 33, 92, 1.0 },
std::tuple<int, int, double>{ 33, 108, 1.0 },
std::tuple<int, int, double>{ 33, 109, 1.0 },
std::tuple<int, int, double>{ 33, 110, 1.0 },
std::tuple<int, int, double>{ 33, 111, 1.0 },
std::tuple<int, int, double>{ 33, 112, 1.0 },
std::tuple<int, int, double>{ 33, 113, 1.0 },
std::tuple<int, int, double>{ 33, 129, 1.0 },
std::tuple<int, int, double>{ 33, 130, 1.0 },
std::tuple<int, int, double>{ 33, 131, 1.0 },
std::tuple<int, int, double>{ 33, 132, 1.0 },
std::tuple<int, int, double>{ 33, 133, 1.0 },
std::tuple<int, int, double>{ 33, 134, 1.0 },
std::tuple<int, int, double>{ 34, 21, 1.0 },
std::tuple<int, int, double>{ 34, 22, 1.0 },
std::tuple<int, int, double>{ 34, 23, 1.0 },
std::tuple<int, int, double>{ 34, 27, 1.0 },
std::tuple<int, int, double>{ 34, 28, 1.0 },
std::tuple<int, int, double>{ 34, 29, 1.0 },
std::tuple<int, int, double>{ 34, 63, 1.0 },
std::tuple<int, int, double>{ 34, 64, 1.0 },
std::tuple<int, int, double>{ 34, 65, 1.0 },
std::tuple<int, int, double>{ 34, 69, 1.0 },
std::tuple<int, int, double>{ 34, 70, 1.0 },
std::tuple<int, int, double>{ 34, 71, 1.0 },
std::tuple<int, int, double>{ 34, 84, 1.0 },
std::tuple<int, int, double>{ 34, 85, 1.0 },
std::tuple<int, int, double>{ 34, 86, 1.0 },
std::tuple<int, int, double>{ 34, 90, 1.0 },
std::tuple<int, int, double>{ 34, 91, 1.0 },
std::tuple<int, int, double>{ 34, 92, 1.0 },
std::tuple<int, int, double>{ 34, 105, 1.0 },
std::tuple<int, int, double>{ 34, 106, 1.0 },
std::tuple<int, int, double>{ 34, 107, 1.0 },
std::tuple<int, int, double>{ 34, 111, 1.0 },
std::tuple<int, int, double>{ 34, 112, 1.0 },
std::tuple<int, int, double>{ 34, 113, 1.0 },
std::tuple<int, int, double>{ 34, 126, 1.0 },
std::tuple<int, int, double>{ 34, 127, 1.0 },
std::tuple<int, int, double>{ 34, 128, 1.0 },
std::tuple<int, int, double>{ 34, 132, 1.0 },
std::tuple<int, int, double>{ 34, 133, 1.0 },
std::tuple<int, int, double>{ 34, 134, 1.0 },
std::tuple<int, int, double>{ 35, 6, 1.0 },
std::tuple<int, int, double>{ 35, 7, 1.0 },
std::tuple<int, int, double>{ 35, 8, 1.0 },
std::tuple<int, int, double>{ 35, 27, 1.0 },
std::tuple<int, int, double>{ 35, 28, 1.0 },
std::tuple<int, int, double>{ 35, 29, 1.0 },
std::tuple<int, int, double>{ 35, 69, 1.0 },
std::tuple<int, int, double>{ 35, 70, 1.0 },
std::tuple<int, int, double>{ 35, 71, 1.0 },
std::tuple<int, int, double>{ 35, 90, 1.0 },
std::tuple<int, int, double>{ 35, 91, 1.0 },
std::tuple<int, int, double>{ 35, 92, 1.0 },
std::tuple<int, int, double>{ 35, 111, 1.0 },
std::tuple<int, int, double>{ 35, 112, 1.0 },
std::tuple<int, int, double>{ 35, 113, 1.0 },
std::tuple<int, int, double>{ 35, 132, 1.0 },
std::tuple<int, int, double>{ 35, 133, 1.0 },
std::tuple<int, int, double>{ 35, 134, 1.0 },
std::tuple<int, int, double>{ 36, 42, 1.0 },
std::tuple<int, int, double>{ 36, 43, 1.0 },
std::tuple<int, int, double>{ 36, 44, 1.0 },
std::tuple<int, int, double>{ 36, 45, 1.0 },
std::tuple<int, int, double>{ 36, 46, 1.0 },
std::tuple<int, int, double>{ 36, 47, 1.0 },
std::tuple<int, int, double>{ 36, 63, 1.0 },
std::tuple<int, int, double>{ 36, 64, 1.0 },
std::tuple<int, int, double>{ 36, 65, 1.0 },
std::tuple<int, int, double>{ 36, 66, 1.0 },
std::tuple<int, int, double>{ 36, 67, 1.0 },
std::tuple<int, int, double>{ 36, 68, 1.0 },
std::tuple<int, int, double>{ 36, 84, 1.0 },
std::tuple<int, int, double>{ 36, 85, 1.0 },
std::tuple<int, int, double>{ 36, 86, 1.0 },
std::tuple<int, int, double>{ 36, 87, 1.0 },
std::tuple<int, int, double>{ 36, 88, 1.0 },
std::tuple<int, int, double>{ 36, 89, 1.0 },
std::tuple<int, int, double>{ 36, 105, 1.0 },
std::tuple<int, int, double>{ 36, 106, 1.0 },
std::tuple<int, int, double>{ 36, 107, 1.0 },
std::tuple<int, int, double>{ 36, 108, 1.0 },
std::tuple<int, int, double>{ 36, 109, 1.0 },
std::tuple<int, int, double>{ 36, 110, 1.0 },
std::tuple<int, int, double>{ 36, 126, 1.0 },
std::tuple<int, int, double>{ 36, 127, 1.0 },
std::tuple<int, int, double>{ 36, 128, 1.0 },
std::tuple<int, int, double>{ 36, 129, 1.0 },
std::tuple<int, int, double>{ 36, 130, 1.0 },
std::tuple<int, int, double>{ 36, 131, 1.0 },
std::tuple<int, int, double>{ 37, 3, 1.0 },
std::tuple<int, int, double>{ 37, 4, 1.0 },
std::tuple<int, int, double>{ 37, 5, 1.0 },
std::tuple<int, int, double>{ 37, 45, 1.0 },
std::tuple<int, int, double>{ 37, 46, 1.0 },
std::tuple<int, int, double>{ 37, 47, 1.0 },
std::tuple<int, int, double>{ 37, 66, 1.0 },
std::tuple<int, int, double>{ 37, 67, 1.0 },
std::tuple<int, int, double>{ 37, 68, 1.0 },
std::tuple<int, int, double>{ 37, 87, 1.0 },
std::tuple<int, int, double>{ 37, 88, 1.0 },
std::tuple<int, int, double>{ 37, 89, 1.0 },
std::tuple<int, int, double>{ 37, 108, 1.0 },
std::tuple<int, int, double>{ 37, 109, 1.0 },
std::tuple<int, int, double>{ 37, 110, 1.0 },
std::tuple<int, int, double>{ 37, 129, 1.0 },
std::tuple<int, int, double>{ 37, 130, 1.0 },
std::tuple<int, int, double>{ 37, 131, 1.0 },
std::tuple<int, int, double>{ 38, 21, 1.0 },
std::tuple<int, int, double>{ 38, 22, 1.0 },
std::tuple<int, int, double>{ 38, 23, 1.0 },
std::tuple<int, int, double>{ 38, 42, 1.0 },
std::tuple<int, int, double>{ 38, 43, 1.0 },
std::tuple<int, int, double>{ 38, 44, 1.0 },
std::tuple<int, int, double>{ 38, 63, 1.0 },
std::tuple<int, int, double>{ 38, 64, 1.0 },
std::tuple<int, int, double>{ 38, 65, 1.0 },
std::tuple<int, int, double>{ 38, 84, 1.0 },
std::tuple<int, int, double>{ 38, 85, 1.0 },
std::tuple<int, int, double>{ 38, 86, 1.0 },
std::tuple<int, int, double>{ 38, 105, 1.0 },
std::tuple<int, int, double>{ 38, 106, 1.0 },
std::tuple<int, int, double>{ 38, 107, 1.0 },
std::tuple<int, int, double>{ 38, 126, 1.0 },
std::tuple<int, int, double>{ 38, 127, 1.0 },
std::tuple<int, int, double>{ 38, 128, 1.0 },
std::tuple<int, int, double>{ 39, 105, 1.0 },
std::tuple<int, int, double>{ 39, 106, 1.0 },
std::tuple<int, int, double>{ 39, 107, 1.0 },
std::tuple<int, int, double>{ 39, 108, 1.0 },
std::tuple<int, int, double>{ 39, 109, 1.0 },
std::tuple<int, int, double>{ 39, 110, 1.0 },
std::tuple<int, int, double>{ 39, 111, 1.0 },
std::tuple<int, int, double>{ 39, 112, 1.0 },
std::tuple<int, int, double>{ 39, 113, 1.0 },
std::tuple<int, int, double>{ 39, 114, 1.0 },
std::tuple<int, int, double>{ 39, 115, 1.0 },
std::tuple<int, int, double>{ 39, 116, 1.0 },
std::tuple<int, int, double>{ 39, 117, 1.0 },
std::tuple<int, int, double>{ 39, 118, 1.0 },
std::tuple<int, int, double>{ 39, 119, 1.0 },
std::tuple<int, int, double>{ 39, 126, 1.0 },
std::tuple<int, int, double>{ 39, 127, 1.0 },
std::tuple<int, int, double>{ 39, 128, 1.0 },
std::tuple<int, int, double>{ 39, 129, 1.0 },
std::tuple<int, int, double>{ 39, 130, 1.0 },
std::tuple<int, int, double>{ 39, 131, 1.0 },
std::tuple<int, int, double>{ 39, 132, 1.0 },
std::tuple<int, int, double>{ 39, 133, 1.0 },
std::tuple<int, int, double>{ 39, 134, 1.0 },
std::tuple<int, int, double>{ 39, 135, 1.0 },
std::tuple<int, int, double>{ 39, 136, 1.0 },
std::tuple<int, int, double>{ 39, 137, 1.0 },
std::tuple<int, int, double>{ 39, 138, 1.0 },
std::tuple<int, int, double>{ 39, 139, 1.0 },
std::tuple<int, int, double>{ 39, 140, 1.0 },
std::tuple<int, int, double>{ 40, 3, 1.0 },
std::tuple<int, int, double>{ 40, 6, 1.0 },
std::tuple<int, int, double>{ 40, 9, 1.0 },
std::tuple<int, int, double>{ 40, 12, 1.0 },
std::tuple<int, int, double>{ 40, 15, 1.0 },
std::tuple<int, int, double>{ 40, 18, 1.0 },
std::tuple<int, int, double>{ 40, 21, -1.0 },
std::tuple<int, int, double>{ 40, 42, -1.0 },
std::tuple<int, int, double>{ 40, 63, -1.0 },
std::tuple<int, int, double>{ 40, 84, -1.0 },
std::tuple<int, int, double>{ 40, 105, -1.0 },
std::tuple<int, int, double>{ 40, 126, -1.0 },
std::tuple<int, int, double>{ 41, 3, -1.0 },
std::tuple<int, int, double>{ 41, 21, 1.0 },
std::tuple<int, int, double>{ 41, 27, 1.0 },
std::tuple<int, int, double>{ 41, 30, 1.0 },
std::tuple<int, int, double>{ 41, 33, 1.0 },
std::tuple<int, int, double>{ 41, 36, 1.0 },
std::tuple<int, int, double>{ 41, 39, 1.0 },
std::tuple<int, int, double>{ 41, 45, -1.0 },
std::tuple<int, int, double>{ 41, 66, -1.0 },
std::tuple<int, int, double>{ 41, 87, -1.0 },
std::tuple<int, int, double>{ 41, 108, -1.0 },
std::tuple<int, int, double>{ 41, 129, -1.0 },
std::tuple<int, int, double>{ 42, 6, -1.0 },
std::tuple<int, int, double>{ 42, 27, -1.0 },
std::tuple<int, int, double>{ 42, 42, 1.0 },
std::tuple<int, int, double>{ 42, 45, 1.0 },
std::tuple<int, int, double>{ 42, 51, 1.0 },
std::tuple<int, int, double>{ 42, 54, 1.0 },
std::tuple<int, int, double>{ 42, 57, 1.0 },
std::tuple<int, int, double>{ 42, 60, 1.0 },
std::tuple<int, int, double>{ 42, 69, -1.0 },
std::tuple<int, int, double>{ 42, 90, -1.0 },
std::tuple<int, int, double>{ 42, 111, -1.0 },
std::tuple<int, int, double>{ 42, 132, -1.0 },
std::tuple<int, int, double>{ 43, 9, -1.0 },
std::tuple<int, int, double>{ 43, 30, -1.0 },
std::tuple<int, int, double>{ 43, 51, -1.0 },
std::tuple<int, int, double>{ 43, 63, 1.0 },
std::tuple<int, int, double>{ 43, 66, 1.0 },
std::tuple<int, int, double>{ 43, 69, 1.0 },
std::tuple<int, int, double>{ 43, 75, 1.0 },
std::tuple<int, int, double>{ 43, 78, 1.0 },
std::tuple<int, int, double>{ 43, 81, 1.0 },
std::tuple<int, int, double>{ 43, 93, -1.0 },
std::tuple<int, int, double>{ 43, 114, -1.0 },
std::tuple<int, int, double>{ 43, 135, -1.0 },
std::tuple<int, int, double>{ 44, 12, -1.0 },
std::tuple<int, int, double>{ 44, 33, -1.0 },
std::tuple<int, int, double>{ 44, 54, -1.0 },
std::tuple<int, int, double>{ 44, 75, -1.0 },
std::tuple<int, int, double>{ 44, 84, 1.0 },
std::tuple<int, int, double>{ 44, 87, 1.0 },
std::tuple<int, int, double>{ 44, 90, 1.0 },
std::tuple<int, int, double>{ 44, 93, 1.0 },
std::tuple<int, int, double>{ 44, 99, 1.0 },
std::tuple<int, int, double>{ 44, 102, 1.0 },
std::tuple<int, int, double>{ 44, 117, -1.0 },
std::tuple<int, int, double>{ 44, 138, -1.0 },
std::tuple<int, int, double>{ 45, 15, -1.0 },
std::tuple<int, int, double>{ 45, 36, -1.0 },
std::tuple<int, int, double>{ 45, 57, -1.0 },
std::tuple<int, int, double>{ 45, 78, -1.0 },
std::tuple<int, int, double>{ 45, 99, -1.0 },
std::tuple<int, int, double>{ 45, 105, 1.0 },
std::tuple<int, int, double>{ 45, 108, 1.0 },
std::tuple<int, int, double>{ 45, 111, 1.0 },
std::tuple<int, int, double>{ 45, 114, 1.0 },
std::tuple<int, int, double>{ 45, 117, 1.0 },
std::tuple<int, int, double>{ 45, 123, 1.0 },
std::tuple<int, int, double>{ 45, 141, -1.0 },
std::tuple<int, int, double>{ 46, 18, -1.0 },
std::tuple<int, int, double>{ 46, 39, -1.0 },
std::tuple<int, int, double>{ 46, 60, -1.0 },
std::tuple<int, int, double>{ 46, 81, -1.0 },
std::tuple<int, int, double>{ 46, 102, -1.0 },
std::tuple<int, int, double>{ 46, 123, -1.0 },
std::tuple<int, int, double>{ 46, 126, 1.0 },
std::tuple<int, int, double>{ 46, 129, 1.0 },
std::tuple<int, int, double>{ 46, 132, 1.0 },
std::tuple<int, int, double>{ 46, 135, 1.0 },
std::tuple<int, int, double>{ 46, 138, 1.0 },
std::tuple<int, int, double>{ 46, 141, 1.0 },
std::tuple<int, int, double>{ 47, 4, 1.0 },
std::tuple<int, int, double>{ 47, 7, 1.0 },
std::tuple<int, int, double>{ 47, 10, 1.0 },
std::tuple<int, int, double>{ 47, 13, 1.0 },
std::tuple<int, int, double>{ 47, 16, 1.0 },
std::tuple<int, int, double>{ 47, 19, 1.0 },
std::tuple<int, int, double>{ 47, 22, -1.0 },
std::tuple<int, int, double>{ 47, 43, -1.0 },
std::tuple<int, int, double>{ 47, 64, -1.0 },
std::tuple<int, int, double>{ 47, 85, -1.0 },
std::tuple<int, int, double>{ 47, 106, -1.0 },
std::tuple<int, int, double>{ 47, 127, -1.0 },
std::tuple<int, int, double>{ 48, 4, -1.0 },
std::tuple<int, int, double>{ 48, 22, 1.0 },
std::tuple<int, int, double>{ 48, 28, 1.0 },
std::tuple<int, int, double>{ 48, 31, 1.0 },
std::tuple<int, int, double>{ 48, 34, 1.0 },
std::tuple<int, int, double>{ 48, 37, 1.0 },
std::tuple<int, int, double>{ 48, 40, 1.0 },
std::tuple<int, int, double>{ 48, 46, -1.0 },
std::tuple<int, int, double>{ 48, 67, -1.0 },
std::tuple<int, int, double>{ 48, 88, -1.0 },
std::tuple<int, int, double>{ 48, 109, -1.0 },
std::tuple<int, int, double>{ 48, 130, -1.0 },
std::tuple<int, int, double>{ 49, 7, -1.0 },
std::tuple<int, int, double>{ 49, 28, -1.0 },
std::tuple<int, int, double>{ 49, 43, 1.0 },
std::tuple<int, int, double>{ 49, 46, 1.0 },
std::tuple<int, int, double>{ 49, 52, 1.0 },
std::tuple<int, int, double>{ 49, 55, 1.0 },
std::tuple<int, int, double>{ 49, 58, 1.0 },
std::tuple<int, int, double>{ 49, 61, 1.0 },
std::tuple<int, int, double>{ 49, 70, -1.0 },
std::tuple<int, int, double>{ 49, 91, -1.0 },
std::tuple<int, int, double>{ 49, 112, -1.0 },
std::tuple<int, int, double>{ 49, 133, -1.0 },
std::tuple<int, int, double>{ 50, 10, -1.0 },
std::tuple<int, int, double>{ 50, 31, -1.0 },
std::tuple<int, int, double>{ 50, 52, -1.0 },
std::tuple<int, int, double>{ 50, 64, 1.0 },
std::tuple<int, int, double>{ 50, 67, 1.0 },
std::tuple<int, int, double>{ 50, 70, 1.0 },
std::tuple<int, int, double>{ 50, 76, 1.0 },
std::tuple<int, int, double>{ 50, 79, 1.0 },
std::tuple<int, int, double>{ 50, 82, 1.0 },
std::tuple<int, int, double>{ 50, 94, -1.0 },
std::tuple<int, int, double>{ 50, 115, -1.0 },
std::tuple<int, int, double>{ 50, 136, -1.0 },
std::tuple<int, int, double>{ 51, 13, -1.0 },
std::tuple<int, int, double>{ 51, 34, -1.0 },
std::tuple<int, int, double>{ 51, 55, -1.0 },
std::tuple<int, int, double>{ 51, 76, -1.0 },
std::tuple<int, int, double>{ 51, 85, 1.0 },
std::tuple<int, int, double>{ 51, 88, 1.0 },
std::tuple<int, int, double>{ 51, 91, 1.0 },
std::tuple<int, int, double>{ 51, 94, 1.0 },
std::tuple<int, int, double>{ 51, 100, 1.0 },
std::tuple<int, int, double>{ 51, 103, 1.0 },
std::tuple<int, int, double>{ 51, 118, -1.0 },
std::tuple<int, int, double>{ 51, 139, -1.0 },
std::tuple<int, int, double>{ 52, 16, -1.0 },
std::tuple<int, int, double>{ 52, 37, -1.0 },
std::tuple<int, int, double>{ 52, 58, -1.0 },
std::tuple<int, int, double>{ 52, 79, -1.0 },
std::tuple<int, int, double>{ 52, 100, -1.0 },
std::tuple<int, int, double>{ 52, 106, 1.0 },
std::tuple<int, int, double>{ 52, 109, 1.0 },
std::tuple<int, int, double>{ 52, 112, 1.0 },
std::tuple<int, int, double>{ 52, 115, 1.0 },
std::tuple<int, int, double>{ 52, 118, 1.0 },
std::tuple<int, int, double>{ 52, 124, 1.0 },
std::tuple<int, int, double>{ 52, 142, -1.0 },
std::tuple<int, int, double>{ 53, 19, -1.0 },
std::tuple<int, int, double>{ 53, 40, -1.0 },
std::tuple<int, int, double>{ 53, 61, -1.0 },
std::tuple<int, int, double>{ 53, 82, -1.0 },
std::tuple<int, int, double>{ 53, 103, -1.0 },
std::tuple<int, int, double>{ 53, 124, -1.0 },
std::tuple<int, int, double>{ 53, 127, 1.0 },
std::tuple<int, int, double>{ 53, 130, 1.0 },
std::tuple<int, int, double>{ 53, 133, 1.0 },
std::tuple<int, int, double>{ 53, 136, 1.0 },
std::tuple<int, int, double>{ 53, 139, 1.0 },
std::tuple<int, int, double>{ 53, 142, 1.0 },
std::tuple<int, int, double>{ 54, 5, 1.0 },
std::tuple<int, int, double>{ 54, 8, 1.0 },
std::tuple<int, int, double>{ 54, 11, 1.0 },
std::tuple<int, int, double>{ 54, 14, 1.0 },
std::tuple<int, int, double>{ 54, 17, 1.0 },
std::tuple<int, int, double>{ 54, 20, 1.0 },
std::tuple<int, int, double>{ 54, 23, -1.0 },
std::tuple<int, int, double>{ 54, 44, -1.0 },
std::tuple<int, int, double>{ 54, 65, -1.0 },
std::tuple<int, int, double>{ 54, 86, -1.0 },
std::tuple<int, int, double>{ 54, 107, -1.0 },
std::tuple<int, int, double>{ 54, 128, -1.0 },
std::tuple<int, int, double>{ 55, 5, -1.0 },
std::tuple<int, int, double>{ 55, 23, 1.0 },
std::tuple<int, int, double>{ 55, 29, 1.0 },
std::tuple<int, int, double>{ 55, 32, 1.0 },
std::tuple<int, int, double>{ 55, 35, 1.0 },
std::tuple<int, int, double>{ 55, 38, 1.0 },
std::tuple<int, int, double>{ 55, 41, 1.0 },
std::tuple<int, int, double>{ 55, 47, -1.0 },
std::tuple<int, int, double>{ 55, 68, -1.0 },
std::tuple<int, int, double>{ 55, 89, -1.0 },
std::tuple<int, int, double>{ 55, 110, -1.0 },
std::tuple<int, int, double>{ 55, 131, -1.0 },
std::tuple<int, int, double>{ 56, 8, -1.0 },
std::tuple<int, int, double>{ 56, 29, -1.0 },
std::tuple<int, int, double>{ 56, 44, 1.0 },
std::tuple<int, int, double>{ 56, 47, 1.0 },
std::tuple<int, int, double>{ 56, 53, 1.0 },
std::tuple<int, int, double>{ 56, 56, 1.0 },
std::tuple<int, int, double>{ 56, 59, 1.0 },
std::tuple<int, int, double>{ 56, 62, 1.0 },
std::tuple<int, int, double>{ 56, 71, -1.0 },
std::tuple<int, int, double>{ 56, 92, -1.0 },
std::tuple<int, int, double>{ 56, 113, -1.0 },
std::tuple<int, int, double>{ 56, 134, -1.0 },
std::tuple<int, int, double>{ 57, 11, -1.0 },
std::tuple<int, int, double>{ 57, 32, -1.0 },
std::tuple<int, int, double>{ 57, 53, -1.0 },
std::tuple<int, int, double>{ 57, 65, 1.0 },
std::tuple<int, int, double>{ 57, 68, 1.0 },
std::tuple<int, int, double>{ 57, 71, 1.0 },
std::tuple<int, int, double>{ 57, 77, 1.0 },
std::tuple<int, int, double>{ 57, 80, 1.0 },
std::tuple<int, int, double>{ 57, 83, 1.0 },
std::tuple<int, int, double>{ 57, 95, -1.0 },
std::tuple<int, int, double>{ 57, 116, -1.0 },
std::tuple<int, int, double>{ 57, 137, -1.0 },
std::tuple<int, int, double>{ 58, 14, -1.0 },
std::tuple<int, int, double>{ 58, 35, -1.0 },
std::tuple<int, int, double>{ 58, 56, -1.0 },
std::tuple<int, int, double>{ 58, 77, -1.0 },
std::tuple<int, int, double>{ 58, 86, 1.0 },
std::tuple<int, int, double>{ 58, 89, 1.0 },
std::tuple<int, int, double>{ 58, 92, 1.0 },
std::tuple<int, int, double>{ 58, 95, 1.0 },
std::tuple<int, int, double>{ 58, 101, 1.0 },
std::tuple<int, int, double>{ 58, 104, 1.0 },
std::tuple<int, int, double>{ 58, 119, -1.0 },
std::tuple<int, int, double>{ 58, 140, -1.0 },
std::tuple<int, int, double>{ 59, 17, -1.0 },
std::tuple<int, int, double>{ 59, 38, -1.0 },
std::tuple<int, int, double>{ 59, 59, -1.0 },
std::tuple<int, int, double>{ 59, 80, -1.0 },
std::tuple<int, int, double>{ 59, 101, -1.0 },
std::tuple<int, int, double>{ 59, 107, 1.0 },
std::tuple<int, int, double>{ 59, 110, 1.0 },
std::tuple<int, int, double>{ 59, 113, 1.0 },
std::tuple<int, int, double>{ 59, 116, 1.0 },
std::tuple<int, int, double>{ 59, 119, 1.0 },
std::tuple<int, int, double>{ 59, 125, 1.0 },
std::tuple<int, int, double>{ 59, 143, -1.0 },
std::tuple<int, int, double>{ 60, 20, -1.0 },
std::tuple<int, int, double>{ 60, 41, -1.0 },
std::tuple<int, int, double>{ 60, 62, -1.0 },
std::tuple<int, int, double>{ 60, 83, -1.0 },
std::tuple<int, int, double>{ 60, 104, -1.0 },
std::tuple<int, int, double>{ 60, 125, -1.0 },
std::tuple<int, int, double>{ 60, 128, 1.0 },
std::tuple<int, int, double>{ 60, 131, 1.0 },
std::tuple<int, int, double>{ 60, 134, 1.0 },
std::tuple<int, int, double>{ 60, 137, 1.0 },
std::tuple<int, int, double>{ 60, 140, 1.0 },
std::tuple<int, int, double>{ 60, 143, 1.0 },
std::tuple<int, int, double>{ 61, 15, 1.0 },
std::tuple<int, int, double>{ 61, 18, 1.0 },
std::tuple<int, int, double>{ 61, 36, 1.0 },
std::tuple<int, int, double>{ 61, 39, 1.0 },
std::tuple<int, int, double>{ 61, 57, 1.0 },
std::tuple<int, int, double>{ 61, 60, 1.0 },
std::tuple<int, int, double>{ 61, 78, 1.0 },
std::tuple<int, int, double>{ 61, 81, 1.0 },
std::tuple<int, int, double>{ 61, 99, 1.0 },
std::tuple<int, int, double>{ 61, 102, 1.0 },
std::tuple<int, int, double>{ 62, 16, 1.0 },
std::tuple<int, int, double>{ 62, 19, 1.0 },
std::tuple<int, int, double>{ 62, 37, 1.0 },
std::tuple<int, int, double>{ 62, 40, 1.0 },
std::tuple<int, int, double>{ 62, 58, 1.0 },
std::tuple<int, int, double>{ 62, 61, 1.0 },
std::tuple<int, int, double>{ 62, 79, 1.0 },
std::tuple<int, int, double>{ 62, 82, 1.0 },
std::tuple<int, int, double>{ 62, 100, 1.0 },
std::tuple<int, int, double>{ 62, 103, 1.0 },
std::tuple<int, int, double>{ 63, 17, 1.0 },
std::tuple<int, int, double>{ 63, 20, 1.0 },
std::tuple<int, int, double>{ 63, 38, 1.0 },
std::tuple<int, int, double>{ 63, 41, 1.0 },
std::tuple<int, int, double>{ 63, 59, 1.0 },
std::tuple<int, int, double>{ 63, 62, 1.0 },
std::tuple<int, int, double>{ 63, 80, 1.0 },
std::tuple<int, int, double>{ 63, 83, 1.0 },
std::tuple<int, int, double>{ 63, 101, 1.0 },
std::tuple<int, int, double>{ 63, 104, 1.0 },
std::tuple<int, int, double>{ 64, 147, -300.0 },
std::tuple<int, int, double>{ 64, 149, 100.0 },
std::tuple<int, int, double>{ 64, 151, 100.0 },
std::tuple<int, int, double>{ 64, 153, 100.0 },
std::tuple<int, int, double>{ 64, 155, 100.0 },
std::tuple<int, int, double>{ 64, 157, 100.0 },
std::tuple<int, int, double>{ 65, 148, -300.0 },
std::tuple<int, int, double>{ 65, 150, 100.0 },
std::tuple<int, int, double>{ 65, 152, 100.0 },
std::tuple<int, int, double>{ 65, 154, 100.0 },
std::tuple<int, int, double>{ 65, 156, 100.0 },
std::tuple<int, int, double>{ 65, 158, 100.0 },
std::tuple<int, int, double>{ 66, 0, 1.0 },
std::tuple<int, int, double>{ 66, 3, 1.0 },
std::tuple<int, int, double>{ 66, 6, 1.0 },
std::tuple<int, int, double>{ 66, 9, 1.0 },
std::tuple<int, int, double>{ 66, 12, 1.0 },
std::tuple<int, int, double>{ 66, 15, 1.0 },
std::tuple<int, int, double>{ 66, 18, 1.0 },
std::tuple<int, int, double>{ 66, 105, 1.0 },
std::tuple<int, int, double>{ 66, 108, 1.0 },
std::tuple<int, int, double>{ 66, 111, 1.0 },
std::tuple<int, int, double>{ 66, 114, 1.0 },
std::tuple<int, int, double>{ 66, 117, 1.0 },
std::tuple<int, int, double>{ 66, 120, 1.0 },
std::tuple<int, int, double>{ 66, 123, 1.0 },
std::tuple<int, int, double>{ 66, 149, -1.0 },
std::tuple<int, int, double>{ 67, 1, 1.0 },
std::tuple<int, int, double>{ 67, 4, 1.0 },
std::tuple<int, int, double>{ 67, 7, 1.0 },
std::tuple<int, int, double>{ 67, 10, 1.0 },
std::tuple<int, int, double>{ 67, 13, 1.0 },
std::tuple<int, int, double>{ 67, 16, 1.0 },
std::tuple<int, int, double>{ 67, 19, 1.0 },
std::tuple<int, int, double>{ 67, 106, 1.0 },
std::tuple<int, int, double>{ 67, 109, 1.0 },
std::tuple<int, int, double>{ 67, 112, 1.0 },
std::tuple<int, int, double>{ 67, 115, 1.0 },
std::tuple<int, int, double>{ 67, 118, 1.0 },
std::tuple<int, int, double>{ 67, 121, 1.0 },
std::tuple<int, int, double>{ 67, 124, 1.0 },
std::tuple<int, int, double>{ 67, 149, -1.0 },
std::tuple<int, int, double>{ 68, 2, 1.0 },
std::tuple<int, int, double>{ 68, 5, 1.0 },
std::tuple<int, int, double>{ 68, 8, 1.0 },
std::tuple<int, int, double>{ 68, 11, 1.0 },
std::tuple<int, int, double>{ 68, 14, 1.0 },
std::tuple<int, int, double>{ 68, 17, 1.0 },
std::tuple<int, int, double>{ 68, 20, 1.0 },
std::tuple<int, int, double>{ 68, 107, 1.0 },
std::tuple<int, int, double>{ 68, 110, 1.0 },
std::tuple<int, int, double>{ 68, 113, 1.0 },
std::tuple<int, int, double>{ 68, 116, 1.0 },
std::tuple<int, int, double>{ 68, 119, 1.0 },
std::tuple<int, int, double>{ 68, 122, 1.0 },
std::tuple<int, int, double>{ 68, 125, 1.0 },
std::tuple<int, int, double>{ 68, 149, -1.0 },
std::tuple<int, int, double>{ 69, 0, 1.0 },
std::tuple<int, int, double>{ 69, 3, 1.0 },
std::tuple<int, int, double>{ 69, 6, 1.0 },
std::tuple<int, int, double>{ 69, 9, 1.0 },
std::tuple<int, int, double>{ 69, 12, 1.0 },
std::tuple<int, int, double>{ 69, 15, 1.0 },
std::tuple<int, int, double>{ 69, 18, 1.0 },
std::tuple<int, int, double>{ 69, 126, 1.0 },
std::tuple<int, int, double>{ 69, 129, 1.0 },
std::tuple<int, int, double>{ 69, 132, 1.0 },
std::tuple<int, int, double>{ 69, 135, 1.0 },
std::tuple<int, int, double>{ 69, 138, 1.0 },
std::tuple<int, int, double>{ 69, 141, 1.0 },
std::tuple<int, int, double>{ 69, 144, 1.0 },
std::tuple<int, int, double>{ 69, 150, -1.0 },
std::tuple<int, int, double>{ 70, 1, 1.0 },
std::tuple<int, int, double>{ 70, 4, 1.0 },
std::tuple<int, int, double>{ 70, 7, 1.0 },
std::tuple<int, int, double>{ 70, 10, 1.0 },
std::tuple<int, int, double>{ 70, 13, 1.0 },
std::tuple<int, int, double>{ 70, 16, 1.0 },
std::tuple<int, int, double>{ 70, 19, 1.0 },
std::tuple<int, int, double>{ 70, 127, 1.0 },
std::tuple<int, int, double>{ 70, 130, 1.0 },
std::tuple<int, int, double>{ 70, 133, 1.0 },
std::tuple<int, int, double>{ 70, 136, 1.0 },
std::tuple<int, int, double>{ 70, 139, 1.0 },
std::tuple<int, int, double>{ 70, 142, 1.0 },
std::tuple<int, int, double>{ 70, 145, 1.0 },
std::tuple<int, int, double>{ 70, 150, -1.0 },
std::tuple<int, int, double>{ 71, 2, 1.0 },
std::tuple<int, int, double>{ 71, 5, 1.0 },
std::tuple<int, int, double>{ 71, 8, 1.0 },
std::tuple<int, int, double>{ 71, 11, 1.0 },
std::tuple<int, int, double>{ 71, 14, 1.0 },
std::tuple<int, int, double>{ 71, 17, 1.0 },
std::tuple<int, int, double>{ 71, 20, 1.0 },
std::tuple<int, int, double>{ 71, 128, 1.0 },
std::tuple<int, int, double>{ 71, 131, 1.0 },
std::tuple<int, int, double>{ 71, 134, 1.0 },
std::tuple<int, int, double>{ 71, 137, 1.0 },
std::tuple<int, int, double>{ 71, 140, 1.0 },
std::tuple<int, int, double>{ 71, 143, 1.0 },
std::tuple<int, int, double>{ 71, 146, 1.0 },
std::tuple<int, int, double>{ 71, 150, -1.0 },
std::tuple<int, int, double>{ 72, 21, 1.0 },
std::tuple<int, int, double>{ 72, 24, 1.0 },
std::tuple<int, int, double>{ 72, 27, 1.0 },
std::tuple<int, int, double>{ 72, 30, 1.0 },
std::tuple<int, int, double>{ 72, 33, 1.0 },
std::tuple<int, int, double>{ 72, 36, 1.0 },
std::tuple<int, int, double>{ 72, 39, 1.0 },
std::tuple<int, int, double>{ 72, 105, 1.0 },
std::tuple<int, int, double>{ 72, 108, 1.0 },
std::tuple<int, int, double>{ 72, 111, 1.0 },
std::tuple<int, int, double>{ 72, 114, 1.0 },
std::tuple<int, int, double>{ 72, 117, 1.0 },
std::tuple<int, int, double>{ 72, 120, 1.0 },
std::tuple<int, int, double>{ 72, 123, 1.0 },
std::tuple<int, int, double>{ 72, 151, -1.0 },
std::tuple<int, int, double>{ 73, 22, 1.0 },
std::tuple<int, int, double>{ 73, 25, 1.0 },
std::tuple<int, int, double>{ 73, 28, 1.0 },
std::tuple<int, int, double>{ 73, 31, 1.0 },
std::tuple<int, int, double>{ 73, 34, 1.0 },
std::tuple<int, int, double>{ 73, 37, 1.0 },
std::tuple<int, int, double>{ 73, 40, 1.0 },
std::tuple<int, int, double>{ 73, 106, 1.0 },
std::tuple<int, int, double>{ 73, 109, 1.0 },
std::tuple<int, int, double>{ 73, 112, 1.0 },
std::tuple<int, int, double>{ 73, 115, 1.0 },
std::tuple<int, int, double>{ 73, 118, 1.0 },
std::tuple<int, int, double>{ 73, 121, 1.0 },
std::tuple<int, int, double>{ 73, 124, 1.0 },
std::tuple<int, int, double>{ 73, 151, -1.0 },
std::tuple<int, int, double>{ 74, 23, 1.0 },
std::tuple<int, int, double>{ 74, 26, 1.0 },
std::tuple<int, int, double>{ 74, 29, 1.0 },
std::tuple<int, int, double>{ 74, 32, 1.0 },
std::tuple<int, int, double>{ 74, 35, 1.0 },
std::tuple<int, int, double>{ 74, 38, 1.0 },
std::tuple<int, int, double>{ 74, 41, 1.0 },
std::tuple<int, int, double>{ 74, 107, 1.0 },
std::tuple<int, int, double>{ 74, 110, 1.0 },
std::tuple<int, int, double>{ 74, 113, 1.0 },
std::tuple<int, int, double>{ 74, 116, 1.0 },
std::tuple<int, int, double>{ 74, 119, 1.0 },
std::tuple<int, int, double>{ 74, 122, 1.0 },
std::tuple<int, int, double>{ 74, 125, 1.0 },
std::tuple<int, int, double>{ 74, 151, -1.0 },
std::tuple<int, int, double>{ 75, 21, 1.0 },
std::tuple<int, int, double>{ 75, 24, 1.0 },
std::tuple<int, int, double>{ 75, 27, 1.0 },
std::tuple<int, int, double>{ 75, 30, 1.0 },
std::tuple<int, int, double>{ 75, 33, 1.0 },
std::tuple<int, int, double>{ 75, 36, 1.0 },
std::tuple<int, int, double>{ 75, 39, 1.0 },
std::tuple<int, int, double>{ 75, 126, 1.0 },
std::tuple<int, int, double>{ 75, 129, 1.0 },
std::tuple<int, int, double>{ 75, 132, 1.0 },
std::tuple<int, int, double>{ 75, 135, 1.0 },
std::tuple<int, int, double>{ 75, 138, 1.0 },
std::tuple<int, int, double>{ 75, 141, 1.0 },
std::tuple<int, int, double>{ 75, 144, 1.0 },
std::tuple<int, int, double>{ 75, 152, -1.0 },
std::tuple<int, int, double>{ 76, 22, 1.0 },
std::tuple<int, int, double>{ 76, 25, 1.0 },
std::tuple<int, int, double>{ 76, 28, 1.0 },
std::tuple<int, int, double>{ 76, 31, 1.0 },
std::tuple<int, int, double>{ 76, 34, 1.0 },
std::tuple<int, int, double>{ 76, 37, 1.0 },
std::tuple<int, int, double>{ 76, 40, 1.0 },
std::tuple<int, int, double>{ 76, 127, 1.0 },
std::tuple<int, int, double>{ 76, 130, 1.0 },
std::tuple<int, int, double>{ 76, 133, 1.0 },
std::tuple<int, int, double>{ 76, 136, 1.0 },
std::tuple<int, int, double>{ 76, 139, 1.0 },
std::tuple<int, int, double>{ 76, 142, 1.0 },
std::tuple<int, int, double>{ 76, 145, 1.0 },
std::tuple<int, int, double>{ 76, 152, -1.0 },
std::tuple<int, int, double>{ 77, 23, 1.0 },
std::tuple<int, int, double>{ 77, 26, 1.0 },
std::tuple<int, int, double>{ 77, 29, 1.0 },
std::tuple<int, int, double>{ 77, 32, 1.0 },
std::tuple<int, int, double>{ 77, 35, 1.0 },
std::tuple<int, int, double>{ 77, 38, 1.0 },
std::tuple<int, int, double>{ 77, 41, 1.0 },
std::tuple<int, int, double>{ 77, 128, 1.0 },
std::tuple<int, int, double>{ 77, 131, 1.0 },
std::tuple<int, int, double>{ 77, 134, 1.0 },
std::tuple<int, int, double>{ 77, 137, 1.0 },
std::tuple<int, int, double>{ 77, 140, 1.0 },
std::tuple<int, int, double>{ 77, 143, 1.0 },
std::tuple<int, int, double>{ 77, 146, 1.0 },
std::tuple<int, int, double>{ 77, 152, -1.0 },
std::tuple<int, int, double>{ 78, 42, 1.0 },
std::tuple<int, int, double>{ 78, 45, 1.0 },
std::tuple<int, int, double>{ 78, 48, 1.0 },
std::tuple<int, int, double>{ 78, 51, 1.0 },
std::tuple<int, int, double>{ 78, 54, 1.0 },
std::tuple<int, int, double>{ 78, 57, 1.0 },
std::tuple<int, int, double>{ 78, 60, 1.0 },
std::tuple<int, int, double>{ 78, 105, 1.0 },
std::tuple<int, int, double>{ 78, 108, 1.0 },
std::tuple<int, int, double>{ 78, 111, 1.0 },
std::tuple<int, int, double>{ 78, 114, 1.0 },
std::tuple<int, int, double>{ 78, 117, 1.0 },
std::tuple<int, int, double>{ 78, 120, 1.0 },
std::tuple<int, int, double>{ 78, 123, 1.0 },
std::tuple<int, int, double>{ 78, 153, -1.0 },
std::tuple<int, int, double>{ 79, 43, 1.0 },
std::tuple<int, int, double>{ 79, 46, 1.0 },
std::tuple<int, int, double>{ 79, 49, 1.0 },
std::tuple<int, int, double>{ 79, 52, 1.0 },
std::tuple<int, int, double>{ 79, 55, 1.0 },
std::tuple<int, int, double>{ 79, 58, 1.0 },
std::tuple<int, int, double>{ 79, 61, 1.0 },
std::tuple<int, int, double>{ 79, 106, 1.0 },
std::tuple<int, int, double>{ 79, 109, 1.0 },
std::tuple<int, int, double>{ 79, 112, 1.0 },
std::tuple<int, int, double>{ 79, 115, 1.0 },
std::tuple<int, int, double>{ 79, 118, 1.0 },
std::tuple<int, int, double>{ 79, 121, 1.0 },
std::tuple<int, int, double>{ 79, 124, 1.0 },
std::tuple<int, int, double>{ 79, 153, -1.0 },
std::tuple<int, int, double>{ 80, 44, 1.0 },
std::tuple<int, int, double>{ 80, 47, 1.0 },
std::tuple<int, int, double>{ 80, 50, 1.0 },
std::tuple<int, int, double>{ 80, 53, 1.0 },
std::tuple<int, int, double>{ 80, 56, 1.0 },
std::tuple<int, int, double>{ 80, 59, 1.0 },
std::tuple<int, int, double>{ 80, 62, 1.0 },
std::tuple<int, int, double>{ 80, 107, 1.0 },
std::tuple<int, int, double>{ 80, 110, 1.0 },
std::tuple<int, int, double>{ 80, 113, 1.0 },
std::tuple<int, int, double>{ 80, 116, 1.0 },
std::tuple<int, int, double>{ 80, 119, 1.0 },
std::tuple<int, int, double>{ 80, 122, 1.0 },
std::tuple<int, int, double>{ 80, 125, 1.0 },
std::tuple<int, int, double>{ 80, 153, -1.0 },
std::tuple<int, int, double>{ 81, 42, 1.0 },
std::tuple<int, int, double>{ 81, 45, 1.0 },
std::tuple<int, int, double>{ 81, 48, 1.0 },
std::tuple<int, int, double>{ 81, 51, 1.0 },
std::tuple<int, int, double>{ 81, 54, 1.0 },
std::tuple<int, int, double>{ 81, 57, 1.0 },
std::tuple<int, int, double>{ 81, 60, 1.0 },
std::tuple<int, int, double>{ 81, 126, 1.0 },
std::tuple<int, int, double>{ 81, 129, 1.0 },
std::tuple<int, int, double>{ 81, 132, 1.0 },
std::tuple<int, int, double>{ 81, 135, 1.0 },
std::tuple<int, int, double>{ 81, 138, 1.0 },
std::tuple<int, int, double>{ 81, 141, 1.0 },
std::tuple<int, int, double>{ 81, 144, 1.0 },
std::tuple<int, int, double>{ 81, 154, -1.0 },
std::tuple<int, int, double>{ 82, 43, 1.0 },
std::tuple<int, int, double>{ 82, 46, 1.0 },
std::tuple<int, int, double>{ 82, 49, 1.0 },
std::tuple<int, int, double>{ 82, 52, 1.0 },
std::tuple<int, int, double>{ 82, 55, 1.0 },
std::tuple<int, int, double>{ 82, 58, 1.0 },
std::tuple<int, int, double>{ 82, 61, 1.0 },
std::tuple<int, int, double>{ 82, 127, 1.0 },
std::tuple<int, int, double>{ 82, 130, 1.0 },
std::tuple<int, int, double>{ 82, 133, 1.0 },
std::tuple<int, int, double>{ 82, 136, 1.0 },
std::tuple<int, int, double>{ 82, 139, 1.0 },
std::tuple<int, int, double>{ 82, 142, 1.0 },
std::tuple<int, int, double>{ 82, 145, 1.0 },
std::tuple<int, int, double>{ 82, 154, -1.0 },
std::tuple<int, int, double>{ 83, 44, 1.0 },
std::tuple<int, int, double>{ 83, 47, 1.0 },
std::tuple<int, int, double>{ 83, 50, 1.0 },
std::tuple<int, int, double>{ 83, 53, 1.0 },
std::tuple<int, int, double>{ 83, 56, 1.0 },
std::tuple<int, int, double>{ 83, 59, 1.0 },
std::tuple<int, int, double>{ 83, 62, 1.0 },
std::tuple<int, int, double>{ 83, 128, 1.0 },
std::tuple<int, int, double>{ 83, 131, 1.0 },
std::tuple<int, int, double>{ 83, 134, 1.0 },
std::tuple<int, int, double>{ 83, 137, 1.0 },
std::tuple<int, int, double>{ 83, 140, 1.0 },
std::tuple<int, int, double>{ 83, 143, 1.0 },
std::tuple<int, int, double>{ 83, 146, 1.0 },
std::tuple<int, int, double>{ 83, 154, -1.0 },
std::tuple<int, int, double>{ 84, 63, 1.0 },
std::tuple<int, int, double>{ 84, 66, 1.0 },
std::tuple<int, int, double>{ 84, 69, 1.0 },
std::tuple<int, int, double>{ 84, 72, 1.0 },
std::tuple<int, int, double>{ 84, 75, 1.0 },
std::tuple<int, int, double>{ 84, 78, 1.0 },
std::tuple<int, int, double>{ 84, 81, 1.0 },
std::tuple<int, int, double>{ 84, 105, 1.0 },
std::tuple<int, int, double>{ 84, 108, 1.0 },
std::tuple<int, int, double>{ 84, 111, 1.0 },
std::tuple<int, int, double>{ 84, 114, 1.0 },
std::tuple<int, int, double>{ 84, 117, 1.0 },
std::tuple<int, int, double>{ 84, 120, 1.0 },
std::tuple<int, int, double>{ 84, 123, 1.0 },
std::tuple<int, int, double>{ 84, 155, -1.0 },
std::tuple<int, int, double>{ 85, 64, 1.0 },
std::tuple<int, int, double>{ 85, 67, 1.0 },
std::tuple<int, int, double>{ 85, 70, 1.0 },
std::tuple<int, int, double>{ 85, 73, 1.0 },
std::tuple<int, int, double>{ 85, 76, 1.0 },
std::tuple<int, int, double>{ 85, 79, 1.0 },
std::tuple<int, int, double>{ 85, 82, 1.0 },
std::tuple<int, int, double>{ 85, 106, 1.0 },
std::tuple<int, int, double>{ 85, 109, 1.0 },
std::tuple<int, int, double>{ 85, 112, 1.0 },
std::tuple<int, int, double>{ 85, 115, 1.0 },
std::tuple<int, int, double>{ 85, 118, 1.0 },
std::tuple<int, int, double>{ 85, 121, 1.0 },
std::tuple<int, int, double>{ 85, 124, 1.0 },
std::tuple<int, int, double>{ 85, 155, -1.0 },
std::tuple<int, int, double>{ 86, 65, 1.0 },
std::tuple<int, int, double>{ 86, 68, 1.0 },
std::tuple<int, int, double>{ 86, 71, 1.0 },
std::tuple<int, int, double>{ 86, 74, 1.0 },
std::tuple<int, int, double>{ 86, 77, 1.0 },
std::tuple<int, int, double>{ 86, 80, 1.0 },
std::tuple<int, int, double>{ 86, 83, 1.0 },
std::tuple<int, int, double>{ 86, 107, 1.0 },
std::tuple<int, int, double>{ 86, 110, 1.0 },
std::tuple<int, int, double>{ 86, 113, 1.0 },
std::tuple<int, int, double>{ 86, 116, 1.0 },
std::tuple<int, int, double>{ 86, 119, 1.0 },
std::tuple<int, int, double>{ 86, 122, 1.0 },
std::tuple<int, int, double>{ 86, 125, 1.0 },
std::tuple<int, int, double>{ 86, 155, -1.0 },
std::tuple<int, int, double>{ 87, 63, 1.0 },
std::tuple<int, int, double>{ 87, 66, 1.0 },
std::tuple<int, int, double>{ 87, 69, 1.0 },
std::tuple<int, int, double>{ 87, 72, 1.0 },
std::tuple<int, int, double>{ 87, 75, 1.0 },
std::tuple<int, int, double>{ 87, 78, 1.0 },
std::tuple<int, int, double>{ 87, 81, 1.0 },
std::tuple<int, int, double>{ 87, 126, 1.0 },
std::tuple<int, int, double>{ 87, 129, 1.0 },
std::tuple<int, int, double>{ 87, 132, 1.0 },
std::tuple<int, int, double>{ 87, 135, 1.0 },
std::tuple<int, int, double>{ 87, 138, 1.0 },
std::tuple<int, int, double>{ 87, 141, 1.0 },
std::tuple<int, int, double>{ 87, 144, 1.0 },
std::tuple<int, int, double>{ 87, 156, -1.0 },
std::tuple<int, int, double>{ 88, 64, 1.0 },
std::tuple<int, int, double>{ 88, 67, 1.0 },
std::tuple<int, int, double>{ 88, 70, 1.0 },
std::tuple<int, int, double>{ 88, 73, 1.0 },
std::tuple<int, int, double>{ 88, 76, 1.0 },
std::tuple<int, int, double>{ 88, 79, 1.0 },
std::tuple<int, int, double>{ 88, 82, 1.0 },
std::tuple<int, int, double>{ 88, 127, 1.0 },
std::tuple<int, int, double>{ 88, 130, 1.0 },
std::tuple<int, int, double>{ 88, 133, 1.0 },
std::tuple<int, int, double>{ 88, 136, 1.0 },
std::tuple<int, int, double>{ 88, 139, 1.0 },
std::tuple<int, int, double>{ 88, 142, 1.0 },
std::tuple<int, int, double>{ 88, 145, 1.0 },
std::tuple<int, int, double>{ 88, 156, -1.0 },
std::tuple<int, int, double>{ 89, 65, 1.0 },
std::tuple<int, int, double>{ 89, 68, 1.0 },
std::tuple<int, int, double>{ 89, 71, 1.0 },
std::tuple<int, int, double>{ 89, 74, 1.0 },
std::tuple<int, int, double>{ 89, 77, 1.0 },
std::tuple<int, int, double>{ 89, 80, 1.0 },
std::tuple<int, int, double>{ 89, 83, 1.0 },
std::tuple<int, int, double>{ 89, 128, 1.0 },
std::tuple<int, int, double>{ 89, 131, 1.0 },
std::tuple<int, int, double>{ 89, 134, 1.0 },
std::tuple<int, int, double>{ 89, 137, 1.0 },
std::tuple<int, int, double>{ 89, 140, 1.0 },
std::tuple<int, int, double>{ 89, 143, 1.0 },
std::tuple<int, int, double>{ 89, 146, 1.0 },
std::tuple<int, int, double>{ 89, 156, -1.0 },
std::tuple<int, int, double>{ 90, 84, 1.0 },
std::tuple<int, int, double>{ 90, 87, 1.0 },
std::tuple<int, int, double>{ 90, 90, 1.0 },
std::tuple<int, int, double>{ 90, 93, 1.0 },
std::tuple<int, int, double>{ 90, 96, 1.0 },
std::tuple<int, int, double>{ 90, 99, 1.0 },
std::tuple<int, int, double>{ 90, 102, 1.0 },
std::tuple<int, int, double>{ 90, 105, 1.0 },
std::tuple<int, int, double>{ 90, 108, 1.0 },
std::tuple<int, int, double>{ 90, 111, 1.0 },
std::tuple<int, int, double>{ 90, 114, 1.0 },
std::tuple<int, int, double>{ 90, 117, 1.0 },
std::tuple<int, int, double>{ 90, 120, 1.0 },
std::tuple<int, int, double>{ 90, 123, 1.0 },
std::tuple<int, int, double>{ 90, 157, -1.0 },
std::tuple<int, int, double>{ 91, 85, 1.0 },
std::tuple<int, int, double>{ 91, 88, 1.0 },
std::tuple<int, int, double>{ 91, 91, 1.0 },
std::tuple<int, int, double>{ 91, 94, 1.0 },
std::tuple<int, int, double>{ 91, 97, 1.0 },
std::tuple<int, int, double>{ 91, 100, 1.0 },
std::tuple<int, int, double>{ 91, 103, 1.0 },
std::tuple<int, int, double>{ 91, 106, 1.0 },
std::tuple<int, int, double>{ 91, 109, 1.0 },
std::tuple<int, int, double>{ 91, 112, 1.0 },
std::tuple<int, int, double>{ 91, 115, 1.0 },
std::tuple<int, int, double>{ 91, 118, 1.0 },
std::tuple<int, int, double>{ 91, 121, 1.0 },
std::tuple<int, int, double>{ 91, 124, 1.0 },
std::tuple<int, int, double>{ 91, 157, -1.0 },
std::tuple<int, int, double>{ 92, 86, 1.0 },
std::tuple<int, int, double>{ 92, 89, 1.0 },
std::tuple<int, int, double>{ 92, 92, 1.0 },
std::tuple<int, int, double>{ 92, 95, 1.0 },
std::tuple<int, int, double>{ 92, 98, 1.0 },
std::tuple<int, int, double>{ 92, 101, 1.0 },
std::tuple<int, int, double>{ 92, 104, 1.0 },
std::tuple<int, int, double>{ 92, 107, 1.0 },
std::tuple<int, int, double>{ 92, 110, 1.0 },
std::tuple<int, int, double>{ 92, 113, 1.0 },
std::tuple<int, int, double>{ 92, 116, 1.0 },
std::tuple<int, int, double>{ 92, 119, 1.0 },
std::tuple<int, int, double>{ 92, 122, 1.0 },
std::tuple<int, int, double>{ 92, 125, 1.0 },
std::tuple<int, int, double>{ 92, 157, -1.0 },
std::tuple<int, int, double>{ 93, 84, 1.0 },
std::tuple<int, int, double>{ 93, 87, 1.0 },
std::tuple<int, int, double>{ 93, 90, 1.0 },
std::tuple<int, int, double>{ 93, 93, 1.0 },
std::tuple<int, int, double>{ 93, 96, 1.0 },
std::tuple<int, int, double>{ 93, 99, 1.0 },
std::tuple<int, int, double>{ 93, 102, 1.0 },
std::tuple<int, int, double>{ 93, 126, 1.0 },
std::tuple<int, int, double>{ 93, 129, 1.0 },
std::tuple<int, int, double>{ 93, 132, 1.0 },
std::tuple<int, int, double>{ 93, 135, 1.0 },
std::tuple<int, int, double>{ 93, 138, 1.0 },
std::tuple<int, int, double>{ 93, 141, 1.0 },
std::tuple<int, int, double>{ 93, 144, 1.0 },
std::tuple<int, int, double>{ 93, 158, -1.0 },
std::tuple<int, int, double>{ 94, 85, 1.0 },
std::tuple<int, int, double>{ 94, 88, 1.0 },
std::tuple<int, int, double>{ 94, 91, 1.0 },
std::tuple<int, int, double>{ 94, 94, 1.0 },
std::tuple<int, int, double>{ 94, 97, 1.0 },
std::tuple<int, int, double>{ 94, 100, 1.0 },
std::tuple<int, int, double>{ 94, 103, 1.0 },
std::tuple<int, int, double>{ 94, 127, 1.0 },
std::tuple<int, int, double>{ 94, 130, 1.0 },
std::tuple<int, int, double>{ 94, 133, 1.0 },
std::tuple<int, int, double>{ 94, 136, 1.0 },
std::tuple<int, int, double>{ 94, 139, 1.0 },
std::tuple<int, int, double>{ 94, 142, 1.0 },
std::tuple<int, int, double>{ 94, 145, 1.0 },
std::tuple<int, int, double>{ 94, 158, -1.0 },
std::tuple<int, int, double>{ 95, 86, 1.0 },
std::tuple<int, int, double>{ 95, 89, 1.0 },
std::tuple<int, int, double>{ 95, 92, 1.0 },
std::tuple<int, int, double>{ 95, 95, 1.0 },
std::tuple<int, int, double>{ 95, 98, 1.0 },
std::tuple<int, int, double>{ 95, 101, 1.0 },
std::tuple<int, int, double>{ 95, 104, 1.0 },
std::tuple<int, int, double>{ 95, 128, 1.0 },
std::tuple<int, int, double>{ 95, 131, 1.0 },
std::tuple<int, int, double>{ 95, 134, 1.0 },
std::tuple<int, int, double>{ 95, 137, 1.0 },
std::tuple<int, int, double>{ 95, 140, 1.0 },
std::tuple<int, int, double>{ 95, 143, 1.0 },
std::tuple<int, int, double>{ 95, 146, 1.0 },
std::tuple<int, int, double>{ 95, 158, -1.0 },
};
Vec<std::string> rnames{
"ROW001", "ROW002", "ROW003", "ROW004", "ROW005", "ROW006", "ROW007",
"ROW008", "ROW009", "ROW010", "ROW011", "ROW012", "ROW013", "ROW014",
"ROW015", "ROW016", "ROW017", "ROW018", "ROW019", "ROW020", "ROW021",
"ROW022", "ROW023", "ROW024", "ROW025", "ROW026", "ROW027", "ROW028",
"ROW029", "ROW030", "ROW031", "ROW032", "ROW033", "ROW034", "ROW035",
"ROW036", "ROW037", "ROW038", "ROW039", "ROW040", "ROW041", "ROW042",
"ROW043", "ROW044", "ROW045", "ROW046", "ROW047", "ROW048", "ROW049",
"ROW050", "ROW051", "ROW052", "ROW053", "ROW054", "ROW055", "ROW056",
"ROW057", "ROW058", "ROW059", "ROW060", "ROW061", "ROW062", "ROW063",
"ROW064", "ROW065", "ROW066", "ROW067", "ROW068", "ROW069", "ROW070",
"ROW071", "ROW072", "ROW073", "ROW074", "ROW075", "ROW076", "ROW077",
"ROW078", "ROW079", "ROW080", "ROW081", "ROW082", "ROW083", "ROW084",
"ROW085", "ROW086", "ROW087", "ROW088", "ROW089", "ROW090", "ROW091",
"ROW092", "ROW093", "ROW094", "ROW095", "ROW096",
};
Vec<std::string> cnames{
"COL001", "COL002", "COL003", "COL004", "COL005", "COL006", "COL007",
"COL008", "COL009", "COL010", "COL011", "COL012", "COL013", "COL014",
"COL015", "COL016", "COL017", "COL018", "COL019", "COL020", "COL021",
"COL022", "COL023", "COL024", "COL025", "COL026", "COL027", "COL028",
"COL029", "COL030", "COL031", "COL032", "COL033", "COL034", "COL035",
"COL036", "COL037", "COL038", "COL039", "COL040", "COL041", "COL042",
"COL043", "COL044", "COL045", "COL046", "COL047", "COL048", "COL049",
"COL050", "COL051", "COL052", "COL053", "COL054", "COL055", "COL056",
"COL057", "COL058", "COL059", "COL060", "COL061", "COL062", "COL063",
"COL064", "COL065", "COL066", "COL067", "COL068", "COL069", "COL070",
"COL071", "COL072", "COL073", "COL074", "COL075", "COL076", "COL077",
"COL078", "COL079", "COL080", "COL081", "COL082", "COL083", "COL084",
"COL085", "COL086", "COL087", "COL088", "COL089", "COL090", "COL091",
"COL092", "COL093", "COL094", "COL095", "COL096", "COL097", "COL098",
"COL099", "COL100", "COL101", "COL102", "COL103", "COL104", "COL105",
"COL106", "COL107", "COL108", "COL109", "COL110", "COL111", "COL112",
"COL113", "COL114", "COL115", "COL116", "COL117", "COL118", "COL119",
"COL120", "COL121", "COL122", "COL123", "COL124", "COL125", "COL126",
"COL127", "COL128", "COL129", "COL130", "COL131", "COL132", "COL133",
"COL134", "COL135", "COL136", "COL137", "COL138", "COL139", "COL140",
"COL141", "COL142", "COL143", "COL144", "COL145", "COL146", "COL147",
"COL148", "COL149", "COL150", "COL151", "COL152", "COL153", "COL154",
"COL155", "COL156", "COL157", "COL158", "COL159", "COL160",
};
int nCols = 160;
int nRows = 96;
ProblemBuilder<double> pb;
pb.reserve( 2053, 96, 160 );
pb.setNumRows( nRows );
pb.setNumCols( nCols );
pb.setObjAll( coeffobj );
pb.setObjOffset( 0.0 );
pb.setColLbAll( lbs );
pb.setColLbInfAll( lbInf );
pb.setColUbAll( ubs );
pb.setColUbInfAll( ubInf );
pb.setColIntegralAll( isIntegral );
pb.setRowLhsInfAll( lhsIsInf );
pb.setRowRhsInfAll( rhsIsInf );
pb.setRowLhsAll( lhs );
pb.setRowRhsAll( rhs );
pb.setRowNameAll( rnames );
pb.addEntryAll( entries );
pb.setColNameAll( cnames );
pb.setProblemName( "misc03.hpp" );
Problem<double> problem = pb.build();
/// PROBLEM BUILDER CODE END
return problem;
}
} // namespace instances
} // namespace papilo
#endif
| 119,937
|
C++
|
.h
| 2,258
| 45.318423
| 79
| 0.5047
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,856
|
bell5.hpp
|
lgottwald_PaPILO/test/instances/bell5.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef PAPILO_TEST_INSTANCES_BELL5
#define PAPILO_TEST_INSTANCES_BELL5
#include "papilo/core/Problem.hpp"
#include "papilo/core/ProblemBuilder.hpp"
namespace papilo
{
namespace instances
{
Problem<double>
bell5()
{
/// PROBLEM BUILDER CODE
Vec<double> coeffobj{
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
43000.0, 43000.0, 43000.0, 43000.0, 43000.0, 43000.0, 43000.0, 43000.0,
43000.0, 43000.0, 43000.0, 43000.0, 43000.0, 43000.0, 58000.0, 58000.0,
58000.0, 59000.0, 59000.0, 59000.0, 59000.0, 60000.0, 59000.0, 59000.0,
59000.0, 58000.0, 58000.0, 58000.0, 10000.0, 10000.0, 10000.0, 10000.0,
10000.0, 10000.0, 10000.0, 10000.0, 10000.0, 10000.0, 10000.0, 10000.0,
10000.0, 10000.0, 24.5645, 20.3962, 14.1693, 50.2605, 58.0423, 36.6095,
39.201, 48.034, 29.4336, 36.0182, 18.7245, 30.3169, 5.3655, 25.55,
20.7977, 1.825, 2.45645, 2.03962, 1.41693, 5.02605, 5.80423, 3.66095,
3.9201, 4.8034, 2.94336, 3.60182, 1.87245, 3.03169, 0.53655, 2.555,
2.07977, 0.1825, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
};
Vec<double> lbs{
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,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.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, -800.0, -3100.0, -50.0, -40.0, -900.0,
-40.0, -7150.0, -4800.0, -3000.0, -250.0, -400.0, -1000.0, -4000.0,
-90.0, -700.0, -24.0, 8.0, 8.0, 8.0, 8.0, 1.0,
1.0, 13.0, 13.0, 1.0, 1.0, 13.0, 13.0, 8.0,
8.0, 2.0, 2.0,
};
Vec<std::tuple<int, int, double>> entries{
std::tuple<int, int, double>{ 0, 0, -1.0 },
std::tuple<int, int, double>{ 0, 1, 1.0 },
std::tuple<int, int, double>{ 1, 1, -1.0 },
std::tuple<int, int, double>{ 1, 2, 1.0 },
std::tuple<int, int, double>{ 2, 2, -1.0 },
std::tuple<int, int, double>{ 2, 3, 1.0 },
std::tuple<int, int, double>{ 3, 3, -1.0 },
std::tuple<int, int, double>{ 3, 4, 1.0 },
std::tuple<int, int, double>{ 4, 4, -1.0 },
std::tuple<int, int, double>{ 4, 5, 1.0 },
std::tuple<int, int, double>{ 5, 4, -1.0 },
std::tuple<int, int, double>{ 5, 6, 1.0 },
std::tuple<int, int, double>{ 6, 6, -1.0 },
std::tuple<int, int, double>{ 6, 7, 1.0 },
std::tuple<int, int, double>{ 7, 7, -1.0 },
std::tuple<int, int, double>{ 7, 8, 1.0 },
std::tuple<int, int, double>{ 8, 3, -1.0 },
std::tuple<int, int, double>{ 8, 9, 1.0 },
std::tuple<int, int, double>{ 9, 9, -1.0 },
std::tuple<int, int, double>{ 9, 10, 1.0 },
std::tuple<int, int, double>{ 10, 10, -1.0 },
std::tuple<int, int, double>{ 10, 11, 1.0 },
std::tuple<int, int, double>{ 11, 1, -1.0 },
std::tuple<int, int, double>{ 11, 12, 1.0 },
std::tuple<int, int, double>{ 12, 12, -1.0 },
std::tuple<int, int, double>{ 12, 13, 1.0 },
std::tuple<int, int, double>{ 13, 13, -1.0 },
std::tuple<int, int, double>{ 13, 14, 1.0 },
std::tuple<int, int, double>{ 14, 0, -1.0 },
std::tuple<int, int, double>{ 14, 15, 1.0 },
std::tuple<int, int, double>{ 15, 0, -20.0 },
std::tuple<int, int, double>{ 15, 16, 1.0 },
std::tuple<int, int, double>{ 15, 30, 1.0 },
std::tuple<int, int, double>{ 16, 1, -20.0 },
std::tuple<int, int, double>{ 16, 17, 1.0 },
std::tuple<int, int, double>{ 16, 31, 1.0 },
std::tuple<int, int, double>{ 17, 2, -20.0 },
std::tuple<int, int, double>{ 17, 18, 1.0 },
std::tuple<int, int, double>{ 17, 32, 1.0 },
std::tuple<int, int, double>{ 18, 3, -20.0 },
std::tuple<int, int, double>{ 18, 19, 1.0 },
std::tuple<int, int, double>{ 18, 33, 1.0 },
std::tuple<int, int, double>{ 19, 4, -20.0 },
std::tuple<int, int, double>{ 19, 20, 1.0 },
std::tuple<int, int, double>{ 19, 34, 1.0 },
std::tuple<int, int, double>{ 20, 5, -20.0 },
std::tuple<int, int, double>{ 20, 21, 1.0 },
std::tuple<int, int, double>{ 20, 35, 1.0 },
std::tuple<int, int, double>{ 21, 6, -20.0 },
std::tuple<int, int, double>{ 21, 22, 1.0 },
std::tuple<int, int, double>{ 21, 36, 1.0 },
std::tuple<int, int, double>{ 22, 8, -20.0 },
std::tuple<int, int, double>{ 22, 23, 1.0 },
std::tuple<int, int, double>{ 22, 37, 1.0 },
std::tuple<int, int, double>{ 23, 9, -20.0 },
std::tuple<int, int, double>{ 23, 24, 1.0 },
std::tuple<int, int, double>{ 23, 38, 1.0 },
std::tuple<int, int, double>{ 24, 10, -20.0 },
std::tuple<int, int, double>{ 24, 25, 1.0 },
std::tuple<int, int, double>{ 24, 39, 1.0 },
std::tuple<int, int, double>{ 25, 11, -20.0 },
std::tuple<int, int, double>{ 25, 26, 1.0 },
std::tuple<int, int, double>{ 25, 40, 1.0 },
std::tuple<int, int, double>{ 26, 12, -20.0 },
std::tuple<int, int, double>{ 26, 27, 1.0 },
std::tuple<int, int, double>{ 26, 41, 1.0 },
std::tuple<int, int, double>{ 27, 13, -20.0 },
std::tuple<int, int, double>{ 27, 28, 1.0 },
std::tuple<int, int, double>{ 27, 42, 1.0 },
std::tuple<int, int, double>{ 28, 15, -20.0 },
std::tuple<int, int, double>{ 28, 29, 1.0 },
std::tuple<int, int, double>{ 28, 43, 1.0 },
std::tuple<int, int, double>{ 29, 16, -672.0 },
std::tuple<int, int, double>{ 29, 30, -1344.0 },
std::tuple<int, int, double>{ 29, 74, -1.0 },
std::tuple<int, int, double>{ 29, 75, 1.0 },
std::tuple<int, int, double>{ 29, 89, 1.0 },
std::tuple<int, int, double>{ 29, 90, 1.0 },
std::tuple<int, int, double>{ 30, 17, -672.0 },
std::tuple<int, int, double>{ 30, 31, -1344.0 },
std::tuple<int, int, double>{ 30, 75, -1.0 },
std::tuple<int, int, double>{ 30, 76, 1.0 },
std::tuple<int, int, double>{ 30, 86, 1.0 },
std::tuple<int, int, double>{ 30, 91, 1.0 },
std::tuple<int, int, double>{ 31, 18, -672.0 },
std::tuple<int, int, double>{ 31, 32, -1344.0 },
std::tuple<int, int, double>{ 31, 76, -1.0 },
std::tuple<int, int, double>{ 31, 77, 1.0 },
std::tuple<int, int, double>{ 31, 92, 1.0 },
std::tuple<int, int, double>{ 32, 19, -672.0 },
std::tuple<int, int, double>{ 32, 33, -1344.0 },
std::tuple<int, int, double>{ 32, 77, -1.0 },
std::tuple<int, int, double>{ 32, 78, 1.0 },
std::tuple<int, int, double>{ 32, 83, 1.0 },
std::tuple<int, int, double>{ 32, 93, 1.0 },
std::tuple<int, int, double>{ 33, 20, -672.0 },
std::tuple<int, int, double>{ 33, 34, -1344.0 },
std::tuple<int, int, double>{ 33, 78, -1.0 },
std::tuple<int, int, double>{ 33, 79, 1.0 },
std::tuple<int, int, double>{ 33, 80, 1.0 },
std::tuple<int, int, double>{ 33, 94, 1.0 },
std::tuple<int, int, double>{ 34, 21, -672.0 },
std::tuple<int, int, double>{ 34, 35, -1344.0 },
std::tuple<int, int, double>{ 34, 79, -1.0 },
std::tuple<int, int, double>{ 34, 95, 1.0 },
std::tuple<int, int, double>{ 35, 22, -672.0 },
std::tuple<int, int, double>{ 35, 36, -1344.0 },
std::tuple<int, int, double>{ 35, 80, -1.0 },
std::tuple<int, int, double>{ 35, 81, 1.0 },
std::tuple<int, int, double>{ 35, 96, 1.0 },
std::tuple<int, int, double>{ 36, 81, -1.0 },
std::tuple<int, int, double>{ 36, 82, 1.0 },
std::tuple<int, int, double>{ 37, 23, -672.0 },
std::tuple<int, int, double>{ 37, 37, -1344.0 },
std::tuple<int, int, double>{ 37, 82, -1.0 },
std::tuple<int, int, double>{ 37, 97, 1.0 },
std::tuple<int, int, double>{ 38, 24, -672.0 },
std::tuple<int, int, double>{ 38, 38, -1344.0 },
std::tuple<int, int, double>{ 38, 83, -1.0 },
std::tuple<int, int, double>{ 38, 84, 1.0 },
std::tuple<int, int, double>{ 38, 98, 1.0 },
std::tuple<int, int, double>{ 39, 25, -672.0 },
std::tuple<int, int, double>{ 39, 39, -1344.0 },
std::tuple<int, int, double>{ 39, 84, -1.0 },
std::tuple<int, int, double>{ 39, 85, 1.0 },
std::tuple<int, int, double>{ 39, 99, 1.0 },
std::tuple<int, int, double>{ 40, 26, -672.0 },
std::tuple<int, int, double>{ 40, 40, -1344.0 },
std::tuple<int, int, double>{ 40, 85, -1.0 },
std::tuple<int, int, double>{ 40, 100, 1.0 },
std::tuple<int, int, double>{ 41, 27, -672.0 },
std::tuple<int, int, double>{ 41, 41, -1344.0 },
std::tuple<int, int, double>{ 41, 86, -1.0 },
std::tuple<int, int, double>{ 41, 87, 1.0 },
std::tuple<int, int, double>{ 41, 101, 1.0 },
std::tuple<int, int, double>{ 42, 28, -672.0 },
std::tuple<int, int, double>{ 42, 42, -1344.0 },
std::tuple<int, int, double>{ 42, 87, -1.0 },
std::tuple<int, int, double>{ 42, 88, 1.0 },
std::tuple<int, int, double>{ 42, 102, 1.0 },
std::tuple<int, int, double>{ 43, 88, -1.0 },
std::tuple<int, int, double>{ 44, 29, -672.0 },
std::tuple<int, int, double>{ 44, 43, -1344.0 },
std::tuple<int, int, double>{ 44, 89, -1.0 },
std::tuple<int, int, double>{ 44, 103, 1.0 },
std::tuple<int, int, double>{ 45, 44, -24.0 },
std::tuple<int, int, double>{ 45, 90, 1.0 },
std::tuple<int, int, double>{ 46, 45, -24.0 },
std::tuple<int, int, double>{ 46, 91, 1.0 },
std::tuple<int, int, double>{ 47, 46, -24.0 },
std::tuple<int, int, double>{ 47, 92, 1.0 },
std::tuple<int, int, double>{ 48, 47, -24.0 },
std::tuple<int, int, double>{ 48, 93, 1.0 },
std::tuple<int, int, double>{ 49, 48, -24.0 },
std::tuple<int, int, double>{ 49, 94, 1.0 },
std::tuple<int, int, double>{ 50, 49, -24.0 },
std::tuple<int, int, double>{ 50, 95, 1.0 },
std::tuple<int, int, double>{ 51, 50, -24.0 },
std::tuple<int, int, double>{ 51, 96, 1.0 },
std::tuple<int, int, double>{ 52, 51, -24.0 },
std::tuple<int, int, double>{ 52, 97, 1.0 },
std::tuple<int, int, double>{ 53, 52, -24.0 },
std::tuple<int, int, double>{ 53, 98, 1.0 },
std::tuple<int, int, double>{ 54, 53, -24.0 },
std::tuple<int, int, double>{ 54, 99, 1.0 },
std::tuple<int, int, double>{ 55, 54, -24.0 },
std::tuple<int, int, double>{ 55, 100, 1.0 },
std::tuple<int, int, double>{ 56, 55, -24.0 },
std::tuple<int, int, double>{ 56, 101, 1.0 },
std::tuple<int, int, double>{ 57, 56, -24.0 },
std::tuple<int, int, double>{ 57, 102, 1.0 },
std::tuple<int, int, double>{ 58, 57, -24.0 },
std::tuple<int, int, double>{ 58, 103, 1.0 },
std::tuple<int, int, double>{ 59, 58, -1.0 },
std::tuple<int, int, double>{ 59, 59, 1.0 },
std::tuple<int, int, double>{ 59, 73, 1.0 },
std::tuple<int, int, double>{ 59, 90, -1.0 },
std::tuple<int, int, double>{ 60, 59, -1.0 },
std::tuple<int, int, double>{ 60, 60, 1.0 },
std::tuple<int, int, double>{ 60, 70, 1.0 },
std::tuple<int, int, double>{ 60, 91, -1.0 },
std::tuple<int, int, double>{ 61, 60, -1.0 },
std::tuple<int, int, double>{ 61, 61, 1.0 },
std::tuple<int, int, double>{ 61, 92, -1.0 },
std::tuple<int, int, double>{ 62, 61, -1.0 },
std::tuple<int, int, double>{ 62, 62, 1.0 },
std::tuple<int, int, double>{ 62, 67, 1.0 },
std::tuple<int, int, double>{ 62, 93, -1.0 },
std::tuple<int, int, double>{ 63, 62, -1.0 },
std::tuple<int, int, double>{ 63, 63, 1.0 },
std::tuple<int, int, double>{ 63, 64, 1.0 },
std::tuple<int, int, double>{ 63, 94, -1.0 },
std::tuple<int, int, double>{ 64, 63, -1.0 },
std::tuple<int, int, double>{ 64, 95, -1.0 },
std::tuple<int, int, double>{ 65, 64, -1.0 },
std::tuple<int, int, double>{ 65, 65, 1.0 },
std::tuple<int, int, double>{ 65, 96, -1.0 },
std::tuple<int, int, double>{ 66, 65, -1.0 },
std::tuple<int, int, double>{ 66, 66, 1.0 },
std::tuple<int, int, double>{ 67, 66, -1.0 },
std::tuple<int, int, double>{ 67, 97, -1.0 },
std::tuple<int, int, double>{ 68, 67, -1.0 },
std::tuple<int, int, double>{ 68, 68, 1.0 },
std::tuple<int, int, double>{ 68, 98, -1.0 },
std::tuple<int, int, double>{ 69, 68, -1.0 },
std::tuple<int, int, double>{ 69, 69, 1.0 },
std::tuple<int, int, double>{ 69, 99, -1.0 },
std::tuple<int, int, double>{ 70, 69, -1.0 },
std::tuple<int, int, double>{ 70, 100, -1.0 },
std::tuple<int, int, double>{ 71, 70, -1.0 },
std::tuple<int, int, double>{ 71, 71, 1.0 },
std::tuple<int, int, double>{ 71, 101, -1.0 },
std::tuple<int, int, double>{ 72, 71, -1.0 },
std::tuple<int, int, double>{ 72, 72, 1.0 },
std::tuple<int, int, double>{ 72, 102, -1.0 },
std::tuple<int, int, double>{ 73, 72, -1.0 },
std::tuple<int, int, double>{ 74, 73, -1.0 },
std::tuple<int, int, double>{ 74, 103, -1.0 },
std::tuple<int, int, double>{ 75, 0, 1.0 },
std::tuple<int, int, double>{ 75, 58, 0.000833 },
std::tuple<int, int, double>{ 75, 74, 8.3e-05 },
std::tuple<int, int, double>{ 76, 1, 1.0 },
std::tuple<int, int, double>{ 76, 59, 0.000833 },
std::tuple<int, int, double>{ 76, 75, 8.3e-05 },
std::tuple<int, int, double>{ 77, 2, 1.0 },
std::tuple<int, int, double>{ 77, 60, 0.000833 },
std::tuple<int, int, double>{ 77, 76, 8.3e-05 },
std::tuple<int, int, double>{ 78, 3, 1.0 },
std::tuple<int, int, double>{ 78, 61, 0.000833 },
std::tuple<int, int, double>{ 78, 77, 8.3e-05 },
std::tuple<int, int, double>{ 79, 4, 1.0 },
std::tuple<int, int, double>{ 79, 62, 0.000833 },
std::tuple<int, int, double>{ 79, 78, 8.3e-05 },
std::tuple<int, int, double>{ 80, 5, 1.0 },
std::tuple<int, int, double>{ 80, 63, 0.000833 },
std::tuple<int, int, double>{ 80, 79, 8.3e-05 },
std::tuple<int, int, double>{ 81, 6, 1.0 },
std::tuple<int, int, double>{ 81, 64, 0.000833 },
std::tuple<int, int, double>{ 81, 80, 8.3e-05 },
std::tuple<int, int, double>{ 82, 7, 1.0 },
std::tuple<int, int, double>{ 82, 65, 0.000833 },
std::tuple<int, int, double>{ 82, 81, 8.3e-05 },
std::tuple<int, int, double>{ 83, 8, 1.0 },
std::tuple<int, int, double>{ 83, 66, 0.000833 },
std::tuple<int, int, double>{ 83, 82, 8.3e-05 },
std::tuple<int, int, double>{ 84, 9, 1.0 },
std::tuple<int, int, double>{ 84, 67, 0.000833 },
std::tuple<int, int, double>{ 84, 83, 8.3e-05 },
std::tuple<int, int, double>{ 85, 10, 1.0 },
std::tuple<int, int, double>{ 85, 68, 0.000833 },
std::tuple<int, int, double>{ 85, 84, 8.3e-05 },
std::tuple<int, int, double>{ 86, 11, 1.0 },
std::tuple<int, int, double>{ 86, 69, 0.000833 },
std::tuple<int, int, double>{ 86, 85, 8.3e-05 },
std::tuple<int, int, double>{ 87, 12, 1.0 },
std::tuple<int, int, double>{ 87, 70, 0.000833 },
std::tuple<int, int, double>{ 87, 86, 8.3e-05 },
std::tuple<int, int, double>{ 88, 13, 1.0 },
std::tuple<int, int, double>{ 88, 71, 0.000833 },
std::tuple<int, int, double>{ 88, 87, 8.3e-05 },
std::tuple<int, int, double>{ 89, 14, 1.0 },
std::tuple<int, int, double>{ 89, 72, 0.000833 },
std::tuple<int, int, double>{ 89, 88, 8.3e-05 },
std::tuple<int, int, double>{ 90, 15, 1.0 },
std::tuple<int, int, double>{ 90, 73, 0.000833 },
std::tuple<int, int, double>{ 90, 89, 8.3e-05 },
};
Vec<std::string> rnames{
"A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10",
"A11", "A12", "A13", "A14", "A15", "B1", "B2", "B3", "B4", "B5",
"B6", "B7", "B9", "B10", "B11", "B12", "B13", "B14", "B16", "C1",
"C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "C10", "C11",
"C12", "C13", "C14", "C15", "C16", "D1", "D2", "D3", "D4", "D5",
"D6", "D7", "D9", "D10", "D11", "D12", "D13", "D14", "D16", "E1",
"E2", "E3", "E4", "E5", "E6", "E7", "E8", "E9", "E10", "E11",
"E12", "E13", "E14", "E15", "E16", "F0", "F1", "F2", "F3", "F4",
"F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", "F14",
"F15",
};
Vec<std::string> cnames{
"c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10",
"c11", "c12", "c13", "c14", "c15", "c16", "d1", "d2", "d3", "d4",
"d5", "d6", "d7", "d9", "d10", "d11", "d12", "d13", "d14", "d16",
"h1", "h2", "h3", "h4", "h5", "h6", "h7", "h9", "h10", "h11",
"h12", "h13", "h14", "h16", "g1", "g2", "g3", "g4", "g5", "g6",
"g7", "g9", "g10", "g11", "g12", "g13", "g14", "g16", "a1", "a2",
"a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10", "a11", "a12",
"a13", "a14", "a15", "a16", "b1", "b2", "b3", "b4", "b5", "b6",
"b7", "b8", "b9", "b10", "b11", "b12", "b13", "b14", "b15", "b16",
"f1", "f2", "f3", "f4", "f5", "f6", "f7", "f9", "f10", "f11",
"f12", "f13", "f14", "f16",
};
int nCols = 104;
int nRows = 91;
ProblemBuilder<double> pb;
pb.reserve( 266, 91, 104 );
pb.setNumRows( nRows );
pb.setNumCols( nCols );
pb.setObjAll( coeffobj );
pb.setObjOffset( 0.0 );
pb.setColLbAll( lbs );
pb.setColLbInfAll( lbInf );
pb.setColUbAll( ubs );
pb.setColUbInfAll( ubInf );
pb.setColIntegralAll( isIntegral );
pb.setRowLhsInfAll( lhsIsInf );
pb.setRowRhsInfAll( rhsIsInf );
pb.setRowLhsAll( lhs );
pb.setRowRhsAll( rhs );
pb.setRowNameAll( rnames );
pb.addEntryAll( entries );
pb.setColNameAll( cnames );
pb.setProblemName( "bell5.hpp" );
Problem<double> problem = pb.build();
/// PROBLEM BUILDER CODE END
return problem;
}
} // namespace instances
} // namespace papilo
#endif
| 24,376
|
C++
|
.h
| 451
| 47.059867
| 79
| 0.460448
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,857
|
gt2.hpp
|
lgottwald_PaPILO/test/instances/gt2.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef PAPILO_TEST_INSTANCES_GT2
#define PAPILO_TEST_INSTANCES_GT2
#include "papilo/core/Problem.hpp"
#include "papilo/core/ProblemBuilder.hpp"
namespace papilo
{
namespace instances
{
Problem<double>
gt2()
{
/// PROBLEM BUILDER CODE
Vec<double> coeffobj{
3595.0, 3595.0, 1833.0, 3595.0, 3595.0, 3595.0, 1833.0, 3595.0, 3100.0,
3100.0, 1257.0, 3100.0, 1355.0, 7797.0, 3100.0, 3100.0, 1257.0, 3100.0,
1355.0, 7797.0, 2685.0, 2685.0, 1257.0, 2685.0, 1176.0, 6214.0, 2685.0,
2685.0, 1257.0, 2685.0, 1176.0, 6214.0, 2940.0, 2940.0, 1980.0, 2940.0,
1980.0, 7145.0, 2940.0, 2940.0, 1980.0, 2940.0, 1980.0, 7145.0, 3100.0,
3100.0, 1816.0, 3100.0, 1926.0, 7011.0, 3100.0, 3100.0, 1816.0, 3100.0,
1926.0, 7011.0, 3100.0, 3100.0, 1816.0, 3100.0, 1983.0, 7797.0, 3100.0,
3100.0, 1816.0, 3100.0, 1983.0, 7797.0, 1926.0, 7011.0, 1926.0, 7011.0,
3100.0, 3100.0, 1257.0, 3100.0, 3100.0, 3100.0, 1257.0, 3100.0, 2448.0,
2448.0, 1652.0, 2448.0, 1652.0, 5954.0, 2448.0, 2448.0, 1652.0, 2448.0,
1652.0, 5954.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0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 1, 1, 1, 1, 1, 1, 1,
};
Vec<double> lhs{
200.0, 80.0, 300.0, 250.0, 61.0, 6064.0, 94.0, 67.0, 450.0, 231.0,
76.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
};
Vec<uint8_t> rhsIsInf{
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
Vec<double> rhs{
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 9.0, 15.0, 14.0, 1.0, 6.0, 8.0, 5.0, 12.0,
5.0, 6.0, 4.0, 9.0, 5.0, 4.0, 2.0, 2.0, 1.0,
};
Vec<std::tuple<int, int, double>> entries{
std::tuple<int, int, double>{ 0, 0, 50.0 },
std::tuple<int, int, double>{ 0, 8, 45.0 },
std::tuple<int, int, double>{ 0, 20, 40.0 },
std::tuple<int, int, double>{ 0, 32, 30.0 },
std::tuple<int, int, double>{ 0, 44, 32.0 },
std::tuple<int, int, double>{ 0, 56, 50.0 },
std::tuple<int, int, double>{ 0, 72, 45.0 },
std::tuple<int, int, double>{ 0, 80, 2534.0 },
std::tuple<int, int, double>{ 0, 92, 22.0 },
std::tuple<int, int, double>{ 0, 93, 56.0 },
std::tuple<int, int, double>{ 0, 94, 30.0 },
std::tuple<int, int, double>{ 0, 95, 30.0 },
std::tuple<int, int, double>{ 0, 96, 23.0 },
std::tuple<int, int, double>{ 0, 97, 42.0 },
std::tuple<int, int, double>{ 0, 98, 56.0 },
std::tuple<int, int, double>{ 0, 99, 28.0 },
std::tuple<int, int, double>{ 1, 1, 50.0 },
std::tuple<int, int, double>{ 1, 9, 45.0 },
std::tuple<int, int, double>{ 1, 21, 40.0 },
std::tuple<int, int, double>{ 1, 33, 30.0 },
std::tuple<int, int, double>{ 1, 45, 32.0 },
std::tuple<int, int, double>{ 1, 57, 50.0 },
std::tuple<int, int, double>{ 1, 73, 45.0 },
std::tuple<int, int, double>{ 1, 81, 2534.0 },
std::tuple<int, int, double>{ 1, 100, 22.0 },
std::tuple<int, int, double>{ 1, 101, 56.0 },
std::tuple<int, int, double>{ 1, 102, 30.0 },
std::tuple<int, int, double>{ 1, 103, 30.0 },
std::tuple<int, int, double>{ 1, 104, 23.0 },
std::tuple<int, int, double>{ 1, 105, 42.0 },
std::tuple<int, int, double>{ 1, 106, 56.0 },
std::tuple<int, int, double>{ 1, 107, 28.0 },
std::tuple<int, int, double>{ 2, 2, 50.0 },
std::tuple<int, int, double>{ 2, 10, 45.0 },
std::tuple<int, int, double>{ 2, 22, 40.0 },
std::tuple<int, int, double>{ 2, 34, 30.0 },
std::tuple<int, int, double>{ 2, 46, 32.0 },
std::tuple<int, int, double>{ 2, 58, 50.0 },
std::tuple<int, int, double>{ 2, 74, 45.0 },
std::tuple<int, int, double>{ 2, 82, 2534.0 },
std::tuple<int, int, double>{ 2, 108, 22.0 },
std::tuple<int, int, double>{ 2, 109, 56.0 },
std::tuple<int, int, double>{ 2, 110, 30.0 },
std::tuple<int, int, double>{ 2, 111, 30.0 },
std::tuple<int, int, double>{ 2, 112, 23.0 },
std::tuple<int, int, double>{ 2, 113, 42.0 },
std::tuple<int, int, double>{ 2, 114, 56.0 },
std::tuple<int, int, double>{ 2, 115, 28.0 },
std::tuple<int, int, double>{ 3, 3, 50.0 },
std::tuple<int, int, double>{ 3, 11, 45.0 },
std::tuple<int, int, double>{ 3, 23, 40.0 },
std::tuple<int, int, double>{ 3, 35, 30.0 },
std::tuple<int, int, double>{ 3, 47, 32.0 },
std::tuple<int, int, double>{ 3, 59, 52.0 },
std::tuple<int, int, double>{ 3, 75, 44.0 },
std::tuple<int, int, double>{ 3, 83, 2534.0 },
std::tuple<int, int, double>{ 3, 116, 22.0 },
std::tuple<int, int, double>{ 3, 117, 56.0 },
std::tuple<int, int, double>{ 3, 118, 30.0 },
std::tuple<int, int, double>{ 3, 119, 30.0 },
std::tuple<int, int, double>{ 3, 120, 23.0 },
std::tuple<int, int, double>{ 3, 121, 42.0 },
std::tuple<int, int, double>{ 3, 122, 56.0 },
std::tuple<int, int, double>{ 3, 123, 28.0 },
std::tuple<int, int, double>{ 4, 12, 28.0 },
std::tuple<int, int, double>{ 4, 24, 45.0 },
std::tuple<int, int, double>{ 4, 36, 16.5 },
std::tuple<int, int, double>{ 4, 48, 45.0 },
std::tuple<int, int, double>{ 4, 60, 52.0 },
std::tuple<int, int, double>{ 4, 68, 45.0 },
std::tuple<int, int, double>{ 4, 84, 2519.0 },
std::tuple<int, int, double>{ 4, 124, 25.0 },
std::tuple<int, int, double>{ 4, 125, 34.0 },
std::tuple<int, int, double>{ 4, 126, 25.0 },
std::tuple<int, int, double>{ 4, 127, 19.0 },
std::tuple<int, int, double>{ 4, 128, 56.0 },
std::tuple<int, int, double>{ 4, 129, 34.0 },
std::tuple<int, int, double>{ 4, 130, 34.0 },
std::tuple<int, int, double>{ 4, 131, 25.0 },
std::tuple<int, int, double>{ 5, 13, 28.0 },
std::tuple<int, int, double>{ 5, 25, 45.0 },
std::tuple<int, int, double>{ 5, 37, 16.5 },
std::tuple<int, int, double>{ 5, 49, 45.0 },
std::tuple<int, int, double>{ 5, 61, 52.0 },
std::tuple<int, int, double>{ 5, 69, 45.0 },
std::tuple<int, int, double>{ 5, 85, 2519.0 },
std::tuple<int, int, double>{ 5, 132, 25.0 },
std::tuple<int, int, double>{ 5, 133, 34.0 },
std::tuple<int, int, double>{ 5, 134, 25.0 },
std::tuple<int, int, double>{ 5, 135, 19.0 },
std::tuple<int, int, double>{ 5, 136, 56.0 },
std::tuple<int, int, double>{ 5, 137, 34.0 },
std::tuple<int, int, double>{ 5, 138, 34.0 },
std::tuple<int, int, double>{ 5, 139, 25.0 },
std::tuple<int, int, double>{ 6, 4, 50.0 },
std::tuple<int, int, double>{ 6, 14, 45.0 },
std::tuple<int, int, double>{ 6, 26, 40.0 },
std::tuple<int, int, double>{ 6, 38, 30.0 },
std::tuple<int, int, double>{ 6, 50, 32.0 },
std::tuple<int, int, double>{ 6, 62, 50.0 },
std::tuple<int, int, double>{ 6, 76, 45.0 },
std::tuple<int, int, double>{ 6, 86, 2534.0 },
std::tuple<int, int, double>{ 6, 140, 22.0 },
std::tuple<int, int, double>{ 6, 141, 56.0 },
std::tuple<int, int, double>{ 6, 142, 30.0 },
std::tuple<int, int, double>{ 6, 143, 30.0 },
std::tuple<int, int, double>{ 6, 144, 23.0 },
std::tuple<int, int, double>{ 6, 145, 42.0 },
std::tuple<int, int, double>{ 6, 146, 56.0 },
std::tuple<int, int, double>{ 6, 147, 28.0 },
std::tuple<int, int, double>{ 7, 5, 50.0 },
std::tuple<int, int, double>{ 7, 15, 45.0 },
std::tuple<int, int, double>{ 7, 27, 40.0 },
std::tuple<int, int, double>{ 7, 39, 30.0 },
std::tuple<int, int, double>{ 7, 51, 32.0 },
std::tuple<int, int, double>{ 7, 63, 50.0 },
std::tuple<int, int, double>{ 7, 77, 45.0 },
std::tuple<int, int, double>{ 7, 87, 2534.0 },
std::tuple<int, int, double>{ 7, 148, 22.0 },
std::tuple<int, int, double>{ 7, 149, 56.0 },
std::tuple<int, int, double>{ 7, 150, 30.0 },
std::tuple<int, int, double>{ 7, 151, 30.0 },
std::tuple<int, int, double>{ 7, 152, 23.0 },
std::tuple<int, int, double>{ 7, 153, 42.0 },
std::tuple<int, int, double>{ 7, 154, 56.0 },
std::tuple<int, int, double>{ 7, 155, 28.0 },
std::tuple<int, int, double>{ 8, 6, 50.0 },
std::tuple<int, int, double>{ 8, 16, 45.0 },
std::tuple<int, int, double>{ 8, 28, 40.0 },
std::tuple<int, int, double>{ 8, 40, 30.0 },
std::tuple<int, int, double>{ 8, 52, 32.0 },
std::tuple<int, int, double>{ 8, 64, 50.0 },
std::tuple<int, int, double>{ 8, 78, 45.0 },
std::tuple<int, int, double>{ 8, 88, 2534.0 },
std::tuple<int, int, double>{ 8, 156, 22.0 },
std::tuple<int, int, double>{ 8, 157, 56.0 },
std::tuple<int, int, double>{ 8, 158, 30.0 },
std::tuple<int, int, double>{ 8, 159, 30.0 },
std::tuple<int, int, double>{ 8, 160, 23.0 },
std::tuple<int, int, double>{ 8, 161, 42.0 },
std::tuple<int, int, double>{ 8, 162, 56.0 },
std::tuple<int, int, double>{ 8, 163, 28.0 },
std::tuple<int, int, double>{ 9, 7, 50.0 },
std::tuple<int, int, double>{ 9, 17, 45.0 },
std::tuple<int, int, double>{ 9, 29, 40.0 },
std::tuple<int, int, double>{ 9, 41, 30.0 },
std::tuple<int, int, double>{ 9, 53, 32.0 },
std::tuple<int, int, double>{ 9, 65, 52.0 },
std::tuple<int, int, double>{ 9, 79, 44.0 },
std::tuple<int, int, double>{ 9, 89, 2534.0 },
std::tuple<int, int, double>{ 9, 164, 22.0 },
std::tuple<int, int, double>{ 9, 165, 56.0 },
std::tuple<int, int, double>{ 9, 166, 30.0 },
std::tuple<int, int, double>{ 9, 167, 30.0 },
std::tuple<int, int, double>{ 9, 168, 23.0 },
std::tuple<int, int, double>{ 9, 169, 42.0 },
std::tuple<int, int, double>{ 9, 170, 56.0 },
std::tuple<int, int, double>{ 9, 171, 28.0 },
std::tuple<int, int, double>{ 10, 18, 28.0 },
std::tuple<int, int, double>{ 10, 30, 45.0 },
std::tuple<int, int, double>{ 10, 42, 16.5 },
std::tuple<int, int, double>{ 10, 54, 45.0 },
std::tuple<int, int, double>{ 10, 66, 52.0 },
std::tuple<int, int, double>{ 10, 70, 45.0 },
std::tuple<int, int, double>{ 10, 90, 2519.0 },
std::tuple<int, int, double>{ 10, 172, 25.0 },
std::tuple<int, int, double>{ 10, 173, 34.0 },
std::tuple<int, int, double>{ 10, 174, 25.0 },
std::tuple<int, int, double>{ 10, 175, 19.0 },
std::tuple<int, int, double>{ 10, 176, 56.0 },
std::tuple<int, int, double>{ 10, 177, 34.0 },
std::tuple<int, int, double>{ 10, 178, 34.0 },
std::tuple<int, int, double>{ 10, 179, 25.0 },
std::tuple<int, int, double>{ 11, 19, 28.0 },
std::tuple<int, int, double>{ 11, 31, 45.0 },
std::tuple<int, int, double>{ 11, 43, 16.5 },
std::tuple<int, int, double>{ 11, 55, 45.0 },
std::tuple<int, int, double>{ 11, 67, 52.0 },
std::tuple<int, int, double>{ 11, 71, 45.0 },
std::tuple<int, int, double>{ 11, 91, 2519.0 },
std::tuple<int, int, double>{ 11, 180, 25.0 },
std::tuple<int, int, double>{ 11, 181, 34.0 },
std::tuple<int, int, double>{ 11, 182, 25.0 },
std::tuple<int, int, double>{ 11, 183, 19.0 },
std::tuple<int, int, double>{ 11, 184, 56.0 },
std::tuple<int, int, double>{ 11, 185, 34.0 },
std::tuple<int, int, double>{ 11, 186, 34.0 },
std::tuple<int, int, double>{ 11, 187, 25.0 },
std::tuple<int, int, double>{ 12, 0, 1.0 },
std::tuple<int, int, double>{ 12, 1, 1.0 },
std::tuple<int, int, double>{ 12, 2, 1.0 },
std::tuple<int, int, double>{ 12, 3, 1.0 },
std::tuple<int, int, double>{ 12, 4, 1.0 },
std::tuple<int, int, double>{ 12, 5, 1.0 },
std::tuple<int, int, double>{ 12, 6, 1.0 },
std::tuple<int, int, double>{ 12, 7, 1.0 },
std::tuple<int, int, double>{ 13, 8, 1.0 },
std::tuple<int, int, double>{ 13, 9, 1.0 },
std::tuple<int, int, double>{ 13, 10, 1.0 },
std::tuple<int, int, double>{ 13, 11, 1.0 },
std::tuple<int, int, double>{ 13, 12, 1.0 },
std::tuple<int, int, double>{ 13, 13, 1.0 },
std::tuple<int, int, double>{ 13, 14, 1.0 },
std::tuple<int, int, double>{ 13, 15, 1.0 },
std::tuple<int, int, double>{ 13, 16, 1.0 },
std::tuple<int, int, double>{ 13, 17, 1.0 },
std::tuple<int, int, double>{ 13, 18, 1.0 },
std::tuple<int, int, double>{ 13, 19, 1.0 },
std::tuple<int, int, double>{ 14, 20, 1.0 },
std::tuple<int, int, double>{ 14, 21, 1.0 },
std::tuple<int, int, double>{ 14, 22, 1.0 },
std::tuple<int, int, double>{ 14, 23, 1.0 },
std::tuple<int, int, double>{ 14, 24, 1.0 },
std::tuple<int, int, double>{ 14, 25, 1.0 },
std::tuple<int, int, double>{ 14, 26, 1.0 },
std::tuple<int, int, double>{ 14, 27, 1.0 },
std::tuple<int, int, double>{ 14, 28, 1.0 },
std::tuple<int, int, double>{ 14, 29, 1.0 },
std::tuple<int, int, double>{ 14, 30, 1.0 },
std::tuple<int, int, double>{ 14, 31, 1.0 },
std::tuple<int, int, double>{ 15, 32, 1.0 },
std::tuple<int, int, double>{ 15, 33, 1.0 },
std::tuple<int, int, double>{ 15, 34, 1.0 },
std::tuple<int, int, double>{ 15, 35, 1.0 },
std::tuple<int, int, double>{ 15, 36, 1.0 },
std::tuple<int, int, double>{ 15, 37, 1.0 },
std::tuple<int, int, double>{ 15, 38, 1.0 },
std::tuple<int, int, double>{ 15, 39, 1.0 },
std::tuple<int, int, double>{ 15, 40, 1.0 },
std::tuple<int, int, double>{ 15, 41, 1.0 },
std::tuple<int, int, double>{ 15, 42, 1.0 },
std::tuple<int, int, double>{ 15, 43, 1.0 },
std::tuple<int, int, double>{ 16, 44, 1.0 },
std::tuple<int, int, double>{ 16, 45, 1.0 },
std::tuple<int, int, double>{ 16, 46, 1.0 },
std::tuple<int, int, double>{ 16, 47, 1.0 },
std::tuple<int, int, double>{ 16, 48, 1.0 },
std::tuple<int, int, double>{ 16, 49, 1.0 },
std::tuple<int, int, double>{ 16, 50, 1.0 },
std::tuple<int, int, double>{ 16, 51, 1.0 },
std::tuple<int, int, double>{ 16, 52, 1.0 },
std::tuple<int, int, double>{ 16, 53, 1.0 },
std::tuple<int, int, double>{ 16, 54, 1.0 },
std::tuple<int, int, double>{ 16, 55, 1.0 },
std::tuple<int, int, double>{ 17, 56, 1.0 },
std::tuple<int, int, double>{ 17, 57, 1.0 },
std::tuple<int, int, double>{ 17, 58, 1.0 },
std::tuple<int, int, double>{ 17, 59, 1.0 },
std::tuple<int, int, double>{ 17, 60, 1.0 },
std::tuple<int, int, double>{ 17, 61, 1.0 },
std::tuple<int, int, double>{ 17, 62, 1.0 },
std::tuple<int, int, double>{ 17, 63, 1.0 },
std::tuple<int, int, double>{ 17, 64, 1.0 },
std::tuple<int, int, double>{ 17, 65, 1.0 },
std::tuple<int, int, double>{ 17, 66, 1.0 },
std::tuple<int, int, double>{ 17, 67, 1.0 },
std::tuple<int, int, double>{ 18, 68, 1.0 },
std::tuple<int, int, double>{ 18, 69, 1.0 },
std::tuple<int, int, double>{ 18, 70, 1.0 },
std::tuple<int, int, double>{ 18, 71, 1.0 },
std::tuple<int, int, double>{ 19, 72, 1.0 },
std::tuple<int, int, double>{ 19, 73, 1.0 },
std::tuple<int, int, double>{ 19, 74, 1.0 },
std::tuple<int, int, double>{ 19, 75, 1.0 },
std::tuple<int, int, double>{ 19, 76, 1.0 },
std::tuple<int, int, double>{ 19, 77, 1.0 },
std::tuple<int, int, double>{ 19, 78, 1.0 },
std::tuple<int, int, double>{ 19, 79, 1.0 },
std::tuple<int, int, double>{ 20, 80, 1.0 },
std::tuple<int, int, double>{ 20, 81, 1.0 },
std::tuple<int, int, double>{ 20, 82, 1.0 },
std::tuple<int, int, double>{ 20, 83, 1.0 },
std::tuple<int, int, double>{ 20, 84, 1.0 },
std::tuple<int, int, double>{ 20, 85, 1.0 },
std::tuple<int, int, double>{ 20, 86, 1.0 },
std::tuple<int, int, double>{ 20, 87, 1.0 },
std::tuple<int, int, double>{ 20, 88, 1.0 },
std::tuple<int, int, double>{ 20, 89, 1.0 },
std::tuple<int, int, double>{ 20, 90, 1.0 },
std::tuple<int, int, double>{ 20, 91, 1.0 },
std::tuple<int, int, double>{ 21, 92, 1.0 },
std::tuple<int, int, double>{ 21, 100, 1.0 },
std::tuple<int, int, double>{ 21, 108, 1.0 },
std::tuple<int, int, double>{ 21, 116, 1.0 },
std::tuple<int, int, double>{ 21, 124, 1.0 },
std::tuple<int, int, double>{ 21, 132, 1.0 },
std::tuple<int, int, double>{ 21, 140, 1.0 },
std::tuple<int, int, double>{ 21, 148, 1.0 },
std::tuple<int, int, double>{ 21, 156, 1.0 },
std::tuple<int, int, double>{ 21, 164, 1.0 },
std::tuple<int, int, double>{ 21, 172, 1.0 },
std::tuple<int, int, double>{ 21, 180, 1.0 },
std::tuple<int, int, double>{ 22, 93, 1.0 },
std::tuple<int, int, double>{ 22, 101, 1.0 },
std::tuple<int, int, double>{ 22, 109, 1.0 },
std::tuple<int, int, double>{ 22, 117, 1.0 },
std::tuple<int, int, double>{ 22, 125, 1.0 },
std::tuple<int, int, double>{ 22, 133, 1.0 },
std::tuple<int, int, double>{ 22, 141, 1.0 },
std::tuple<int, int, double>{ 22, 149, 1.0 },
std::tuple<int, int, double>{ 22, 157, 1.0 },
std::tuple<int, int, double>{ 22, 165, 1.0 },
std::tuple<int, int, double>{ 22, 173, 1.0 },
std::tuple<int, int, double>{ 22, 181, 1.0 },
std::tuple<int, int, double>{ 23, 94, 1.0 },
std::tuple<int, int, double>{ 23, 102, 1.0 },
std::tuple<int, int, double>{ 23, 110, 1.0 },
std::tuple<int, int, double>{ 23, 118, 1.0 },
std::tuple<int, int, double>{ 23, 126, 1.0 },
std::tuple<int, int, double>{ 23, 134, 1.0 },
std::tuple<int, int, double>{ 23, 142, 1.0 },
std::tuple<int, int, double>{ 23, 150, 1.0 },
std::tuple<int, int, double>{ 23, 158, 1.0 },
std::tuple<int, int, double>{ 23, 166, 1.0 },
std::tuple<int, int, double>{ 23, 174, 1.0 },
std::tuple<int, int, double>{ 23, 182, 1.0 },
std::tuple<int, int, double>{ 24, 95, 1.0 },
std::tuple<int, int, double>{ 24, 103, 1.0 },
std::tuple<int, int, double>{ 24, 111, 1.0 },
std::tuple<int, int, double>{ 24, 119, 1.0 },
std::tuple<int, int, double>{ 24, 127, 1.0 },
std::tuple<int, int, double>{ 24, 135, 1.0 },
std::tuple<int, int, double>{ 24, 143, 1.0 },
std::tuple<int, int, double>{ 24, 151, 1.0 },
std::tuple<int, int, double>{ 24, 159, 1.0 },
std::tuple<int, int, double>{ 24, 167, 1.0 },
std::tuple<int, int, double>{ 24, 175, 1.0 },
std::tuple<int, int, double>{ 24, 183, 1.0 },
std::tuple<int, int, double>{ 25, 96, 1.0 },
std::tuple<int, int, double>{ 25, 104, 1.0 },
std::tuple<int, int, double>{ 25, 112, 1.0 },
std::tuple<int, int, double>{ 25, 120, 1.0 },
std::tuple<int, int, double>{ 25, 128, 1.0 },
std::tuple<int, int, double>{ 25, 136, 1.0 },
std::tuple<int, int, double>{ 25, 144, 1.0 },
std::tuple<int, int, double>{ 25, 152, 1.0 },
std::tuple<int, int, double>{ 25, 160, 1.0 },
std::tuple<int, int, double>{ 25, 168, 1.0 },
std::tuple<int, int, double>{ 25, 176, 1.0 },
std::tuple<int, int, double>{ 25, 184, 1.0 },
std::tuple<int, int, double>{ 26, 97, 1.0 },
std::tuple<int, int, double>{ 26, 105, 1.0 },
std::tuple<int, int, double>{ 26, 113, 1.0 },
std::tuple<int, int, double>{ 26, 121, 1.0 },
std::tuple<int, int, double>{ 26, 129, 1.0 },
std::tuple<int, int, double>{ 26, 137, 1.0 },
std::tuple<int, int, double>{ 26, 145, 1.0 },
std::tuple<int, int, double>{ 26, 153, 1.0 },
std::tuple<int, int, double>{ 26, 161, 1.0 },
std::tuple<int, int, double>{ 26, 169, 1.0 },
std::tuple<int, int, double>{ 26, 177, 1.0 },
std::tuple<int, int, double>{ 26, 185, 1.0 },
std::tuple<int, int, double>{ 27, 98, 1.0 },
std::tuple<int, int, double>{ 27, 106, 1.0 },
std::tuple<int, int, double>{ 27, 114, 1.0 },
std::tuple<int, int, double>{ 27, 122, 1.0 },
std::tuple<int, int, double>{ 27, 130, 1.0 },
std::tuple<int, int, double>{ 27, 138, 1.0 },
std::tuple<int, int, double>{ 27, 146, 1.0 },
std::tuple<int, int, double>{ 27, 154, 1.0 },
std::tuple<int, int, double>{ 27, 162, 1.0 },
std::tuple<int, int, double>{ 27, 170, 1.0 },
std::tuple<int, int, double>{ 27, 178, 1.0 },
std::tuple<int, int, double>{ 27, 186, 1.0 },
std::tuple<int, int, double>{ 28, 99, 1.0 },
std::tuple<int, int, double>{ 28, 107, 1.0 },
std::tuple<int, int, double>{ 28, 115, 1.0 },
std::tuple<int, int, double>{ 28, 123, 1.0 },
std::tuple<int, int, double>{ 28, 131, 1.0 },
std::tuple<int, int, double>{ 28, 139, 1.0 },
std::tuple<int, int, double>{ 28, 147, 1.0 },
std::tuple<int, int, double>{ 28, 155, 1.0 },
std::tuple<int, int, double>{ 28, 163, 1.0 },
std::tuple<int, int, double>{ 28, 171, 1.0 },
std::tuple<int, int, double>{ 28, 179, 1.0 },
std::tuple<int, int, double>{ 28, 187, 1.0 },
};
Vec<std::string> rnames{
"dem...01", "dem...02", "dem...03", "dem...04", "dem...05", "dem...06",
"dem...07", "dem...08", "dem...09", "dem...10", "dem...11", "dem...12",
"avail.01", "avail.02", "avail.03", "avail.04", "avail.05", "avail.06",
"avail.07", "avail.08", "avail.09", "avail.10", "avail.11", "avail.12",
"avail.13", "avail.14", "avail.15", "avail.16", "avail.17",
};
Vec<std::string> cnames{
"x...0101", "x...0201", "x...0301", "x...0401", "x...0701", "x...0801",
"x...0901", "x...1001", "x...0102", "x...0202", "x...0302", "x...0402",
"x...0502", "x...0602", "x...0702", "x...0802", "x...0902", "x...1002",
"x...1102", "x...1202", "x...0103", "x...0203", "x...0303", "x...0403",
"x...0503", "x...0603", "x...0703", "x...0803", "x...0903", "x...1003",
"x...1103", "x...1203", "x...0104", "x...0204", "x...0304", "x...0404",
"x...0504", "x...0604", "x...0704", "x...0804", "x...0904", "x...1004",
"x...1104", "x...1204", "x...0105", "x...0205", "x...0305", "x...0405",
"x...0505", "x...0605", "x...0705", "x...0805", "x...0905", "x...1005",
"x...1105", "x...1205", "x...0106", "x...0206", "x...0306", "x...0406",
"x...0506", "x...0606", "x...0706", "x...0806", "x...0906", "x...1006",
"x...1106", "x...1206", "x...0507", "x...0607", "x...1107", "x...1207",
"x...0108", "x...0208", "x...0308", "x...0408", "x...0708", "x...0808",
"x...0908", "x...1008", "x...0109", "x...0209", "x...0309", "x...0409",
"x...0509", "x...0609", "x...0709", "x...0809", "x...0909", "x...1009",
"x...1109", "x...1209", "x...0110", "x...0111", "x...0112", "x...0113",
"x...0114", "x...0115", "x...0116", "x...0117", "x...0210", "x...0211",
"x...0212", "x...0213", "x...0214", "x...0215", "x...0216", "x...0217",
"x...0310", "x...0311", "x...0312", "x...0313", "x...0314", "x...0315",
"x...0316", "x...0317", "x...0410", "x...0411", "x...0412", "x...0413",
"x...0414", "x...0415", "x...0416", "x...0417", "x...0510", "x...0511",
"x...0512", "x...0513", "x...0514", "x...0515", "x...0516", "x...0517",
"x...0610", "x...0611", "x...0612", "x...0613", "x...0614", "x...0615",
"x...0616", "x...0617", "x...0710", "x...0711", "x...0712", "x...0713",
"x...0714", "x...0715", "x...0716", "x...0717", "x...0810", "x...0811",
"x...0812", "x...0813", "x...0814", "x...0815", "x...0816", "x...0817",
"x...0910", "x...0911", "x...0912", "x...0913", "x...0914", "x...0915",
"x...0916", "x...0917", "x...1010", "x...1011", "x...1012", "x...1013",
"x...1014", "x...1015", "x...1016", "x...1017", "x...1110", "x...1111",
"x...1112", "x...1113", "x...1114", "x...1115", "x...1116", "x...1117",
"x...1210", "x...1211", "x...1212", "x...1213", "x...1214", "x...1215",
"x...1216", "x...1217",
};
int nCols = 188;
int nRows = 29;
ProblemBuilder<double> pb;
pb.reserve( 376, 29, 188 );
pb.setNumRows( nRows );
pb.setNumCols( nCols );
pb.setObjAll( coeffobj );
pb.setObjOffset( 0.0 );
pb.setColLbAll( lbs );
pb.setColLbInfAll( lbInf );
pb.setColUbAll( ubs );
pb.setColUbInfAll( ubInf );
pb.setColIntegralAll( isIntegral );
pb.setRowLhsInfAll( lhsIsInf );
pb.setRowRhsInfAll( rhsIsInf );
pb.setRowLhsAll( lhs );
pb.setRowRhsAll( rhs );
pb.setRowNameAll( rnames );
pb.addEntryAll( entries );
pb.setColNameAll( cnames );
pb.setProblemName( "gt2.hpp" );
Problem<double> problem = pb.build();
/// PROBLEM BUILDER CODE END
return problem;
}
} // namespace instances
} // namespace papilo
#endif
| 32,131
|
C++
|
.h
| 586
| 47.609215
| 79
| 0.470829
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,858
|
rgn.hpp
|
lgottwald_PaPILO/test/instances/rgn.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef PAPILO_TEST_INSTANCES_RGN
#define PAPILO_TEST_INSTANCES_RGN
#include "papilo/core/Problem.hpp"
#include "papilo/core/ProblemBuilder.hpp"
namespace papilo
{
namespace instances
{
Problem<double>
rgn()
{
/// PROBLEM BUILDER CODE
Vec<double> coeffobj{
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
Vec<uint8_t> lhsIsInf{
1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
Vec<double> lhs{
0.0, 0.0, 0.0, 0.0, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5,
-3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5,
};
Vec<uint8_t> rhsIsInf{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
Vec<double> rhs{
1.0, 1.0, 1.0, 1.0, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5,
-3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5, -3.5,
};
Vec<std::tuple<int, int, double>> entries{
std::tuple<int, int, double>{ 0, 0, 1.0 },
std::tuple<int, int, double>{ 0, 1, 1.0 },
std::tuple<int, int, double>{ 0, 2, 1.0 },
std::tuple<int, int, double>{ 0, 3, 1.0 },
std::tuple<int, int, double>{ 0, 4, 1.0 },
std::tuple<int, int, double>{ 0, 5, 1.0 },
std::tuple<int, int, double>{ 0, 6, 1.0 },
std::tuple<int, int, double>{ 0, 7, 1.0 },
std::tuple<int, int, double>{ 0, 8, 1.0 },
std::tuple<int, int, double>{ 0, 9, 1.0 },
std::tuple<int, int, double>{ 0, 10, 1.0 },
std::tuple<int, int, double>{ 0, 11, 1.0 },
std::tuple<int, int, double>{ 0, 12, 1.0 },
std::tuple<int, int, double>{ 0, 13, 1.0 },
std::tuple<int, int, double>{ 0, 14, 1.0 },
std::tuple<int, int, double>{ 0, 15, 1.0 },
std::tuple<int, int, double>{ 0, 16, 1.0 },
std::tuple<int, int, double>{ 0, 17, 1.0 },
std::tuple<int, int, double>{ 0, 18, 1.0 },
std::tuple<int, int, double>{ 0, 19, 1.0 },
std::tuple<int, int, double>{ 0, 20, 1.0 },
std::tuple<int, int, double>{ 0, 21, 1.0 },
std::tuple<int, int, double>{ 0, 22, 1.0 },
std::tuple<int, int, double>{ 0, 23, 1.0 },
std::tuple<int, int, double>{ 0, 24, 1.0 },
std::tuple<int, int, double>{ 1, 25, 1.0 },
std::tuple<int, int, double>{ 1, 26, 1.0 },
std::tuple<int, int, double>{ 1, 27, 1.0 },
std::tuple<int, int, double>{ 1, 28, 1.0 },
std::tuple<int, int, double>{ 1, 29, 1.0 },
std::tuple<int, int, double>{ 1, 30, 1.0 },
std::tuple<int, int, double>{ 1, 31, 1.0 },
std::tuple<int, int, double>{ 1, 32, 1.0 },
std::tuple<int, int, double>{ 1, 33, 1.0 },
std::tuple<int, int, double>{ 1, 34, 1.0 },
std::tuple<int, int, double>{ 1, 35, 1.0 },
std::tuple<int, int, double>{ 1, 36, 1.0 },
std::tuple<int, int, double>{ 1, 37, 1.0 },
std::tuple<int, int, double>{ 1, 38, 1.0 },
std::tuple<int, int, double>{ 1, 39, 1.0 },
std::tuple<int, int, double>{ 1, 40, 1.0 },
std::tuple<int, int, double>{ 1, 41, 1.0 },
std::tuple<int, int, double>{ 1, 42, 1.0 },
std::tuple<int, int, double>{ 1, 43, 1.0 },
std::tuple<int, int, double>{ 1, 44, 1.0 },
std::tuple<int, int, double>{ 1, 45, 1.0 },
std::tuple<int, int, double>{ 1, 46, 1.0 },
std::tuple<int, int, double>{ 1, 47, 1.0 },
std::tuple<int, int, double>{ 1, 48, 1.0 },
std::tuple<int, int, double>{ 1, 49, 1.0 },
std::tuple<int, int, double>{ 2, 50, 1.0 },
std::tuple<int, int, double>{ 2, 51, 1.0 },
std::tuple<int, int, double>{ 2, 52, 1.0 },
std::tuple<int, int, double>{ 2, 53, 1.0 },
std::tuple<int, int, double>{ 2, 54, 1.0 },
std::tuple<int, int, double>{ 2, 55, 1.0 },
std::tuple<int, int, double>{ 2, 56, 1.0 },
std::tuple<int, int, double>{ 2, 57, 1.0 },
std::tuple<int, int, double>{ 2, 58, 1.0 },
std::tuple<int, int, double>{ 2, 59, 1.0 },
std::tuple<int, int, double>{ 2, 60, 1.0 },
std::tuple<int, int, double>{ 2, 61, 1.0 },
std::tuple<int, int, double>{ 2, 62, 1.0 },
std::tuple<int, int, double>{ 2, 63, 1.0 },
std::tuple<int, int, double>{ 2, 64, 1.0 },
std::tuple<int, int, double>{ 2, 65, 1.0 },
std::tuple<int, int, double>{ 2, 66, 1.0 },
std::tuple<int, int, double>{ 2, 67, 1.0 },
std::tuple<int, int, double>{ 2, 68, 1.0 },
std::tuple<int, int, double>{ 2, 69, 1.0 },
std::tuple<int, int, double>{ 2, 70, 1.0 },
std::tuple<int, int, double>{ 2, 71, 1.0 },
std::tuple<int, int, double>{ 2, 72, 1.0 },
std::tuple<int, int, double>{ 2, 73, 1.0 },
std::tuple<int, int, double>{ 2, 74, 1.0 },
std::tuple<int, int, double>{ 3, 75, 1.0 },
std::tuple<int, int, double>{ 3, 76, 1.0 },
std::tuple<int, int, double>{ 3, 77, 1.0 },
std::tuple<int, int, double>{ 3, 78, 1.0 },
std::tuple<int, int, double>{ 3, 79, 1.0 },
std::tuple<int, int, double>{ 3, 80, 1.0 },
std::tuple<int, int, double>{ 3, 81, 1.0 },
std::tuple<int, int, double>{ 3, 82, 1.0 },
std::tuple<int, int, double>{ 3, 83, 1.0 },
std::tuple<int, int, double>{ 3, 84, 1.0 },
std::tuple<int, int, double>{ 3, 85, 1.0 },
std::tuple<int, int, double>{ 3, 86, 1.0 },
std::tuple<int, int, double>{ 3, 87, 1.0 },
std::tuple<int, int, double>{ 3, 88, 1.0 },
std::tuple<int, int, double>{ 3, 89, 1.0 },
std::tuple<int, int, double>{ 3, 90, 1.0 },
std::tuple<int, int, double>{ 3, 91, 1.0 },
std::tuple<int, int, double>{ 3, 92, 1.0 },
std::tuple<int, int, double>{ 3, 93, 1.0 },
std::tuple<int, int, double>{ 3, 94, 1.0 },
std::tuple<int, int, double>{ 3, 95, 1.0 },
std::tuple<int, int, double>{ 3, 96, 1.0 },
std::tuple<int, int, double>{ 3, 97, 1.0 },
std::tuple<int, int, double>{ 3, 98, 1.0 },
std::tuple<int, int, double>{ 3, 99, 1.0 },
std::tuple<int, int, double>{ 4, 0, -4.60000002 },
std::tuple<int, int, double>{ 4, 5, -4.60000002 },
std::tuple<int, int, double>{ 4, 6, -4.60000002 },
std::tuple<int, int, double>{ 4, 7, -4.60000002 },
std::tuple<int, int, double>{ 4, 8, -4.60000002 },
std::tuple<int, int, double>{ 4, 15, -4.60000002 },
std::tuple<int, int, double>{ 4, 16, -4.60000002 },
std::tuple<int, int, double>{ 4, 17, -4.60000002 },
std::tuple<int, int, double>{ 4, 18, -4.60000002 },
std::tuple<int, int, double>{ 4, 19, -4.60000002 },
std::tuple<int, int, double>{ 4, 20, -4.60000002 },
std::tuple<int, int, double>{ 4, 100, 1.0 },
std::tuple<int, int, double>{ 4, 120, 1.0 },
std::tuple<int, int, double>{ 4, 140, -1.0 },
std::tuple<int, int, double>{ 4, 160, -1.0 },
std::tuple<int, int, double>{ 5, 1, -4.60000002 },
std::tuple<int, int, double>{ 5, 5, -4.60000002 },
std::tuple<int, int, double>{ 5, 9, -4.60000002 },
std::tuple<int, int, double>{ 5, 10, -4.60000002 },
std::tuple<int, int, double>{ 5, 11, -4.60000002 },
std::tuple<int, int, double>{ 5, 15, -4.60000002 },
std::tuple<int, int, double>{ 5, 16, -4.60000002 },
std::tuple<int, int, double>{ 5, 17, -4.60000002 },
std::tuple<int, int, double>{ 5, 21, -4.60000002 },
std::tuple<int, int, double>{ 5, 22, -4.60000002 },
std::tuple<int, int, double>{ 5, 23, -4.60000002 },
std::tuple<int, int, double>{ 5, 104, 1.0 },
std::tuple<int, int, double>{ 5, 124, 1.0 },
std::tuple<int, int, double>{ 5, 144, -1.0 },
std::tuple<int, int, double>{ 5, 164, -1.0 },
std::tuple<int, int, double>{ 6, 2, -4.60000002 },
std::tuple<int, int, double>{ 6, 6, -4.60000002 },
std::tuple<int, int, double>{ 6, 9, -4.60000002 },
std::tuple<int, int, double>{ 6, 12, -4.60000002 },
std::tuple<int, int, double>{ 6, 13, -4.60000002 },
std::tuple<int, int, double>{ 6, 15, -4.60000002 },
std::tuple<int, int, double>{ 6, 18, -4.60000002 },
std::tuple<int, int, double>{ 6, 19, -4.60000002 },
std::tuple<int, int, double>{ 6, 21, -4.60000002 },
std::tuple<int, int, double>{ 6, 22, -4.60000002 },
std::tuple<int, int, double>{ 6, 24, -4.60000002 },
std::tuple<int, int, double>{ 6, 108, 1.0 },
std::tuple<int, int, double>{ 6, 128, 1.0 },
std::tuple<int, int, double>{ 6, 148, -1.0 },
std::tuple<int, int, double>{ 6, 168, -1.0 },
std::tuple<int, int, double>{ 7, 3, -4.60000002 },
std::tuple<int, int, double>{ 7, 7, -4.60000002 },
std::tuple<int, int, double>{ 7, 10, -4.60000002 },
std::tuple<int, int, double>{ 7, 12, -4.60000002 },
std::tuple<int, int, double>{ 7, 14, -4.60000002 },
std::tuple<int, int, double>{ 7, 16, -4.60000002 },
std::tuple<int, int, double>{ 7, 18, -4.60000002 },
std::tuple<int, int, double>{ 7, 20, -4.60000002 },
std::tuple<int, int, double>{ 7, 21, -4.60000002 },
std::tuple<int, int, double>{ 7, 23, -4.60000002 },
std::tuple<int, int, double>{ 7, 24, -4.60000002 },
std::tuple<int, int, double>{ 7, 112, 1.0 },
std::tuple<int, int, double>{ 7, 132, 1.0 },
std::tuple<int, int, double>{ 7, 152, -1.0 },
std::tuple<int, int, double>{ 7, 172, -1.0 },
std::tuple<int, int, double>{ 8, 4, -4.60000002 },
std::tuple<int, int, double>{ 8, 8, -4.60000002 },
std::tuple<int, int, double>{ 8, 11, -4.60000002 },
std::tuple<int, int, double>{ 8, 13, -4.60000002 },
std::tuple<int, int, double>{ 8, 14, -4.60000002 },
std::tuple<int, int, double>{ 8, 17, -4.60000002 },
std::tuple<int, int, double>{ 8, 19, -4.60000002 },
std::tuple<int, int, double>{ 8, 20, -4.60000002 },
std::tuple<int, int, double>{ 8, 22, -4.60000002 },
std::tuple<int, int, double>{ 8, 23, -4.60000002 },
std::tuple<int, int, double>{ 8, 24, -4.60000002 },
std::tuple<int, int, double>{ 8, 116, 1.0 },
std::tuple<int, int, double>{ 8, 136, 1.0 },
std::tuple<int, int, double>{ 8, 156, -1.0 },
std::tuple<int, int, double>{ 8, 176, -1.0 },
std::tuple<int, int, double>{ 9, 25, -4.60000002 },
std::tuple<int, int, double>{ 9, 30, -4.60000002 },
std::tuple<int, int, double>{ 9, 31, -4.60000002 },
std::tuple<int, int, double>{ 9, 32, -4.60000002 },
std::tuple<int, int, double>{ 9, 33, -4.60000002 },
std::tuple<int, int, double>{ 9, 40, -4.60000002 },
std::tuple<int, int, double>{ 9, 41, -4.60000002 },
std::tuple<int, int, double>{ 9, 42, -4.60000002 },
std::tuple<int, int, double>{ 9, 43, -4.60000002 },
std::tuple<int, int, double>{ 9, 44, -4.60000002 },
std::tuple<int, int, double>{ 9, 45, -4.60000002 },
std::tuple<int, int, double>{ 9, 100, -1.0 },
std::tuple<int, int, double>{ 9, 101, 1.0 },
std::tuple<int, int, double>{ 9, 120, -1.0 },
std::tuple<int, int, double>{ 9, 121, 1.0 },
std::tuple<int, int, double>{ 9, 140, 1.0 },
std::tuple<int, int, double>{ 9, 141, -1.0 },
std::tuple<int, int, double>{ 9, 160, 1.0 },
std::tuple<int, int, double>{ 9, 161, -1.0 },
std::tuple<int, int, double>{ 10, 26, -4.60000002 },
std::tuple<int, int, double>{ 10, 30, -4.60000002 },
std::tuple<int, int, double>{ 10, 34, -4.60000002 },
std::tuple<int, int, double>{ 10, 35, -4.60000002 },
std::tuple<int, int, double>{ 10, 36, -4.60000002 },
std::tuple<int, int, double>{ 10, 40, -4.60000002 },
std::tuple<int, int, double>{ 10, 41, -4.60000002 },
std::tuple<int, int, double>{ 10, 42, -4.60000002 },
std::tuple<int, int, double>{ 10, 46, -4.60000002 },
std::tuple<int, int, double>{ 10, 47, -4.60000002 },
std::tuple<int, int, double>{ 10, 48, -4.60000002 },
std::tuple<int, int, double>{ 10, 104, -1.0 },
std::tuple<int, int, double>{ 10, 105, 1.0 },
std::tuple<int, int, double>{ 10, 124, -1.0 },
std::tuple<int, int, double>{ 10, 125, 1.0 },
std::tuple<int, int, double>{ 10, 144, 1.0 },
std::tuple<int, int, double>{ 10, 145, -1.0 },
std::tuple<int, int, double>{ 10, 164, 1.0 },
std::tuple<int, int, double>{ 10, 165, -1.0 },
std::tuple<int, int, double>{ 11, 27, -4.60000002 },
std::tuple<int, int, double>{ 11, 31, -4.60000002 },
std::tuple<int, int, double>{ 11, 34, -4.60000002 },
std::tuple<int, int, double>{ 11, 37, -4.60000002 },
std::tuple<int, int, double>{ 11, 38, -4.60000002 },
std::tuple<int, int, double>{ 11, 40, -4.60000002 },
std::tuple<int, int, double>{ 11, 43, -4.60000002 },
std::tuple<int, int, double>{ 11, 44, -4.60000002 },
std::tuple<int, int, double>{ 11, 46, -4.60000002 },
std::tuple<int, int, double>{ 11, 47, -4.60000002 },
std::tuple<int, int, double>{ 11, 49, -4.60000002 },
std::tuple<int, int, double>{ 11, 108, -1.0 },
std::tuple<int, int, double>{ 11, 109, 1.0 },
std::tuple<int, int, double>{ 11, 128, -1.0 },
std::tuple<int, int, double>{ 11, 129, 1.0 },
std::tuple<int, int, double>{ 11, 148, 1.0 },
std::tuple<int, int, double>{ 11, 149, -1.0 },
std::tuple<int, int, double>{ 11, 168, 1.0 },
std::tuple<int, int, double>{ 11, 169, -1.0 },
std::tuple<int, int, double>{ 12, 28, -4.60000002 },
std::tuple<int, int, double>{ 12, 32, -4.60000002 },
std::tuple<int, int, double>{ 12, 35, -4.60000002 },
std::tuple<int, int, double>{ 12, 37, -4.60000002 },
std::tuple<int, int, double>{ 12, 39, -4.60000002 },
std::tuple<int, int, double>{ 12, 41, -4.60000002 },
std::tuple<int, int, double>{ 12, 43, -4.60000002 },
std::tuple<int, int, double>{ 12, 45, -4.60000002 },
std::tuple<int, int, double>{ 12, 46, -4.60000002 },
std::tuple<int, int, double>{ 12, 48, -4.60000002 },
std::tuple<int, int, double>{ 12, 49, -4.60000002 },
std::tuple<int, int, double>{ 12, 112, -1.0 },
std::tuple<int, int, double>{ 12, 113, 1.0 },
std::tuple<int, int, double>{ 12, 132, -1.0 },
std::tuple<int, int, double>{ 12, 133, 1.0 },
std::tuple<int, int, double>{ 12, 152, 1.0 },
std::tuple<int, int, double>{ 12, 153, -1.0 },
std::tuple<int, int, double>{ 12, 172, 1.0 },
std::tuple<int, int, double>{ 12, 173, -1.0 },
std::tuple<int, int, double>{ 13, 29, -4.60000002 },
std::tuple<int, int, double>{ 13, 33, -4.60000002 },
std::tuple<int, int, double>{ 13, 36, -4.60000002 },
std::tuple<int, int, double>{ 13, 38, -4.60000002 },
std::tuple<int, int, double>{ 13, 39, -4.60000002 },
std::tuple<int, int, double>{ 13, 42, -4.60000002 },
std::tuple<int, int, double>{ 13, 44, -4.60000002 },
std::tuple<int, int, double>{ 13, 45, -4.60000002 },
std::tuple<int, int, double>{ 13, 47, -4.60000002 },
std::tuple<int, int, double>{ 13, 48, -4.60000002 },
std::tuple<int, int, double>{ 13, 49, -4.60000002 },
std::tuple<int, int, double>{ 13, 116, -1.0 },
std::tuple<int, int, double>{ 13, 117, 1.0 },
std::tuple<int, int, double>{ 13, 136, -1.0 },
std::tuple<int, int, double>{ 13, 137, 1.0 },
std::tuple<int, int, double>{ 13, 156, 1.0 },
std::tuple<int, int, double>{ 13, 157, -1.0 },
std::tuple<int, int, double>{ 13, 176, 1.0 },
std::tuple<int, int, double>{ 13, 177, -1.0 },
std::tuple<int, int, double>{ 14, 50, -4.60000002 },
std::tuple<int, int, double>{ 14, 55, -4.60000002 },
std::tuple<int, int, double>{ 14, 56, -4.60000002 },
std::tuple<int, int, double>{ 14, 57, -4.60000002 },
std::tuple<int, int, double>{ 14, 58, -4.60000002 },
std::tuple<int, int, double>{ 14, 65, -4.60000002 },
std::tuple<int, int, double>{ 14, 66, -4.60000002 },
std::tuple<int, int, double>{ 14, 67, -4.60000002 },
std::tuple<int, int, double>{ 14, 68, -4.60000002 },
std::tuple<int, int, double>{ 14, 69, -4.60000002 },
std::tuple<int, int, double>{ 14, 70, -4.60000002 },
std::tuple<int, int, double>{ 14, 101, -1.0 },
std::tuple<int, int, double>{ 14, 102, 1.0 },
std::tuple<int, int, double>{ 14, 121, -1.0 },
std::tuple<int, int, double>{ 14, 122, 1.0 },
std::tuple<int, int, double>{ 14, 141, 1.0 },
std::tuple<int, int, double>{ 14, 142, -1.0 },
std::tuple<int, int, double>{ 14, 161, 1.0 },
std::tuple<int, int, double>{ 14, 162, -1.0 },
std::tuple<int, int, double>{ 15, 51, -4.60000002 },
std::tuple<int, int, double>{ 15, 55, -4.60000002 },
std::tuple<int, int, double>{ 15, 59, -4.60000002 },
std::tuple<int, int, double>{ 15, 60, -4.60000002 },
std::tuple<int, int, double>{ 15, 61, -4.60000002 },
std::tuple<int, int, double>{ 15, 65, -4.60000002 },
std::tuple<int, int, double>{ 15, 66, -4.60000002 },
std::tuple<int, int, double>{ 15, 67, -4.60000002 },
std::tuple<int, int, double>{ 15, 71, -4.60000002 },
std::tuple<int, int, double>{ 15, 72, -4.60000002 },
std::tuple<int, int, double>{ 15, 73, -4.60000002 },
std::tuple<int, int, double>{ 15, 105, -1.0 },
std::tuple<int, int, double>{ 15, 106, 1.0 },
std::tuple<int, int, double>{ 15, 125, -1.0 },
std::tuple<int, int, double>{ 15, 126, 1.0 },
std::tuple<int, int, double>{ 15, 145, 1.0 },
std::tuple<int, int, double>{ 15, 146, -1.0 },
std::tuple<int, int, double>{ 15, 165, 1.0 },
std::tuple<int, int, double>{ 15, 166, -1.0 },
std::tuple<int, int, double>{ 16, 52, -4.60000002 },
std::tuple<int, int, double>{ 16, 56, -4.60000002 },
std::tuple<int, int, double>{ 16, 59, -4.60000002 },
std::tuple<int, int, double>{ 16, 62, -4.60000002 },
std::tuple<int, int, double>{ 16, 63, -4.60000002 },
std::tuple<int, int, double>{ 16, 65, -4.60000002 },
std::tuple<int, int, double>{ 16, 68, -4.60000002 },
std::tuple<int, int, double>{ 16, 69, -4.60000002 },
std::tuple<int, int, double>{ 16, 71, -4.60000002 },
std::tuple<int, int, double>{ 16, 72, -4.60000002 },
std::tuple<int, int, double>{ 16, 74, -4.60000002 },
std::tuple<int, int, double>{ 16, 109, -1.0 },
std::tuple<int, int, double>{ 16, 110, 1.0 },
std::tuple<int, int, double>{ 16, 129, -1.0 },
std::tuple<int, int, double>{ 16, 130, 1.0 },
std::tuple<int, int, double>{ 16, 149, 1.0 },
std::tuple<int, int, double>{ 16, 150, -1.0 },
std::tuple<int, int, double>{ 16, 169, 1.0 },
std::tuple<int, int, double>{ 16, 170, -1.0 },
std::tuple<int, int, double>{ 17, 53, -4.60000002 },
std::tuple<int, int, double>{ 17, 57, -4.60000002 },
std::tuple<int, int, double>{ 17, 60, -4.60000002 },
std::tuple<int, int, double>{ 17, 62, -4.60000002 },
std::tuple<int, int, double>{ 17, 64, -4.60000002 },
std::tuple<int, int, double>{ 17, 66, -4.60000002 },
std::tuple<int, int, double>{ 17, 68, -4.60000002 },
std::tuple<int, int, double>{ 17, 70, -4.60000002 },
std::tuple<int, int, double>{ 17, 71, -4.60000002 },
std::tuple<int, int, double>{ 17, 73, -4.60000002 },
std::tuple<int, int, double>{ 17, 74, -4.60000002 },
std::tuple<int, int, double>{ 17, 113, -1.0 },
std::tuple<int, int, double>{ 17, 114, 1.0 },
std::tuple<int, int, double>{ 17, 133, -1.0 },
std::tuple<int, int, double>{ 17, 134, 1.0 },
std::tuple<int, int, double>{ 17, 153, 1.0 },
std::tuple<int, int, double>{ 17, 154, -1.0 },
std::tuple<int, int, double>{ 17, 173, 1.0 },
std::tuple<int, int, double>{ 17, 174, -1.0 },
std::tuple<int, int, double>{ 18, 54, -4.60000002 },
std::tuple<int, int, double>{ 18, 58, -4.60000002 },
std::tuple<int, int, double>{ 18, 61, -4.60000002 },
std::tuple<int, int, double>{ 18, 63, -4.60000002 },
std::tuple<int, int, double>{ 18, 64, -4.60000002 },
std::tuple<int, int, double>{ 18, 67, -4.60000002 },
std::tuple<int, int, double>{ 18, 69, -4.60000002 },
std::tuple<int, int, double>{ 18, 70, -4.60000002 },
std::tuple<int, int, double>{ 18, 72, -4.60000002 },
std::tuple<int, int, double>{ 18, 73, -4.60000002 },
std::tuple<int, int, double>{ 18, 74, -4.60000002 },
std::tuple<int, int, double>{ 18, 117, -1.0 },
std::tuple<int, int, double>{ 18, 118, 1.0 },
std::tuple<int, int, double>{ 18, 137, -1.0 },
std::tuple<int, int, double>{ 18, 138, 1.0 },
std::tuple<int, int, double>{ 18, 157, 1.0 },
std::tuple<int, int, double>{ 18, 158, -1.0 },
std::tuple<int, int, double>{ 18, 177, 1.0 },
std::tuple<int, int, double>{ 18, 178, -1.0 },
std::tuple<int, int, double>{ 19, 75, -4.60000002 },
std::tuple<int, int, double>{ 19, 80, -4.60000002 },
std::tuple<int, int, double>{ 19, 81, -4.60000002 },
std::tuple<int, int, double>{ 19, 82, -4.60000002 },
std::tuple<int, int, double>{ 19, 83, -4.60000002 },
std::tuple<int, int, double>{ 19, 90, -4.60000002 },
std::tuple<int, int, double>{ 19, 91, -4.60000002 },
std::tuple<int, int, double>{ 19, 92, -4.60000002 },
std::tuple<int, int, double>{ 19, 93, -4.60000002 },
std::tuple<int, int, double>{ 19, 94, -4.60000002 },
std::tuple<int, int, double>{ 19, 95, -4.60000002 },
std::tuple<int, int, double>{ 19, 102, -1.0 },
std::tuple<int, int, double>{ 19, 103, 1.0 },
std::tuple<int, int, double>{ 19, 122, -1.0 },
std::tuple<int, int, double>{ 19, 123, 1.0 },
std::tuple<int, int, double>{ 19, 142, 1.0 },
std::tuple<int, int, double>{ 19, 143, -1.0 },
std::tuple<int, int, double>{ 19, 162, 1.0 },
std::tuple<int, int, double>{ 19, 163, -1.0 },
std::tuple<int, int, double>{ 20, 76, -4.60000002 },
std::tuple<int, int, double>{ 20, 80, -4.60000002 },
std::tuple<int, int, double>{ 20, 84, -4.60000002 },
std::tuple<int, int, double>{ 20, 85, -4.60000002 },
std::tuple<int, int, double>{ 20, 86, -4.60000002 },
std::tuple<int, int, double>{ 20, 90, -4.60000002 },
std::tuple<int, int, double>{ 20, 91, -4.60000002 },
std::tuple<int, int, double>{ 20, 92, -4.60000002 },
std::tuple<int, int, double>{ 20, 96, -4.60000002 },
std::tuple<int, int, double>{ 20, 97, -4.60000002 },
std::tuple<int, int, double>{ 20, 98, -4.60000002 },
std::tuple<int, int, double>{ 20, 106, -1.0 },
std::tuple<int, int, double>{ 20, 107, 1.0 },
std::tuple<int, int, double>{ 20, 126, -1.0 },
std::tuple<int, int, double>{ 20, 127, 1.0 },
std::tuple<int, int, double>{ 20, 146, 1.0 },
std::tuple<int, int, double>{ 20, 147, -1.0 },
std::tuple<int, int, double>{ 20, 166, 1.0 },
std::tuple<int, int, double>{ 20, 167, -1.0 },
std::tuple<int, int, double>{ 21, 77, -4.60000002 },
std::tuple<int, int, double>{ 21, 81, -4.60000002 },
std::tuple<int, int, double>{ 21, 84, -4.60000002 },
std::tuple<int, int, double>{ 21, 87, -4.60000002 },
std::tuple<int, int, double>{ 21, 88, -4.60000002 },
std::tuple<int, int, double>{ 21, 90, -4.60000002 },
std::tuple<int, int, double>{ 21, 93, -4.60000002 },
std::tuple<int, int, double>{ 21, 94, -4.60000002 },
std::tuple<int, int, double>{ 21, 96, -4.60000002 },
std::tuple<int, int, double>{ 21, 97, -4.60000002 },
std::tuple<int, int, double>{ 21, 99, -4.60000002 },
std::tuple<int, int, double>{ 21, 110, -1.0 },
std::tuple<int, int, double>{ 21, 111, 1.0 },
std::tuple<int, int, double>{ 21, 130, -1.0 },
std::tuple<int, int, double>{ 21, 131, 1.0 },
std::tuple<int, int, double>{ 21, 150, 1.0 },
std::tuple<int, int, double>{ 21, 151, -1.0 },
std::tuple<int, int, double>{ 21, 170, 1.0 },
std::tuple<int, int, double>{ 21, 171, -1.0 },
std::tuple<int, int, double>{ 22, 78, -4.60000002 },
std::tuple<int, int, double>{ 22, 82, -4.60000002 },
std::tuple<int, int, double>{ 22, 85, -4.60000002 },
std::tuple<int, int, double>{ 22, 87, -4.60000002 },
std::tuple<int, int, double>{ 22, 89, -4.60000002 },
std::tuple<int, int, double>{ 22, 91, -4.60000002 },
std::tuple<int, int, double>{ 22, 93, -4.60000002 },
std::tuple<int, int, double>{ 22, 95, -4.60000002 },
std::tuple<int, int, double>{ 22, 96, -4.60000002 },
std::tuple<int, int, double>{ 22, 98, -4.60000002 },
std::tuple<int, int, double>{ 22, 99, -4.60000002 },
std::tuple<int, int, double>{ 22, 114, -1.0 },
std::tuple<int, int, double>{ 22, 115, 1.0 },
std::tuple<int, int, double>{ 22, 134, -1.0 },
std::tuple<int, int, double>{ 22, 135, 1.0 },
std::tuple<int, int, double>{ 22, 154, 1.0 },
std::tuple<int, int, double>{ 22, 155, -1.0 },
std::tuple<int, int, double>{ 22, 174, 1.0 },
std::tuple<int, int, double>{ 22, 175, -1.0 },
std::tuple<int, int, double>{ 23, 79, -4.60000002 },
std::tuple<int, int, double>{ 23, 83, -4.60000002 },
std::tuple<int, int, double>{ 23, 86, -4.60000002 },
std::tuple<int, int, double>{ 23, 88, -4.60000002 },
std::tuple<int, int, double>{ 23, 89, -4.60000002 },
std::tuple<int, int, double>{ 23, 92, -4.60000002 },
std::tuple<int, int, double>{ 23, 94, -4.60000002 },
std::tuple<int, int, double>{ 23, 95, -4.60000002 },
std::tuple<int, int, double>{ 23, 97, -4.60000002 },
std::tuple<int, int, double>{ 23, 98, -4.60000002 },
std::tuple<int, int, double>{ 23, 99, -4.60000002 },
std::tuple<int, int, double>{ 23, 118, -1.0 },
std::tuple<int, int, double>{ 23, 119, 1.0 },
std::tuple<int, int, double>{ 23, 138, -1.0 },
std::tuple<int, int, double>{ 23, 139, 1.0 },
std::tuple<int, int, double>{ 23, 158, 1.0 },
std::tuple<int, int, double>{ 23, 159, -1.0 },
std::tuple<int, int, double>{ 23, 178, 1.0 },
std::tuple<int, int, double>{ 23, 179, -1.0 },
};
Vec<std::string> rnames{
"2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13",
"14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25",
};
Vec<std::string> cnames{
"A1", "B1", "C1", "D1", "E1", "AB1", "AC1", "AD1", "AE1",
"BC1", "BD1", "BE1", "CD1", "CE1", "DE1", "ABC1", "ABD1", "ABE1",
"ACD1", "ACE1", "ADE1", "BCD1", "BCE1", "BDE1", "CDE1", "A2", "B2",
"C2", "D2", "E2", "AB2", "AC2", "AD2", "AE2", "BC2", "BD2",
"BE2", "CD2", "CE2", "DE2", "ABC2", "ABD2", "ABE2", "ACD2", "ACE2",
"ADE2", "BCD2", "BCE2", "BDE2", "CDE2", "A3", "B3", "C3", "D3",
"E3", "AB3", "AC3", "AD3", "AE3", "BC3", "BD3", "BE3", "CD3",
"CE3", "DE3", "ABC3", "ABD3", "ABE3", "ACD3", "ACE3", "ADE3", "BCD3",
"BCE3", "BDE3", "CDE3", "A4", "B4", "C4", "D4", "E4", "AB4",
"AC4", "AD4", "AE4", "BC4", "BD4", "BE4", "CD4", "CE4", "DE4",
"ABC4", "ABD4", "ABE4", "ACD4", "ACE4", "ADE4", "BCD4", "BCE4", "BDE4",
"CDE4", "TA1", "TA2", "TA3", "TA4", "TB1", "TB2", "TB3", "TB4",
"TC1", "TC2", "TC3", "TC4", "TD1", "TD2", "TD3", "TD4", "TE1",
"TE2", "TE3", "TE4", "UA1", "UA2", "UA3", "UA4", "UB1", "UB2",
"UB3", "UB4", "UC1", "UC2", "UC3", "UC4", "UD1", "UD2", "UD3",
"UD4", "UE1", "UE2", "UE3", "UE4", "VA1", "VA2", "VA3", "VA4",
"VB1", "VB2", "VB3", "VB4", "VC1", "VC2", "VC3", "VC4", "VD1",
"VD2", "VD3", "VD4", "VE1", "VE2", "VE3", "VE4", "WA1", "WA2",
"WA3", "WA4", "WB1", "WB2", "WB3", "WB4", "WC1", "WC2", "WC3",
"WC4", "WD1", "WD2", "WD3", "WD4", "WE1", "WE2", "WE3", "WE4",
};
int nCols = 180;
int nRows = 24;
ProblemBuilder<double> pb;
pb.reserve( 460, 24, 180 );
pb.setNumRows( nRows );
pb.setNumCols( nCols );
pb.setObjAll( coeffobj );
pb.setObjOffset( 0.0 );
pb.setColLbAll( lbs );
pb.setColLbInfAll( lbInf );
pb.setColUbAll( ubs );
pb.setColUbInfAll( ubInf );
pb.setColIntegralAll( isIntegral );
pb.setRowLhsInfAll( lhsIsInf );
pb.setRowRhsInfAll( rhsIsInf );
pb.setRowLhsAll( lhs );
pb.setRowRhsAll( rhs );
pb.setRowNameAll( rnames );
pb.addEntryAll( entries );
pb.setColNameAll( cnames );
pb.setProblemName( "rgn.hpp" );
Problem<double> problem = pb.build();
/// PROBLEM BUILDER CODE END
return problem;
}
} // namespace instances
} // namespace papilo
#endif
| 36,171
|
C++
|
.h
| 644
| 48.874224
| 79
| 0.490259
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,859
|
lseu.hpp
|
lgottwald_PaPILO/test/instances/lseu.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef PAPILO_TEST_INSTANCES_LSEU
#define PAPILO_TEST_INSTANCES_LSEU
#include "papilo/core/Problem.hpp"
#include "papilo/core/ProblemBuilder.hpp"
namespace papilo
{
namespace instances
{
Problem<double>
lseu()
{
/// PROBLEM BUILDER CODE
Vec<double> coeffobj{
7.0, 10.0, 179.0, 186.0, 179.0, 0.0, 0.0, 6.0, 0.0, 0.0,
164.0, 164.0, 170.0, 164.0, 346.0, 346.0, 248.0, 253.0, 248.0, 346.0,
346.0, 346.0, 346.0, 160.0, 161.0, 160.0, 160.0, 161.0, 160.0, 160.0,
278.0, 278.0, 278.0, 86.0, 86.0, 86.0, 86.0, 86.0, 86.0, 188.0,
188.0, 188.0, 85.0, 85.0, 85.0, 85.0, 85.0, 78.0, 78.0, 78.0,
78.0, 78.0, 78.0, 78.0, 78.0, 78.0, 171.0, 171.0, 171.0, 171.0,
163.0, 163.0, 163.0, 69.0, 69.0, 183.0, 183.0, 183.0, 183.0, 49.0,
183.0, 258.0, 517.0, 250.0, 500.0, 250.0, 500.0, 159.0, 318.0, 159.0,
318.0, 159.0, 318.0, 159.0, 318.0, 114.0, 228.0, 159.0, 318.0,
};
Vec<double> lbs{
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,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630.0,
-900.0, -1656.0, -335.0, -1026.0, -150.0, -500.0, -270.0,
};
Vec<std::tuple<int, int, double>> entries{
std::tuple<int, int, double>{ 0, 2, 1.0 },
std::tuple<int, int, double>{ 0, 3, 1.0 },
std::tuple<int, int, double>{ 0, 4, 1.0 },
std::tuple<int, int, double>{ 1, 5, 1.0 },
std::tuple<int, int, double>{ 1, 6, 1.0 },
std::tuple<int, int, double>{ 1, 7, 1.0 },
std::tuple<int, int, double>{ 1, 8, 1.0 },
std::tuple<int, int, double>{ 1, 9, 1.0 },
std::tuple<int, int, double>{ 2, 10, 1.0 },
std::tuple<int, int, double>{ 2, 11, 1.0 },
std::tuple<int, int, double>{ 2, 12, 1.0 },
std::tuple<int, int, double>{ 2, 13, 1.0 },
std::tuple<int, int, double>{ 3, 14, 1.0 },
std::tuple<int, int, double>{ 3, 15, 1.0 },
std::tuple<int, int, double>{ 4, 16, 1.0 },
std::tuple<int, int, double>{ 4, 17, 1.0 },
std::tuple<int, int, double>{ 4, 18, 1.0 },
std::tuple<int, int, double>{ 5, 19, 1.0 },
std::tuple<int, int, double>{ 5, 20, 1.0 },
std::tuple<int, int, double>{ 5, 21, 1.0 },
std::tuple<int, int, double>{ 5, 22, 1.0 },
std::tuple<int, int, double>{ 6, 23, 1.0 },
std::tuple<int, int, double>{ 6, 24, 1.0 },
std::tuple<int, int, double>{ 6, 25, 1.0 },
std::tuple<int, int, double>{ 6, 26, 1.0 },
std::tuple<int, int, double>{ 6, 27, 1.0 },
std::tuple<int, int, double>{ 6, 28, 1.0 },
std::tuple<int, int, double>{ 6, 29, 1.0 },
std::tuple<int, int, double>{ 7, 30, 1.0 },
std::tuple<int, int, double>{ 7, 31, 1.0 },
std::tuple<int, int, double>{ 7, 32, 1.0 },
std::tuple<int, int, double>{ 8, 33, 1.0 },
std::tuple<int, int, double>{ 8, 34, 1.0 },
std::tuple<int, int, double>{ 8, 35, 1.0 },
std::tuple<int, int, double>{ 8, 36, 1.0 },
std::tuple<int, int, double>{ 8, 37, 1.0 },
std::tuple<int, int, double>{ 9, 39, 1.0 },
std::tuple<int, int, double>{ 9, 40, 1.0 },
std::tuple<int, int, double>{ 9, 41, 1.0 },
std::tuple<int, int, double>{ 10, 42, 1.0 },
std::tuple<int, int, double>{ 10, 43, 1.0 },
std::tuple<int, int, double>{ 10, 44, 1.0 },
std::tuple<int, int, double>{ 10, 45, 1.0 },
std::tuple<int, int, double>{ 10, 46, 1.0 },
std::tuple<int, int, double>{ 11, 47, 1.0 },
std::tuple<int, int, double>{ 11, 48, 1.0 },
std::tuple<int, int, double>{ 11, 49, 1.0 },
std::tuple<int, int, double>{ 11, 50, 1.0 },
std::tuple<int, int, double>{ 12, 51, 1.0 },
std::tuple<int, int, double>{ 12, 52, 1.0 },
std::tuple<int, int, double>{ 12, 53, 1.0 },
std::tuple<int, int, double>{ 12, 54, 1.0 },
std::tuple<int, int, double>{ 12, 55, 1.0 },
std::tuple<int, int, double>{ 13, 56, 1.0 },
std::tuple<int, int, double>{ 13, 57, 1.0 },
std::tuple<int, int, double>{ 13, 58, 1.0 },
std::tuple<int, int, double>{ 13, 59, 1.0 },
std::tuple<int, int, double>{ 14, 60, 1.0 },
std::tuple<int, int, double>{ 14, 61, 1.0 },
std::tuple<int, int, double>{ 14, 62, 1.0 },
std::tuple<int, int, double>{ 15, 63, 1.0 },
std::tuple<int, int, double>{ 15, 64, 1.0 },
std::tuple<int, int, double>{ 16, 65, 1.0 },
std::tuple<int, int, double>{ 16, 66, 1.0 },
std::tuple<int, int, double>{ 16, 67, 1.0 },
std::tuple<int, int, double>{ 16, 68, 1.0 },
std::tuple<int, int, double>{ 16, 70, 1.0 },
std::tuple<int, int, double>{ 17, 5, -450.0 },
std::tuple<int, int, double>{ 17, 10, -435.0 },
std::tuple<int, int, double>{ 17, 19, -435.0 },
std::tuple<int, int, double>{ 17, 30, -350.0 },
std::tuple<int, int, double>{ 17, 65, -230.0 },
std::tuple<int, int, double>{ 17, 71, -200.0 },
std::tuple<int, int, double>{ 17, 72, -400.0 },
std::tuple<int, int, double>{ 18, 0, 525.0 },
std::tuple<int, int, double>{ 18, 1, 500.0 },
std::tuple<int, int, double>{ 18, 2, 475.0 },
std::tuple<int, int, double>{ 18, 3, 475.0 },
std::tuple<int, int, double>{ 18, 4, 475.0 },
std::tuple<int, int, double>{ 18, 12, 435.0 },
std::tuple<int, int, double>{ 18, 13, 435.0 },
std::tuple<int, int, double>{ 18, 15, 435.0 },
std::tuple<int, int, double>{ 18, 16, 435.0 },
std::tuple<int, int, double>{ 18, 17, 435.0 },
std::tuple<int, int, double>{ 18, 18, 435.0 },
std::tuple<int, int, double>{ 18, 26, 425.0 },
std::tuple<int, int, double>{ 18, 27, 425.0 },
std::tuple<int, int, double>{ 18, 28, 425.0 },
std::tuple<int, int, double>{ 18, 35, 330.0 },
std::tuple<int, int, double>{ 18, 36, 330.0 },
std::tuple<int, int, double>{ 18, 37, 330.0 },
std::tuple<int, int, double>{ 18, 38, 330.0 },
std::tuple<int, int, double>{ 18, 40, 330.0 },
std::tuple<int, int, double>{ 18, 41, 330.0 },
std::tuple<int, int, double>{ 18, 44, 325.0 },
std::tuple<int, int, double>{ 18, 45, 325.0 },
std::tuple<int, int, double>{ 18, 46, 325.0 },
std::tuple<int, int, double>{ 18, 48, 300.0 },
std::tuple<int, int, double>{ 18, 49, 300.0 },
std::tuple<int, int, double>{ 18, 53, 300.0 },
std::tuple<int, int, double>{ 18, 54, 300.0 },
std::tuple<int, int, double>{ 18, 55, 300.0 },
std::tuple<int, int, double>{ 18, 58, 300.0 },
std::tuple<int, int, double>{ 18, 59, 300.0 },
std::tuple<int, int, double>{ 18, 60, 285.0 },
std::tuple<int, int, double>{ 18, 61, 285.0 },
std::tuple<int, int, double>{ 18, 63, 265.0 },
std::tuple<int, int, double>{ 18, 64, 265.0 },
std::tuple<int, int, double>{ 18, 67, 230.0 },
std::tuple<int, int, double>{ 18, 68, 230.0 },
std::tuple<int, int, double>{ 18, 69, 190.0 },
std::tuple<int, int, double>{ 18, 77, 200.0 },
std::tuple<int, int, double>{ 18, 78, 400.0 },
std::tuple<int, int, double>{ 18, 79, 200.0 },
std::tuple<int, int, double>{ 18, 80, 400.0 },
std::tuple<int, int, double>{ 18, 81, 200.0 },
std::tuple<int, int, double>{ 18, 82, 400.0 },
std::tuple<int, int, double>{ 18, 83, 200.0 },
std::tuple<int, int, double>{ 18, 84, 400.0 },
std::tuple<int, int, double>{ 18, 85, 200.0 },
std::tuple<int, int, double>{ 18, 86, 400.0 },
std::tuple<int, int, double>{ 19, 0, -525.0 },
std::tuple<int, int, double>{ 19, 1, -500.0 },
std::tuple<int, int, double>{ 19, 2, -475.0 },
std::tuple<int, int, double>{ 19, 3, -475.0 },
std::tuple<int, int, double>{ 19, 4, -475.0 },
std::tuple<int, int, double>{ 19, 12, -435.0 },
std::tuple<int, int, double>{ 19, 13, -435.0 },
std::tuple<int, int, double>{ 19, 15, -435.0 },
std::tuple<int, int, double>{ 19, 16, -435.0 },
std::tuple<int, int, double>{ 19, 17, -435.0 },
std::tuple<int, int, double>{ 19, 18, -435.0 },
std::tuple<int, int, double>{ 19, 26, -425.0 },
std::tuple<int, int, double>{ 19, 27, -425.0 },
std::tuple<int, int, double>{ 19, 28, -425.0 },
std::tuple<int, int, double>{ 19, 35, -330.0 },
std::tuple<int, int, double>{ 19, 36, -330.0 },
std::tuple<int, int, double>{ 19, 37, -330.0 },
std::tuple<int, int, double>{ 19, 38, -330.0 },
std::tuple<int, int, double>{ 19, 40, -330.0 },
std::tuple<int, int, double>{ 19, 41, -330.0 },
std::tuple<int, int, double>{ 19, 44, -325.0 },
std::tuple<int, int, double>{ 19, 45, -325.0 },
std::tuple<int, int, double>{ 19, 46, -325.0 },
std::tuple<int, int, double>{ 19, 48, -300.0 },
std::tuple<int, int, double>{ 19, 49, -300.0 },
std::tuple<int, int, double>{ 19, 53, -300.0 },
std::tuple<int, int, double>{ 19, 54, -300.0 },
std::tuple<int, int, double>{ 19, 55, -300.0 },
std::tuple<int, int, double>{ 19, 58, -300.0 },
std::tuple<int, int, double>{ 19, 59, -300.0 },
std::tuple<int, int, double>{ 19, 60, -285.0 },
std::tuple<int, int, double>{ 19, 61, -285.0 },
std::tuple<int, int, double>{ 19, 63, -265.0 },
std::tuple<int, int, double>{ 19, 64, -265.0 },
std::tuple<int, int, double>{ 19, 67, -230.0 },
std::tuple<int, int, double>{ 19, 68, -230.0 },
std::tuple<int, int, double>{ 19, 69, -190.0 },
std::tuple<int, int, double>{ 19, 77, -200.0 },
std::tuple<int, int, double>{ 19, 78, -400.0 },
std::tuple<int, int, double>{ 19, 79, -200.0 },
std::tuple<int, int, double>{ 19, 80, -400.0 },
std::tuple<int, int, double>{ 19, 81, -200.0 },
std::tuple<int, int, double>{ 19, 82, -400.0 },
std::tuple<int, int, double>{ 19, 83, -200.0 },
std::tuple<int, int, double>{ 19, 84, -400.0 },
std::tuple<int, int, double>{ 19, 85, -200.0 },
std::tuple<int, int, double>{ 19, 86, -400.0 },
std::tuple<int, int, double>{ 20, 13, -435.0 },
std::tuple<int, int, double>{ 20, 21, -400.0 },
std::tuple<int, int, double>{ 20, 32, -350.0 },
std::tuple<int, int, double>{ 20, 37, -330.0 },
std::tuple<int, int, double>{ 20, 41, -330.0 },
std::tuple<int, int, double>{ 20, 46, -325.0 },
std::tuple<int, int, double>{ 20, 49, -300.0 },
std::tuple<int, int, double>{ 20, 55, -300.0 },
std::tuple<int, int, double>{ 20, 59, -300.0 },
std::tuple<int, int, double>{ 20, 85, -200.0 },
std::tuple<int, int, double>{ 20, 86, -400.0 },
std::tuple<int, int, double>{ 21, 0, -525.0 },
std::tuple<int, int, double>{ 21, 1, -500.0 },
std::tuple<int, int, double>{ 21, 3, -475.0 },
std::tuple<int, int, double>{ 21, 4, -190.0 },
std::tuple<int, int, double>{ 21, 7, -450.0 },
std::tuple<int, int, double>{ 21, 8, -165.0 },
std::tuple<int, int, double>{ 21, 17, -435.0 },
std::tuple<int, int, double>{ 21, 18, -300.0 },
std::tuple<int, int, double>{ 21, 24, -400.0 },
std::tuple<int, int, double>{ 21, 25, -115.0 },
std::tuple<int, int, double>{ 21, 33, -330.0 },
std::tuple<int, int, double>{ 21, 38, -330.0 },
std::tuple<int, int, double>{ 21, 39, -330.0 },
std::tuple<int, int, double>{ 21, 42, -325.0 },
std::tuple<int, int, double>{ 21, 47, -300.0 },
std::tuple<int, int, double>{ 21, 51, -300.0 },
std::tuple<int, int, double>{ 21, 56, -300.0 },
std::tuple<int, int, double>{ 21, 61, -285.0 },
std::tuple<int, int, double>{ 21, 64, -265.0 },
std::tuple<int, int, double>{ 21, 69, -190.0 },
std::tuple<int, int, double>{ 21, 81, -200.0 },
std::tuple<int, int, double>{ 21, 82, -400.0 },
std::tuple<int, int, double>{ 22, 0, -525.0 },
std::tuple<int, int, double>{ 22, 1, -500.0 },
std::tuple<int, int, double>{ 22, 3, -475.0 },
std::tuple<int, int, double>{ 22, 4, -190.0 },
std::tuple<int, int, double>{ 22, 7, -450.0 },
std::tuple<int, int, double>{ 22, 8, -165.0 },
std::tuple<int, int, double>{ 22, 12, -435.0 },
std::tuple<int, int, double>{ 22, 17, -435.0 },
std::tuple<int, int, double>{ 22, 18, -300.0 },
std::tuple<int, int, double>{ 22, 20, -400.0 },
std::tuple<int, int, double>{ 22, 24, -400.0 },
std::tuple<int, int, double>{ 22, 25, -115.0 },
std::tuple<int, int, double>{ 22, 27, -425.0 },
std::tuple<int, int, double>{ 22, 28, -140.0 },
std::tuple<int, int, double>{ 22, 33, -330.0 },
std::tuple<int, int, double>{ 22, 36, -330.0 },
std::tuple<int, int, double>{ 22, 38, -330.0 },
std::tuple<int, int, double>{ 22, 39, -330.0 },
std::tuple<int, int, double>{ 22, 42, -325.0 },
std::tuple<int, int, double>{ 22, 45, -325.0 },
std::tuple<int, int, double>{ 22, 47, -300.0 },
std::tuple<int, int, double>{ 22, 51, -300.0 },
std::tuple<int, int, double>{ 22, 54, -300.0 },
std::tuple<int, int, double>{ 22, 56, -300.0 },
std::tuple<int, int, double>{ 22, 58, -300.0 },
std::tuple<int, int, double>{ 22, 61, -285.0 },
std::tuple<int, int, double>{ 22, 64, -265.0 },
std::tuple<int, int, double>{ 22, 68, -230.0 },
std::tuple<int, int, double>{ 22, 69, -190.0 },
std::tuple<int, int, double>{ 22, 81, -200.0 },
std::tuple<int, int, double>{ 22, 82, -400.0 },
std::tuple<int, int, double>{ 22, 83, -200.0 },
std::tuple<int, int, double>{ 22, 84, -400.0 },
std::tuple<int, int, double>{ 23, 2, -475.0 },
std::tuple<int, int, double>{ 23, 4, -285.0 },
std::tuple<int, int, double>{ 23, 6, -450.0 },
std::tuple<int, int, double>{ 23, 8, -285.0 },
std::tuple<int, int, double>{ 23, 9, -150.0 },
std::tuple<int, int, double>{ 23, 11, -435.0 },
std::tuple<int, int, double>{ 23, 14, -435.0 },
std::tuple<int, int, double>{ 23, 16, -435.0 },
std::tuple<int, int, double>{ 23, 18, -135.0 },
std::tuple<int, int, double>{ 23, 22, -100.0 },
std::tuple<int, int, double>{ 23, 23, -400.0 },
std::tuple<int, int, double>{ 23, 25, -285.0 },
std::tuple<int, int, double>{ 23, 29, -100.0 },
std::tuple<int, int, double>{ 23, 31, -350.0 },
std::tuple<int, int, double>{ 23, 35, -330.0 },
std::tuple<int, int, double>{ 23, 40, -330.0 },
std::tuple<int, int, double>{ 23, 44, -325.0 },
std::tuple<int, int, double>{ 23, 48, -300.0 },
std::tuple<int, int, double>{ 23, 53, -300.0 },
std::tuple<int, int, double>{ 23, 60, -285.0 },
std::tuple<int, int, double>{ 23, 63, -265.0 },
std::tuple<int, int, double>{ 23, 66, -230.0 },
std::tuple<int, int, double>{ 23, 77, -200.0 },
std::tuple<int, int, double>{ 23, 78, -400.0 },
std::tuple<int, int, double>{ 24, 2, -475.0 },
std::tuple<int, int, double>{ 24, 4, -285.0 },
std::tuple<int, int, double>{ 24, 6, -450.0 },
std::tuple<int, int, double>{ 24, 8, -285.0 },
std::tuple<int, int, double>{ 24, 9, -150.0 },
std::tuple<int, int, double>{ 24, 11, -435.0 },
std::tuple<int, int, double>{ 24, 14, -435.0 },
std::tuple<int, int, double>{ 24, 15, -435.0 },
std::tuple<int, int, double>{ 24, 16, -435.0 },
std::tuple<int, int, double>{ 24, 18, -135.0 },
std::tuple<int, int, double>{ 24, 22, -100.0 },
std::tuple<int, int, double>{ 24, 23, -400.0 },
std::tuple<int, int, double>{ 24, 25, -285.0 },
std::tuple<int, int, double>{ 24, 26, -425.0 },
std::tuple<int, int, double>{ 24, 28, -285.0 },
std::tuple<int, int, double>{ 24, 29, -100.0 },
std::tuple<int, int, double>{ 24, 31, -350.0 },
std::tuple<int, int, double>{ 24, 35, -330.0 },
std::tuple<int, int, double>{ 24, 40, -330.0 },
std::tuple<int, int, double>{ 24, 44, -325.0 },
std::tuple<int, int, double>{ 24, 48, -300.0 },
std::tuple<int, int, double>{ 24, 53, -300.0 },
std::tuple<int, int, double>{ 24, 60, -285.0 },
std::tuple<int, int, double>{ 24, 63, -265.0 },
std::tuple<int, int, double>{ 24, 66, -230.0 },
std::tuple<int, int, double>{ 24, 67, -230.0 },
std::tuple<int, int, double>{ 24, 77, -200.0 },
std::tuple<int, int, double>{ 24, 78, -400.0 },
std::tuple<int, int, double>{ 24, 79, -200.0 },
std::tuple<int, int, double>{ 24, 80, -400.0 },
std::tuple<int, int, double>{ 25, 29, -300.0 },
std::tuple<int, int, double>{ 25, 34, -330.0 },
std::tuple<int, int, double>{ 25, 43, -325.0 },
std::tuple<int, int, double>{ 25, 52, -300.0 },
std::tuple<int, int, double>{ 25, 57, -300.0 },
std::tuple<int, int, double>{ 25, 73, -200.0 },
std::tuple<int, int, double>{ 25, 74, -400.0 },
std::tuple<int, int, double>{ 26, 22, -300.0 },
std::tuple<int, int, double>{ 26, 29, -300.0 },
std::tuple<int, int, double>{ 26, 34, -330.0 },
std::tuple<int, int, double>{ 26, 43, -325.0 },
std::tuple<int, int, double>{ 26, 52, -300.0 },
std::tuple<int, int, double>{ 26, 57, -300.0 },
std::tuple<int, int, double>{ 26, 73, -200.0 },
std::tuple<int, int, double>{ 26, 74, -400.0 },
std::tuple<int, int, double>{ 26, 75, -200.0 },
std::tuple<int, int, double>{ 26, 76, -400.0 },
std::tuple<int, int, double>{ 27, 50, -300.0 },
std::tuple<int, int, double>{ 27, 62, -285.0 },
std::tuple<int, int, double>{ 27, 87, -200.0 },
std::tuple<int, int, double>{ 27, 88, -400.0 },
};
Vec<std::string> rnames{
"R101", "R102", "R103", "R104", "R105", "R106", "R107",
"R108", "R109", "R110", "R111", "R112", "R113", "R114",
"R115", "R116", "R117", "R118", "R119", "R120", "R121",
"R122", "R123", "R124", "R125", "R126", "R127", "R128",
};
Vec<std::string> cnames{
"C101", "C102", "C103", "C104", "C105", "C106", "C107", "C108", "C109",
"C110", "C111", "C112", "C113", "C114", "C115", "C116", "C117", "C118",
"C119", "C120", "C121", "C122", "C123", "C124", "C125", "C126", "C127",
"C128", "C129", "C130", "C131", "C132", "C133", "C134", "C135", "C136",
"C137", "C138", "C139", "C140", "C141", "C142", "C143", "C144", "C145",
"C146", "C147", "C148", "C149", "C150", "C151", "C152", "C153", "C154",
"C155", "C156", "C157", "C158", "C159", "C160", "C161", "C162", "C163",
"C164", "C165", "C166", "C167", "C168", "C169", "C170", "C171", "C172",
"C173", "C174", "C175", "C176", "C177", "C178", "C179", "C180", "C181",
"C182", "C183", "C184", "C185", "C186", "C187", "C188", "C189",
};
int nCols = 89;
int nRows = 28;
ProblemBuilder<double> pb;
pb.reserve( 309, 28, 89 );
pb.setNumRows( nRows );
pb.setNumCols( nCols );
pb.setObjAll( coeffobj );
pb.setObjOffset( 0.0 );
pb.setColLbAll( lbs );
pb.setColLbInfAll( lbInf );
pb.setColUbAll( ubs );
pb.setColUbInfAll( ubInf );
pb.setColIntegralAll( isIntegral );
pb.setRowLhsInfAll( lhsIsInf );
pb.setRowRhsInfAll( rhsIsInf );
pb.setRowLhsAll( lhs );
pb.setRowRhsAll( rhs );
pb.setRowNameAll( rnames );
pb.addEntryAll( entries );
pb.setColNameAll( cnames );
pb.setProblemName( "lseu.hpp" );
Problem<double> problem = pb.build();
/// PROBLEM BUILDER CODE END
return problem;
}
} // namespace instances
} // namespace papilo
#endif
| 24,044
|
C++
|
.h
| 456
| 45.72807
| 79
| 0.491667
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,860
|
enigma.hpp
|
lgottwald_PaPILO/test/instances/enigma.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef PAPILO_TEST_INSTANCES_ENIGMA
#define PAPILO_TEST_INSTANCES_ENIGMA
#include "papilo/core/Problem.hpp"
#include "papilo/core/ProblemBuilder.hpp"
namespace papilo
{
namespace instances
{
Problem<double>
enigma()
{
/// PROBLEM BUILDER CODE
Vec<double> coeffobj{
0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0,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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
};
Vec<uint8_t> lhsIsInf{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
Vec<double> lhs{
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
};
Vec<uint8_t> rhsIsInf{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
Vec<double> rhs{
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
};
Vec<std::tuple<int, int, double>> entries{
std::tuple<int, int, double>{ 0, 0, 1.0 },
std::tuple<int, int, double>{ 0, 10, 1.0 },
std::tuple<int, int, double>{ 0, 20, 1.0 },
std::tuple<int, int, double>{ 0, 30, 1.0 },
std::tuple<int, int, double>{ 0, 40, 1.0 },
std::tuple<int, int, double>{ 0, 50, 1.0 },
std::tuple<int, int, double>{ 0, 60, 1.0 },
std::tuple<int, int, double>{ 0, 70, 1.0 },
std::tuple<int, int, double>{ 0, 80, 1.0 },
std::tuple<int, int, double>{ 0, 90, 1.0 },
std::tuple<int, int, double>{ 1, 1, 1.0 },
std::tuple<int, int, double>{ 1, 11, 1.0 },
std::tuple<int, int, double>{ 1, 21, 1.0 },
std::tuple<int, int, double>{ 1, 31, 1.0 },
std::tuple<int, int, double>{ 1, 41, 1.0 },
std::tuple<int, int, double>{ 1, 51, 1.0 },
std::tuple<int, int, double>{ 1, 61, 1.0 },
std::tuple<int, int, double>{ 1, 71, 1.0 },
std::tuple<int, int, double>{ 1, 81, 1.0 },
std::tuple<int, int, double>{ 1, 91, 1.0 },
std::tuple<int, int, double>{ 2, 2, 1.0 },
std::tuple<int, int, double>{ 2, 12, 1.0 },
std::tuple<int, int, double>{ 2, 22, 1.0 },
std::tuple<int, int, double>{ 2, 32, 1.0 },
std::tuple<int, int, double>{ 2, 42, 1.0 },
std::tuple<int, int, double>{ 2, 52, 1.0 },
std::tuple<int, int, double>{ 2, 62, 1.0 },
std::tuple<int, int, double>{ 2, 72, 1.0 },
std::tuple<int, int, double>{ 2, 82, 1.0 },
std::tuple<int, int, double>{ 2, 92, 1.0 },
std::tuple<int, int, double>{ 3, 3, 1.0 },
std::tuple<int, int, double>{ 3, 13, 1.0 },
std::tuple<int, int, double>{ 3, 23, 1.0 },
std::tuple<int, int, double>{ 3, 33, 1.0 },
std::tuple<int, int, double>{ 3, 43, 1.0 },
std::tuple<int, int, double>{ 3, 53, 1.0 },
std::tuple<int, int, double>{ 3, 63, 1.0 },
std::tuple<int, int, double>{ 3, 73, 1.0 },
std::tuple<int, int, double>{ 3, 83, 1.0 },
std::tuple<int, int, double>{ 3, 93, 1.0 },
std::tuple<int, int, double>{ 4, 4, 1.0 },
std::tuple<int, int, double>{ 4, 14, 1.0 },
std::tuple<int, int, double>{ 4, 24, 1.0 },
std::tuple<int, int, double>{ 4, 34, 1.0 },
std::tuple<int, int, double>{ 4, 44, 1.0 },
std::tuple<int, int, double>{ 4, 54, 1.0 },
std::tuple<int, int, double>{ 4, 64, 1.0 },
std::tuple<int, int, double>{ 4, 74, 1.0 },
std::tuple<int, int, double>{ 4, 84, 1.0 },
std::tuple<int, int, double>{ 4, 94, 1.0 },
std::tuple<int, int, double>{ 5, 5, 1.0 },
std::tuple<int, int, double>{ 5, 15, 1.0 },
std::tuple<int, int, double>{ 5, 25, 1.0 },
std::tuple<int, int, double>{ 5, 35, 1.0 },
std::tuple<int, int, double>{ 5, 45, 1.0 },
std::tuple<int, int, double>{ 5, 55, 1.0 },
std::tuple<int, int, double>{ 5, 65, 1.0 },
std::tuple<int, int, double>{ 5, 75, 1.0 },
std::tuple<int, int, double>{ 5, 85, 1.0 },
std::tuple<int, int, double>{ 5, 95, 1.0 },
std::tuple<int, int, double>{ 6, 6, 1.0 },
std::tuple<int, int, double>{ 6, 16, 1.0 },
std::tuple<int, int, double>{ 6, 26, 1.0 },
std::tuple<int, int, double>{ 6, 36, 1.0 },
std::tuple<int, int, double>{ 6, 46, 1.0 },
std::tuple<int, int, double>{ 6, 56, 1.0 },
std::tuple<int, int, double>{ 6, 66, 1.0 },
std::tuple<int, int, double>{ 6, 76, 1.0 },
std::tuple<int, int, double>{ 6, 86, 1.0 },
std::tuple<int, int, double>{ 6, 96, 1.0 },
std::tuple<int, int, double>{ 7, 7, 1.0 },
std::tuple<int, int, double>{ 7, 17, 1.0 },
std::tuple<int, int, double>{ 7, 27, 1.0 },
std::tuple<int, int, double>{ 7, 37, 1.0 },
std::tuple<int, int, double>{ 7, 47, 1.0 },
std::tuple<int, int, double>{ 7, 57, 1.0 },
std::tuple<int, int, double>{ 7, 67, 1.0 },
std::tuple<int, int, double>{ 7, 77, 1.0 },
std::tuple<int, int, double>{ 7, 87, 1.0 },
std::tuple<int, int, double>{ 7, 97, 1.0 },
std::tuple<int, int, double>{ 8, 8, 1.0 },
std::tuple<int, int, double>{ 8, 18, 1.0 },
std::tuple<int, int, double>{ 8, 28, 1.0 },
std::tuple<int, int, double>{ 8, 38, 1.0 },
std::tuple<int, int, double>{ 8, 48, 1.0 },
std::tuple<int, int, double>{ 8, 58, 1.0 },
std::tuple<int, int, double>{ 8, 68, 1.0 },
std::tuple<int, int, double>{ 8, 78, 1.0 },
std::tuple<int, int, double>{ 8, 88, 1.0 },
std::tuple<int, int, double>{ 8, 98, 1.0 },
std::tuple<int, int, double>{ 9, 9, 1.0 },
std::tuple<int, int, double>{ 9, 19, 1.0 },
std::tuple<int, int, double>{ 9, 29, 1.0 },
std::tuple<int, int, double>{ 9, 39, 1.0 },
std::tuple<int, int, double>{ 9, 49, 1.0 },
std::tuple<int, int, double>{ 9, 59, 1.0 },
std::tuple<int, int, double>{ 9, 69, 1.0 },
std::tuple<int, int, double>{ 9, 79, 1.0 },
std::tuple<int, int, double>{ 9, 89, 1.0 },
std::tuple<int, int, double>{ 9, 99, 1.0 },
std::tuple<int, int, double>{ 10, 1, 202.0 },
std::tuple<int, int, double>{ 10, 2, 404.0 },
std::tuple<int, int, double>{ 10, 3, 606.0 },
std::tuple<int, int, double>{ 10, 4, 808.0 },
std::tuple<int, int, double>{ 10, 5, 1010.0 },
std::tuple<int, int, double>{ 10, 6, 1212.0 },
std::tuple<int, int, double>{ 10, 7, 1414.0 },
std::tuple<int, int, double>{ 10, 8, 1616.0 },
std::tuple<int, int, double>{ 10, 9, 1818.0 },
std::tuple<int, int, double>{ 10, 11, -79.0 },
std::tuple<int, int, double>{ 10, 12, -158.0 },
std::tuple<int, int, double>{ 10, 13, -237.0 },
std::tuple<int, int, double>{ 10, 14, -316.0 },
std::tuple<int, int, double>{ 10, 15, -395.0 },
std::tuple<int, int, double>{ 10, 16, -474.0 },
std::tuple<int, int, double>{ 10, 17, -553.0 },
std::tuple<int, int, double>{ 10, 18, -632.0 },
std::tuple<int, int, double>{ 10, 19, -711.0 },
std::tuple<int, int, double>{ 10, 21, 100023.0 },
std::tuple<int, int, double>{ 10, 22, 200046.0 },
std::tuple<int, int, double>{ 10, 23, 300069.0 },
std::tuple<int, int, double>{ 10, 24, 400092.0 },
std::tuple<int, int, double>{ 10, 25, 500115.0 },
std::tuple<int, int, double>{ 10, 26, 600138.0 },
std::tuple<int, int, double>{ 10, 27, 700161.0 },
std::tuple<int, int, double>{ 10, 28, 800184.0 },
std::tuple<int, int, double>{ 10, 29, 900207.0 },
std::tuple<int, int, double>{ 10, 31, -89810.0 },
std::tuple<int, int, double>{ 10, 32, -179620.0 },
std::tuple<int, int, double>{ 10, 33, -269430.0 },
std::tuple<int, int, double>{ 10, 34, -359240.0 },
std::tuple<int, int, double>{ 10, 35, -449050.0 },
std::tuple<int, int, double>{ 10, 36, -538860.0 },
std::tuple<int, int, double>{ 10, 37, -628670.0 },
std::tuple<int, int, double>{ 10, 38, -718480.0 },
std::tuple<int, int, double>{ 10, 39, -808290.0 },
std::tuple<int, int, double>{ 10, 41, -9980.0 },
std::tuple<int, int, double>{ 10, 42, -19960.0 },
std::tuple<int, int, double>{ 10, 43, -29940.0 },
std::tuple<int, int, double>{ 10, 44, -39920.0 },
std::tuple<int, int, double>{ 10, 45, -49900.0 },
std::tuple<int, int, double>{ 10, 46, -59880.0 },
std::tuple<int, int, double>{ 10, 47, -69860.0 },
std::tuple<int, int, double>{ 10, 48, -79840.0 },
std::tuple<int, int, double>{ 10, 49, -89820.0 },
std::tuple<int, int, double>{ 10, 51, 1000.0 },
std::tuple<int, int, double>{ 10, 52, 2000.0 },
std::tuple<int, int, double>{ 10, 53, 3000.0 },
std::tuple<int, int, double>{ 10, 54, 4000.0 },
std::tuple<int, int, double>{ 10, 55, 5000.0 },
std::tuple<int, int, double>{ 10, 56, 6000.0 },
std::tuple<int, int, double>{ 10, 57, 7000.0 },
std::tuple<int, int, double>{ 10, 58, 8000.0 },
std::tuple<int, int, double>{ 10, 59, 9000.0 },
std::tuple<int, int, double>{ 10, 61, 100.0 },
std::tuple<int, int, double>{ 10, 62, 200.0 },
std::tuple<int, int, double>{ 10, 63, 300.0 },
std::tuple<int, int, double>{ 10, 64, 400.0 },
std::tuple<int, int, double>{ 10, 65, 500.0 },
std::tuple<int, int, double>{ 10, 66, 600.0 },
std::tuple<int, int, double>{ 10, 67, 700.0 },
std::tuple<int, int, double>{ 10, 68, 800.0 },
std::tuple<int, int, double>{ 10, 69, 900.0 },
std::tuple<int, int, double>{ 10, 71, 10000.0 },
std::tuple<int, int, double>{ 10, 72, 20000.0 },
std::tuple<int, int, double>{ 10, 73, 30000.0 },
std::tuple<int, int, double>{ 10, 74, 40000.0 },
std::tuple<int, int, double>{ 10, 75, 50000.0 },
std::tuple<int, int, double>{ 10, 76, 60000.0 },
std::tuple<int, int, double>{ 10, 77, 70000.0 },
std::tuple<int, int, double>{ 10, 78, 80000.0 },
std::tuple<int, int, double>{ 10, 79, 90000.0 },
std::tuple<int, int, double>{ 10, 81, 100.0 },
std::tuple<int, int, double>{ 10, 82, 200.0 },
std::tuple<int, int, double>{ 10, 83, 300.0 },
std::tuple<int, int, double>{ 10, 84, 400.0 },
std::tuple<int, int, double>{ 10, 85, 500.0 },
std::tuple<int, int, double>{ 10, 86, 600.0 },
std::tuple<int, int, double>{ 10, 87, 700.0 },
std::tuple<int, int, double>{ 10, 88, 800.0 },
std::tuple<int, int, double>{ 10, 89, 900.0 },
std::tuple<int, int, double>{ 10, 91, -1.0 },
std::tuple<int, int, double>{ 10, 92, -2.0 },
std::tuple<int, int, double>{ 10, 93, -3.0 },
std::tuple<int, int, double>{ 10, 94, -4.0 },
std::tuple<int, int, double>{ 10, 95, -5.0 },
std::tuple<int, int, double>{ 10, 96, -6.0 },
std::tuple<int, int, double>{ 10, 97, -7.0 },
std::tuple<int, int, double>{ 10, 98, -8.0 },
std::tuple<int, int, double>{ 10, 99, -9.0 },
std::tuple<int, int, double>{ 11, 0, 1.0 },
std::tuple<int, int, double>{ 11, 1, 1.0 },
std::tuple<int, int, double>{ 11, 2, 1.0 },
std::tuple<int, int, double>{ 11, 3, 1.0 },
std::tuple<int, int, double>{ 11, 4, 1.0 },
std::tuple<int, int, double>{ 11, 5, 1.0 },
std::tuple<int, int, double>{ 11, 6, 1.0 },
std::tuple<int, int, double>{ 11, 7, 1.0 },
std::tuple<int, int, double>{ 11, 8, 1.0 },
std::tuple<int, int, double>{ 12, 10, 1.0 },
std::tuple<int, int, double>{ 12, 11, 1.0 },
std::tuple<int, int, double>{ 12, 12, 1.0 },
std::tuple<int, int, double>{ 12, 13, 1.0 },
std::tuple<int, int, double>{ 12, 14, 1.0 },
std::tuple<int, int, double>{ 12, 15, 1.0 },
std::tuple<int, int, double>{ 12, 16, 1.0 },
std::tuple<int, int, double>{ 12, 17, 1.0 },
std::tuple<int, int, double>{ 12, 18, 1.0 },
std::tuple<int, int, double>{ 12, 19, 1.0 },
std::tuple<int, int, double>{ 13, 20, 1.0 },
std::tuple<int, int, double>{ 13, 21, 1.0 },
std::tuple<int, int, double>{ 13, 22, 1.0 },
std::tuple<int, int, double>{ 13, 23, 1.0 },
std::tuple<int, int, double>{ 13, 24, 1.0 },
std::tuple<int, int, double>{ 13, 25, 1.0 },
std::tuple<int, int, double>{ 13, 26, 1.0 },
std::tuple<int, int, double>{ 13, 27, 1.0 },
std::tuple<int, int, double>{ 13, 28, 1.0 },
std::tuple<int, int, double>{ 13, 29, 1.0 },
std::tuple<int, int, double>{ 14, 30, 1.0 },
std::tuple<int, int, double>{ 14, 31, 1.0 },
std::tuple<int, int, double>{ 14, 32, 1.0 },
std::tuple<int, int, double>{ 14, 33, 1.0 },
std::tuple<int, int, double>{ 14, 34, 1.0 },
std::tuple<int, int, double>{ 14, 35, 1.0 },
std::tuple<int, int, double>{ 14, 36, 1.0 },
std::tuple<int, int, double>{ 14, 37, 1.0 },
std::tuple<int, int, double>{ 14, 38, 1.0 },
std::tuple<int, int, double>{ 14, 39, 1.0 },
std::tuple<int, int, double>{ 15, 40, 1.0 },
std::tuple<int, int, double>{ 15, 41, 1.0 },
std::tuple<int, int, double>{ 15, 42, 1.0 },
std::tuple<int, int, double>{ 15, 43, 1.0 },
std::tuple<int, int, double>{ 15, 44, 1.0 },
std::tuple<int, int, double>{ 15, 45, 1.0 },
std::tuple<int, int, double>{ 15, 46, 1.0 },
std::tuple<int, int, double>{ 15, 47, 1.0 },
std::tuple<int, int, double>{ 15, 48, 1.0 },
std::tuple<int, int, double>{ 15, 49, 1.0 },
std::tuple<int, int, double>{ 16, 50, 1.0 },
std::tuple<int, int, double>{ 16, 51, 1.0 },
std::tuple<int, int, double>{ 16, 52, 1.0 },
std::tuple<int, int, double>{ 16, 53, 1.0 },
std::tuple<int, int, double>{ 16, 54, 1.0 },
std::tuple<int, int, double>{ 16, 55, 1.0 },
std::tuple<int, int, double>{ 16, 56, 1.0 },
std::tuple<int, int, double>{ 16, 57, 1.0 },
std::tuple<int, int, double>{ 16, 58, 1.0 },
std::tuple<int, int, double>{ 16, 59, 1.0 },
std::tuple<int, int, double>{ 17, 60, 1.0 },
std::tuple<int, int, double>{ 17, 61, 1.0 },
std::tuple<int, int, double>{ 17, 62, 1.0 },
std::tuple<int, int, double>{ 17, 63, 1.0 },
std::tuple<int, int, double>{ 17, 64, 1.0 },
std::tuple<int, int, double>{ 17, 65, 1.0 },
std::tuple<int, int, double>{ 17, 66, 1.0 },
std::tuple<int, int, double>{ 17, 67, 1.0 },
std::tuple<int, int, double>{ 17, 68, 1.0 },
std::tuple<int, int, double>{ 17, 69, 1.0 },
std::tuple<int, int, double>{ 18, 70, 1.0 },
std::tuple<int, int, double>{ 18, 71, 1.0 },
std::tuple<int, int, double>{ 18, 72, 1.0 },
std::tuple<int, int, double>{ 18, 73, 1.0 },
std::tuple<int, int, double>{ 18, 74, 1.0 },
std::tuple<int, int, double>{ 18, 75, 1.0 },
std::tuple<int, int, double>{ 18, 76, 1.0 },
std::tuple<int, int, double>{ 18, 77, 1.0 },
std::tuple<int, int, double>{ 18, 78, 1.0 },
std::tuple<int, int, double>{ 18, 79, 1.0 },
std::tuple<int, int, double>{ 19, 80, 1.0 },
std::tuple<int, int, double>{ 19, 81, 1.0 },
std::tuple<int, int, double>{ 19, 82, 1.0 },
std::tuple<int, int, double>{ 19, 83, 1.0 },
std::tuple<int, int, double>{ 19, 84, 1.0 },
std::tuple<int, int, double>{ 19, 85, 1.0 },
std::tuple<int, int, double>{ 19, 86, 1.0 },
std::tuple<int, int, double>{ 19, 87, 1.0 },
std::tuple<int, int, double>{ 19, 88, 1.0 },
std::tuple<int, int, double>{ 19, 89, 1.0 },
std::tuple<int, int, double>{ 20, 90, 1.0 },
std::tuple<int, int, double>{ 20, 91, 1.0 },
std::tuple<int, int, double>{ 20, 92, 1.0 },
std::tuple<int, int, double>{ 20, 93, 1.0 },
std::tuple<int, int, double>{ 20, 94, 1.0 },
std::tuple<int, int, double>{ 20, 95, 1.0 },
std::tuple<int, int, double>{ 20, 96, 1.0 },
std::tuple<int, int, double>{ 20, 97, 1.0 },
std::tuple<int, int, double>{ 20, 98, 1.0 },
std::tuple<int, int, double>{ 20, 99, 1.0 },
};
Vec<std::string> rnames{
"SOS0", "SOS1", "SOS2", "SOS3", "SOS4", "SOS5", "SOS6",
"SOS7", "SOS8", "SOS9", "BILANCIO", "SOSA", "SOSB", "SOSC",
"SOSD", "SOSE", "SOSF", "SOSG", "SOSH", "SOSI", "SOSL",
};
Vec<std::string> cnames{
"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9",
"B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9",
"C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9",
"D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9",
"E_0", "E_1", "E_2", "E_3", "E_4", "E_5", "E_6", "E_7", "E_8", "E_9",
"F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9",
"G0", "G1", "G2", "G3", "G4", "G5", "G6", "G7", "G8", "G9",
"H0", "H1", "H2", "H3", "H4", "H5", "H6", "H7", "H8", "H9",
"I0", "I1", "I2", "I3", "I4", "I5", "I6", "I7", "I8", "I9",
"L0", "L1", "L2", "L3", "L4", "L5", "L6", "L7", "L8", "L9",
};
int nCols = 100;
int nRows = 21;
ProblemBuilder<double> pb;
pb.reserve( 289, 21, 100 );
pb.setNumRows( nRows );
pb.setNumCols( nCols );
pb.setObjAll( coeffobj );
pb.setObjOffset( 0.0 );
pb.setColLbAll( lbs );
pb.setColLbInfAll( lbInf );
pb.setColUbAll( ubs );
pb.setColUbInfAll( ubInf );
pb.setColIntegralAll( isIntegral );
pb.setRowLhsInfAll( lhsIsInf );
pb.setRowRhsInfAll( rhsIsInf );
pb.setRowLhsAll( lhs );
pb.setRowRhsAll( rhs );
pb.setRowNameAll( rnames );
pb.addEntryAll( entries );
pb.setColNameAll( cnames );
pb.setProblemName( "enigma.hpp" );
Problem<double> problem = pb.build();
/// PROBLEM BUILDER CODE END
return problem;
}
} // namespace instances
} // namespace papilo
#endif
| 22,402
|
C++
|
.h
| 435
| 44.547126
| 79
| 0.479235
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,861
|
blend2.hpp
|
lgottwald_PaPILO/test/instances/blend2.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef PAPILO_TEST_INSTANCES_BLEND2
#define PAPILO_TEST_INSTANCES_BLEND2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.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.537756,
0.698853, 0.50276, 0.895022, 1.743451, 0.942649, 1.830058, 0.895022,
1.161897, 2.63988, 0.687402, 0.502796, 3.85769, 0.502796, 1.502445,
2.527007, 1.502445, 0.613929, 2.109085, 2.417521, 1.042655, 0.587534,
0.808229, 0.994499, 0.50276, 0.732566, 0.587534, 3.308961, 4.697755,
3.85769, 0.994499, 0.750942, 4.697755, 3.000857, 1.438391, 0.50276,
0.587534, 0.525196, 0.639556, 4.697755, 2.433549, 0.948479, 1.199801,
0.609059, 0.50276, 0.718052, 0.507716, 3.415212, 1.569899, 1.161897,
3.101773, 0.994499, 0.515061, 0.613929, 13.458794, 5.618654, 3.204477,
1.314989, 0.823386, 0.63289, 0.769018, 1.502445, 1.502445, 0.862908,
0.502796, 9.264861, 23.501588, 14.501741, 6.324203, 4.089271, 0.63289,
0.525196, 2.875916, 3.000857, 1.438391, 0.750942, 0.502796, 0.993126,
9.264861, 4.824437, 3.000857, 4.572721, 2.345465, 0.862908, 0.515061,
0.808229, 5.472803, 24.014225,
};
Vec<double> lbs{
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0,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0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 609.0, 908.0, 574.0, 100.0,
71.0, 424.0, 400.0, 339.0, 383.0, 906.0, 0.0, 86.0, 0.0, 57.0,
64.0, 958.0, 467.0, 228.0, 270.0, 129.0, 941.0, 934.0, 354.0, 678.0,
128.0, 646.0, 500.0, 200.0, 600.0, 0.0, 66.0, 903.0, 0.0, 60.0,
843.0, 0.0, 172.0, 468.0, 715.0, 633.0, 156.0, 279.0, 625.0, 350.0,
828.0, 41.0, 443.0, 568.0, 952.0, 0.0, 437.0, 197.0, 420.0, 995.0,
498.0, 580.0, 883.0, 328.0, 52.0, 332.0, 998.0, 895.0, 870.0, 605.0,
430.0, 863.0, 299.0, 522.0, 0.0, 455.0, 0.0, 830.0, 0.0, 768.0,
787.0, 890.0, 844.0, 914.0, 922.0, 775.0, 616.0, 850.0, 832.0, 770.0,
450.0, 9.0, 60.0, 685.0,
};
Vec<std::tuple<int, int, double>> entries{
std::tuple<int, int, double>{ 0, 0, -1000.0 },
std::tuple<int, int, double>{ 0, 88, -609.0 },
std::tuple<int, int, double>{ 0, 176, 1.0 },
std::tuple<int, int, double>{ 1, 1, -1000.0 },
std::tuple<int, int, double>{ 1, 89, -908.0 },
std::tuple<int, int, double>{ 1, 177, 1.0 },
std::tuple<int, int, double>{ 2, 2, -1000.0 },
std::tuple<int, int, double>{ 2, 90, -574.0 },
std::tuple<int, int, double>{ 2, 178, 1.0 },
std::tuple<int, int, double>{ 3, 3, -1000.0 },
std::tuple<int, int, double>{ 3, 91, -100.0 },
std::tuple<int, int, double>{ 3, 179, 1.0 },
std::tuple<int, int, double>{ 4, 4, -1000.0 },
std::tuple<int, int, double>{ 4, 92, -71.0 },
std::tuple<int, int, double>{ 4, 180, 1.0 },
std::tuple<int, int, double>{ 5, 5, -1000.0 },
std::tuple<int, int, double>{ 5, 93, -424.0 },
std::tuple<int, int, double>{ 5, 181, 1.0 },
std::tuple<int, int, double>{ 6, 6, -1000.0 },
std::tuple<int, int, double>{ 6, 94, -400.0 },
std::tuple<int, int, double>{ 6, 182, 1.0 },
std::tuple<int, int, double>{ 7, 7, -1000.0 },
std::tuple<int, int, double>{ 7, 95, -339.0 },
std::tuple<int, int, double>{ 7, 183, 1.0 },
std::tuple<int, int, double>{ 8, 8, -1000.0 },
std::tuple<int, int, double>{ 8, 96, -383.0 },
std::tuple<int, int, double>{ 8, 184, 1.0 },
std::tuple<int, int, double>{ 9, 9, -1000.0 },
std::tuple<int, int, double>{ 9, 97, -906.0 },
std::tuple<int, int, double>{ 9, 185, 1.0 },
std::tuple<int, int, double>{ 10, 10, -1000.0 },
std::tuple<int, int, double>{ 10, 186, 1.0 },
std::tuple<int, int, double>{ 11, 11, -1000.0 },
std::tuple<int, int, double>{ 11, 99, -86.0 },
std::tuple<int, int, double>{ 11, 187, 1.0 },
std::tuple<int, int, double>{ 12, 12, -1000.0 },
std::tuple<int, int, double>{ 12, 188, 1.0 },
std::tuple<int, int, double>{ 13, 13, -1000.0 },
std::tuple<int, int, double>{ 13, 101, -57.0 },
std::tuple<int, int, double>{ 13, 189, 1.0 },
std::tuple<int, int, double>{ 14, 14, -1000.0 },
std::tuple<int, int, double>{ 14, 102, -64.0 },
std::tuple<int, int, double>{ 14, 190, 1.0 },
std::tuple<int, int, double>{ 15, 15, -1000.0 },
std::tuple<int, int, double>{ 15, 103, -958.0 },
std::tuple<int, int, double>{ 15, 191, 1.0 },
std::tuple<int, int, double>{ 16, 16, -1000.0 },
std::tuple<int, int, double>{ 16, 104, -467.0 },
std::tuple<int, int, double>{ 16, 192, 1.0 },
std::tuple<int, int, double>{ 17, 17, -1000.0 },
std::tuple<int, int, double>{ 17, 105, -228.0 },
std::tuple<int, int, double>{ 17, 193, 1.0 },
std::tuple<int, int, double>{ 18, 18, -1000.0 },
std::tuple<int, int, double>{ 18, 106, -270.0 },
std::tuple<int, int, double>{ 18, 194, 1.0 },
std::tuple<int, int, double>{ 19, 19, -1000.0 },
std::tuple<int, int, double>{ 19, 107, -129.0 },
std::tuple<int, int, double>{ 19, 195, 1.0 },
std::tuple<int, int, double>{ 20, 20, -1000.0 },
std::tuple<int, int, double>{ 20, 108, -941.0 },
std::tuple<int, int, double>{ 20, 196, 1.0 },
std::tuple<int, int, double>{ 21, 21, -1000.0 },
std::tuple<int, int, double>{ 21, 109, -934.0 },
std::tuple<int, int, double>{ 21, 197, 1.0 },
std::tuple<int, int, double>{ 22, 22, -1000.0 },
std::tuple<int, int, double>{ 22, 110, -354.0 },
std::tuple<int, int, double>{ 22, 198, 1.0 },
std::tuple<int, int, double>{ 23, 23, -1000.0 },
std::tuple<int, int, double>{ 23, 111, -678.0 },
std::tuple<int, int, double>{ 23, 199, 1.0 },
std::tuple<int, int, double>{ 24, 24, -1000.0 },
std::tuple<int, int, double>{ 24, 112, -128.0 },
std::tuple<int, int, double>{ 24, 200, 1.0 },
std::tuple<int, int, double>{ 25, 25, -1000.0 },
std::tuple<int, int, double>{ 25, 113, -646.0 },
std::tuple<int, int, double>{ 25, 201, 1.0 },
std::tuple<int, int, double>{ 26, 26, -1000.0 },
std::tuple<int, int, double>{ 26, 114, -500.0 },
std::tuple<int, int, double>{ 26, 202, 1.0 },
std::tuple<int, int, double>{ 27, 27, -1000.0 },
std::tuple<int, int, double>{ 27, 115, -200.0 },
std::tuple<int, int, double>{ 27, 203, 1.0 },
std::tuple<int, int, double>{ 28, 28, -1000.0 },
std::tuple<int, int, double>{ 28, 116, -600.0 },
std::tuple<int, int, double>{ 28, 204, 1.0 },
std::tuple<int, int, double>{ 29, 29, -1000.0 },
std::tuple<int, int, double>{ 29, 205, 1.0 },
std::tuple<int, int, double>{ 30, 30, -1000.0 },
std::tuple<int, int, double>{ 30, 118, -66.0 },
std::tuple<int, int, double>{ 30, 206, 1.0 },
std::tuple<int, int, double>{ 31, 31, -1000.0 },
std::tuple<int, int, double>{ 31, 119, -903.0 },
std::tuple<int, int, double>{ 31, 207, 1.0 },
std::tuple<int, int, double>{ 32, 32, -1000.0 },
std::tuple<int, int, double>{ 32, 208, 1.0 },
std::tuple<int, int, double>{ 33, 33, -1000.0 },
std::tuple<int, int, double>{ 33, 121, -60.0 },
std::tuple<int, int, double>{ 33, 209, 1.0 },
std::tuple<int, int, double>{ 34, 34, -1000.0 },
std::tuple<int, int, double>{ 34, 122, -843.0 },
std::tuple<int, int, double>{ 34, 210, 1.0 },
std::tuple<int, int, double>{ 35, 35, -1000.0 },
std::tuple<int, int, double>{ 35, 211, 1.0 },
std::tuple<int, int, double>{ 36, 36, -1000.0 },
std::tuple<int, int, double>{ 36, 124, -172.0 },
std::tuple<int, int, double>{ 36, 212, 1.0 },
std::tuple<int, int, double>{ 37, 37, -1000.0 },
std::tuple<int, int, double>{ 37, 125, -468.0 },
std::tuple<int, int, double>{ 37, 213, 1.0 },
std::tuple<int, int, double>{ 38, 38, -1000.0 },
std::tuple<int, int, double>{ 38, 126, -715.0 },
std::tuple<int, int, double>{ 38, 214, 1.0 },
std::tuple<int, int, double>{ 39, 39, -1000.0 },
std::tuple<int, int, double>{ 39, 127, -633.0 },
std::tuple<int, int, double>{ 39, 215, 1.0 },
std::tuple<int, int, double>{ 40, 40, -1000.0 },
std::tuple<int, int, double>{ 40, 128, -156.0 },
std::tuple<int, int, double>{ 40, 216, 1.0 },
std::tuple<int, int, double>{ 41, 41, -1000.0 },
std::tuple<int, int, double>{ 41, 129, -279.0 },
std::tuple<int, int, double>{ 41, 217, 1.0 },
std::tuple<int, int, double>{ 42, 42, -1000.0 },
std::tuple<int, int, double>{ 42, 130, -625.0 },
std::tuple<int, int, double>{ 42, 218, 1.0 },
std::tuple<int, int, double>{ 43, 43, -1000.0 },
std::tuple<int, int, double>{ 43, 131, -350.0 },
std::tuple<int, int, double>{ 43, 219, 1.0 },
std::tuple<int, int, double>{ 44, 44, -1000.0 },
std::tuple<int, int, double>{ 44, 132, -828.0 },
std::tuple<int, int, double>{ 44, 220, 1.0 },
std::tuple<int, int, double>{ 45, 45, -1000.0 },
std::tuple<int, int, double>{ 45, 133, -41.0 },
std::tuple<int, int, double>{ 45, 221, 1.0 },
std::tuple<int, int, double>{ 46, 46, -1000.0 },
std::tuple<int, int, double>{ 46, 134, -443.0 },
std::tuple<int, int, double>{ 46, 222, 1.0 },
std::tuple<int, int, double>{ 47, 47, -1000.0 },
std::tuple<int, int, double>{ 47, 135, -568.0 },
std::tuple<int, int, double>{ 47, 223, 1.0 },
std::tuple<int, int, double>{ 48, 48, -1000.0 },
std::tuple<int, int, double>{ 48, 136, -952.0 },
std::tuple<int, int, double>{ 48, 224, 1.0 },
std::tuple<int, int, double>{ 49, 49, -1000.0 },
std::tuple<int, int, double>{ 49, 225, 1.0 },
std::tuple<int, int, double>{ 50, 50, -1000.0 },
std::tuple<int, int, double>{ 50, 138, -437.0 },
std::tuple<int, int, double>{ 50, 226, 1.0 },
std::tuple<int, int, double>{ 51, 51, -1000.0 },
std::tuple<int, int, double>{ 51, 139, -197.0 },
std::tuple<int, int, double>{ 51, 227, 1.0 },
std::tuple<int, int, double>{ 52, 52, -1000.0 },
std::tuple<int, int, double>{ 52, 140, -420.0 },
std::tuple<int, int, double>{ 52, 228, 1.0 },
std::tuple<int, int, double>{ 53, 53, -1000.0 },
std::tuple<int, int, double>{ 53, 141, -995.0 },
std::tuple<int, int, double>{ 53, 229, 1.0 },
std::tuple<int, int, double>{ 54, 54, -1000.0 },
std::tuple<int, int, double>{ 54, 142, -498.0 },
std::tuple<int, int, double>{ 54, 230, 1.0 },
std::tuple<int, int, double>{ 55, 55, -1000.0 },
std::tuple<int, int, double>{ 55, 143, -580.0 },
std::tuple<int, int, double>{ 55, 231, 1.0 },
std::tuple<int, int, double>{ 56, 56, -1000.0 },
std::tuple<int, int, double>{ 56, 144, -883.0 },
std::tuple<int, int, double>{ 56, 232, 1.0 },
std::tuple<int, int, double>{ 57, 57, -1000.0 },
std::tuple<int, int, double>{ 57, 145, -328.0 },
std::tuple<int, int, double>{ 57, 233, 1.0 },
std::tuple<int, int, double>{ 58, 58, -1000.0 },
std::tuple<int, int, double>{ 58, 146, -52.0 },
std::tuple<int, int, double>{ 58, 234, 1.0 },
std::tuple<int, int, double>{ 59, 59, -1000.0 },
std::tuple<int, int, double>{ 59, 147, -332.0 },
std::tuple<int, int, double>{ 59, 235, 1.0 },
std::tuple<int, int, double>{ 60, 60, -1000.0 },
std::tuple<int, int, double>{ 60, 148, -998.0 },
std::tuple<int, int, double>{ 60, 236, 1.0 },
std::tuple<int, int, double>{ 61, 61, -1000.0 },
std::tuple<int, int, double>{ 61, 149, -895.0 },
std::tuple<int, int, double>{ 61, 237, 1.0 },
std::tuple<int, int, double>{ 62, 62, -1000.0 },
std::tuple<int, int, double>{ 62, 150, -870.0 },
std::tuple<int, int, double>{ 62, 238, 1.0 },
std::tuple<int, int, double>{ 63, 63, -1000.0 },
std::tuple<int, int, double>{ 63, 151, -605.0 },
std::tuple<int, int, double>{ 63, 239, 1.0 },
std::tuple<int, int, double>{ 64, 64, -1000.0 },
std::tuple<int, int, double>{ 64, 152, -430.0 },
std::tuple<int, int, double>{ 64, 240, 1.0 },
std::tuple<int, int, double>{ 65, 65, -1000.0 },
std::tuple<int, int, double>{ 65, 153, -863.0 },
std::tuple<int, int, double>{ 65, 241, 1.0 },
std::tuple<int, int, double>{ 66, 66, -1000.0 },
std::tuple<int, int, double>{ 66, 154, -299.0 },
std::tuple<int, int, double>{ 66, 242, 1.0 },
std::tuple<int, int, double>{ 67, 67, -1000.0 },
std::tuple<int, int, double>{ 67, 155, -522.0 },
std::tuple<int, int, double>{ 67, 243, 1.0 },
std::tuple<int, int, double>{ 68, 68, -1000.0 },
std::tuple<int, int, double>{ 68, 244, 1.0 },
std::tuple<int, int, double>{ 69, 69, -1000.0 },
std::tuple<int, int, double>{ 69, 157, -455.0 },
std::tuple<int, int, double>{ 69, 245, 1.0 },
std::tuple<int, int, double>{ 70, 70, -1000.0 },
std::tuple<int, int, double>{ 70, 246, 1.0 },
std::tuple<int, int, double>{ 71, 71, -1000.0 },
std::tuple<int, int, double>{ 71, 159, -830.0 },
std::tuple<int, int, double>{ 71, 247, 1.0 },
std::tuple<int, int, double>{ 72, 72, -1000.0 },
std::tuple<int, int, double>{ 72, 248, 1.0 },
std::tuple<int, int, double>{ 73, 73, -1000.0 },
std::tuple<int, int, double>{ 73, 161, -768.0 },
std::tuple<int, int, double>{ 73, 249, 1.0 },
std::tuple<int, int, double>{ 74, 74, -1000.0 },
std::tuple<int, int, double>{ 74, 162, -787.0 },
std::tuple<int, int, double>{ 74, 250, 1.0 },
std::tuple<int, int, double>{ 75, 75, -1000.0 },
std::tuple<int, int, double>{ 75, 163, -890.0 },
std::tuple<int, int, double>{ 75, 251, 1.0 },
std::tuple<int, int, double>{ 76, 76, -1000.0 },
std::tuple<int, int, double>{ 76, 164, -844.0 },
std::tuple<int, int, double>{ 76, 252, 1.0 },
std::tuple<int, int, double>{ 77, 77, -1000.0 },
std::tuple<int, int, double>{ 77, 165, -914.0 },
std::tuple<int, int, double>{ 77, 253, 1.0 },
std::tuple<int, int, double>{ 78, 78, -1000.0 },
std::tuple<int, int, double>{ 78, 166, -922.0 },
std::tuple<int, int, double>{ 78, 254, 1.0 },
std::tuple<int, int, double>{ 79, 79, -1000.0 },
std::tuple<int, int, double>{ 79, 167, -775.0 },
std::tuple<int, int, double>{ 79, 255, 1.0 },
std::tuple<int, int, double>{ 80, 80, -1000.0 },
std::tuple<int, int, double>{ 80, 168, -616.0 },
std::tuple<int, int, double>{ 80, 256, 1.0 },
std::tuple<int, int, double>{ 81, 81, -1000.0 },
std::tuple<int, int, double>{ 81, 169, -850.0 },
std::tuple<int, int, double>{ 81, 257, 1.0 },
std::tuple<int, int, double>{ 82, 82, -1000.0 },
std::tuple<int, int, double>{ 82, 170, -832.0 },
std::tuple<int, int, double>{ 82, 258, 1.0 },
std::tuple<int, int, double>{ 83, 83, -1000.0 },
std::tuple<int, int, double>{ 83, 171, -770.0 },
std::tuple<int, int, double>{ 83, 259, 1.0 },
std::tuple<int, int, double>{ 84, 84, -1000.0 },
std::tuple<int, int, double>{ 84, 172, -450.0 },
std::tuple<int, int, double>{ 84, 260, 1.0 },
std::tuple<int, int, double>{ 85, 85, -1000.0 },
std::tuple<int, int, double>{ 85, 173, -9.0 },
std::tuple<int, int, double>{ 85, 261, 1.0 },
std::tuple<int, int, double>{ 86, 86, -1000.0 },
std::tuple<int, int, double>{ 86, 174, -60.0 },
std::tuple<int, int, double>{ 86, 262, 1.0 },
std::tuple<int, int, double>{ 87, 87, -1000.0 },
std::tuple<int, int, double>{ 87, 175, -685.0 },
std::tuple<int, int, double>{ 87, 263, 1.0 },
std::tuple<int, int, double>{ 88, 176, 1.0 },
std::tuple<int, int, double>{ 88, 265, -1609.0 },
std::tuple<int, int, double>{ 89, 177, 1.0 },
std::tuple<int, int, double>{ 89, 266, -2908.0 },
std::tuple<int, int, double>{ 90, 178, 1.0 },
std::tuple<int, int, double>{ 90, 267, -1574.0 },
std::tuple<int, int, double>{ 91, 179, 1.0 },
std::tuple<int, int, double>{ 91, 268, -100.0 },
std::tuple<int, int, double>{ 92, 180, 1.0 },
std::tuple<int, int, double>{ 92, 269, -1071.0 },
std::tuple<int, int, double>{ 93, 181, 1.0 },
std::tuple<int, int, double>{ 93, 270, -1424.0 },
std::tuple<int, int, double>{ 94, 182, 1.0 },
std::tuple<int, int, double>{ 94, 271, -2400.0 },
std::tuple<int, int, double>{ 95, 183, 1.0 },
std::tuple<int, int, double>{ 95, 272, -1339.0 },
std::tuple<int, int, double>{ 96, 184, 1.0 },
std::tuple<int, int, double>{ 96, 273, -1383.0 },
std::tuple<int, int, double>{ 97, 185, 1.0 },
std::tuple<int, int, double>{ 97, 274, -906.0 },
std::tuple<int, int, double>{ 98, 186, 1.0 },
std::tuple<int, int, double>{ 98, 275, -1000.0 },
std::tuple<int, int, double>{ 99, 187, 1.0 },
std::tuple<int, int, double>{ 99, 276, -1086.0 },
std::tuple<int, int, double>{ 100, 188, 1.0 },
std::tuple<int, int, double>{ 100, 277, -3000.0 },
std::tuple<int, int, double>{ 101, 189, 1.0 },
std::tuple<int, int, double>{ 101, 278, -2057.0 },
std::tuple<int, int, double>{ 102, 190, 1.0 },
std::tuple<int, int, double>{ 102, 279, -2064.0 },
std::tuple<int, int, double>{ 103, 191, 1.0 },
std::tuple<int, int, double>{ 103, 280, -1958.0 },
std::tuple<int, int, double>{ 104, 192, 1.0 },
std::tuple<int, int, double>{ 104, 281, -1467.0 },
std::tuple<int, int, double>{ 105, 193, 1.0 },
std::tuple<int, int, double>{ 105, 282, -2228.0 },
std::tuple<int, int, double>{ 106, 194, 1.0 },
std::tuple<int, int, double>{ 106, 283, -2270.0 },
std::tuple<int, int, double>{ 107, 195, 1.0 },
std::tuple<int, int, double>{ 107, 284, -2129.0 },
std::tuple<int, int, double>{ 108, 196, 1.0 },
std::tuple<int, int, double>{ 108, 285, -1941.0 },
std::tuple<int, int, double>{ 109, 197, 1.0 },
std::tuple<int, int, double>{ 109, 286, -1934.0 },
std::tuple<int, int, double>{ 110, 198, 1.0 },
std::tuple<int, int, double>{ 110, 287, -354.0 },
std::tuple<int, int, double>{ 111, 199, 1.0 },
std::tuple<int, int, double>{ 111, 288, -1678.0 },
std::tuple<int, int, double>{ 112, 200, 1.0 },
std::tuple<int, int, double>{ 112, 289, -3128.0 },
std::tuple<int, int, double>{ 113, 201, 1.0 },
std::tuple<int, int, double>{ 113, 290, -1646.0 },
std::tuple<int, int, double>{ 114, 202, 1.0 },
std::tuple<int, int, double>{ 114, 291, -500.0 },
std::tuple<int, int, double>{ 115, 203, 1.0 },
std::tuple<int, int, double>{ 115, 292, -1200.0 },
std::tuple<int, int, double>{ 116, 204, 1.0 },
std::tuple<int, int, double>{ 116, 293, -600.0 },
std::tuple<int, int, double>{ 117, 205, 1.0 },
std::tuple<int, int, double>{ 117, 294, -1000.0 },
std::tuple<int, int, double>{ 118, 206, 1.0 },
std::tuple<int, int, double>{ 118, 295, -1066.0 },
std::tuple<int, int, double>{ 119, 207, 1.0 },
std::tuple<int, int, double>{ 119, 296, -1903.0 },
std::tuple<int, int, double>{ 120, 208, 1.0 },
std::tuple<int, int, double>{ 120, 297, -3000.0 },
std::tuple<int, int, double>{ 121, 209, 1.0 },
std::tuple<int, int, double>{ 121, 298, -2060.0 },
std::tuple<int, int, double>{ 122, 210, 1.0 },
std::tuple<int, int, double>{ 122, 299, -843.0 },
std::tuple<int, int, double>{ 123, 211, 1.0 },
std::tuple<int, int, double>{ 123, 300, -1000.0 },
std::tuple<int, int, double>{ 124, 212, 1.0 },
std::tuple<int, int, double>{ 124, 301, -1172.0 },
std::tuple<int, int, double>{ 125, 213, 1.0 },
std::tuple<int, int, double>{ 125, 302, -1468.0 },
std::tuple<int, int, double>{ 126, 214, 1.0 },
std::tuple<int, int, double>{ 126, 303, -1715.0 },
std::tuple<int, int, double>{ 127, 215, 1.0 },
std::tuple<int, int, double>{ 127, 304, -2633.0 },
std::tuple<int, int, double>{ 128, 216, 1.0 },
std::tuple<int, int, double>{ 128, 305, -1156.0 },
std::tuple<int, int, double>{ 129, 217, 1.0 },
std::tuple<int, int, double>{ 129, 306, -1279.0 },
std::tuple<int, int, double>{ 130, 218, 1.0 },
std::tuple<int, int, double>{ 130, 307, -1625.0 },
std::tuple<int, int, double>{ 131, 219, 1.0 },
std::tuple<int, int, double>{ 131, 308, -1350.0 },
std::tuple<int, int, double>{ 132, 220, 1.0 },
std::tuple<int, int, double>{ 132, 309, -1828.0 },
std::tuple<int, int, double>{ 133, 221, 1.0 },
std::tuple<int, int, double>{ 133, 310, -1041.0 },
std::tuple<int, int, double>{ 134, 222, 1.0 },
std::tuple<int, int, double>{ 134, 311, -1443.0 },
std::tuple<int, int, double>{ 135, 223, 1.0 },
std::tuple<int, int, double>{ 135, 312, -3568.0 },
std::tuple<int, int, double>{ 136, 224, 1.0 },
std::tuple<int, int, double>{ 136, 313, -1952.0 },
std::tuple<int, int, double>{ 137, 225, 1.0 },
std::tuple<int, int, double>{ 137, 314, -1000.0 },
std::tuple<int, int, double>{ 138, 226, 1.0 },
std::tuple<int, int, double>{ 138, 315, -5437.0 },
std::tuple<int, int, double>{ 139, 227, 1.0 },
std::tuple<int, int, double>{ 139, 316, -1197.0 },
std::tuple<int, int, double>{ 140, 228, 1.0 },
std::tuple<int, int, double>{ 140, 317, -1420.0 },
std::tuple<int, int, double>{ 141, 229, 1.0 },
std::tuple<int, int, double>{ 141, 318, -995.0 },
std::tuple<int, int, double>{ 142, 230, 1.0 },
std::tuple<int, int, double>{ 142, 319, -1498.0 },
std::tuple<int, int, double>{ 143, 231, 1.0 },
std::tuple<int, int, double>{ 143, 320, -4580.0 },
std::tuple<int, int, double>{ 144, 232, 1.0 },
std::tuple<int, int, double>{ 144, 321, -3883.0 },
std::tuple<int, int, double>{ 145, 233, 1.0 },
std::tuple<int, int, double>{ 145, 322, -1328.0 },
std::tuple<int, int, double>{ 146, 234, 1.0 },
std::tuple<int, int, double>{ 146, 323, -1052.0 },
std::tuple<int, int, double>{ 147, 235, 1.0 },
std::tuple<int, int, double>{ 147, 324, -1332.0 },
std::tuple<int, int, double>{ 148, 236, 1.0 },
std::tuple<int, int, double>{ 148, 325, -1998.0 },
std::tuple<int, int, double>{ 149, 237, 1.0 },
std::tuple<int, int, double>{ 149, 326, -895.0 },
std::tuple<int, int, double>{ 150, 238, 1.0 },
std::tuple<int, int, double>{ 150, 327, -1870.0 },
std::tuple<int, int, double>{ 151, 239, 1.0 },
std::tuple<int, int, double>{ 151, 328, -1605.0 },
std::tuple<int, int, double>{ 152, 240, 1.0 },
std::tuple<int, int, double>{ 152, 329, -1430.0 },
std::tuple<int, int, double>{ 153, 241, 1.0 },
std::tuple<int, int, double>{ 153, 330, -1863.0 },
std::tuple<int, int, double>{ 154, 242, 1.0 },
std::tuple<int, int, double>{ 154, 331, -2299.0 },
std::tuple<int, int, double>{ 155, 243, 1.0 },
std::tuple<int, int, double>{ 155, 332, -1522.0 },
std::tuple<int, int, double>{ 156, 244, 1.0 },
std::tuple<int, int, double>{ 156, 333, -3000.0 },
std::tuple<int, int, double>{ 157, 245, 1.0 },
std::tuple<int, int, double>{ 157, 334, -4455.0 },
std::tuple<int, int, double>{ 158, 246, 1.0 },
std::tuple<int, int, double>{ 158, 335, -2000.0 },
std::tuple<int, int, double>{ 159, 247, 1.0 },
std::tuple<int, int, double>{ 159, 336, -1830.0 },
std::tuple<int, int, double>{ 160, 248, 1.0 },
std::tuple<int, int, double>{ 160, 337, -1000.0 },
std::tuple<int, int, double>{ 161, 249, 1.0 },
std::tuple<int, int, double>{ 161, 338, -3768.0 },
std::tuple<int, int, double>{ 162, 250, 1.0 },
std::tuple<int, int, double>{ 162, 339, -1787.0 },
std::tuple<int, int, double>{ 163, 251, 1.0 },
std::tuple<int, int, double>{ 163, 340, -1890.0 },
std::tuple<int, int, double>{ 164, 252, 1.0 },
std::tuple<int, int, double>{ 164, 341, -1844.0 },
std::tuple<int, int, double>{ 165, 253, 1.0 },
std::tuple<int, int, double>{ 165, 342, -1914.0 },
std::tuple<int, int, double>{ 166, 254, 1.0 },
std::tuple<int, int, double>{ 166, 343, -1922.0 },
std::tuple<int, int, double>{ 167, 255, 1.0 },
std::tuple<int, int, double>{ 167, 344, -4775.0 },
std::tuple<int, int, double>{ 168, 256, 1.0 },
std::tuple<int, int, double>{ 168, 345, -1616.0 },
std::tuple<int, int, double>{ 169, 257, 1.0 },
std::tuple<int, int, double>{ 169, 346, -1850.0 },
std::tuple<int, int, double>{ 170, 258, 1.0 },
std::tuple<int, int, double>{ 170, 347, -1832.0 },
std::tuple<int, int, double>{ 171, 259, 1.0 },
std::tuple<int, int, double>{ 171, 348, -1770.0 },
std::tuple<int, int, double>{ 172, 260, 1.0 },
std::tuple<int, int, double>{ 172, 349, -1450.0 },
std::tuple<int, int, double>{ 173, 261, 1.0 },
std::tuple<int, int, double>{ 173, 350, -2009.0 },
std::tuple<int, int, double>{ 174, 262, 1.0 },
std::tuple<int, int, double>{ 174, 351, -2060.0 },
std::tuple<int, int, double>{ 175, 263, 1.0 },
std::tuple<int, int, double>{ 175, 352, -2685.0 },
std::tuple<int, int, double>{ 176, 176, -1.0 },
std::tuple<int, int, double>{ 176, 177, -1.0 },
std::tuple<int, int, double>{ 176, 178, -1.0 },
std::tuple<int, int, double>{ 176, 179, -1.0 },
std::tuple<int, int, double>{ 176, 180, -1.0 },
std::tuple<int, int, double>{ 176, 181, -1.0 },
std::tuple<int, int, double>{ 176, 182, -1.0 },
std::tuple<int, int, double>{ 176, 183, -1.0 },
std::tuple<int, int, double>{ 176, 184, -1.0 },
std::tuple<int, int, double>{ 176, 185, -1.0 },
std::tuple<int, int, double>{ 176, 186, -1.0 },
std::tuple<int, int, double>{ 176, 187, -1.0 },
std::tuple<int, int, double>{ 176, 188, -1.0 },
std::tuple<int, int, double>{ 176, 189, -1.0 },
std::tuple<int, int, double>{ 176, 190, -1.0 },
std::tuple<int, int, double>{ 176, 191, -1.0 },
std::tuple<int, int, double>{ 176, 192, -1.0 },
std::tuple<int, int, double>{ 176, 193, -1.0 },
std::tuple<int, int, double>{ 176, 194, -1.0 },
std::tuple<int, int, double>{ 176, 195, -1.0 },
std::tuple<int, int, double>{ 176, 196, -1.0 },
std::tuple<int, int, double>{ 176, 197, -1.0 },
std::tuple<int, int, double>{ 176, 198, -1.0 },
std::tuple<int, int, double>{ 176, 199, -1.0 },
std::tuple<int, int, double>{ 176, 200, -1.0 },
std::tuple<int, int, double>{ 176, 201, -1.0 },
std::tuple<int, int, double>{ 176, 202, -1.0 },
std::tuple<int, int, double>{ 176, 203, -1.0 },
std::tuple<int, int, double>{ 176, 204, -1.0 },
std::tuple<int, int, double>{ 176, 205, -1.0 },
std::tuple<int, int, double>{ 176, 206, -1.0 },
std::tuple<int, int, double>{ 176, 207, -1.0 },
std::tuple<int, int, double>{ 176, 208, -1.0 },
std::tuple<int, int, double>{ 176, 209, -1.0 },
std::tuple<int, int, double>{ 176, 210, -1.0 },
std::tuple<int, int, double>{ 176, 211, -1.0 },
std::tuple<int, int, double>{ 176, 212, -1.0 },
std::tuple<int, int, double>{ 176, 213, -1.0 },
std::tuple<int, int, double>{ 176, 214, -1.0 },
std::tuple<int, int, double>{ 176, 215, -1.0 },
std::tuple<int, int, double>{ 176, 216, -1.0 },
std::tuple<int, int, double>{ 176, 217, -1.0 },
std::tuple<int, int, double>{ 176, 218, -1.0 },
std::tuple<int, int, double>{ 176, 219, -1.0 },
std::tuple<int, int, double>{ 176, 220, -1.0 },
std::tuple<int, int, double>{ 176, 221, -1.0 },
std::tuple<int, int, double>{ 176, 222, -1.0 },
std::tuple<int, int, double>{ 176, 223, -1.0 },
std::tuple<int, int, double>{ 176, 224, -1.0 },
std::tuple<int, int, double>{ 176, 225, -1.0 },
std::tuple<int, int, double>{ 176, 226, -1.0 },
std::tuple<int, int, double>{ 176, 227, -1.0 },
std::tuple<int, int, double>{ 176, 228, -1.0 },
std::tuple<int, int, double>{ 176, 229, -1.0 },
std::tuple<int, int, double>{ 176, 230, -1.0 },
std::tuple<int, int, double>{ 176, 231, -1.0 },
std::tuple<int, int, double>{ 176, 232, -1.0 },
std::tuple<int, int, double>{ 176, 233, -1.0 },
std::tuple<int, int, double>{ 176, 234, -1.0 },
std::tuple<int, int, double>{ 176, 235, -1.0 },
std::tuple<int, int, double>{ 176, 236, -1.0 },
std::tuple<int, int, double>{ 176, 237, -1.0 },
std::tuple<int, int, double>{ 176, 238, -1.0 },
std::tuple<int, int, double>{ 176, 239, -1.0 },
std::tuple<int, int, double>{ 176, 240, -1.0 },
std::tuple<int, int, double>{ 176, 241, -1.0 },
std::tuple<int, int, double>{ 176, 242, -1.0 },
std::tuple<int, int, double>{ 176, 243, -1.0 },
std::tuple<int, int, double>{ 176, 244, -1.0 },
std::tuple<int, int, double>{ 176, 245, -1.0 },
std::tuple<int, int, double>{ 176, 246, -1.0 },
std::tuple<int, int, double>{ 176, 247, -1.0 },
std::tuple<int, int, double>{ 176, 248, -1.0 },
std::tuple<int, int, double>{ 176, 249, -1.0 },
std::tuple<int, int, double>{ 176, 250, -1.0 },
std::tuple<int, int, double>{ 176, 251, -1.0 },
std::tuple<int, int, double>{ 176, 252, -1.0 },
std::tuple<int, int, double>{ 176, 253, -1.0 },
std::tuple<int, int, double>{ 176, 254, -1.0 },
std::tuple<int, int, double>{ 176, 255, -1.0 },
std::tuple<int, int, double>{ 176, 256, -1.0 },
std::tuple<int, int, double>{ 176, 257, -1.0 },
std::tuple<int, int, double>{ 176, 258, -1.0 },
std::tuple<int, int, double>{ 176, 259, -1.0 },
std::tuple<int, int, double>{ 176, 260, -1.0 },
std::tuple<int, int, double>{ 176, 261, -1.0 },
std::tuple<int, int, double>{ 176, 262, -1.0 },
std::tuple<int, int, double>{ 176, 263, -1.0 },
std::tuple<int, int, double>{ 176, 264, 1.0 },
std::tuple<int, int, double>{ 177, 176, 1.763519 },
std::tuple<int, int, double>{ 177, 177, 1.658312 },
std::tuple<int, int, double>{ 177, 178, 1.830301 },
std::tuple<int, int, double>{ 177, 179, 1.749286 },
std::tuple<int, int, double>{ 177, 180, 1.649242 },
std::tuple<int, int, double>{ 177, 181, 1.734935 },
std::tuple<int, int, double>{ 177, 182, 1.581139 },
std::tuple<int, int, double>{ 177, 183, 1.676305 },
std::tuple<int, int, double>{ 177, 184, 1.74069 },
std::tuple<int, int, double>{ 177, 185, 1.615549 },
std::tuple<int, int, double>{ 177, 186, 1.959592 },
std::tuple<int, int, double>{ 177, 187, 1.819341 },
std::tuple<int, int, double>{ 177, 188, 2.118962 },
std::tuple<int, int, double>{ 177, 189, 1.794436 },
std::tuple<int, int, double>{ 177, 190, 1.581139 },
std::tuple<int, int, double>{ 177, 191, 1.615549 },
std::tuple<int, int, double>{ 177, 192, 1.67332 },
std::tuple<int, int, double>{ 177, 193, 1.734935 },
std::tuple<int, int, double>{ 177, 194, 1.612452 },
std::tuple<int, int, double>{ 177, 195, 1.691153 },
std::tuple<int, int, double>{ 177, 196, 2.55147 },
std::tuple<int, int, double>{ 177, 197, 1.852026 },
std::tuple<int, int, double>{ 177, 198, 2.204541 },
std::tuple<int, int, double>{ 177, 199, 1.926136 },
std::tuple<int, int, double>{ 177, 200, 1.777639 },
std::tuple<int, int, double>{ 177, 201, 2.063977 },
std::tuple<int, int, double>{ 177, 202, 1.67332 },
std::tuple<int, int, double>{ 177, 203, 2.19089 },
std::tuple<int, int, double>{ 177, 204, 2.022375 },
std::tuple<int, int, double>{ 177, 205, 2.193171 },
std::tuple<int, int, double>{ 177, 206, 2.453569 },
std::tuple<int, int, double>{ 177, 207, 2.569047 },
std::tuple<int, int, double>{ 177, 208, 2.03224 },
std::tuple<int, int, double>{ 177, 209, 2.140093 },
std::tuple<int, int, double>{ 177, 210, 1.923538 },
std::tuple<int, int, double>{ 177, 211, 2.218107 },
std::tuple<int, int, double>{ 177, 212, 1.918333 },
std::tuple<int, int, double>{ 177, 213, 1.752142 },
std::tuple<int, int, double>{ 177, 214, 1.881489 },
std::tuple<int, int, double>{ 177, 215, 2.078461 },
std::tuple<int, int, double>{ 177, 216, 2.184033 },
std::tuple<int, int, double>{ 177, 217, 2.362202 },
std::tuple<int, int, double>{ 177, 218, 2.278157 },
std::tuple<int, int, double>{ 177, 219, 2.366432 },
std::tuple<int, int, double>{ 177, 220, 2.289105 },
std::tuple<int, int, double>{ 177, 221, 2.0 },
std::tuple<int, int, double>{ 177, 222, 2.039608 },
std::tuple<int, int, double>{ 177, 223, 2.142429 },
std::tuple<int, int, double>{ 177, 224, 2.319483 },
std::tuple<int, int, double>{ 177, 225, 2.304344 },
std::tuple<int, int, double>{ 177, 226, 2.22036 },
std::tuple<int, int, double>{ 177, 227, 2.48998 },
std::tuple<int, int, double>{ 177, 228, 2.565151 },
std::tuple<int, int, double>{ 177, 229, 2.673948 },
std::tuple<int, int, double>{ 177, 230, 1.545962 },
std::tuple<int, int, double>{ 177, 231, 2.0 },
std::tuple<int, int, double>{ 177, 232, 2.211334 },
std::tuple<int, int, double>{ 177, 233, 2.453569 },
std::tuple<int, int, double>{ 177, 234, 2.485961 },
std::tuple<int, int, double>{ 177, 235, 2.611513 },
std::tuple<int, int, double>{ 177, 236, 2.605763 },
std::tuple<int, int, double>{ 177, 237, 2.447448 },
std::tuple<int, int, double>{ 177, 238, 2.416609 },
std::tuple<int, int, double>{ 177, 239, 2.039608 },
std::tuple<int, int, double>{ 177, 240, 2.280351 },
std::tuple<int, int, double>{ 177, 241, 1.841195 },
std::tuple<int, int, double>{ 177, 242, 1.5 },
std::tuple<int, int, double>{ 177, 243, 1.664332 },
std::tuple<int, int, double>{ 177, 244, 2.063977 },
std::tuple<int, int, double>{ 177, 245, 2.19089 },
std::tuple<int, int, double>{ 177, 246, 1.941649 },
std::tuple<int, int, double>{ 177, 247, 2.0 },
std::tuple<int, int, double>{ 177, 248, 2.238303 },
std::tuple<int, int, double>{ 177, 249, 2.227106 },
std::tuple<int, int, double>{ 177, 250, 2.416609 },
std::tuple<int, int, double>{ 177, 251, 2.624881 },
std::tuple<int, int, double>{ 177, 252, 2.673948 },
std::tuple<int, int, double>{ 177, 253, 2.572936 },
std::tuple<int, int, double>{ 177, 254, 1.609348 },
std::tuple<int, int, double>{ 177, 255, 2.090454 },
std::tuple<int, int, double>{ 177, 256, 2.244994 },
std::tuple<int, int, double>{ 177, 257, 2.135416 },
std::tuple<int, int, double>{ 177, 258, 2.381176 },
std::tuple<int, int, double>{ 177, 259, 2.6 },
std::tuple<int, int, double>{ 177, 260, 2.437212 },
std::tuple<int, int, double>{ 177, 261, 2.059126 },
std::tuple<int, int, double>{ 177, 262, 1.931321 },
std::tuple<int, int, double>{ 177, 263, 1.414214 },
std::tuple<int, int, double>{ 177, 264, -2.156386 },
std::tuple<int, int, double>{ 178, 176, 1.763519 },
std::tuple<int, int, double>{ 178, 177, 1.658312 },
std::tuple<int, int, double>{ 178, 178, 1.830301 },
std::tuple<int, int, double>{ 178, 179, 1.749286 },
std::tuple<int, int, double>{ 178, 180, 1.649242 },
std::tuple<int, int, double>{ 178, 181, 1.734935 },
std::tuple<int, int, double>{ 178, 182, 1.581139 },
std::tuple<int, int, double>{ 178, 183, 1.676305 },
std::tuple<int, int, double>{ 178, 184, 1.74069 },
std::tuple<int, int, double>{ 178, 185, 1.615549 },
std::tuple<int, int, double>{ 178, 186, 1.959592 },
std::tuple<int, int, double>{ 178, 187, 1.819341 },
std::tuple<int, int, double>{ 178, 188, 2.118962 },
std::tuple<int, int, double>{ 178, 189, 1.794436 },
std::tuple<int, int, double>{ 178, 190, 1.581139 },
std::tuple<int, int, double>{ 178, 191, 1.615549 },
std::tuple<int, int, double>{ 178, 192, 1.67332 },
std::tuple<int, int, double>{ 178, 193, 1.734935 },
std::tuple<int, int, double>{ 178, 194, 1.612452 },
std::tuple<int, int, double>{ 178, 195, 1.691153 },
std::tuple<int, int, double>{ 178, 196, 2.55147 },
std::tuple<int, int, double>{ 178, 197, 1.852026 },
std::tuple<int, int, double>{ 178, 198, 2.204541 },
std::tuple<int, int, double>{ 178, 199, 1.926136 },
std::tuple<int, int, double>{ 178, 200, 1.777639 },
std::tuple<int, int, double>{ 178, 201, 2.063977 },
std::tuple<int, int, double>{ 178, 202, 1.67332 },
std::tuple<int, int, double>{ 178, 203, 2.19089 },
std::tuple<int, int, double>{ 178, 204, 2.022375 },
std::tuple<int, int, double>{ 178, 205, 2.193171 },
std::tuple<int, int, double>{ 178, 206, 2.453569 },
std::tuple<int, int, double>{ 178, 207, 2.569047 },
std::tuple<int, int, double>{ 178, 208, 2.03224 },
std::tuple<int, int, double>{ 178, 209, 2.140093 },
std::tuple<int, int, double>{ 178, 210, 1.923538 },
std::tuple<int, int, double>{ 178, 211, 2.218107 },
std::tuple<int, int, double>{ 178, 212, 1.918333 },
std::tuple<int, int, double>{ 178, 213, 1.752142 },
std::tuple<int, int, double>{ 178, 214, 1.881489 },
std::tuple<int, int, double>{ 178, 215, 2.078461 },
std::tuple<int, int, double>{ 178, 216, 2.184033 },
std::tuple<int, int, double>{ 178, 217, 2.362202 },
std::tuple<int, int, double>{ 178, 218, 2.278157 },
std::tuple<int, int, double>{ 178, 219, 2.366432 },
std::tuple<int, int, double>{ 178, 220, 2.289105 },
std::tuple<int, int, double>{ 178, 221, 2.0 },
std::tuple<int, int, double>{ 178, 222, 2.039608 },
std::tuple<int, int, double>{ 178, 223, 2.142429 },
std::tuple<int, int, double>{ 178, 224, 2.319483 },
std::tuple<int, int, double>{ 178, 225, 2.304344 },
std::tuple<int, int, double>{ 178, 226, 2.22036 },
std::tuple<int, int, double>{ 178, 227, 2.48998 },
std::tuple<int, int, double>{ 178, 228, 2.565151 },
std::tuple<int, int, double>{ 178, 229, 2.673948 },
std::tuple<int, int, double>{ 178, 230, 1.545962 },
std::tuple<int, int, double>{ 178, 231, 2.0 },
std::tuple<int, int, double>{ 178, 232, 2.211334 },
std::tuple<int, int, double>{ 178, 233, 2.453569 },
std::tuple<int, int, double>{ 178, 234, 2.485961 },
std::tuple<int, int, double>{ 178, 235, 2.611513 },
std::tuple<int, int, double>{ 178, 236, 2.605763 },
std::tuple<int, int, double>{ 178, 237, 2.447448 },
std::tuple<int, int, double>{ 178, 238, 2.416609 },
std::tuple<int, int, double>{ 178, 239, 2.039608 },
std::tuple<int, int, double>{ 178, 240, 2.280351 },
std::tuple<int, int, double>{ 178, 241, 1.841195 },
std::tuple<int, int, double>{ 178, 242, 1.5 },
std::tuple<int, int, double>{ 178, 243, 1.664332 },
std::tuple<int, int, double>{ 178, 244, 2.063977 },
std::tuple<int, int, double>{ 178, 245, 2.19089 },
std::tuple<int, int, double>{ 178, 246, 1.941649 },
std::tuple<int, int, double>{ 178, 247, 2.0 },
std::tuple<int, int, double>{ 178, 248, 2.238303 },
std::tuple<int, int, double>{ 178, 249, 2.227106 },
std::tuple<int, int, double>{ 178, 250, 2.416609 },
std::tuple<int, int, double>{ 178, 251, 2.624881 },
std::tuple<int, int, double>{ 178, 252, 2.673948 },
std::tuple<int, int, double>{ 178, 253, 2.572936 },
std::tuple<int, int, double>{ 178, 254, 1.609348 },
std::tuple<int, int, double>{ 178, 255, 2.090454 },
std::tuple<int, int, double>{ 178, 256, 2.244994 },
std::tuple<int, int, double>{ 178, 257, 2.135416 },
std::tuple<int, int, double>{ 178, 258, 2.381176 },
std::tuple<int, int, double>{ 178, 259, 2.6 },
std::tuple<int, int, double>{ 178, 260, 2.437212 },
std::tuple<int, int, double>{ 178, 261, 2.059126 },
std::tuple<int, int, double>{ 178, 262, 1.931321 },
std::tuple<int, int, double>{ 178, 263, 1.414214 },
std::tuple<int, int, double>{ 178, 264, -2.161018 },
std::tuple<int, int, double>{ 179, 176, 14.03567 },
std::tuple<int, int, double>{ 179, 177, 13.78405 },
std::tuple<int, int, double>{ 179, 178, 14.177448 },
std::tuple<int, int, double>{ 179, 179, 13.601471 },
std::tuple<int, int, double>{ 179, 180, 13.114877 },
std::tuple<int, int, double>{ 179, 181, 13.564661 },
std::tuple<int, int, double>{ 179, 182, 13.076698 },
std::tuple<int, int, double>{ 179, 183, 13.601471 },
std::tuple<int, int, double>{ 179, 184, 13.416408 },
std::tuple<int, int, double>{ 179, 185, 12.767146 },
std::tuple<int, int, double>{ 179, 186, 14.662879 },
std::tuple<int, int, double>{ 179, 187, 14.282857 },
std::tuple<int, int, double>{ 179, 188, 16.062377 },
std::tuple<int, int, double>{ 179, 189, 14.282857 },
std::tuple<int, int, double>{ 179, 190, 13.228757 },
std::tuple<int, int, double>{ 179, 191, 12.806248 },
std::tuple<int, int, double>{ 179, 192, 13.228757 },
std::tuple<int, int, double>{ 179, 193, 13.892444 },
std::tuple<int, int, double>{ 179, 194, 12.961482 },
std::tuple<int, int, double>{ 179, 195, 12.845233 },
std::tuple<int, int, double>{ 179, 196, 14.96663 },
std::tuple<int, int, double>{ 179, 197, 14.525839 },
std::tuple<int, int, double>{ 179, 198, 13.674795 },
std::tuple<int, int, double>{ 179, 199, 14.933185 },
std::tuple<int, int, double>{ 179, 200, 14.177448 },
std::tuple<int, int, double>{ 179, 201, 13.747728 },
std::tuple<int, int, double>{ 179, 202, 14.525839 },
std::tuple<int, int, double>{ 179, 203, 15.905975 },
std::tuple<int, int, double>{ 179, 204, 16.278821 },
std::tuple<int, int, double>{ 179, 205, 16.062377 },
std::tuple<int, int, double>{ 179, 206, 14.933185 },
std::tuple<int, int, double>{ 179, 207, 14.73092 },
std::tuple<int, int, double>{ 179, 208, 16.278821 },
std::tuple<int, int, double>{ 179, 209, 15.811388 },
std::tuple<int, int, double>{ 179, 210, 15.198684 },
std::tuple<int, int, double>{ 179, 211, 14.177448 },
std::tuple<int, int, double>{ 179, 212, 14.525839 },
std::tuple<int, int, double>{ 179, 213, 14.071248 },
std::tuple<int, int, double>{ 179, 214, 13.856407 },
std::tuple<int, int, double>{ 179, 215, 16.278821 },
std::tuple<int, int, double>{ 179, 216, 15.620499 },
std::tuple<int, int, double>{ 179, 217, 14.899664 },
std::tuple<int, int, double>{ 179, 218, 15.066519 },
std::tuple<int, int, double>{ 179, 219, 14.56022 },
std::tuple<int, int, double>{ 179, 220, 14.177448 },
std::tuple<int, int, double>{ 179, 221, 14.696938 },
std::tuple<int, int, double>{ 179, 222, 14.317821 },
std::tuple<int, int, double>{ 179, 223, 15.937377 },
std::tuple<int, int, double>{ 179, 224, 15.264338 },
std::tuple<int, int, double>{ 179, 225, 13.416408 },
std::tuple<int, int, double>{ 179, 226, 15.842981 },
std::tuple<int, int, double>{ 179, 227, 14.933185 },
std::tuple<int, int, double>{ 179, 228, 14.352701 },
std::tuple<int, int, double>{ 179, 229, 13.892444 },
std::tuple<int, int, double>{ 179, 230, 10.630146 },
std::tuple<int, int, double>{ 179, 231, 16.492422 },
std::tuple<int, int, double>{ 179, 232, 15.874508 },
std::tuple<int, int, double>{ 179, 233, 15.132746 },
std::tuple<int, int, double>{ 179, 234, 14.798649 },
std::tuple<int, int, double>{ 179, 235, 14.59452 },
std::tuple<int, int, double>{ 179, 236, 13.71131 },
std::tuple<int, int, double>{ 179, 237, 13.228757 },
std::tuple<int, int, double>{ 179, 238, 13.228757 },
std::tuple<int, int, double>{ 179, 239, 14.832398 },
std::tuple<int, int, double>{ 179, 240, 14.282857 },
std::tuple<int, int, double>{ 179, 241, 11.269429 },
std::tuple<int, int, double>{ 179, 242, 9.433981 },
std::tuple<int, int, double>{ 179, 243, 10.488088 },
std::tuple<int, int, double>{ 179, 244, 16.643316 },
std::tuple<int, int, double>{ 179, 245, 16.124515 },
std::tuple<int, int, double>{ 179, 246, 14.59452 },
std::tuple<int, int, double>{ 179, 247, 14.071248 },
std::tuple<int, int, double>{ 179, 248, 12.688578 },
std::tuple<int, int, double>{ 179, 249, 15.811388 },
std::tuple<int, int, double>{ 179, 250, 15.198684 },
std::tuple<int, int, double>{ 179, 251, 14.73092 },
std::tuple<int, int, double>{ 179, 252, 14.282857 },
std::tuple<int, int, double>{ 179, 253, 13.52775 },
std::tuple<int, int, double>{ 179, 254, 11.269429 },
std::tuple<int, int, double>{ 179, 255, 16.309505 },
std::tuple<int, int, double>{ 179, 256, 15.811388 },
std::tuple<int, int, double>{ 179, 257, 16.248077 },
std::tuple<int, int, double>{ 179, 258, 15.588458 },
std::tuple<int, int, double>{ 179, 259, 14.832398 },
std::tuple<int, int, double>{ 179, 260, 14.352701 },
std::tuple<int, int, double>{ 179, 261, 13.674795 },
std::tuple<int, int, double>{ 179, 262, 12.0 },
std::tuple<int, int, double>{ 179, 263, 9.380832 },
std::tuple<int, int, double>{ 179, 264, -14.142136 },
std::tuple<int, int, double>{ 180, 176, 14.03567 },
std::tuple<int, int, double>{ 180, 177, 13.78405 },
std::tuple<int, int, double>{ 180, 178, 14.177448 },
std::tuple<int, int, double>{ 180, 179, 13.601471 },
std::tuple<int, int, double>{ 180, 180, 13.114877 },
std::tuple<int, int, double>{ 180, 181, 13.564661 },
std::tuple<int, int, double>{ 180, 182, 13.076698 },
std::tuple<int, int, double>{ 180, 183, 13.601471 },
std::tuple<int, int, double>{ 180, 184, 13.416408 },
std::tuple<int, int, double>{ 180, 185, 12.767146 },
std::tuple<int, int, double>{ 180, 186, 14.662879 },
std::tuple<int, int, double>{ 180, 187, 14.282857 },
std::tuple<int, int, double>{ 180, 188, 16.062377 },
std::tuple<int, int, double>{ 180, 189, 14.282857 },
std::tuple<int, int, double>{ 180, 190, 13.228757 },
std::tuple<int, int, double>{ 180, 191, 12.806248 },
std::tuple<int, int, double>{ 180, 192, 13.228757 },
std::tuple<int, int, double>{ 180, 193, 13.892444 },
std::tuple<int, int, double>{ 180, 194, 12.961482 },
std::tuple<int, int, double>{ 180, 195, 12.845233 },
std::tuple<int, int, double>{ 180, 196, 14.96663 },
std::tuple<int, int, double>{ 180, 197, 14.525839 },
std::tuple<int, int, double>{ 180, 198, 13.674795 },
std::tuple<int, int, double>{ 180, 199, 14.933185 },
std::tuple<int, int, double>{ 180, 200, 14.177448 },
std::tuple<int, int, double>{ 180, 201, 13.747728 },
std::tuple<int, int, double>{ 180, 202, 14.525839 },
std::tuple<int, int, double>{ 180, 203, 15.905975 },
std::tuple<int, int, double>{ 180, 204, 16.278821 },
std::tuple<int, int, double>{ 180, 205, 16.062377 },
std::tuple<int, int, double>{ 180, 206, 14.933185 },
std::tuple<int, int, double>{ 180, 207, 14.73092 },
std::tuple<int, int, double>{ 180, 208, 16.278821 },
std::tuple<int, int, double>{ 180, 209, 15.811388 },
std::tuple<int, int, double>{ 180, 210, 15.198684 },
std::tuple<int, int, double>{ 180, 211, 14.177448 },
std::tuple<int, int, double>{ 180, 212, 14.525839 },
std::tuple<int, int, double>{ 180, 213, 14.071248 },
std::tuple<int, int, double>{ 180, 214, 13.856407 },
std::tuple<int, int, double>{ 180, 215, 16.278821 },
std::tuple<int, int, double>{ 180, 216, 15.620499 },
std::tuple<int, int, double>{ 180, 217, 14.899664 },
std::tuple<int, int, double>{ 180, 218, 15.066519 },
std::tuple<int, int, double>{ 180, 219, 14.56022 },
std::tuple<int, int, double>{ 180, 220, 14.177448 },
std::tuple<int, int, double>{ 180, 221, 14.696938 },
std::tuple<int, int, double>{ 180, 222, 14.317821 },
std::tuple<int, int, double>{ 180, 223, 15.937377 },
std::tuple<int, int, double>{ 180, 224, 15.264338 },
std::tuple<int, int, double>{ 180, 225, 13.416408 },
std::tuple<int, int, double>{ 180, 226, 15.842981 },
std::tuple<int, int, double>{ 180, 227, 14.933185 },
std::tuple<int, int, double>{ 180, 228, 14.352701 },
std::tuple<int, int, double>{ 180, 229, 13.892444 },
std::tuple<int, int, double>{ 180, 230, 10.630146 },
std::tuple<int, int, double>{ 180, 231, 16.492422 },
std::tuple<int, int, double>{ 180, 232, 15.874508 },
std::tuple<int, int, double>{ 180, 233, 15.132746 },
std::tuple<int, int, double>{ 180, 234, 14.798649 },
std::tuple<int, int, double>{ 180, 235, 14.59452 },
std::tuple<int, int, double>{ 180, 236, 13.71131 },
std::tuple<int, int, double>{ 180, 237, 13.228757 },
std::tuple<int, int, double>{ 180, 238, 13.228757 },
std::tuple<int, int, double>{ 180, 239, 14.832398 },
std::tuple<int, int, double>{ 180, 240, 14.282857 },
std::tuple<int, int, double>{ 180, 241, 11.269429 },
std::tuple<int, int, double>{ 180, 242, 9.433981 },
std::tuple<int, int, double>{ 180, 243, 10.488088 },
std::tuple<int, int, double>{ 180, 244, 16.643316 },
std::tuple<int, int, double>{ 180, 245, 16.124515 },
std::tuple<int, int, double>{ 180, 246, 14.59452 },
std::tuple<int, int, double>{ 180, 247, 14.071248 },
std::tuple<int, int, double>{ 180, 248, 12.688578 },
std::tuple<int, int, double>{ 180, 249, 15.811388 },
std::tuple<int, int, double>{ 180, 250, 15.198684 },
std::tuple<int, int, double>{ 180, 251, 14.73092 },
std::tuple<int, int, double>{ 180, 252, 14.282857 },
std::tuple<int, int, double>{ 180, 253, 13.52775 },
std::tuple<int, int, double>{ 180, 254, 11.269429 },
std::tuple<int, int, double>{ 180, 255, 16.309505 },
std::tuple<int, int, double>{ 180, 256, 15.811388 },
std::tuple<int, int, double>{ 180, 257, 16.248077 },
std::tuple<int, int, double>{ 180, 258, 15.588458 },
std::tuple<int, int, double>{ 180, 259, 14.832398 },
std::tuple<int, int, double>{ 180, 260, 14.352701 },
std::tuple<int, int, double>{ 180, 261, 13.674795 },
std::tuple<int, int, double>{ 180, 262, 12.0 },
std::tuple<int, int, double>{ 180, 263, 9.380832 },
std::tuple<int, int, double>{ 180, 264, -14.317821 },
std::tuple<int, int, double>{ 181, 176, 10.300001 },
std::tuple<int, int, double>{ 181, 177, 10.58 },
std::tuple<int, int, double>{ 181, 178, 10.430001 },
std::tuple<int, int, double>{ 181, 179, 10.210001 },
std::tuple<int, int, double>{ 181, 180, 10.28 },
std::tuple<int, int, double>{ 181, 181, 9.520001 },
std::tuple<int, int, double>{ 181, 182, 10.78 },
std::tuple<int, int, double>{ 181, 183, 9.7 },
std::tuple<int, int, double>{ 181, 184, 10.65 },
std::tuple<int, int, double>{ 181, 185, 10.220001 },
std::tuple<int, int, double>{ 181, 186, 10.420001 },
std::tuple<int, int, double>{ 181, 187, 10.420001 },
std::tuple<int, int, double>{ 181, 188, 10.020001 },
std::tuple<int, int, double>{ 181, 189, 10.11 },
std::tuple<int, int, double>{ 181, 190, 10.19 },
std::tuple<int, int, double>{ 181, 191, 10.270001 },
std::tuple<int, int, double>{ 181, 192, 10.800001 },
std::tuple<int, int, double>{ 181, 193, 10.840001 },
std::tuple<int, int, double>{ 181, 194, 10.130001 },
std::tuple<int, int, double>{ 181, 195, 9.83 },
std::tuple<int, int, double>{ 181, 196, 11.270001 },
std::tuple<int, int, double>{ 181, 197, 10.65 },
std::tuple<int, int, double>{ 181, 198, 10.54 },
std::tuple<int, int, double>{ 181, 199, 11.99 },
std::tuple<int, int, double>{ 181, 200, 11.390001 },
std::tuple<int, int, double>{ 181, 201, 11.800001 },
std::tuple<int, int, double>{ 181, 202, 10.36 },
std::tuple<int, int, double>{ 181, 203, 11.62 },
std::tuple<int, int, double>{ 181, 204, 11.560001 },
std::tuple<int, int, double>{ 181, 205, 10.53 },
std::tuple<int, int, double>{ 181, 206, 11.9 },
std::tuple<int, int, double>{ 181, 207, 11.04 },
std::tuple<int, int, double>{ 181, 208, 10.62 },
std::tuple<int, int, double>{ 181, 209, 11.62 },
std::tuple<int, int, double>{ 181, 210, 10.760001 },
std::tuple<int, int, double>{ 181, 211, 11.11 },
std::tuple<int, int, double>{ 181, 212, 10.680001 },
std::tuple<int, int, double>{ 181, 213, 10.800001 },
std::tuple<int, int, double>{ 181, 214, 10.090001 },
std::tuple<int, int, double>{ 181, 215, 9.74 },
std::tuple<int, int, double>{ 181, 216, 10.060001 },
std::tuple<int, int, double>{ 181, 217, 10.390001 },
std::tuple<int, int, double>{ 181, 218, 10.720001 },
std::tuple<int, int, double>{ 181, 219, 10.98 },
std::tuple<int, int, double>{ 181, 220, 11.28 },
std::tuple<int, int, double>{ 181, 221, 10.49 },
std::tuple<int, int, double>{ 181, 222, 10.99 },
std::tuple<int, int, double>{ 181, 223, 10.550001 },
std::tuple<int, int, double>{ 181, 224, 10.83 },
std::tuple<int, int, double>{ 181, 225, 10.810001 },
std::tuple<int, int, double>{ 181, 226, 11.020001 },
std::tuple<int, int, double>{ 181, 227, 10.800001 },
std::tuple<int, int, double>{ 181, 228, 10.82 },
std::tuple<int, int, double>{ 181, 229, 11.12 },
std::tuple<int, int, double>{ 181, 230, 10.48 },
std::tuple<int, int, double>{ 181, 231, 10.65 },
std::tuple<int, int, double>{ 181, 232, 10.69 },
std::tuple<int, int, double>{ 181, 233, 10.49 },
std::tuple<int, int, double>{ 181, 234, 10.560001 },
std::tuple<int, int, double>{ 181, 235, 10.9 },
std::tuple<int, int, double>{ 181, 236, 10.94 },
std::tuple<int, int, double>{ 181, 237, 10.65 },
std::tuple<int, int, double>{ 181, 238, 10.83 },
std::tuple<int, int, double>{ 181, 239, 11.08 },
std::tuple<int, int, double>{ 181, 240, 11.44 },
std::tuple<int, int, double>{ 181, 241, 9.800001 },
std::tuple<int, int, double>{ 181, 242, 10.24 },
std::tuple<int, int, double>{ 181, 243, 9.99 },
std::tuple<int, int, double>{ 181, 244, 11.57 },
std::tuple<int, int, double>{ 181, 245, 11.24 },
std::tuple<int, int, double>{ 181, 246, 10.970001 },
std::tuple<int, int, double>{ 181, 247, 10.890001 },
std::tuple<int, int, double>{ 181, 248, 10.130001 },
std::tuple<int, int, double>{ 181, 249, 11.090001 },
std::tuple<int, int, double>{ 181, 250, 11.12 },
std::tuple<int, int, double>{ 181, 251, 11.590001 },
std::tuple<int, int, double>{ 181, 252, 11.41 },
std::tuple<int, int, double>{ 181, 253, 11.550001 },
std::tuple<int, int, double>{ 181, 254, 10.08 },
std::tuple<int, int, double>{ 181, 255, 11.0 },
std::tuple<int, int, double>{ 181, 256, 10.010001 },
std::tuple<int, int, double>{ 181, 257, 10.87 },
std::tuple<int, int, double>{ 181, 258, 10.65 },
std::tuple<int, int, double>{ 181, 259, 11.03 },
std::tuple<int, int, double>{ 181, 260, 10.680001 },
std::tuple<int, int, double>{ 181, 261, 10.53 },
std::tuple<int, int, double>{ 181, 262, 10.720001 },
std::tuple<int, int, double>{ 181, 263, 10.44 },
std::tuple<int, int, double>{ 181, 264, -11.2 },
std::tuple<int, int, double>{ 182, 176, 5.75 },
std::tuple<int, int, double>{ 182, 177, 7.25 },
std::tuple<int, int, double>{ 182, 178, 5.0 },
std::tuple<int, int, double>{ 182, 179, 6.25 },
std::tuple<int, int, double>{ 182, 180, 6.75 },
std::tuple<int, int, double>{ 182, 181, 5.75 },
std::tuple<int, int, double>{ 182, 182, 5.75 },
std::tuple<int, int, double>{ 182, 183, 6.25 },
std::tuple<int, int, double>{ 182, 184, 4.75 },
std::tuple<int, int, double>{ 182, 185, 5.25 },
std::tuple<int, int, double>{ 182, 186, 5.0 },
std::tuple<int, int, double>{ 182, 187, 5.25 },
std::tuple<int, int, double>{ 182, 188, 2.25 },
std::tuple<int, int, double>{ 182, 189, 5.5 },
std::tuple<int, int, double>{ 182, 190, 7.0 },
std::tuple<int, int, double>{ 182, 191, 7.5 },
std::tuple<int, int, double>{ 182, 192, 6.5 },
std::tuple<int, int, double>{ 182, 193, 5.5 },
std::tuple<int, int, double>{ 182, 194, 6.25 },
std::tuple<int, int, double>{ 182, 195, 6.5 },
std::tuple<int, int, double>{ 182, 196, 3.25 },
std::tuple<int, int, double>{ 182, 197, 5.25 },
std::tuple<int, int, double>{ 182, 198, 3.0 },
std::tuple<int, int, double>{ 182, 199, 3.5 },
std::tuple<int, int, double>{ 182, 200, 4.25 },
std::tuple<int, int, double>{ 182, 201, 4.25 },
std::tuple<int, int, double>{ 182, 202, 4.25 },
std::tuple<int, int, double>{ 182, 203, 1.75 },
std::tuple<int, int, double>{ 182, 204, 1.75 },
std::tuple<int, int, double>{ 182, 205, 2.25 },
std::tuple<int, int, double>{ 182, 206, 3.0 },
std::tuple<int, int, double>{ 182, 207, 3.5 },
std::tuple<int, int, double>{ 182, 208, 1.75 },
std::tuple<int, int, double>{ 182, 209, 1.75 },
std::tuple<int, int, double>{ 182, 210, 2.5 },
std::tuple<int, int, double>{ 182, 211, 2.75 },
std::tuple<int, int, double>{ 182, 212, 4.75 },
std::tuple<int, int, double>{ 182, 213, 6.0 },
std::tuple<int, int, double>{ 182, 214, 6.0 },
std::tuple<int, int, double>{ 182, 215, 2.5 },
std::tuple<int, int, double>{ 182, 216, 3.0 },
std::tuple<int, int, double>{ 182, 217, 3.75 },
std::tuple<int, int, double>{ 182, 218, 2.25 },
std::tuple<int, int, double>{ 182, 219, 2.75 },
std::tuple<int, int, double>{ 182, 220, 3.25 },
std::tuple<int, int, double>{ 182, 221, 3.5 },
std::tuple<int, int, double>{ 182, 222, 4.25 },
std::tuple<int, int, double>{ 182, 223, 2.5 },
std::tuple<int, int, double>{ 182, 224, 3.0 },
std::tuple<int, int, double>{ 182, 225, 3.75 },
std::tuple<int, int, double>{ 182, 226, 2.75 },
std::tuple<int, int, double>{ 182, 227, 3.25 },
std::tuple<int, int, double>{ 182, 228, 4.0 },
std::tuple<int, int, double>{ 182, 229, 4.5 },
std::tuple<int, int, double>{ 182, 230, 6.75 },
std::tuple<int, int, double>{ 182, 231, 1.75 },
std::tuple<int, int, double>{ 182, 232, 1.75 },
std::tuple<int, int, double>{ 182, 233, 2.25 },
std::tuple<int, int, double>{ 182, 234, 2.75 },
std::tuple<int, int, double>{ 182, 235, 3.25 },
std::tuple<int, int, double>{ 182, 236, 3.75 },
std::tuple<int, int, double>{ 182, 237, 4.75 },
std::tuple<int, int, double>{ 182, 238, 2.75 },
std::tuple<int, int, double>{ 182, 239, 1.75 },
std::tuple<int, int, double>{ 182, 240, 2.25 },
std::tuple<int, int, double>{ 182, 241, 4.5 },
std::tuple<int, int, double>{ 182, 242, 5.25 },
std::tuple<int, int, double>{ 182, 243, 4.75 },
std::tuple<int, int, double>{ 182, 244, 1.75 },
std::tuple<int, int, double>{ 182, 245, 1.75 },
std::tuple<int, int, double>{ 182, 246, 3.75 },
std::tuple<int, int, double>{ 182, 247, 4.25 },
std::tuple<int, int, double>{ 182, 248, 5.0 },
std::tuple<int, int, double>{ 182, 249, 2.25 },
std::tuple<int, int, double>{ 182, 250, 2.75 },
std::tuple<int, int, double>{ 182, 251, 3.25 },
std::tuple<int, int, double>{ 182, 252, 4.25 },
std::tuple<int, int, double>{ 182, 253, 4.25 },
std::tuple<int, int, double>{ 182, 254, 4.75 },
std::tuple<int, int, double>{ 182, 255, 1.25 },
std::tuple<int, int, double>{ 182, 256, 1.5 },
std::tuple<int, int, double>{ 182, 257, 1.5 },
std::tuple<int, int, double>{ 182, 258, 1.75 },
std::tuple<int, int, double>{ 182, 259, 2.25 },
std::tuple<int, int, double>{ 182, 260, 2.75 },
std::tuple<int, int, double>{ 182, 261, 3.0 },
std::tuple<int, int, double>{ 182, 262, 4.75 },
std::tuple<int, int, double>{ 182, 263, 6.25 },
std::tuple<int, int, double>{ 182, 264, -3.5 },
std::tuple<int, int, double>{ 183, 176, 75.0 },
std::tuple<int, int, double>{ 183, 177, 95.0 },
std::tuple<int, int, double>{ 183, 178, 59.0 },
std::tuple<int, int, double>{ 183, 179, 79.0 },
std::tuple<int, int, double>{ 183, 180, 104.0 },
std::tuple<int, int, double>{ 183, 181, 94.0 },
std::tuple<int, int, double>{ 183, 182, 77.0 },
std::tuple<int, int, double>{ 183, 183, 86.0 },
std::tuple<int, int, double>{ 183, 184, 89.0 },
std::tuple<int, int, double>{ 183, 185, 200.0 },
std::tuple<int, int, double>{ 183, 186, 59.0 },
std::tuple<int, int, double>{ 183, 187, 81.0 },
std::tuple<int, int, double>{ 183, 188, 4.0 },
std::tuple<int, int, double>{ 183, 189, 95.0 },
std::tuple<int, int, double>{ 183, 190, 129.0 },
std::tuple<int, int, double>{ 183, 191, 180.0 },
std::tuple<int, int, double>{ 183, 192, 92.0 },
std::tuple<int, int, double>{ 183, 193, 72.0 },
std::tuple<int, int, double>{ 183, 194, 145.0 },
std::tuple<int, int, double>{ 183, 195, 200.0 },
std::tuple<int, int, double>{ 183, 196, 19.0 },
std::tuple<int, int, double>{ 183, 197, 38.0 },
std::tuple<int, int, double>{ 183, 198, 42.0 },
std::tuple<int, int, double>{ 183, 199, 29.0 },
std::tuple<int, int, double>{ 183, 200, 41.0 },
std::tuple<int, int, double>{ 183, 201, 38.0 },
std::tuple<int, int, double>{ 183, 202, 45.0 },
std::tuple<int, int, double>{ 183, 203, 4.0 },
std::tuple<int, int, double>{ 183, 204, 5.0 },
std::tuple<int, int, double>{ 183, 205, 5.0 },
std::tuple<int, int, double>{ 183, 206, 17.0 },
std::tuple<int, int, double>{ 183, 207, 25.0 },
std::tuple<int, int, double>{ 183, 208, 5.0 },
std::tuple<int, int, double>{ 183, 209, 6.0 },
std::tuple<int, int, double>{ 183, 210, 15.0 },
std::tuple<int, int, double>{ 183, 211, 15.0 },
std::tuple<int, int, double>{ 183, 212, 54.0 },
std::tuple<int, int, double>{ 183, 213, 79.0 },
std::tuple<int, int, double>{ 183, 214, 72.0 },
std::tuple<int, int, double>{ 183, 215, 6.0 },
std::tuple<int, int, double>{ 183, 216, 10.0 },
std::tuple<int, int, double>{ 183, 217, 15.0 },
std::tuple<int, int, double>{ 183, 218, 13.0 },
std::tuple<int, int, double>{ 183, 219, 19.0 },
std::tuple<int, int, double>{ 183, 220, 34.0 },
std::tuple<int, int, double>{ 183, 221, 15.0 },
std::tuple<int, int, double>{ 183, 222, 38.0 },
std::tuple<int, int, double>{ 183, 223, 6.0 },
std::tuple<int, int, double>{ 183, 224, 10.0 },
std::tuple<int, int, double>{ 183, 225, 41.0 },
std::tuple<int, int, double>{ 183, 226, 5.0 },
std::tuple<int, int, double>{ 183, 227, 13.0 },
std::tuple<int, int, double>{ 183, 228, 25.0 },
std::tuple<int, int, double>{ 183, 229, 43.0 },
std::tuple<int, int, double>{ 183, 230, 25.0 },
std::tuple<int, int, double>{ 183, 231, 4.0 },
std::tuple<int, int, double>{ 183, 232, 4.0 },
std::tuple<int, int, double>{ 183, 233, 6.0 },
std::tuple<int, int, double>{ 183, 234, 9.0 },
std::tuple<int, int, double>{ 183, 235, 13.0 },
std::tuple<int, int, double>{ 183, 236, 30.0 },
std::tuple<int, int, double>{ 183, 237, 37.0 },
std::tuple<int, int, double>{ 183, 238, 44.0 },
std::tuple<int, int, double>{ 183, 239, 7.0 },
std::tuple<int, int, double>{ 183, 240, 12.0 },
std::tuple<int, int, double>{ 183, 241, 55.0 },
std::tuple<int, int, double>{ 183, 242, 17.0 },
std::tuple<int, int, double>{ 183, 243, 39.0 },
std::tuple<int, int, double>{ 183, 244, 4.0 },
std::tuple<int, int, double>{ 183, 245, 5.0 },
std::tuple<int, int, double>{ 183, 246, 23.0 },
std::tuple<int, int, double>{ 183, 247, 47.0 },
std::tuple<int, int, double>{ 183, 248, 78.0 },
std::tuple<int, int, double>{ 183, 249, 6.0 },
std::tuple<int, int, double>{ 183, 250, 10.0 },
std::tuple<int, int, double>{ 183, 251, 19.0 },
std::tuple<int, int, double>{ 183, 252, 33.0 },
std::tuple<int, int, double>{ 183, 253, 54.0 },
std::tuple<int, int, double>{ 183, 254, 26.0 },
std::tuple<int, int, double>{ 183, 255, 4.0 },
std::tuple<int, int, double>{ 183, 256, 5.0 },
std::tuple<int, int, double>{ 183, 257, 7.0 },
std::tuple<int, int, double>{ 183, 258, 6.0 },
std::tuple<int, int, double>{ 183, 259, 8.0 },
std::tuple<int, int, double>{ 183, 260, 13.0 },
std::tuple<int, int, double>{ 183, 261, 31.0 },
std::tuple<int, int, double>{ 183, 262, 21.0 },
std::tuple<int, int, double>{ 183, 263, 13.0 },
std::tuple<int, int, double>{ 183, 264, -30.0 },
std::tuple<int, int, double>{ 184, 176, 2747.0 },
std::tuple<int, int, double>{ 184, 177, 4929.0 },
std::tuple<int, int, double>{ 184, 178, 3018.0 },
std::tuple<int, int, double>{ 184, 179, 2975.0 },
std::tuple<int, int, double>{ 184, 180, 7243.0 },
std::tuple<int, int, double>{ 184, 181, 5017.0 },
std::tuple<int, int, double>{ 184, 182, 5046.0 },
std::tuple<int, int, double>{ 184, 183, 3062.0 },
std::tuple<int, int, double>{ 184, 184, 3787.0 },
std::tuple<int, int, double>{ 184, 185, 7075.0 },
std::tuple<int, int, double>{ 184, 186, 2237.0 },
std::tuple<int, int, double>{ 184, 187, 2796.0 },
std::tuple<int, int, double>{ 184, 188, 150.0 },
std::tuple<int, int, double>{ 184, 189, 3493.0 },
std::tuple<int, int, double>{ 184, 190, 5405.0 },
std::tuple<int, int, double>{ 184, 191, 5500.0 },
std::tuple<int, int, double>{ 184, 192, 4566.0 },
std::tuple<int, int, double>{ 184, 193, 2500.0 },
std::tuple<int, int, double>{ 184, 194, 4874.0 },
std::tuple<int, int, double>{ 184, 195, 5303.0 },
std::tuple<int, int, double>{ 184, 196, 150.0 },
std::tuple<int, int, double>{ 184, 197, 2197.0 },
std::tuple<int, int, double>{ 184, 198, 150.0 },
std::tuple<int, int, double>{ 184, 199, 1458.0 },
std::tuple<int, int, double>{ 184, 200, 2810.0 },
std::tuple<int, int, double>{ 184, 201, 2630.0 },
std::tuple<int, int, double>{ 184, 202, 150.0 },
std::tuple<int, int, double>{ 184, 203, 150.0 },
std::tuple<int, int, double>{ 184, 204, 150.0 },
std::tuple<int, int, double>{ 184, 205, 150.0 },
std::tuple<int, int, double>{ 184, 206, 150.0 },
std::tuple<int, int, double>{ 184, 207, 150.0 },
std::tuple<int, int, double>{ 184, 208, 150.0 },
std::tuple<int, int, double>{ 184, 209, 150.0 },
std::tuple<int, int, double>{ 184, 210, 150.0 },
std::tuple<int, int, double>{ 184, 211, 150.0 },
std::tuple<int, int, double>{ 184, 212, 2177.0 },
std::tuple<int, int, double>{ 184, 213, 3219.0 },
std::tuple<int, int, double>{ 184, 214, 3947.0 },
std::tuple<int, int, double>{ 184, 215, 150.0 },
std::tuple<int, int, double>{ 184, 216, 150.0 },
std::tuple<int, int, double>{ 184, 217, 150.0 },
std::tuple<int, int, double>{ 184, 218, 150.0 },
std::tuple<int, int, double>{ 184, 219, 150.0 },
std::tuple<int, int, double>{ 184, 220, 150.0 },
std::tuple<int, int, double>{ 184, 221, 150.0 },
std::tuple<int, int, double>{ 184, 222, 150.0 },
std::tuple<int, int, double>{ 184, 223, 150.0 },
std::tuple<int, int, double>{ 184, 224, 150.0 },
std::tuple<int, int, double>{ 184, 225, 150.0 },
std::tuple<int, int, double>{ 184, 226, 150.0 },
std::tuple<int, int, double>{ 184, 227, 150.0 },
std::tuple<int, int, double>{ 184, 228, 150.0 },
std::tuple<int, int, double>{ 184, 229, 150.0 },
std::tuple<int, int, double>{ 184, 230, 150.0 },
std::tuple<int, int, double>{ 184, 231, 150.0 },
std::tuple<int, int, double>{ 184, 232, 150.0 },
std::tuple<int, int, double>{ 184, 233, 150.0 },
std::tuple<int, int, double>{ 184, 234, 150.0 },
std::tuple<int, int, double>{ 184, 235, 150.0 },
std::tuple<int, int, double>{ 184, 236, 150.0 },
std::tuple<int, int, double>{ 184, 237, 150.0 },
std::tuple<int, int, double>{ 184, 238, 150.0 },
std::tuple<int, int, double>{ 184, 239, 150.0 },
std::tuple<int, int, double>{ 184, 240, 150.0 },
std::tuple<int, int, double>{ 184, 241, 150.0 },
std::tuple<int, int, double>{ 184, 242, 150.0 },
std::tuple<int, int, double>{ 184, 243, 150.0 },
std::tuple<int, int, double>{ 184, 244, 150.0 },
std::tuple<int, int, double>{ 184, 245, 150.0 },
std::tuple<int, int, double>{ 184, 246, 150.0 },
std::tuple<int, int, double>{ 184, 247, 150.0 },
std::tuple<int, int, double>{ 184, 248, 150.0 },
std::tuple<int, int, double>{ 184, 249, 150.0 },
std::tuple<int, int, double>{ 184, 250, 150.0 },
std::tuple<int, int, double>{ 184, 251, 150.0 },
std::tuple<int, int, double>{ 184, 252, 150.0 },
std::tuple<int, int, double>{ 184, 253, 150.0 },
std::tuple<int, int, double>{ 184, 254, 150.0 },
std::tuple<int, int, double>{ 184, 255, 150.0 },
std::tuple<int, int, double>{ 184, 256, 150.0 },
std::tuple<int, int, double>{ 184, 257, 150.0 },
std::tuple<int, int, double>{ 184, 258, 150.0 },
std::tuple<int, int, double>{ 184, 259, 150.0 },
std::tuple<int, int, double>{ 184, 260, 150.0 },
std::tuple<int, int, double>{ 184, 261, 150.0 },
std::tuple<int, int, double>{ 184, 262, 150.0 },
std::tuple<int, int, double>{ 184, 263, 150.0 },
std::tuple<int, int, double>{ 184, 264, -410.0 },
std::tuple<int, int, double>{ 185, 176, 2747.0 },
std::tuple<int, int, double>{ 185, 177, 4929.0 },
std::tuple<int, int, double>{ 185, 178, 3018.0 },
std::tuple<int, int, double>{ 185, 179, 2975.0 },
std::tuple<int, int, double>{ 185, 180, 7243.0 },
std::tuple<int, int, double>{ 185, 181, 5017.0 },
std::tuple<int, int, double>{ 185, 182, 5046.0 },
std::tuple<int, int, double>{ 185, 183, 3062.0 },
std::tuple<int, int, double>{ 185, 184, 3787.0 },
std::tuple<int, int, double>{ 185, 185, 7075.0 },
std::tuple<int, int, double>{ 185, 186, 2237.0 },
std::tuple<int, int, double>{ 185, 187, 2796.0 },
std::tuple<int, int, double>{ 185, 188, 150.0 },
std::tuple<int, int, double>{ 185, 189, 3493.0 },
std::tuple<int, int, double>{ 185, 190, 5405.0 },
std::tuple<int, int, double>{ 185, 191, 5500.0 },
std::tuple<int, int, double>{ 185, 192, 4566.0 },
std::tuple<int, int, double>{ 185, 193, 2500.0 },
std::tuple<int, int, double>{ 185, 194, 4874.0 },
std::tuple<int, int, double>{ 185, 195, 5303.0 },
std::tuple<int, int, double>{ 185, 196, 150.0 },
std::tuple<int, int, double>{ 185, 197, 2197.0 },
std::tuple<int, int, double>{ 185, 198, 150.0 },
std::tuple<int, int, double>{ 185, 199, 1458.0 },
std::tuple<int, int, double>{ 185, 200, 2810.0 },
std::tuple<int, int, double>{ 185, 201, 2630.0 },
std::tuple<int, int, double>{ 185, 202, 150.0 },
std::tuple<int, int, double>{ 185, 203, 150.0 },
std::tuple<int, int, double>{ 185, 204, 150.0 },
std::tuple<int, int, double>{ 185, 205, 150.0 },
std::tuple<int, int, double>{ 185, 206, 150.0 },
std::tuple<int, int, double>{ 185, 207, 150.0 },
std::tuple<int, int, double>{ 185, 208, 150.0 },
std::tuple<int, int, double>{ 185, 209, 150.0 },
std::tuple<int, int, double>{ 185, 210, 150.0 },
std::tuple<int, int, double>{ 185, 211, 150.0 },
std::tuple<int, int, double>{ 185, 212, 2177.0 },
std::tuple<int, int, double>{ 185, 213, 3219.0 },
std::tuple<int, int, double>{ 185, 214, 3947.0 },
std::tuple<int, int, double>{ 185, 215, 150.0 },
std::tuple<int, int, double>{ 185, 216, 150.0 },
std::tuple<int, int, double>{ 185, 217, 150.0 },
std::tuple<int, int, double>{ 185, 218, 150.0 },
std::tuple<int, int, double>{ 185, 219, 150.0 },
std::tuple<int, int, double>{ 185, 220, 150.0 },
std::tuple<int, int, double>{ 185, 221, 150.0 },
std::tuple<int, int, double>{ 185, 222, 150.0 },
std::tuple<int, int, double>{ 185, 223, 150.0 },
std::tuple<int, int, double>{ 185, 224, 150.0 },
std::tuple<int, int, double>{ 185, 225, 150.0 },
std::tuple<int, int, double>{ 185, 226, 150.0 },
std::tuple<int, int, double>{ 185, 227, 150.0 },
std::tuple<int, int, double>{ 185, 228, 150.0 },
std::tuple<int, int, double>{ 185, 229, 150.0 },
std::tuple<int, int, double>{ 185, 230, 150.0 },
std::tuple<int, int, double>{ 185, 231, 150.0 },
std::tuple<int, int, double>{ 185, 232, 150.0 },
std::tuple<int, int, double>{ 185, 233, 150.0 },
std::tuple<int, int, double>{ 185, 234, 150.0 },
std::tuple<int, int, double>{ 185, 235, 150.0 },
std::tuple<int, int, double>{ 185, 236, 150.0 },
std::tuple<int, int, double>{ 185, 237, 150.0 },
std::tuple<int, int, double>{ 185, 238, 150.0 },
std::tuple<int, int, double>{ 185, 239, 150.0 },
std::tuple<int, int, double>{ 185, 240, 150.0 },
std::tuple<int, int, double>{ 185, 241, 150.0 },
std::tuple<int, int, double>{ 185, 242, 150.0 },
std::tuple<int, int, double>{ 185, 243, 150.0 },
std::tuple<int, int, double>{ 185, 244, 150.0 },
std::tuple<int, int, double>{ 185, 245, 150.0 },
std::tuple<int, int, double>{ 185, 246, 150.0 },
std::tuple<int, int, double>{ 185, 247, 150.0 },
std::tuple<int, int, double>{ 185, 248, 150.0 },
std::tuple<int, int, double>{ 185, 249, 150.0 },
std::tuple<int, int, double>{ 185, 250, 150.0 },
std::tuple<int, int, double>{ 185, 251, 150.0 },
std::tuple<int, int, double>{ 185, 252, 150.0 },
std::tuple<int, int, double>{ 185, 253, 150.0 },
std::tuple<int, int, double>{ 185, 254, 150.0 },
std::tuple<int, int, double>{ 185, 255, 150.0 },
std::tuple<int, int, double>{ 185, 256, 150.0 },
std::tuple<int, int, double>{ 185, 257, 150.0 },
std::tuple<int, int, double>{ 185, 258, 150.0 },
std::tuple<int, int, double>{ 185, 259, 150.0 },
std::tuple<int, int, double>{ 185, 260, 150.0 },
std::tuple<int, int, double>{ 185, 261, 150.0 },
std::tuple<int, int, double>{ 185, 262, 150.0 },
std::tuple<int, int, double>{ 185, 263, 150.0 },
std::tuple<int, int, double>{ 185, 264, -450.0 },
std::tuple<int, int, double>{ 186, 88, 1.0 },
std::tuple<int, int, double>{ 187, 89, 1.0 },
std::tuple<int, int, double>{ 188, 90, 1.0 },
std::tuple<int, int, double>{ 189, 91, 1.0 },
std::tuple<int, int, double>{ 190, 92, 1.0 },
std::tuple<int, int, double>{ 191, 93, 1.0 },
std::tuple<int, int, double>{ 192, 94, 1.0 },
std::tuple<int, int, double>{ 193, 95, 1.0 },
std::tuple<int, int, double>{ 194, 96, 1.0 },
std::tuple<int, int, double>{ 195, 97, 1.0 },
std::tuple<int, int, double>{ 196, 98, 1.0 },
std::tuple<int, int, double>{ 197, 99, 1.0 },
std::tuple<int, int, double>{ 198, 100, 1.0 },
std::tuple<int, int, double>{ 199, 101, 1.0 },
std::tuple<int, int, double>{ 200, 102, 1.0 },
std::tuple<int, int, double>{ 201, 103, 1.0 },
std::tuple<int, int, double>{ 202, 104, 1.0 },
std::tuple<int, int, double>{ 203, 105, 1.0 },
std::tuple<int, int, double>{ 204, 106, 1.0 },
std::tuple<int, int, double>{ 205, 107, 1.0 },
std::tuple<int, int, double>{ 206, 108, 1.0 },
std::tuple<int, int, double>{ 207, 109, 1.0 },
std::tuple<int, int, double>{ 208, 110, 1.0 },
std::tuple<int, int, double>{ 209, 111, 1.0 },
std::tuple<int, int, double>{ 210, 112, 1.0 },
std::tuple<int, int, double>{ 211, 113, 1.0 },
std::tuple<int, int, double>{ 212, 114, 1.0 },
std::tuple<int, int, double>{ 213, 115, 1.0 },
std::tuple<int, int, double>{ 214, 116, 1.0 },
std::tuple<int, int, double>{ 215, 117, 1.0 },
std::tuple<int, int, double>{ 216, 118, 1.0 },
std::tuple<int, int, double>{ 217, 119, 1.0 },
std::tuple<int, int, double>{ 218, 120, 1.0 },
std::tuple<int, int, double>{ 219, 121, 1.0 },
std::tuple<int, int, double>{ 220, 122, 1.0 },
std::tuple<int, int, double>{ 221, 123, 1.0 },
std::tuple<int, int, double>{ 222, 124, 1.0 },
std::tuple<int, int, double>{ 223, 125, 1.0 },
std::tuple<int, int, double>{ 224, 126, 1.0 },
std::tuple<int, int, double>{ 225, 127, 1.0 },
std::tuple<int, int, double>{ 226, 128, 1.0 },
std::tuple<int, int, double>{ 227, 129, 1.0 },
std::tuple<int, int, double>{ 228, 130, 1.0 },
std::tuple<int, int, double>{ 229, 131, 1.0 },
std::tuple<int, int, double>{ 230, 132, 1.0 },
std::tuple<int, int, double>{ 231, 133, 1.0 },
std::tuple<int, int, double>{ 232, 134, 1.0 },
std::tuple<int, int, double>{ 233, 135, 1.0 },
std::tuple<int, int, double>{ 234, 136, 1.0 },
std::tuple<int, int, double>{ 235, 137, 1.0 },
std::tuple<int, int, double>{ 236, 138, 1.0 },
std::tuple<int, int, double>{ 237, 139, 1.0 },
std::tuple<int, int, double>{ 238, 140, 1.0 },
std::tuple<int, int, double>{ 239, 141, 1.0 },
std::tuple<int, int, double>{ 240, 142, 1.0 },
std::tuple<int, int, double>{ 241, 143, 1.0 },
std::tuple<int, int, double>{ 242, 144, 1.0 },
std::tuple<int, int, double>{ 243, 145, 1.0 },
std::tuple<int, int, double>{ 244, 146, 1.0 },
std::tuple<int, int, double>{ 245, 147, 1.0 },
std::tuple<int, int, double>{ 246, 148, 1.0 },
std::tuple<int, int, double>{ 247, 149, 1.0 },
std::tuple<int, int, double>{ 248, 150, 1.0 },
std::tuple<int, int, double>{ 249, 151, 1.0 },
std::tuple<int, int, double>{ 250, 152, 1.0 },
std::tuple<int, int, double>{ 251, 153, 1.0 },
std::tuple<int, int, double>{ 252, 154, 1.0 },
std::tuple<int, int, double>{ 253, 155, 1.0 },
std::tuple<int, int, double>{ 254, 156, 1.0 },
std::tuple<int, int, double>{ 255, 157, 1.0 },
std::tuple<int, int, double>{ 256, 158, 1.0 },
std::tuple<int, int, double>{ 257, 159, 1.0 },
std::tuple<int, int, double>{ 258, 160, 1.0 },
std::tuple<int, int, double>{ 259, 161, 1.0 },
std::tuple<int, int, double>{ 260, 162, 1.0 },
std::tuple<int, int, double>{ 261, 163, 1.0 },
std::tuple<int, int, double>{ 262, 164, 1.0 },
std::tuple<int, int, double>{ 263, 165, 1.0 },
std::tuple<int, int, double>{ 264, 166, 1.0 },
std::tuple<int, int, double>{ 265, 167, 1.0 },
std::tuple<int, int, double>{ 266, 168, 1.0 },
std::tuple<int, int, double>{ 267, 169, 1.0 },
std::tuple<int, int, double>{ 268, 170, 1.0 },
std::tuple<int, int, double>{ 269, 171, 1.0 },
std::tuple<int, int, double>{ 270, 172, 1.0 },
std::tuple<int, int, double>{ 271, 173, 1.0 },
std::tuple<int, int, double>{ 272, 174, 1.0 },
std::tuple<int, int, double>{ 273, 175, 1.0 },
};
Vec<std::string> rnames{
"VV2", "VV3", "VV4", "VV5", "VV6", "VV7", "VV8", "VV9",
"VV10", "VV11", "VV12", "VV13", "VV14", "VV15", "VV16", "VV17",
"VV18", "VV19", "VV20", "VV21", "VV22", "VV23", "VV24", "VV25",
"VV26", "VV27", "VV28", "VV29", "VV30", "VV31", "VV32", "VV33",
"VV34", "VV35", "VV36", "VV37", "VV38", "VV39", "VV40", "VV41",
"VV42", "VV43", "VV44", "VV45", "VV46", "VV47", "VV48", "VV49",
"VV50", "VV51", "VV52", "VV53", "VV54", "VV55", "VV56", "VV57",
"VV58", "VV59", "VV60", "VV61", "VV62", "VV63", "VV64", "VV65",
"VV66", "VV67", "VV68", "VV69", "VV70", "VV71", "VV72", "VV73",
"VV74", "VV75", "VV76", "VV77", "VV78", "VV79", "VV80", "VV81",
"VV82", "VV83", "VV84", "VV85", "VV86", "VV87", "VV88", "VV89",
"VV90", "VV91", "VV92", "VV93", "VV94", "VV95", "VV96", "VV97",
"VV98", "VV99", "VV100", "VV101", "VV102", "VV103", "VV104", "VV105",
"VV106", "VV107", "VV108", "VV109", "VV110", "VV111", "VV112", "VV113",
"VV114", "VV115", "VV116", "VV117", "VV118", "VV119", "VV120", "VV121",
"VV122", "VV123", "VV124", "VV125", "VV126", "VV127", "VV128", "VV129",
"VV130", "VV131", "VV132", "VV133", "VV134", "VV135", "VV136", "VV137",
"VV138", "VV139", "VV140", "VV141", "VV142", "VV143", "VV144", "VV145",
"VV146", "VV147", "VV148", "VV149", "VV150", "VV151", "VV152", "VV153",
"VV154", "VV155", "VV156", "VV157", "VV158", "VV159", "VV160", "VV161",
"VV162", "VV163", "VV164", "VV165", "VV166", "VV167", "VV168", "VV169",
"VV170", "VV171", "VV172", "VV173", "VV174", "VV175", "VV176", "VV177",
"VV178", "VV179", "VV180", "VV181", "VV182", "VV183", "VV184", "VV185",
"VV186", "VV187", "VV188", "VV189", "VV190", "VV191", "VV192", "VV193",
"VV194", "VV195", "VV196", "VV197", "VV198", "VV199", "VV200", "VV201",
"VV202", "VV203", "VV204", "VV205", "VV206", "VV207", "VV208", "VV209",
"VV210", "VV211", "VV212", "VV213", "VV214", "VV215", "VV216", "VV217",
"VV218", "VV219", "VV220", "VV221", "VV222", "VV223", "VV224", "VV225",
"VV226", "VV227", "VV228", "VV229", "VV230", "VV231", "VV232", "VV233",
"VV234", "VV235", "VV236", "VV237", "VV238", "VV239", "VV240", "VV241",
"VV242", "VV243", "VV244", "VV245", "VV246", "VV247", "VV248", "VV249",
"VV250", "VV251", "VV252", "VV253", "VV254", "VV255", "VV256", "VV257",
"VV258", "VV259", "VV260", "VV261", "VV262", "VV263", "VV264", "VV265",
"VV266", "VV267", "VV268", "VV269", "VV270", "VV271", "VV272", "VV273",
"VV274", "VV275",
};
Vec<std::string> cnames{
"VV276", "VV277", "VV278", "VV279", "VV280", "VV281", "VV282", "VV283",
"VV284", "VV285", "VV286", "VV287", "VV288", "VV289", "VV290", "VV291",
"VV292", "VV293", "VV294", "VV295", "VV296", "VV297", "VV298", "VV299",
"VV300", "VV301", "VV302", "VV303", "VV304", "VV305", "VV306", "VV307",
"VV308", "VV309", "VV310", "VV311", "VV312", "VV313", "VV314", "VV315",
"VV316", "VV317", "VV318", "VV319", "VV320", "VV321", "VV322", "VV323",
"VV324", "VV325", "VV326", "VV327", "VV328", "VV329", "VV330", "VV331",
"VV332", "VV333", "VV334", "VV335", "VV336", "VV337", "VV338", "VV339",
"VV340", "VV341", "VV342", "VV343", "VV344", "VV345", "VV346", "VV347",
"VV348", "VV349", "VV350", "VV351", "VV352", "VV353", "VV354", "VV355",
"VV356", "VV357", "VV358", "VV359", "VV360", "VV361", "VV362", "VV363",
"VV364", "VV365", "VV366", "VV367", "VV368", "VV369", "VV370", "VV371",
"VV372", "VV373", "VV374", "VV375", "VV376", "VV377", "VV378", "VV379",
"VV380", "VV381", "VV382", "VV383", "VV384", "VV385", "VV386", "VV387",
"VV388", "VV389", "VV390", "VV391", "VV392", "VV393", "VV394", "VV395",
"VV396", "VV397", "VV398", "VV399", "VV400", "VV401", "VV402", "VV403",
"VV404", "VV405", "VV406", "VV407", "VV408", "VV409", "VV410", "VV411",
"VV412", "VV413", "VV414", "VV415", "VV416", "VV417", "VV418", "VV419",
"VV420", "VV421", "VV422", "VV423", "VV424", "VV425", "VV426", "VV427",
"VV428", "VV429", "VV430", "VV431", "VV432", "VV433", "VV434", "VV435",
"VV436", "VV437", "VV438", "VV439", "VV440", "VV441", "VV442", "VV443",
"VV444", "VV445", "VV446", "VV447", "VV448", "VV449", "VV450", "VV451",
"VV452", "VV453", "VV454", "VV455", "VV456", "VV457", "VV458", "VV459",
"VV460", "VV461", "VV462", "VV463", "VV464", "VV465", "VV466", "VV467",
"VV468", "VV469", "VV470", "VV471", "VV472", "VV473", "VV474", "VV475",
"VV476", "VV477", "VV478", "VV479", "VV480", "VV481", "VV482", "VV483",
"VV484", "VV485", "VV486", "VV487", "VV488", "VV489", "VV490", "VV491",
"VV492", "VV493", "VV494", "VV495", "VV496", "VV497", "VV498", "VV499",
"VV500", "VV501", "VV502", "VV503", "VV504", "VV505", "VV506", "VV507",
"VV508", "VV509", "VV510", "VV511", "VV512", "VV513", "VV514", "VV515",
"VV516", "VV517", "VV518", "VV519", "VV520", "VV521", "VV522", "VV523",
"VV524", "VV525", "VV526", "VV527", "VV528", "VV529", "VV530", "VV531",
"VV532", "VV533", "VV534", "VV535", "VV536", "VV537", "VV538", "VV539",
"VV540", "VV541", "VV542", "VV543", "VV544", "VV545", "VV546", "VV547",
"VV548", "VV549", "VV550", "VV551", "VV552", "VV553", "VV554", "VV555",
"VV556", "VV557", "VV558", "VV559", "VV560", "VV561", "VV562", "VV563",
"VV564", "VV565", "VV566", "VV567", "VV568", "VV569", "VV570", "VV571",
"VV572", "VV573", "VV574", "VV575", "VV576", "VV577", "VV578", "VV579",
"VV580", "VV581", "VV582", "VV583", "VV584", "VV585", "VV586", "VV587",
"VV588", "VV589", "VV590", "VV591", "VV592", "VV593", "VV594", "VV595",
"VV596", "VV597", "VV598", "VV599", "VV600", "VV601", "VV602", "VV603",
"VV604", "VV605", "VV606", "VV607", "VV608", "VV609", "VV610", "VV611",
"VV612", "VV613", "VV614", "VV615", "VV616", "VV617", "VV618", "VV619",
"VV620", "VV621", "VV622", "VV623", "VV624", "VV625", "VV626", "VV627",
"VV628",
};
int nCols = 353;
int nRows = 274;
ProblemBuilder<double> pb;
pb.reserve( 1409, 274, 353 );
pb.setNumRows( nRows );
pb.setNumCols( nCols );
pb.setObjAll( coeffobj );
pb.setObjOffset( 0.0 );
pb.setColLbAll( lbs );
pb.setColLbInfAll( lbInf );
pb.setColUbAll( ubs );
pb.setColUbInfAll( ubInf );
pb.setColIntegralAll( isIntegral );
pb.setRowLhsInfAll( lhsIsInf );
pb.setRowRhsInfAll( rhsIsInf );
pb.setRowLhsAll( lhs );
pb.setRowRhsAll( rhs );
pb.setRowNameAll( rnames );
pb.addEntryAll( entries );
pb.setColNameAll( cnames );
pb.setProblemName( "blend2.hpp" );
Problem<double> problem = pb.build();
/// PROBLEM BUILDER CODE END
return problem;
}
} // namespace instances
} // namespace papilo
#endif
| 105,610
|
C++
|
.h
| 1,797
| 51.023929
| 80
| 0.504884
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,862
|
Instances.hpp
|
lgottwald_PaPILO/test/instances/Instances.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef PAPILO_TEST_INSTANCES
#define PAPILO_TEST_INSTANCES
#include "../test/instances/bell5.hpp"
#include "../test/instances/blend2.hpp"
#include "../test/instances/dcmulti.hpp"
#include "../test/instances/egout.hpp"
#include "../test/instances/enigma.hpp"
#include "../test/instances/flugpl.hpp"
#include "../test/instances/gt2.hpp"
#include "../test/instances/lseu.hpp"
#include "../test/instances/misc03.hpp"
#include "../test/instances/p0548.hpp"
#include "../test/instances/rgn.hpp"
#endif
| 2,259
|
C++
|
.h
| 36
| 61.694444
| 79
| 0.458352
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,863
|
p0548.hpp
|
lgottwald_PaPILO/test/instances/p0548.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef PAPILO_TEST_INSTANCES_P0548
#define PAPILO_TEST_INSTANCES_P0548
#include "papilo/core/Problem.hpp"
#include "papilo/core/ProblemBuilder.hpp"
namespace papilo
{
namespace instances
{
Problem<double>
p0548()
{
/// PROBLEM BUILDER CODE
Vec<double> coeffobj{
169.0, 10.0, 235.0, 59.0, 39.0, 0.0, 0.0, 118.0, 0.0,
29.0, 186.0, 110.0, 6.0, 154.0, 38.0, 26.0, 0.0, 0.0,
77.0, 0.0, 19.0, 128.0, 7.0, 179.0, 45.0, 30.0, 0.0,
0.0, 89.0, 22.0, 674.0, 39.0, 941.0, 235.0, 157.0, 0.0,
0.0, 470.0, 0.0, 118.0, 755.0, 445.0, 26.0, 622.0, 155.0,
104.0, 0.0, 0.0, 311.0, 0.0, 78.0, 159.0, 94.0, 5.0,
251.0, 0.0, 0.0, 65.0, 0.0, 16.0, 6.0, 37.0, 25.0,
74.0, 0.0, 18.0, 17.0, 101.0, 67.0, 202.0, 0.0, 50.0,
74.0, 6.0, 37.0, 25.0, 74.0, 0.0, 18.0, 265.0, 15.0,
370.0, 92.0, 62.0, 0.0, 0.0, 185.0, 0.0, 46.0, 296.0,
175.0, 10.0, 244.0, 61.0, 41.0, 0.0, 0.0, 122.0, 0.0,
30.0, 156.0, 9.0, 217.0, 54.0, 36.0, 0.0, 0.0, 109.0,
27.0, 819.0, 48.0, 1142.0, 286.0, 190.0, 0.0, 0.0, 571.0,
0.0, 143.0, 916.0, 541.0, 31.0, 755.0, 189.0, 126.0, 0.0,
0.0, 377.0, 0.0, 94.0, 194.0, 114.0, 7.0, 306.0, 0.0,
0.0, 80.0, 0.0, 20.0, 5.0, 30.0, 20.0, 61.0, 0.0,
15.0, 14.0, 83.0, 55.0, 165.0, 0.0, 41.0, 60.0, 5.0,
30.0, 20.0, 60.0, 0.0, 15.0, 192.0, 87.0, 5.0, 121.0,
30.0, 20.0, 0.0, 0.0, 61.0, 455.0, 69.0, 55.0, 15.0,
209.0, 95.0, 6.0, 33.0, 22.0, 0.0, 0.0, 66.0, 495.0,
75.0, 59.0, 17.0, 234.0, 106.0, 6.0, 37.0, 25.0, 0.0,
0.0, 74.0, 554.0, 84.0, 66.0, 18.0, 229.0, 266.0, 120.0,
7.0, 168.0, 42.0, 28.0, 0.0, 0.0, 84.0, 630.0, 95.0,
76.0, 21.0, 7.0, 44.0, 29.0, 87.0, 653.0, 99.0, 22.0,
209.0, 95.0, 6.0, 33.0, 22.0, 0.0, 0.0, 66.0, 495.0,
75.0, 59.0, 17.0, 494.0, 224.0, 13.0, 78.0, 52.0, 0.0,
0.0, 156.0, 1170.0, 177.0, 140.0, 39.0, 208.0, 241.0, 109.0,
76.0, 6.0, 292.0, 0.0, 0.0, 76.0, 571.0, 86.0, 69.0,
19.0, 110.0, 77.0, 6.0, 154.0, 38.0, 26.0, 0.0, 0.0,
77.0, 261.0, 59.0, 51.0, 19.0, 583.0, 306.0, 214.0, 18.0,
427.0, 107.0, 71.0, 0.0, 0.0, 214.0, 725.0, 164.0, 142.0,
53.0, 144.0, 42.0, 8.0, 202.0, 50.0, 34.0, 0.0, 0.0,
101.0, 342.0, 77.0, 67.0, 25.0, 1193.0, 626.0, 437.0, 36.0,
874.0, 218.0, 146.0, 0.0, 0.0, 437.0, 1482.0, 335.0, 291.0,
109.0, 328.0, 172.0, 120.0, 10.0, 240.0, 60.0, 40.0, 0.0,
120.0, 407.0, 92.0, 80.0, 30.0, 164.0, 60.0, 5.0, 30.0,
20.0, 60.0, 204.0, 46.0, 15.0, 220.0, 80.0, 7.0, 27.0,
80.0, 273.0, 62.0, 20.0, 285.0, 104.0, 9.0, 0.0, 104.0,
354.0, 80.0, 70.0, 26.0, 918.0, 336.0, 28.0, 0.0, 336.0,
1140.0, 258.0, 224.0, 84.0, 256.0, 94.0, 8.0, 187.0, 0.0,
94.0, 318.0, 72.0, 62.0, 23.0, 166.0, 87.0, 5.0, 121.0,
30.0, 20.0, 0.0, 0.0, 61.0, 273.0, 56.0, 45.0, 15.0,
229.0, 36.0, 13.0, 319.0, 80.0, 53.0, 0.0, 0.0, 160.0,
718.0, 146.0, 120.0, 40.0, 430.0, 25.0, 600.0, 150.0, 100.0,
0.0, 0.0, 300.0, 1350.0, 275.0, 225.0, 75.0, 356.0, 187.0,
11.0, 260.0, 65.0, 43.0, 0.0, 0.0, 130.0, 586.0, 119.0,
98.0, 33.0, 313.0, 26.0, 10.0, 229.0, 57.0, 38.0, 0.0,
0.0, 115.0, 516.0, 105.0, 86.0, 29.0, 6.0, 24.0, 72.0,
324.0, 66.0, 18.0, 211.0, 17.0, 6.0, 39.0, 0.0, 77.0,
348.0, 71.0, 58.0, 19.0, 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 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
};
Vec<uint8_t> rhsIsInf{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
Vec<double> rhs{
9303.0, 9901.0, 9509.0, 9312.0, 9805.0, 9330.0, 9446.0, 9049.0,
9485.0, 10045.0, 9740.0, 9932.0, 10018.0, 9680.0, 9240.0, 9290.0,
10053.0, 9365.0, 9826.0, 9752.0, 9544.0, 9003.0, 9827.0, 9726.0,
9774.0, 8864.0, 9910.0, 9864.0, 9910.0, 9665.0, 9653.0, 9900.0,
9559.0, 9893.0, 9605.0, 8796.0, 9078.0, 9478.0, 9647.0, 10001.0,
9601.0, 9557.0, 9729.0, 9516.0, 9179.0, 9125.0, 9723.0, 8782.0,
9690.0, 154.0, -2.0, 77.0, 587.0, 94.0, 569.0, 453.0,
850.0, 414.0, -146.0, 159.0, -33.0, -119.0, 219.0, 659.0,
609.0, -154.0, 534.0, 73.0, 147.0, 355.0, 138.0, 72.0,
173.0, 125.0, -1.0, -11.0, 35.0, -11.0, 234.0, 246.0,
-1.0, 340.0, 6.0, 294.0, -69.0, 821.0, 421.0, 252.0,
-102.0, 298.0, 342.0, 170.0, 383.0, 720.0, 774.0, 176.0,
-83.0, 209.0, -920.0, 1200.0, 350.0, -104.0, 195.0, 40.0,
1564.0, 198.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0,
1.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0,
1.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0,
1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0,
0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 0.0,
1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0,
};
Vec<std::tuple<int, int, double>> entries{
std::tuple<int, int, double>{ 0, 0, -59.0 },
std::tuple<int, int, double>{ 0, 1, -10.0 },
std::tuple<int, int, double>{ 0, 2, -167.0 },
std::tuple<int, int, double>{ 0, 3, 161.0 },
std::tuple<int, int, double>{ 0, 4, -35.0 },
std::tuple<int, int, double>{ 0, 5, -120.0 },
std::tuple<int, int, double>{ 0, 6, -189.0 },
std::tuple<int, int, double>{ 0, 7, -68.0 },
std::tuple<int, int, double>{ 0, 8, -68.0 },
std::tuple<int, int, double>{ 0, 9, -71.0 },
std::tuple<int, int, double>{ 0, 499, 9999.0 },
std::tuple<int, int, double>{ 1, 10, -106.0 },
std::tuple<int, int, double>{ 1, 11, -59.0 },
std::tuple<int, int, double>{ 1, 12, -10.0 },
std::tuple<int, int, double>{ 1, 13, -167.0 },
std::tuple<int, int, double>{ 1, 14, 161.0 },
std::tuple<int, int, double>{ 1, 15, -35.0 },
std::tuple<int, int, double>{ 1, 16, -120.0 },
std::tuple<int, int, double>{ 1, 17, -189.0 },
std::tuple<int, int, double>{ 1, 18, -68.0 },
std::tuple<int, int, double>{ 1, 19, -68.0 },
std::tuple<int, int, double>{ 1, 20, -71.0 },
std::tuple<int, int, double>{ 1, 500, 9999.0 },
std::tuple<int, int, double>{ 2, 21, -59.0 },
std::tuple<int, int, double>{ 2, 22, -10.0 },
std::tuple<int, int, double>{ 2, 23, -167.0 },
std::tuple<int, int, double>{ 2, 24, 161.0 },
std::tuple<int, int, double>{ 2, 25, -35.0 },
std::tuple<int, int, double>{ 2, 26, -120.0 },
std::tuple<int, int, double>{ 2, 27, -189.0 },
std::tuple<int, int, double>{ 2, 28, -68.0 },
std::tuple<int, int, double>{ 2, 29, -71.0 },
std::tuple<int, int, double>{ 2, 501, 9999.0 },
std::tuple<int, int, double>{ 3, 30, -59.0 },
std::tuple<int, int, double>{ 3, 31, -10.0 },
std::tuple<int, int, double>{ 3, 32, -167.0 },
std::tuple<int, int, double>{ 3, 33, 161.0 },
std::tuple<int, int, double>{ 3, 34, -35.0 },
std::tuple<int, int, double>{ 3, 35, -120.0 },
std::tuple<int, int, double>{ 3, 36, -189.0 },
std::tuple<int, int, double>{ 3, 37, -68.0 },
std::tuple<int, int, double>{ 3, 38, -68.0 },
std::tuple<int, int, double>{ 3, 39, -71.0 },
std::tuple<int, int, double>{ 3, 502, 9999.0 },
std::tuple<int, int, double>{ 4, 40, -106.0 },
std::tuple<int, int, double>{ 4, 41, -59.0 },
std::tuple<int, int, double>{ 4, 42, -10.0 },
std::tuple<int, int, double>{ 4, 43, -167.0 },
std::tuple<int, int, double>{ 4, 44, 161.0 },
std::tuple<int, int, double>{ 4, 45, -35.0 },
std::tuple<int, int, double>{ 4, 46, -120.0 },
std::tuple<int, int, double>{ 4, 47, -189.0 },
std::tuple<int, int, double>{ 4, 48, -68.0 },
std::tuple<int, int, double>{ 4, 49, -68.0 },
std::tuple<int, int, double>{ 4, 50, -71.0 },
std::tuple<int, int, double>{ 4, 503, 9999.0 },
std::tuple<int, int, double>{ 5, 51, -106.0 },
std::tuple<int, int, double>{ 5, 52, -59.0 },
std::tuple<int, int, double>{ 5, 53, -10.0 },
std::tuple<int, int, double>{ 5, 54, 45.0 },
std::tuple<int, int, double>{ 5, 55, -120.0 },
std::tuple<int, int, double>{ 5, 56, -189.0 },
std::tuple<int, int, double>{ 5, 57, -68.0 },
std::tuple<int, int, double>{ 5, 58, -68.0 },
std::tuple<int, int, double>{ 5, 59, -71.0 },
std::tuple<int, int, double>{ 5, 504, 9999.0 },
std::tuple<int, int, double>{ 6, 60, -10.0 },
std::tuple<int, int, double>{ 6, 61, 161.0 },
std::tuple<int, int, double>{ 6, 62, -35.0 },
std::tuple<int, int, double>{ 6, 63, -68.0 },
std::tuple<int, int, double>{ 6, 64, -68.0 },
std::tuple<int, int, double>{ 6, 65, -71.0 },
std::tuple<int, int, double>{ 6, 505, 9999.0 },
std::tuple<int, int, double>{ 7, 66, -10.0 },
std::tuple<int, int, double>{ 7, 67, 161.0 },
std::tuple<int, int, double>{ 7, 68, -35.0 },
std::tuple<int, int, double>{ 7, 69, -68.0 },
std::tuple<int, int, double>{ 7, 70, -68.0 },
std::tuple<int, int, double>{ 7, 71, -71.0 },
std::tuple<int, int, double>{ 7, 506, 9999.0 },
std::tuple<int, int, double>{ 8, 72, -136.0 },
std::tuple<int, int, double>{ 8, 73, -10.0 },
std::tuple<int, int, double>{ 8, 74, 161.0 },
std::tuple<int, int, double>{ 8, 75, -35.0 },
std::tuple<int, int, double>{ 8, 76, -68.0 },
std::tuple<int, int, double>{ 8, 77, -68.0 },
std::tuple<int, int, double>{ 8, 78, -71.0 },
std::tuple<int, int, double>{ 8, 507, 9999.0 },
std::tuple<int, int, double>{ 9, 79, -59.0 },
std::tuple<int, int, double>{ 9, 80, -10.0 },
std::tuple<int, int, double>{ 9, 81, -167.0 },
std::tuple<int, int, double>{ 9, 82, 161.0 },
std::tuple<int, int, double>{ 9, 83, -35.0 },
std::tuple<int, int, double>{ 9, 84, -120.0 },
std::tuple<int, int, double>{ 9, 85, -189.0 },
std::tuple<int, int, double>{ 9, 86, -68.0 },
std::tuple<int, int, double>{ 9, 87, -68.0 },
std::tuple<int, int, double>{ 9, 88, -71.0 },
std::tuple<int, int, double>{ 9, 508, 9999.0 },
std::tuple<int, int, double>{ 10, 89, -106.0 },
std::tuple<int, int, double>{ 10, 90, -59.0 },
std::tuple<int, int, double>{ 10, 91, -10.0 },
std::tuple<int, int, double>{ 10, 92, -167.0 },
std::tuple<int, int, double>{ 10, 93, 161.0 },
std::tuple<int, int, double>{ 10, 94, -35.0 },
std::tuple<int, int, double>{ 10, 95, -120.0 },
std::tuple<int, int, double>{ 10, 96, -189.0 },
std::tuple<int, int, double>{ 10, 97, -68.0 },
std::tuple<int, int, double>{ 10, 98, -68.0 },
std::tuple<int, int, double>{ 10, 99, -71.0 },
std::tuple<int, int, double>{ 10, 509, 9999.0 },
std::tuple<int, int, double>{ 11, 100, -59.0 },
std::tuple<int, int, double>{ 11, 101, -10.0 },
std::tuple<int, int, double>{ 11, 102, -167.0 },
std::tuple<int, int, double>{ 11, 103, 161.0 },
std::tuple<int, int, double>{ 11, 104, -35.0 },
std::tuple<int, int, double>{ 11, 105, -120.0 },
std::tuple<int, int, double>{ 11, 106, -189.0 },
std::tuple<int, int, double>{ 11, 107, -68.0 },
std::tuple<int, int, double>{ 11, 108, -71.0 },
std::tuple<int, int, double>{ 11, 510, 9999.0 },
std::tuple<int, int, double>{ 12, 109, -59.0 },
std::tuple<int, int, double>{ 12, 110, -10.0 },
std::tuple<int, int, double>{ 12, 111, -167.0 },
std::tuple<int, int, double>{ 12, 112, 161.0 },
std::tuple<int, int, double>{ 12, 113, -35.0 },
std::tuple<int, int, double>{ 12, 114, -120.0 },
std::tuple<int, int, double>{ 12, 115, -189.0 },
std::tuple<int, int, double>{ 12, 116, -68.0 },
std::tuple<int, int, double>{ 12, 117, -68.0 },
std::tuple<int, int, double>{ 12, 118, -71.0 },
std::tuple<int, int, double>{ 12, 511, 9999.0 },
std::tuple<int, int, double>{ 13, 119, -106.0 },
std::tuple<int, int, double>{ 13, 120, -59.0 },
std::tuple<int, int, double>{ 13, 121, -10.0 },
std::tuple<int, int, double>{ 13, 122, -167.0 },
std::tuple<int, int, double>{ 13, 123, 161.0 },
std::tuple<int, int, double>{ 13, 124, -35.0 },
std::tuple<int, int, double>{ 13, 125, -120.0 },
std::tuple<int, int, double>{ 13, 126, -189.0 },
std::tuple<int, int, double>{ 13, 127, -68.0 },
std::tuple<int, int, double>{ 13, 128, -68.0 },
std::tuple<int, int, double>{ 13, 129, -71.0 },
std::tuple<int, int, double>{ 13, 512, 9999.0 },
std::tuple<int, int, double>{ 14, 130, -106.0 },
std::tuple<int, int, double>{ 14, 131, -59.0 },
std::tuple<int, int, double>{ 14, 132, -10.0 },
std::tuple<int, int, double>{ 14, 133, 45.0 },
std::tuple<int, int, double>{ 14, 134, -120.0 },
std::tuple<int, int, double>{ 14, 135, -189.0 },
std::tuple<int, int, double>{ 14, 136, -68.0 },
std::tuple<int, int, double>{ 14, 137, -68.0 },
std::tuple<int, int, double>{ 14, 138, -71.0 },
std::tuple<int, int, double>{ 14, 513, 9999.0 },
std::tuple<int, int, double>{ 15, 139, -10.0 },
std::tuple<int, int, double>{ 15, 140, 161.0 },
std::tuple<int, int, double>{ 15, 141, -35.0 },
std::tuple<int, int, double>{ 15, 142, -68.0 },
std::tuple<int, int, double>{ 15, 143, -68.0 },
std::tuple<int, int, double>{ 15, 144, -71.0 },
std::tuple<int, int, double>{ 15, 514, 9999.0 },
std::tuple<int, int, double>{ 16, 145, -10.0 },
std::tuple<int, int, double>{ 16, 146, 161.0 },
std::tuple<int, int, double>{ 16, 147, -35.0 },
std::tuple<int, int, double>{ 16, 148, -68.0 },
std::tuple<int, int, double>{ 16, 149, -68.0 },
std::tuple<int, int, double>{ 16, 150, -71.0 },
std::tuple<int, int, double>{ 16, 515, 9999.0 },
std::tuple<int, int, double>{ 17, 151, -136.0 },
std::tuple<int, int, double>{ 17, 152, -10.0 },
std::tuple<int, int, double>{ 17, 153, 161.0 },
std::tuple<int, int, double>{ 17, 154, -35.0 },
std::tuple<int, int, double>{ 17, 155, -68.0 },
std::tuple<int, int, double>{ 17, 156, -68.0 },
std::tuple<int, int, double>{ 17, 157, -71.0 },
std::tuple<int, int, double>{ 17, 516, 9999.0 },
std::tuple<int, int, double>{ 18, 158, -81.0 },
std::tuple<int, int, double>{ 18, 159, -59.0 },
std::tuple<int, int, double>{ 18, 160, -10.0 },
std::tuple<int, int, double>{ 18, 161, -167.0 },
std::tuple<int, int, double>{ 18, 162, 161.0 },
std::tuple<int, int, double>{ 18, 163, -35.0 },
std::tuple<int, int, double>{ 18, 164, -120.0 },
std::tuple<int, int, double>{ 18, 165, -189.0 },
std::tuple<int, int, double>{ 18, 166, -68.0 },
std::tuple<int, int, double>{ 18, 167, -149.0 },
std::tuple<int, int, double>{ 18, 168, -100.0 },
std::tuple<int, int, double>{ 18, 169, -77.0 },
std::tuple<int, int, double>{ 18, 170, -71.0 },
std::tuple<int, int, double>{ 18, 517, 9999.0 },
std::tuple<int, int, double>{ 19, 171, -81.0 },
std::tuple<int, int, double>{ 19, 172, -59.0 },
std::tuple<int, int, double>{ 19, 173, -10.0 },
std::tuple<int, int, double>{ 19, 174, 161.0 },
std::tuple<int, int, double>{ 19, 175, -35.0 },
std::tuple<int, int, double>{ 19, 176, -120.0 },
std::tuple<int, int, double>{ 19, 177, -189.0 },
std::tuple<int, int, double>{ 19, 178, -68.0 },
std::tuple<int, int, double>{ 19, 179, -149.0 },
std::tuple<int, int, double>{ 19, 180, -100.0 },
std::tuple<int, int, double>{ 19, 181, -77.0 },
std::tuple<int, int, double>{ 19, 182, -71.0 },
std::tuple<int, int, double>{ 19, 518, 9999.0 },
std::tuple<int, int, double>{ 20, 183, -81.0 },
std::tuple<int, int, double>{ 20, 184, -59.0 },
std::tuple<int, int, double>{ 20, 185, -10.0 },
std::tuple<int, int, double>{ 20, 186, 161.0 },
std::tuple<int, int, double>{ 20, 187, -35.0 },
std::tuple<int, int, double>{ 20, 188, -120.0 },
std::tuple<int, int, double>{ 20, 189, -189.0 },
std::tuple<int, int, double>{ 20, 190, -68.0 },
std::tuple<int, int, double>{ 20, 191, -149.0 },
std::tuple<int, int, double>{ 20, 192, -100.0 },
std::tuple<int, int, double>{ 20, 193, -77.0 },
std::tuple<int, int, double>{ 20, 194, -71.0 },
std::tuple<int, int, double>{ 20, 519, 9999.0 },
std::tuple<int, int, double>{ 21, 195, -93.0 },
std::tuple<int, int, double>{ 21, 196, -81.0 },
std::tuple<int, int, double>{ 21, 197, -59.0 },
std::tuple<int, int, double>{ 21, 198, -10.0 },
std::tuple<int, int, double>{ 21, 199, -167.0 },
std::tuple<int, int, double>{ 21, 200, 161.0 },
std::tuple<int, int, double>{ 21, 201, -35.0 },
std::tuple<int, int, double>{ 21, 202, -120.0 },
std::tuple<int, int, double>{ 21, 203, -189.0 },
std::tuple<int, int, double>{ 21, 204, -68.0 },
std::tuple<int, int, double>{ 21, 205, -149.0 },
std::tuple<int, int, double>{ 21, 206, -100.0 },
std::tuple<int, int, double>{ 21, 207, -77.0 },
std::tuple<int, int, double>{ 21, 208, -71.0 },
std::tuple<int, int, double>{ 21, 520, 9999.0 },
std::tuple<int, int, double>{ 22, 209, -10.0 },
std::tuple<int, int, double>{ 22, 210, 161.0 },
std::tuple<int, int, double>{ 22, 211, -35.0 },
std::tuple<int, int, double>{ 22, 212, -68.0 },
std::tuple<int, int, double>{ 22, 213, -149.0 },
std::tuple<int, int, double>{ 22, 214, -100.0 },
std::tuple<int, int, double>{ 22, 215, -71.0 },
std::tuple<int, int, double>{ 22, 521, 9999.0 },
std::tuple<int, int, double>{ 23, 216, -81.0 },
std::tuple<int, int, double>{ 23, 217, -59.0 },
std::tuple<int, int, double>{ 23, 218, -10.0 },
std::tuple<int, int, double>{ 23, 219, 161.0 },
std::tuple<int, int, double>{ 23, 220, -35.0 },
std::tuple<int, int, double>{ 23, 221, -120.0 },
std::tuple<int, int, double>{ 23, 222, -189.0 },
std::tuple<int, int, double>{ 23, 223, -68.0 },
std::tuple<int, int, double>{ 23, 224, -149.0 },
std::tuple<int, int, double>{ 23, 225, -100.0 },
std::tuple<int, int, double>{ 23, 226, -77.0 },
std::tuple<int, int, double>{ 23, 227, -71.0 },
std::tuple<int, int, double>{ 23, 522, 9999.0 },
std::tuple<int, int, double>{ 24, 228, -81.0 },
std::tuple<int, int, double>{ 24, 229, -59.0 },
std::tuple<int, int, double>{ 24, 230, -10.0 },
std::tuple<int, int, double>{ 24, 231, 161.0 },
std::tuple<int, int, double>{ 24, 232, -35.0 },
std::tuple<int, int, double>{ 24, 233, -120.0 },
std::tuple<int, int, double>{ 24, 234, -189.0 },
std::tuple<int, int, double>{ 24, 235, -68.0 },
std::tuple<int, int, double>{ 24, 236, -149.0 },
std::tuple<int, int, double>{ 24, 237, -100.0 },
std::tuple<int, int, double>{ 24, 238, -77.0 },
std::tuple<int, int, double>{ 24, 239, -71.0 },
std::tuple<int, int, double>{ 24, 523, 9999.0 },
std::tuple<int, int, double>{ 25, 240, -93.0 },
std::tuple<int, int, double>{ 25, 241, -81.0 },
std::tuple<int, int, double>{ 25, 242, -59.0 },
std::tuple<int, int, double>{ 25, 243, -145.0 },
std::tuple<int, int, double>{ 25, 244, -10.0 },
std::tuple<int, int, double>{ 25, 245, 45.0 },
std::tuple<int, int, double>{ 25, 246, -120.0 },
std::tuple<int, int, double>{ 25, 247, -189.0 },
std::tuple<int, int, double>{ 25, 248, -68.0 },
std::tuple<int, int, double>{ 25, 249, -149.0 },
std::tuple<int, int, double>{ 25, 250, -100.0 },
std::tuple<int, int, double>{ 25, 251, -77.0 },
std::tuple<int, int, double>{ 25, 252, -71.0 },
std::tuple<int, int, double>{ 25, 524, 9999.0 },
std::tuple<int, int, double>{ 26, 253, -59.0 },
std::tuple<int, int, double>{ 26, 254, -145.0 },
std::tuple<int, int, double>{ 26, 255, -10.0 },
std::tuple<int, int, double>{ 26, 256, -167.0 },
std::tuple<int, int, double>{ 26, 257, 161.0 },
std::tuple<int, int, double>{ 26, 258, -35.0 },
std::tuple<int, int, double>{ 26, 259, -120.0 },
std::tuple<int, int, double>{ 26, 260, -189.0 },
std::tuple<int, int, double>{ 26, 261, -68.0 },
std::tuple<int, int, double>{ 26, 262, -189.0 },
std::tuple<int, int, double>{ 26, 263, -104.0 },
std::tuple<int, int, double>{ 26, 264, -110.0 },
std::tuple<int, int, double>{ 26, 265, -71.0 },
std::tuple<int, int, double>{ 26, 525, 9999.0 },
std::tuple<int, int, double>{ 27, 266, -93.0 },
std::tuple<int, int, double>{ 27, 267, -59.0 },
std::tuple<int, int, double>{ 27, 268, -145.0 },
std::tuple<int, int, double>{ 27, 269, -10.0 },
std::tuple<int, int, double>{ 27, 270, -167.0 },
std::tuple<int, int, double>{ 27, 271, 161.0 },
std::tuple<int, int, double>{ 27, 272, -35.0 },
std::tuple<int, int, double>{ 27, 273, -120.0 },
std::tuple<int, int, double>{ 27, 274, -189.0 },
std::tuple<int, int, double>{ 27, 275, -68.0 },
std::tuple<int, int, double>{ 27, 276, -189.0 },
std::tuple<int, int, double>{ 27, 277, -104.0 },
std::tuple<int, int, double>{ 27, 278, -110.0 },
std::tuple<int, int, double>{ 27, 279, -71.0 },
std::tuple<int, int, double>{ 27, 526, 9999.0 },
std::tuple<int, int, double>{ 28, 280, -59.0 },
std::tuple<int, int, double>{ 28, 281, -155.0 },
std::tuple<int, int, double>{ 28, 282, -10.0 },
std::tuple<int, int, double>{ 28, 283, -167.0 },
std::tuple<int, int, double>{ 28, 284, 161.0 },
std::tuple<int, int, double>{ 28, 285, -35.0 },
std::tuple<int, int, double>{ 28, 286, -120.0 },
std::tuple<int, int, double>{ 28, 287, -189.0 },
std::tuple<int, int, double>{ 28, 288, -68.0 },
std::tuple<int, int, double>{ 28, 289, -189.0 },
std::tuple<int, int, double>{ 28, 290, -104.0 },
std::tuple<int, int, double>{ 28, 291, -110.0 },
std::tuple<int, int, double>{ 28, 292, -71.0 },
std::tuple<int, int, double>{ 28, 527, 9999.0 },
std::tuple<int, int, double>{ 29, 293, -93.0 },
std::tuple<int, int, double>{ 29, 294, -59.0 },
std::tuple<int, int, double>{ 29, 295, -145.0 },
std::tuple<int, int, double>{ 29, 296, -10.0 },
std::tuple<int, int, double>{ 29, 297, -167.0 },
std::tuple<int, int, double>{ 29, 298, 161.0 },
std::tuple<int, int, double>{ 29, 299, -35.0 },
std::tuple<int, int, double>{ 29, 300, -120.0 },
std::tuple<int, int, double>{ 29, 301, -189.0 },
std::tuple<int, int, double>{ 29, 302, -68.0 },
std::tuple<int, int, double>{ 29, 303, -189.0 },
std::tuple<int, int, double>{ 29, 304, -104.0 },
std::tuple<int, int, double>{ 29, 305, -110.0 },
std::tuple<int, int, double>{ 29, 306, -71.0 },
std::tuple<int, int, double>{ 29, 528, 9999.0 },
std::tuple<int, int, double>{ 30, 307, -93.0 },
std::tuple<int, int, double>{ 30, 308, -59.0 },
std::tuple<int, int, double>{ 30, 309, -136.0 },
std::tuple<int, int, double>{ 30, 310, -10.0 },
std::tuple<int, int, double>{ 30, 311, -167.0 },
std::tuple<int, int, double>{ 30, 312, 161.0 },
std::tuple<int, int, double>{ 30, 313, -35.0 },
std::tuple<int, int, double>{ 30, 314, -138.0 },
std::tuple<int, int, double>{ 30, 315, -68.0 },
std::tuple<int, int, double>{ 30, 316, -189.0 },
std::tuple<int, int, double>{ 30, 317, -104.0 },
std::tuple<int, int, double>{ 30, 318, -110.0 },
std::tuple<int, int, double>{ 30, 319, -71.0 },
std::tuple<int, int, double>{ 30, 529, 9999.0 },
std::tuple<int, int, double>{ 31, 320, -93.0 },
std::tuple<int, int, double>{ 31, 321, -145.0 },
std::tuple<int, int, double>{ 31, 322, -10.0 },
std::tuple<int, int, double>{ 31, 323, 161.0 },
std::tuple<int, int, double>{ 31, 324, -35.0 },
std::tuple<int, int, double>{ 31, 325, -68.0 },
std::tuple<int, int, double>{ 31, 326, -189.0 },
std::tuple<int, int, double>{ 31, 327, -104.0 },
std::tuple<int, int, double>{ 31, 328, -71.0 },
std::tuple<int, int, double>{ 31, 530, 9999.0 },
std::tuple<int, int, double>{ 32, 329, -93.0 },
std::tuple<int, int, double>{ 32, 330, -145.0 },
std::tuple<int, int, double>{ 32, 331, -10.0 },
std::tuple<int, int, double>{ 32, 332, -35.0 },
std::tuple<int, int, double>{ 32, 333, -68.0 },
std::tuple<int, int, double>{ 32, 334, -189.0 },
std::tuple<int, int, double>{ 32, 335, -104.0 },
std::tuple<int, int, double>{ 32, 336, -71.0 },
std::tuple<int, int, double>{ 32, 531, 9999.0 },
std::tuple<int, int, double>{ 33, 337, -93.0 },
std::tuple<int, int, double>{ 33, 338, -145.0 },
std::tuple<int, int, double>{ 33, 339, -10.0 },
std::tuple<int, int, double>{ 33, 340, -189.0 },
std::tuple<int, int, double>{ 33, 341, -68.0 },
std::tuple<int, int, double>{ 33, 342, -189.0 },
std::tuple<int, int, double>{ 33, 343, -104.0 },
std::tuple<int, int, double>{ 33, 344, -110.0 },
std::tuple<int, int, double>{ 33, 345, -71.0 },
std::tuple<int, int, double>{ 33, 532, 9999.0 },
std::tuple<int, int, double>{ 34, 346, -93.0 },
std::tuple<int, int, double>{ 34, 347, -145.0 },
std::tuple<int, int, double>{ 34, 348, -10.0 },
std::tuple<int, int, double>{ 34, 349, -189.0 },
std::tuple<int, int, double>{ 34, 350, -68.0 },
std::tuple<int, int, double>{ 34, 351, -189.0 },
std::tuple<int, int, double>{ 34, 352, -104.0 },
std::tuple<int, int, double>{ 34, 353, -110.0 },
std::tuple<int, int, double>{ 34, 354, -71.0 },
std::tuple<int, int, double>{ 34, 533, 9999.0 },
std::tuple<int, int, double>{ 35, 355, -93.0 },
std::tuple<int, int, double>{ 35, 356, -136.0 },
std::tuple<int, int, double>{ 35, 357, -10.0 },
std::tuple<int, int, double>{ 35, 358, -167.0 },
std::tuple<int, int, double>{ 35, 359, -138.0 },
std::tuple<int, int, double>{ 35, 360, -68.0 },
std::tuple<int, int, double>{ 35, 361, -189.0 },
std::tuple<int, int, double>{ 35, 362, -104.0 },
std::tuple<int, int, double>{ 35, 363, -110.0 },
std::tuple<int, int, double>{ 35, 364, -71.0 },
std::tuple<int, int, double>{ 35, 534, 9999.0 },
std::tuple<int, int, double>{ 36, 365, -93.0 },
std::tuple<int, int, double>{ 36, 366, -59.0 },
std::tuple<int, int, double>{ 36, 367, -10.0 },
std::tuple<int, int, double>{ 36, 368, -167.0 },
std::tuple<int, int, double>{ 36, 369, 161.0 },
std::tuple<int, int, double>{ 36, 370, -35.0 },
std::tuple<int, int, double>{ 36, 371, -120.0 },
std::tuple<int, int, double>{ 36, 372, -189.0 },
std::tuple<int, int, double>{ 36, 373, -68.0 },
std::tuple<int, int, double>{ 36, 374, -180.0 },
std::tuple<int, int, double>{ 36, 375, -120.0 },
std::tuple<int, int, double>{ 36, 376, -100.0 },
std::tuple<int, int, double>{ 36, 377, -71.0 },
std::tuple<int, int, double>{ 36, 535, 9999.0 },
std::tuple<int, int, double>{ 37, 378, -59.0 },
std::tuple<int, int, double>{ 37, 379, -34.0 },
std::tuple<int, int, double>{ 37, 380, -10.0 },
std::tuple<int, int, double>{ 37, 381, -167.0 },
std::tuple<int, int, double>{ 37, 382, 161.0 },
std::tuple<int, int, double>{ 37, 383, -35.0 },
std::tuple<int, int, double>{ 37, 384, -120.0 },
std::tuple<int, int, double>{ 37, 385, -189.0 },
std::tuple<int, int, double>{ 37, 386, -68.0 },
std::tuple<int, int, double>{ 37, 387, -180.0 },
std::tuple<int, int, double>{ 37, 388, -120.0 },
std::tuple<int, int, double>{ 37, 389, -100.0 },
std::tuple<int, int, double>{ 37, 390, -71.0 },
std::tuple<int, int, double>{ 37, 536, 9999.0 },
std::tuple<int, int, double>{ 38, 391, -59.0 },
std::tuple<int, int, double>{ 38, 392, -10.0 },
std::tuple<int, int, double>{ 38, 393, -167.0 },
std::tuple<int, int, double>{ 38, 394, 161.0 },
std::tuple<int, int, double>{ 38, 395, -35.0 },
std::tuple<int, int, double>{ 38, 396, -120.0 },
std::tuple<int, int, double>{ 38, 397, -189.0 },
std::tuple<int, int, double>{ 38, 398, -68.0 },
std::tuple<int, int, double>{ 38, 399, -180.0 },
std::tuple<int, int, double>{ 38, 400, -120.0 },
std::tuple<int, int, double>{ 38, 401, -100.0 },
std::tuple<int, int, double>{ 38, 402, -71.0 },
std::tuple<int, int, double>{ 38, 537, 9999.0 },
std::tuple<int, int, double>{ 39, 403, -93.0 },
std::tuple<int, int, double>{ 39, 404, -59.0 },
std::tuple<int, int, double>{ 39, 405, -10.0 },
std::tuple<int, int, double>{ 39, 406, -167.0 },
std::tuple<int, int, double>{ 39, 407, 161.0 },
std::tuple<int, int, double>{ 39, 408, -35.0 },
std::tuple<int, int, double>{ 39, 409, -120.0 },
std::tuple<int, int, double>{ 39, 410, -189.0 },
std::tuple<int, int, double>{ 39, 411, -68.0 },
std::tuple<int, int, double>{ 39, 412, -180.0 },
std::tuple<int, int, double>{ 39, 413, -120.0 },
std::tuple<int, int, double>{ 39, 414, -100.0 },
std::tuple<int, int, double>{ 39, 415, -71.0 },
std::tuple<int, int, double>{ 39, 538, 9999.0 },
std::tuple<int, int, double>{ 40, 416, -93.0 },
std::tuple<int, int, double>{ 40, 417, -34.0 },
std::tuple<int, int, double>{ 40, 418, -10.0 },
std::tuple<int, int, double>{ 40, 419, -167.0 },
std::tuple<int, int, double>{ 40, 420, 161.0 },
std::tuple<int, int, double>{ 40, 421, -35.0 },
std::tuple<int, int, double>{ 40, 422, -120.0 },
std::tuple<int, int, double>{ 40, 423, -189.0 },
std::tuple<int, int, double>{ 40, 424, -68.0 },
std::tuple<int, int, double>{ 40, 425, -180.0 },
std::tuple<int, int, double>{ 40, 426, -120.0 },
std::tuple<int, int, double>{ 40, 427, -100.0 },
std::tuple<int, int, double>{ 40, 428, -71.0 },
std::tuple<int, int, double>{ 40, 539, 9999.0 },
std::tuple<int, int, double>{ 41, 429, -10.0 },
std::tuple<int, int, double>{ 41, 430, -35.0 },
std::tuple<int, int, double>{ 41, 431, -68.0 },
std::tuple<int, int, double>{ 41, 432, -180.0 },
std::tuple<int, int, double>{ 41, 433, -120.0 },
std::tuple<int, int, double>{ 41, 434, -71.0 },
std::tuple<int, int, double>{ 41, 540, 9999.0 },
std::tuple<int, int, double>{ 42, 435, -93.0 },
std::tuple<int, int, double>{ 42, 436, -34.0 },
std::tuple<int, int, double>{ 42, 437, -10.0 },
std::tuple<int, int, double>{ 42, 438, 161.0 },
std::tuple<int, int, double>{ 42, 439, -189.0 },
std::tuple<int, int, double>{ 42, 440, -68.0 },
std::tuple<int, int, double>{ 42, 441, -180.0 },
std::tuple<int, int, double>{ 42, 442, -120.0 },
std::tuple<int, int, double>{ 42, 443, -100.0 },
std::tuple<int, int, double>{ 42, 444, -71.0 },
std::tuple<int, int, double>{ 42, 541, 9999.0 },
std::tuple<int, int, double>{ 43, 445, -93.0 },
std::tuple<int, int, double>{ 43, 446, -10.0 },
std::tuple<int, int, double>{ 43, 447, -189.0 },
std::tuple<int, int, double>{ 43, 448, -68.0 },
std::tuple<int, int, double>{ 43, 449, -180.0 },
std::tuple<int, int, double>{ 43, 450, -120.0 },
std::tuple<int, int, double>{ 43, 451, -100.0 },
std::tuple<int, int, double>{ 43, 452, -71.0 },
std::tuple<int, int, double>{ 43, 542, 9999.0 },
std::tuple<int, int, double>{ 44, 453, -93.0 },
std::tuple<int, int, double>{ 44, 454, -10.0 },
std::tuple<int, int, double>{ 44, 455, -189.0 },
std::tuple<int, int, double>{ 44, 456, -68.0 },
std::tuple<int, int, double>{ 44, 457, -192.0 },
std::tuple<int, int, double>{ 44, 458, -120.0 },
std::tuple<int, int, double>{ 44, 459, -100.0 },
std::tuple<int, int, double>{ 44, 460, -71.0 },
std::tuple<int, int, double>{ 44, 543, 9999.0 },
std::tuple<int, int, double>{ 45, 461, -93.0 },
std::tuple<int, int, double>{ 45, 462, -10.0 },
std::tuple<int, int, double>{ 45, 463, -189.0 },
std::tuple<int, int, double>{ 45, 464, -68.0 },
std::tuple<int, int, double>{ 45, 465, -192.0 },
std::tuple<int, int, double>{ 45, 466, -120.0 },
std::tuple<int, int, double>{ 45, 467, -100.0 },
std::tuple<int, int, double>{ 45, 468, -71.0 },
std::tuple<int, int, double>{ 45, 544, 9999.0 },
std::tuple<int, int, double>{ 46, 469, -93.0 },
std::tuple<int, int, double>{ 46, 470, -136.0 },
std::tuple<int, int, double>{ 46, 471, -10.0 },
std::tuple<int, int, double>{ 46, 472, -138.0 },
std::tuple<int, int, double>{ 46, 473, -68.0 },
std::tuple<int, int, double>{ 46, 474, -192.0 },
std::tuple<int, int, double>{ 46, 475, -120.0 },
std::tuple<int, int, double>{ 46, 476, -100.0 },
std::tuple<int, int, double>{ 46, 477, -71.0 },
std::tuple<int, int, double>{ 46, 545, 9999.0 },
std::tuple<int, int, double>{ 47, 478, -93.0 },
std::tuple<int, int, double>{ 47, 479, -10.0 },
std::tuple<int, int, double>{ 47, 480, -189.0 },
std::tuple<int, int, double>{ 47, 481, -68.0 },
std::tuple<int, int, double>{ 47, 482, -192.0 },
std::tuple<int, int, double>{ 47, 483, -120.0 },
std::tuple<int, int, double>{ 47, 484, -100.0 },
std::tuple<int, int, double>{ 47, 485, -71.0 },
std::tuple<int, int, double>{ 47, 546, 9999.0 },
std::tuple<int, int, double>{ 48, 486, -106.0 },
std::tuple<int, int, double>{ 48, 487, -10.0 },
std::tuple<int, int, double>{ 48, 488, -189.0 },
std::tuple<int, int, double>{ 48, 489, -68.0 },
std::tuple<int, int, double>{ 48, 490, -192.0 },
std::tuple<int, int, double>{ 48, 491, -120.0 },
std::tuple<int, int, double>{ 48, 492, -100.0 },
std::tuple<int, int, double>{ 48, 493, -71.0 },
std::tuple<int, int, double>{ 48, 547, 9999.0 },
std::tuple<int, int, double>{ 49, 0, -59.0 },
std::tuple<int, int, double>{ 49, 1, -10.0 },
std::tuple<int, int, double>{ 49, 2, -167.0 },
std::tuple<int, int, double>{ 49, 3, 161.0 },
std::tuple<int, int, double>{ 49, 4, -35.0 },
std::tuple<int, int, double>{ 49, 5, -120.0 },
std::tuple<int, int, double>{ 49, 6, -189.0 },
std::tuple<int, int, double>{ 49, 7, -68.0 },
std::tuple<int, int, double>{ 49, 8, -68.0 },
std::tuple<int, int, double>{ 49, 9, -71.0 },
std::tuple<int, int, double>{ 49, 499, -9999.0 },
std::tuple<int, int, double>{ 50, 10, 106.0 },
std::tuple<int, int, double>{ 50, 11, 59.0 },
std::tuple<int, int, double>{ 50, 12, 10.0 },
std::tuple<int, int, double>{ 50, 13, 167.0 },
std::tuple<int, int, double>{ 50, 14, -161.0 },
std::tuple<int, int, double>{ 50, 15, 35.0 },
std::tuple<int, int, double>{ 50, 16, 120.0 },
std::tuple<int, int, double>{ 50, 17, 189.0 },
std::tuple<int, int, double>{ 50, 18, 68.0 },
std::tuple<int, int, double>{ 50, 19, 68.0 },
std::tuple<int, int, double>{ 50, 20, 71.0 },
std::tuple<int, int, double>{ 50, 500, -9999.0 },
std::tuple<int, int, double>{ 51, 21, -59.0 },
std::tuple<int, int, double>{ 51, 22, -10.0 },
std::tuple<int, int, double>{ 51, 23, -167.0 },
std::tuple<int, int, double>{ 51, 24, 161.0 },
std::tuple<int, int, double>{ 51, 25, -35.0 },
std::tuple<int, int, double>{ 51, 26, -120.0 },
std::tuple<int, int, double>{ 51, 27, -189.0 },
std::tuple<int, int, double>{ 51, 28, -68.0 },
std::tuple<int, int, double>{ 51, 29, -71.0 },
std::tuple<int, int, double>{ 51, 501, -9999.0 },
std::tuple<int, int, double>{ 52, 30, 59.0 },
std::tuple<int, int, double>{ 52, 31, 10.0 },
std::tuple<int, int, double>{ 52, 32, 167.0 },
std::tuple<int, int, double>{ 52, 33, -161.0 },
std::tuple<int, int, double>{ 52, 34, 35.0 },
std::tuple<int, int, double>{ 52, 35, 120.0 },
std::tuple<int, int, double>{ 52, 36, 189.0 },
std::tuple<int, int, double>{ 52, 37, 68.0 },
std::tuple<int, int, double>{ 52, 38, 68.0 },
std::tuple<int, int, double>{ 52, 39, 71.0 },
std::tuple<int, int, double>{ 52, 502, -9999.0 },
std::tuple<int, int, double>{ 53, 40, 106.0 },
std::tuple<int, int, double>{ 53, 41, 59.0 },
std::tuple<int, int, double>{ 53, 42, 10.0 },
std::tuple<int, int, double>{ 53, 43, 167.0 },
std::tuple<int, int, double>{ 53, 44, -161.0 },
std::tuple<int, int, double>{ 53, 45, 35.0 },
std::tuple<int, int, double>{ 53, 46, 120.0 },
std::tuple<int, int, double>{ 53, 47, 189.0 },
std::tuple<int, int, double>{ 53, 48, 68.0 },
std::tuple<int, int, double>{ 53, 49, 68.0 },
std::tuple<int, int, double>{ 53, 50, 71.0 },
std::tuple<int, int, double>{ 53, 503, -9999.0 },
std::tuple<int, int, double>{ 54, 51, 106.0 },
std::tuple<int, int, double>{ 54, 52, 59.0 },
std::tuple<int, int, double>{ 54, 53, 10.0 },
std::tuple<int, int, double>{ 54, 54, -45.0 },
std::tuple<int, int, double>{ 54, 55, 120.0 },
std::tuple<int, int, double>{ 54, 56, 189.0 },
std::tuple<int, int, double>{ 54, 57, 68.0 },
std::tuple<int, int, double>{ 54, 58, 68.0 },
std::tuple<int, int, double>{ 54, 59, 71.0 },
std::tuple<int, int, double>{ 54, 504, -9999.0 },
std::tuple<int, int, double>{ 55, 60, 10.0 },
std::tuple<int, int, double>{ 55, 61, -161.0 },
std::tuple<int, int, double>{ 55, 62, 35.0 },
std::tuple<int, int, double>{ 55, 63, 68.0 },
std::tuple<int, int, double>{ 55, 64, 68.0 },
std::tuple<int, int, double>{ 55, 65, 71.0 },
std::tuple<int, int, double>{ 55, 505, -9999.0 },
std::tuple<int, int, double>{ 56, 66, 10.0 },
std::tuple<int, int, double>{ 56, 67, -161.0 },
std::tuple<int, int, double>{ 56, 68, 35.0 },
std::tuple<int, int, double>{ 56, 69, 68.0 },
std::tuple<int, int, double>{ 56, 70, 68.0 },
std::tuple<int, int, double>{ 56, 71, 71.0 },
std::tuple<int, int, double>{ 56, 506, -9999.0 },
std::tuple<int, int, double>{ 57, 72, 136.0 },
std::tuple<int, int, double>{ 57, 73, 10.0 },
std::tuple<int, int, double>{ 57, 74, -161.0 },
std::tuple<int, int, double>{ 57, 75, 35.0 },
std::tuple<int, int, double>{ 57, 76, 68.0 },
std::tuple<int, int, double>{ 57, 77, 68.0 },
std::tuple<int, int, double>{ 57, 78, 71.0 },
std::tuple<int, int, double>{ 57, 507, -9999.0 },
std::tuple<int, int, double>{ 58, 79, 59.0 },
std::tuple<int, int, double>{ 58, 80, 10.0 },
std::tuple<int, int, double>{ 58, 81, 167.0 },
std::tuple<int, int, double>{ 58, 82, -161.0 },
std::tuple<int, int, double>{ 58, 83, 35.0 },
std::tuple<int, int, double>{ 58, 84, 120.0 },
std::tuple<int, int, double>{ 58, 85, 189.0 },
std::tuple<int, int, double>{ 58, 86, 68.0 },
std::tuple<int, int, double>{ 58, 87, 68.0 },
std::tuple<int, int, double>{ 58, 88, 71.0 },
std::tuple<int, int, double>{ 58, 508, -9999.0 },
std::tuple<int, int, double>{ 59, 89, 106.0 },
std::tuple<int, int, double>{ 59, 90, 59.0 },
std::tuple<int, int, double>{ 59, 91, 10.0 },
std::tuple<int, int, double>{ 59, 92, 167.0 },
std::tuple<int, int, double>{ 59, 93, -161.0 },
std::tuple<int, int, double>{ 59, 94, 35.0 },
std::tuple<int, int, double>{ 59, 95, 120.0 },
std::tuple<int, int, double>{ 59, 96, 189.0 },
std::tuple<int, int, double>{ 59, 97, 68.0 },
std::tuple<int, int, double>{ 59, 98, 68.0 },
std::tuple<int, int, double>{ 59, 99, 71.0 },
std::tuple<int, int, double>{ 59, 509, -9999.0 },
std::tuple<int, int, double>{ 60, 100, 59.0 },
std::tuple<int, int, double>{ 60, 101, 10.0 },
std::tuple<int, int, double>{ 60, 102, 167.0 },
std::tuple<int, int, double>{ 60, 103, -161.0 },
std::tuple<int, int, double>{ 60, 104, 35.0 },
std::tuple<int, int, double>{ 60, 105, 120.0 },
std::tuple<int, int, double>{ 60, 106, 189.0 },
std::tuple<int, int, double>{ 60, 107, 68.0 },
std::tuple<int, int, double>{ 60, 108, 71.0 },
std::tuple<int, int, double>{ 60, 510, -9999.0 },
std::tuple<int, int, double>{ 61, 109, 59.0 },
std::tuple<int, int, double>{ 61, 110, 10.0 },
std::tuple<int, int, double>{ 61, 111, 167.0 },
std::tuple<int, int, double>{ 61, 112, -161.0 },
std::tuple<int, int, double>{ 61, 113, 35.0 },
std::tuple<int, int, double>{ 61, 114, 120.0 },
std::tuple<int, int, double>{ 61, 115, 189.0 },
std::tuple<int, int, double>{ 61, 116, 68.0 },
std::tuple<int, int, double>{ 61, 117, 68.0 },
std::tuple<int, int, double>{ 61, 118, 71.0 },
std::tuple<int, int, double>{ 61, 511, -9999.0 },
std::tuple<int, int, double>{ 62, 119, 106.0 },
std::tuple<int, int, double>{ 62, 120, 59.0 },
std::tuple<int, int, double>{ 62, 121, 10.0 },
std::tuple<int, int, double>{ 62, 122, 167.0 },
std::tuple<int, int, double>{ 62, 123, -161.0 },
std::tuple<int, int, double>{ 62, 124, 35.0 },
std::tuple<int, int, double>{ 62, 125, 120.0 },
std::tuple<int, int, double>{ 62, 126, 189.0 },
std::tuple<int, int, double>{ 62, 127, 68.0 },
std::tuple<int, int, double>{ 62, 128, 68.0 },
std::tuple<int, int, double>{ 62, 129, 71.0 },
std::tuple<int, int, double>{ 62, 512, -9999.0 },
std::tuple<int, int, double>{ 63, 130, 106.0 },
std::tuple<int, int, double>{ 63, 131, 59.0 },
std::tuple<int, int, double>{ 63, 132, 10.0 },
std::tuple<int, int, double>{ 63, 133, -45.0 },
std::tuple<int, int, double>{ 63, 134, 120.0 },
std::tuple<int, int, double>{ 63, 135, 189.0 },
std::tuple<int, int, double>{ 63, 136, 68.0 },
std::tuple<int, int, double>{ 63, 137, 68.0 },
std::tuple<int, int, double>{ 63, 138, 71.0 },
std::tuple<int, int, double>{ 63, 513, -9999.0 },
std::tuple<int, int, double>{ 64, 139, 10.0 },
std::tuple<int, int, double>{ 64, 140, -161.0 },
std::tuple<int, int, double>{ 64, 141, 35.0 },
std::tuple<int, int, double>{ 64, 142, 68.0 },
std::tuple<int, int, double>{ 64, 143, 68.0 },
std::tuple<int, int, double>{ 64, 144, 71.0 },
std::tuple<int, int, double>{ 64, 514, -9999.0 },
std::tuple<int, int, double>{ 65, 145, 10.0 },
std::tuple<int, int, double>{ 65, 146, -161.0 },
std::tuple<int, int, double>{ 65, 147, 35.0 },
std::tuple<int, int, double>{ 65, 148, 68.0 },
std::tuple<int, int, double>{ 65, 149, 68.0 },
std::tuple<int, int, double>{ 65, 150, 71.0 },
std::tuple<int, int, double>{ 65, 515, -9999.0 },
std::tuple<int, int, double>{ 66, 151, 136.0 },
std::tuple<int, int, double>{ 66, 152, 10.0 },
std::tuple<int, int, double>{ 66, 153, -161.0 },
std::tuple<int, int, double>{ 66, 154, 35.0 },
std::tuple<int, int, double>{ 66, 155, 68.0 },
std::tuple<int, int, double>{ 66, 156, 68.0 },
std::tuple<int, int, double>{ 66, 157, 71.0 },
std::tuple<int, int, double>{ 66, 516, -9999.0 },
std::tuple<int, int, double>{ 67, 158, 81.0 },
std::tuple<int, int, double>{ 67, 159, 59.0 },
std::tuple<int, int, double>{ 67, 160, 10.0 },
std::tuple<int, int, double>{ 67, 161, 167.0 },
std::tuple<int, int, double>{ 67, 162, -161.0 },
std::tuple<int, int, double>{ 67, 163, 35.0 },
std::tuple<int, int, double>{ 67, 164, 120.0 },
std::tuple<int, int, double>{ 67, 165, 189.0 },
std::tuple<int, int, double>{ 67, 166, 68.0 },
std::tuple<int, int, double>{ 67, 167, 149.0 },
std::tuple<int, int, double>{ 67, 168, 100.0 },
std::tuple<int, int, double>{ 67, 169, 77.0 },
std::tuple<int, int, double>{ 67, 170, 71.0 },
std::tuple<int, int, double>{ 67, 517, -9999.0 },
std::tuple<int, int, double>{ 68, 171, 81.0 },
std::tuple<int, int, double>{ 68, 172, 59.0 },
std::tuple<int, int, double>{ 68, 173, 10.0 },
std::tuple<int, int, double>{ 68, 174, -161.0 },
std::tuple<int, int, double>{ 68, 175, 35.0 },
std::tuple<int, int, double>{ 68, 176, 120.0 },
std::tuple<int, int, double>{ 68, 177, 189.0 },
std::tuple<int, int, double>{ 68, 178, 68.0 },
std::tuple<int, int, double>{ 68, 179, 149.0 },
std::tuple<int, int, double>{ 68, 180, 100.0 },
std::tuple<int, int, double>{ 68, 181, 77.0 },
std::tuple<int, int, double>{ 68, 182, 71.0 },
std::tuple<int, int, double>{ 68, 518, -9999.0 },
std::tuple<int, int, double>{ 69, 183, 81.0 },
std::tuple<int, int, double>{ 69, 184, 59.0 },
std::tuple<int, int, double>{ 69, 185, 10.0 },
std::tuple<int, int, double>{ 69, 186, -161.0 },
std::tuple<int, int, double>{ 69, 187, 35.0 },
std::tuple<int, int, double>{ 69, 188, 120.0 },
std::tuple<int, int, double>{ 69, 189, 189.0 },
std::tuple<int, int, double>{ 69, 190, 68.0 },
std::tuple<int, int, double>{ 69, 191, 149.0 },
std::tuple<int, int, double>{ 69, 192, 100.0 },
std::tuple<int, int, double>{ 69, 193, 77.0 },
std::tuple<int, int, double>{ 69, 194, 71.0 },
std::tuple<int, int, double>{ 69, 519, -9999.0 },
std::tuple<int, int, double>{ 70, 195, -93.0 },
std::tuple<int, int, double>{ 70, 196, -81.0 },
std::tuple<int, int, double>{ 70, 197, -59.0 },
std::tuple<int, int, double>{ 70, 198, -10.0 },
std::tuple<int, int, double>{ 70, 199, -167.0 },
std::tuple<int, int, double>{ 70, 200, 161.0 },
std::tuple<int, int, double>{ 70, 201, -35.0 },
std::tuple<int, int, double>{ 70, 202, -120.0 },
std::tuple<int, int, double>{ 70, 203, -189.0 },
std::tuple<int, int, double>{ 70, 204, -68.0 },
std::tuple<int, int, double>{ 70, 205, -149.0 },
std::tuple<int, int, double>{ 70, 206, -100.0 },
std::tuple<int, int, double>{ 70, 207, -77.0 },
std::tuple<int, int, double>{ 70, 208, -71.0 },
std::tuple<int, int, double>{ 70, 520, -9999.0 },
std::tuple<int, int, double>{ 71, 209, 10.0 },
std::tuple<int, int, double>{ 71, 210, -161.0 },
std::tuple<int, int, double>{ 71, 211, 35.0 },
std::tuple<int, int, double>{ 71, 212, 68.0 },
std::tuple<int, int, double>{ 71, 213, 149.0 },
std::tuple<int, int, double>{ 71, 214, 100.0 },
std::tuple<int, int, double>{ 71, 215, 71.0 },
std::tuple<int, int, double>{ 71, 521, -9999.0 },
std::tuple<int, int, double>{ 72, 216, 81.0 },
std::tuple<int, int, double>{ 72, 217, 59.0 },
std::tuple<int, int, double>{ 72, 218, 10.0 },
std::tuple<int, int, double>{ 72, 219, -161.0 },
std::tuple<int, int, double>{ 72, 220, 35.0 },
std::tuple<int, int, double>{ 72, 221, 120.0 },
std::tuple<int, int, double>{ 72, 222, 189.0 },
std::tuple<int, int, double>{ 72, 223, 68.0 },
std::tuple<int, int, double>{ 72, 224, 149.0 },
std::tuple<int, int, double>{ 72, 225, 100.0 },
std::tuple<int, int, double>{ 72, 226, 77.0 },
std::tuple<int, int, double>{ 72, 227, 71.0 },
std::tuple<int, int, double>{ 72, 522, -9999.0 },
std::tuple<int, int, double>{ 73, 228, 81.0 },
std::tuple<int, int, double>{ 73, 229, 59.0 },
std::tuple<int, int, double>{ 73, 230, 10.0 },
std::tuple<int, int, double>{ 73, 231, -161.0 },
std::tuple<int, int, double>{ 73, 232, 35.0 },
std::tuple<int, int, double>{ 73, 233, 120.0 },
std::tuple<int, int, double>{ 73, 234, 189.0 },
std::tuple<int, int, double>{ 73, 235, 68.0 },
std::tuple<int, int, double>{ 73, 236, 149.0 },
std::tuple<int, int, double>{ 73, 237, 100.0 },
std::tuple<int, int, double>{ 73, 238, 77.0 },
std::tuple<int, int, double>{ 73, 239, 71.0 },
std::tuple<int, int, double>{ 73, 523, -9999.0 },
std::tuple<int, int, double>{ 74, 240, -93.0 },
std::tuple<int, int, double>{ 74, 241, -81.0 },
std::tuple<int, int, double>{ 74, 242, -59.0 },
std::tuple<int, int, double>{ 74, 243, -145.0 },
std::tuple<int, int, double>{ 74, 244, -10.0 },
std::tuple<int, int, double>{ 74, 245, 45.0 },
std::tuple<int, int, double>{ 74, 246, -120.0 },
std::tuple<int, int, double>{ 74, 247, -189.0 },
std::tuple<int, int, double>{ 74, 248, -68.0 },
std::tuple<int, int, double>{ 74, 249, -149.0 },
std::tuple<int, int, double>{ 74, 250, -100.0 },
std::tuple<int, int, double>{ 74, 251, -77.0 },
std::tuple<int, int, double>{ 74, 252, -71.0 },
std::tuple<int, int, double>{ 74, 524, -9999.0 },
std::tuple<int, int, double>{ 75, 253, 59.0 },
std::tuple<int, int, double>{ 75, 254, 145.0 },
std::tuple<int, int, double>{ 75, 255, 10.0 },
std::tuple<int, int, double>{ 75, 256, 167.0 },
std::tuple<int, int, double>{ 75, 257, -161.0 },
std::tuple<int, int, double>{ 75, 258, 35.0 },
std::tuple<int, int, double>{ 75, 259, 120.0 },
std::tuple<int, int, double>{ 75, 260, 189.0 },
std::tuple<int, int, double>{ 75, 261, 68.0 },
std::tuple<int, int, double>{ 75, 262, 189.0 },
std::tuple<int, int, double>{ 75, 263, 104.0 },
std::tuple<int, int, double>{ 75, 264, 110.0 },
std::tuple<int, int, double>{ 75, 265, 71.0 },
std::tuple<int, int, double>{ 75, 525, -9999.0 },
std::tuple<int, int, double>{ 76, 266, 93.0 },
std::tuple<int, int, double>{ 76, 267, 59.0 },
std::tuple<int, int, double>{ 76, 268, 145.0 },
std::tuple<int, int, double>{ 76, 269, 10.0 },
std::tuple<int, int, double>{ 76, 270, 167.0 },
std::tuple<int, int, double>{ 76, 271, -161.0 },
std::tuple<int, int, double>{ 76, 272, 35.0 },
std::tuple<int, int, double>{ 76, 273, 120.0 },
std::tuple<int, int, double>{ 76, 274, 189.0 },
std::tuple<int, int, double>{ 76, 275, 68.0 },
std::tuple<int, int, double>{ 76, 276, 189.0 },
std::tuple<int, int, double>{ 76, 277, 104.0 },
std::tuple<int, int, double>{ 76, 278, 110.0 },
std::tuple<int, int, double>{ 76, 279, 71.0 },
std::tuple<int, int, double>{ 76, 526, -9999.0 },
std::tuple<int, int, double>{ 77, 280, 59.0 },
std::tuple<int, int, double>{ 77, 281, 155.0 },
std::tuple<int, int, double>{ 77, 282, 10.0 },
std::tuple<int, int, double>{ 77, 283, 167.0 },
std::tuple<int, int, double>{ 77, 284, -161.0 },
std::tuple<int, int, double>{ 77, 285, 35.0 },
std::tuple<int, int, double>{ 77, 286, 120.0 },
std::tuple<int, int, double>{ 77, 287, 189.0 },
std::tuple<int, int, double>{ 77, 288, 68.0 },
std::tuple<int, int, double>{ 77, 289, 189.0 },
std::tuple<int, int, double>{ 77, 290, 104.0 },
std::tuple<int, int, double>{ 77, 291, 110.0 },
std::tuple<int, int, double>{ 77, 292, 71.0 },
std::tuple<int, int, double>{ 77, 527, -9999.0 },
std::tuple<int, int, double>{ 78, 293, 93.0 },
std::tuple<int, int, double>{ 78, 294, 59.0 },
std::tuple<int, int, double>{ 78, 295, 145.0 },
std::tuple<int, int, double>{ 78, 296, 10.0 },
std::tuple<int, int, double>{ 78, 297, 167.0 },
std::tuple<int, int, double>{ 78, 298, -161.0 },
std::tuple<int, int, double>{ 78, 299, 35.0 },
std::tuple<int, int, double>{ 78, 300, 120.0 },
std::tuple<int, int, double>{ 78, 301, 189.0 },
std::tuple<int, int, double>{ 78, 302, 68.0 },
std::tuple<int, int, double>{ 78, 303, 189.0 },
std::tuple<int, int, double>{ 78, 304, 104.0 },
std::tuple<int, int, double>{ 78, 305, 110.0 },
std::tuple<int, int, double>{ 78, 306, 71.0 },
std::tuple<int, int, double>{ 78, 528, -9999.0 },
std::tuple<int, int, double>{ 79, 307, 93.0 },
std::tuple<int, int, double>{ 79, 308, 59.0 },
std::tuple<int, int, double>{ 79, 309, 136.0 },
std::tuple<int, int, double>{ 79, 310, 10.0 },
std::tuple<int, int, double>{ 79, 311, 167.0 },
std::tuple<int, int, double>{ 79, 312, -161.0 },
std::tuple<int, int, double>{ 79, 313, 35.0 },
std::tuple<int, int, double>{ 79, 314, 138.0 },
std::tuple<int, int, double>{ 79, 315, 68.0 },
std::tuple<int, int, double>{ 79, 316, 189.0 },
std::tuple<int, int, double>{ 79, 317, 104.0 },
std::tuple<int, int, double>{ 79, 318, 110.0 },
std::tuple<int, int, double>{ 79, 319, 71.0 },
std::tuple<int, int, double>{ 79, 529, -9999.0 },
std::tuple<int, int, double>{ 80, 320, 93.0 },
std::tuple<int, int, double>{ 80, 321, 145.0 },
std::tuple<int, int, double>{ 80, 322, 10.0 },
std::tuple<int, int, double>{ 80, 323, -161.0 },
std::tuple<int, int, double>{ 80, 324, 35.0 },
std::tuple<int, int, double>{ 80, 325, 68.0 },
std::tuple<int, int, double>{ 80, 326, 189.0 },
std::tuple<int, int, double>{ 80, 327, 104.0 },
std::tuple<int, int, double>{ 80, 328, 71.0 },
std::tuple<int, int, double>{ 80, 530, -9999.0 },
std::tuple<int, int, double>{ 81, 329, 93.0 },
std::tuple<int, int, double>{ 81, 330, 145.0 },
std::tuple<int, int, double>{ 81, 331, 10.0 },
std::tuple<int, int, double>{ 81, 332, 35.0 },
std::tuple<int, int, double>{ 81, 333, 68.0 },
std::tuple<int, int, double>{ 81, 334, 189.0 },
std::tuple<int, int, double>{ 81, 335, 104.0 },
std::tuple<int, int, double>{ 81, 336, 71.0 },
std::tuple<int, int, double>{ 81, 531, -9999.0 },
std::tuple<int, int, double>{ 82, 337, 93.0 },
std::tuple<int, int, double>{ 82, 338, 145.0 },
std::tuple<int, int, double>{ 82, 339, 10.0 },
std::tuple<int, int, double>{ 82, 340, 189.0 },
std::tuple<int, int, double>{ 82, 341, 68.0 },
std::tuple<int, int, double>{ 82, 342, 189.0 },
std::tuple<int, int, double>{ 82, 343, 104.0 },
std::tuple<int, int, double>{ 82, 344, 110.0 },
std::tuple<int, int, double>{ 82, 345, 71.0 },
std::tuple<int, int, double>{ 82, 532, -9999.0 },
std::tuple<int, int, double>{ 83, 346, 93.0 },
std::tuple<int, int, double>{ 83, 347, 145.0 },
std::tuple<int, int, double>{ 83, 348, 10.0 },
std::tuple<int, int, double>{ 83, 349, 189.0 },
std::tuple<int, int, double>{ 83, 350, 68.0 },
std::tuple<int, int, double>{ 83, 351, 189.0 },
std::tuple<int, int, double>{ 83, 352, 104.0 },
std::tuple<int, int, double>{ 83, 353, 110.0 },
std::tuple<int, int, double>{ 83, 354, 71.0 },
std::tuple<int, int, double>{ 83, 533, -9999.0 },
std::tuple<int, int, double>{ 84, 355, -93.0 },
std::tuple<int, int, double>{ 84, 356, -136.0 },
std::tuple<int, int, double>{ 84, 357, -10.0 },
std::tuple<int, int, double>{ 84, 358, -167.0 },
std::tuple<int, int, double>{ 84, 359, -138.0 },
std::tuple<int, int, double>{ 84, 360, -68.0 },
std::tuple<int, int, double>{ 84, 361, -189.0 },
std::tuple<int, int, double>{ 84, 362, -104.0 },
std::tuple<int, int, double>{ 84, 363, -110.0 },
std::tuple<int, int, double>{ 84, 364, -71.0 },
std::tuple<int, int, double>{ 84, 534, -9999.0 },
std::tuple<int, int, double>{ 85, 365, 93.0 },
std::tuple<int, int, double>{ 85, 366, 59.0 },
std::tuple<int, int, double>{ 85, 367, 10.0 },
std::tuple<int, int, double>{ 85, 368, 167.0 },
std::tuple<int, int, double>{ 85, 369, -161.0 },
std::tuple<int, int, double>{ 85, 370, 35.0 },
std::tuple<int, int, double>{ 85, 371, 120.0 },
std::tuple<int, int, double>{ 85, 372, 189.0 },
std::tuple<int, int, double>{ 85, 373, 68.0 },
std::tuple<int, int, double>{ 85, 374, 180.0 },
std::tuple<int, int, double>{ 85, 375, 120.0 },
std::tuple<int, int, double>{ 85, 376, 100.0 },
std::tuple<int, int, double>{ 85, 377, 71.0 },
std::tuple<int, int, double>{ 85, 535, -9999.0 },
std::tuple<int, int, double>{ 86, 378, 59.0 },
std::tuple<int, int, double>{ 86, 379, 34.0 },
std::tuple<int, int, double>{ 86, 380, 10.0 },
std::tuple<int, int, double>{ 86, 381, 167.0 },
std::tuple<int, int, double>{ 86, 382, -161.0 },
std::tuple<int, int, double>{ 86, 383, 35.0 },
std::tuple<int, int, double>{ 86, 384, 120.0 },
std::tuple<int, int, double>{ 86, 385, 189.0 },
std::tuple<int, int, double>{ 86, 386, 68.0 },
std::tuple<int, int, double>{ 86, 387, 180.0 },
std::tuple<int, int, double>{ 86, 388, 120.0 },
std::tuple<int, int, double>{ 86, 389, 100.0 },
std::tuple<int, int, double>{ 86, 390, 71.0 },
std::tuple<int, int, double>{ 86, 536, -9999.0 },
std::tuple<int, int, double>{ 87, 391, 59.0 },
std::tuple<int, int, double>{ 87, 392, 10.0 },
std::tuple<int, int, double>{ 87, 393, 167.0 },
std::tuple<int, int, double>{ 87, 394, -161.0 },
std::tuple<int, int, double>{ 87, 395, 35.0 },
std::tuple<int, int, double>{ 87, 396, 120.0 },
std::tuple<int, int, double>{ 87, 397, 189.0 },
std::tuple<int, int, double>{ 87, 398, 68.0 },
std::tuple<int, int, double>{ 87, 399, 180.0 },
std::tuple<int, int, double>{ 87, 400, 120.0 },
std::tuple<int, int, double>{ 87, 401, 100.0 },
std::tuple<int, int, double>{ 87, 402, 71.0 },
std::tuple<int, int, double>{ 87, 537, -9999.0 },
std::tuple<int, int, double>{ 88, 403, 93.0 },
std::tuple<int, int, double>{ 88, 404, 59.0 },
std::tuple<int, int, double>{ 88, 405, 10.0 },
std::tuple<int, int, double>{ 88, 406, 167.0 },
std::tuple<int, int, double>{ 88, 407, -161.0 },
std::tuple<int, int, double>{ 88, 408, 35.0 },
std::tuple<int, int, double>{ 88, 409, 120.0 },
std::tuple<int, int, double>{ 88, 410, 189.0 },
std::tuple<int, int, double>{ 88, 411, 68.0 },
std::tuple<int, int, double>{ 88, 412, 180.0 },
std::tuple<int, int, double>{ 88, 413, 120.0 },
std::tuple<int, int, double>{ 88, 414, 100.0 },
std::tuple<int, int, double>{ 88, 415, 71.0 },
std::tuple<int, int, double>{ 88, 538, -9999.0 },
std::tuple<int, int, double>{ 89, 416, 93.0 },
std::tuple<int, int, double>{ 89, 417, 34.0 },
std::tuple<int, int, double>{ 89, 418, 10.0 },
std::tuple<int, int, double>{ 89, 419, 167.0 },
std::tuple<int, int, double>{ 89, 420, -161.0 },
std::tuple<int, int, double>{ 89, 421, 35.0 },
std::tuple<int, int, double>{ 89, 422, 120.0 },
std::tuple<int, int, double>{ 89, 423, 189.0 },
std::tuple<int, int, double>{ 89, 424, 68.0 },
std::tuple<int, int, double>{ 89, 425, 180.0 },
std::tuple<int, int, double>{ 89, 426, 120.0 },
std::tuple<int, int, double>{ 89, 427, 100.0 },
std::tuple<int, int, double>{ 89, 428, 71.0 },
std::tuple<int, int, double>{ 89, 539, -9999.0 },
std::tuple<int, int, double>{ 90, 429, 10.0 },
std::tuple<int, int, double>{ 90, 430, 35.0 },
std::tuple<int, int, double>{ 90, 431, 68.0 },
std::tuple<int, int, double>{ 90, 432, 180.0 },
std::tuple<int, int, double>{ 90, 433, 120.0 },
std::tuple<int, int, double>{ 90, 434, 71.0 },
std::tuple<int, int, double>{ 90, 540, -9999.0 },
std::tuple<int, int, double>{ 91, 435, 93.0 },
std::tuple<int, int, double>{ 91, 436, 34.0 },
std::tuple<int, int, double>{ 91, 437, 10.0 },
std::tuple<int, int, double>{ 91, 438, -161.0 },
std::tuple<int, int, double>{ 91, 439, 189.0 },
std::tuple<int, int, double>{ 91, 440, 68.0 },
std::tuple<int, int, double>{ 91, 441, 180.0 },
std::tuple<int, int, double>{ 91, 442, 120.0 },
std::tuple<int, int, double>{ 91, 443, 100.0 },
std::tuple<int, int, double>{ 91, 444, 71.0 },
std::tuple<int, int, double>{ 91, 541, -9999.0 },
std::tuple<int, int, double>{ 92, 445, 93.0 },
std::tuple<int, int, double>{ 92, 446, 10.0 },
std::tuple<int, int, double>{ 92, 447, 189.0 },
std::tuple<int, int, double>{ 92, 448, 68.0 },
std::tuple<int, int, double>{ 92, 449, 180.0 },
std::tuple<int, int, double>{ 92, 450, 120.0 },
std::tuple<int, int, double>{ 92, 451, 100.0 },
std::tuple<int, int, double>{ 92, 452, 71.0 },
std::tuple<int, int, double>{ 92, 542, -9999.0 },
std::tuple<int, int, double>{ 93, 453, 93.0 },
std::tuple<int, int, double>{ 93, 454, 10.0 },
std::tuple<int, int, double>{ 93, 455, 189.0 },
std::tuple<int, int, double>{ 93, 456, 68.0 },
std::tuple<int, int, double>{ 93, 457, 192.0 },
std::tuple<int, int, double>{ 93, 458, 120.0 },
std::tuple<int, int, double>{ 93, 459, 100.0 },
std::tuple<int, int, double>{ 93, 460, 71.0 },
std::tuple<int, int, double>{ 93, 543, -9999.0 },
std::tuple<int, int, double>{ 94, 461, 93.0 },
std::tuple<int, int, double>{ 94, 462, 10.0 },
std::tuple<int, int, double>{ 94, 463, 189.0 },
std::tuple<int, int, double>{ 94, 464, 68.0 },
std::tuple<int, int, double>{ 94, 465, 192.0 },
std::tuple<int, int, double>{ 94, 466, 120.0 },
std::tuple<int, int, double>{ 94, 467, 100.0 },
std::tuple<int, int, double>{ 94, 468, 71.0 },
std::tuple<int, int, double>{ 94, 544, -9999.0 },
std::tuple<int, int, double>{ 95, 469, 93.0 },
std::tuple<int, int, double>{ 95, 470, 136.0 },
std::tuple<int, int, double>{ 95, 471, 10.0 },
std::tuple<int, int, double>{ 95, 472, 138.0 },
std::tuple<int, int, double>{ 95, 473, 68.0 },
std::tuple<int, int, double>{ 95, 474, 192.0 },
std::tuple<int, int, double>{ 95, 475, 120.0 },
std::tuple<int, int, double>{ 95, 476, 100.0 },
std::tuple<int, int, double>{ 95, 477, 71.0 },
std::tuple<int, int, double>{ 95, 545, -9999.0 },
std::tuple<int, int, double>{ 96, 478, -93.0 },
std::tuple<int, int, double>{ 96, 479, -10.0 },
std::tuple<int, int, double>{ 96, 480, -189.0 },
std::tuple<int, int, double>{ 96, 481, -68.0 },
std::tuple<int, int, double>{ 96, 482, -192.0 },
std::tuple<int, int, double>{ 96, 483, -120.0 },
std::tuple<int, int, double>{ 96, 484, -100.0 },
std::tuple<int, int, double>{ 96, 485, -71.0 },
std::tuple<int, int, double>{ 96, 546, -9999.0 },
std::tuple<int, int, double>{ 97, 486, 106.0 },
std::tuple<int, int, double>{ 97, 487, 10.0 },
std::tuple<int, int, double>{ 97, 488, 189.0 },
std::tuple<int, int, double>{ 97, 489, 68.0 },
std::tuple<int, int, double>{ 97, 490, 192.0 },
std::tuple<int, int, double>{ 97, 491, 120.0 },
std::tuple<int, int, double>{ 97, 492, 100.0 },
std::tuple<int, int, double>{ 97, 493, 71.0 },
std::tuple<int, int, double>{ 97, 547, -9999.0 },
std::tuple<int, int, double>{ 98, 2, -35.0 },
std::tuple<int, int, double>{ 98, 3, 31.0 },
std::tuple<int, int, double>{ 98, 4, -32.0 },
std::tuple<int, int, double>{ 98, 13, -27.0 },
std::tuple<int, int, double>{ 98, 14, 24.0 },
std::tuple<int, int, double>{ 98, 15, -25.0 },
std::tuple<int, int, double>{ 98, 23, -26.0 },
std::tuple<int, int, double>{ 98, 24, 23.0 },
std::tuple<int, int, double>{ 98, 25, -24.0 },
std::tuple<int, int, double>{ 98, 32, -139.0 },
std::tuple<int, int, double>{ 98, 33, 127.0 },
std::tuple<int, int, double>{ 98, 34, -128.0 },
std::tuple<int, int, double>{ 98, 43, -109.0 },
std::tuple<int, int, double>{ 98, 44, 99.0 },
std::tuple<int, int, double>{ 98, 45, -100.0 },
std::tuple<int, int, double>{ 98, 61, 25.0 },
std::tuple<int, int, double>{ 98, 62, -26.0 },
std::tuple<int, int, double>{ 98, 67, 80.0 },
std::tuple<int, int, double>{ 98, 68, -81.0 },
std::tuple<int, int, double>{ 98, 74, 15.0 },
std::tuple<int, int, double>{ 98, 75, -16.0 },
std::tuple<int, int, double>{ 98, 81, -58.0 },
std::tuple<int, int, double>{ 98, 82, 52.0 },
std::tuple<int, int, double>{ 98, 83, -53.0 },
std::tuple<int, int, double>{ 98, 92, -43.0 },
std::tuple<int, int, double>{ 98, 93, 38.0 },
std::tuple<int, int, double>{ 98, 94, -39.0 },
std::tuple<int, int, double>{ 98, 102, -33.0 },
std::tuple<int, int, double>{ 98, 103, 30.0 },
std::tuple<int, int, double>{ 98, 104, -31.0 },
std::tuple<int, int, double>{ 98, 111, -178.0 },
std::tuple<int, int, double>{ 98, 112, 163.0 },
std::tuple<int, int, double>{ 98, 113, -164.0 },
std::tuple<int, int, double>{ 98, 122, -132.0 },
std::tuple<int, int, double>{ 98, 123, 121.0 },
std::tuple<int, int, double>{ 98, 124, -122.0 },
std::tuple<int, int, double>{ 98, 140, 21.0 },
std::tuple<int, int, double>{ 98, 141, -22.0 },
std::tuple<int, int, double>{ 98, 146, 69.0 },
std::tuple<int, int, double>{ 98, 147, -70.0 },
std::tuple<int, int, double>{ 98, 153, 12.0 },
std::tuple<int, int, double>{ 98, 154, -13.0 },
std::tuple<int, int, double>{ 98, 161, -20.0 },
std::tuple<int, int, double>{ 98, 162, 17.0 },
std::tuple<int, int, double>{ 98, 163, -18.0 },
std::tuple<int, int, double>{ 98, 174, 23.0 },
std::tuple<int, int, double>{ 98, 175, -24.0 },
std::tuple<int, int, double>{ 98, 186, 26.0 },
std::tuple<int, int, double>{ 98, 187, -27.0 },
std::tuple<int, int, double>{ 98, 199, -32.0 },
std::tuple<int, int, double>{ 98, 200, 29.0 },
std::tuple<int, int, double>{ 98, 201, -30.0 },
std::tuple<int, int, double>{ 98, 210, 36.0 },
std::tuple<int, int, double>{ 98, 211, -37.0 },
std::tuple<int, int, double>{ 98, 219, 23.0 },
std::tuple<int, int, double>{ 98, 220, -24.0 },
std::tuple<int, int, double>{ 98, 231, 56.0 },
std::tuple<int, int, double>{ 98, 232, -57.0 },
std::tuple<int, int, double>{ 98, 256, -28.0 },
std::tuple<int, int, double>{ 98, 257, 25.0 },
std::tuple<int, int, double>{ 98, 258, -26.0 },
std::tuple<int, int, double>{ 98, 270, -77.0 },
std::tuple<int, int, double>{ 98, 271, 70.0 },
std::tuple<int, int, double>{ 98, 272, -71.0 },
std::tuple<int, int, double>{ 98, 283, -34.0 },
std::tuple<int, int, double>{ 98, 284, 31.0 },
std::tuple<int, int, double>{ 98, 285, -32.0 },
std::tuple<int, int, double>{ 98, 297, -158.0 },
std::tuple<int, int, double>{ 98, 298, 144.0 },
std::tuple<int, int, double>{ 98, 299, -145.0 },
std::tuple<int, int, double>{ 98, 311, -24.0 },
std::tuple<int, int, double>{ 98, 312, 21.0 },
std::tuple<int, int, double>{ 98, 313, -22.0 },
std::tuple<int, int, double>{ 98, 323, 22.0 },
std::tuple<int, int, double>{ 98, 324, -23.0 },
std::tuple<int, int, double>{ 98, 332, -33.0 },
std::tuple<int, int, double>{ 98, 358, -19.0 },
std::tuple<int, int, double>{ 98, 368, -23.0 },
std::tuple<int, int, double>{ 98, 369, 20.0 },
std::tuple<int, int, double>{ 98, 370, -21.0 },
std::tuple<int, int, double>{ 98, 381, -52.0 },
std::tuple<int, int, double>{ 98, 382, 47.0 },
std::tuple<int, int, double>{ 98, 383, -48.0 },
std::tuple<int, int, double>{ 98, 393, -120.0 },
std::tuple<int, int, double>{ 98, 394, 109.0 },
std::tuple<int, int, double>{ 98, 395, -110.0 },
std::tuple<int, int, double>{ 98, 406, -46.0 },
std::tuple<int, int, double>{ 98, 407, 41.0 },
std::tuple<int, int, double>{ 98, 408, -42.0 },
std::tuple<int, int, double>{ 98, 419, -42.0 },
std::tuple<int, int, double>{ 98, 420, 38.0 },
std::tuple<int, int, double>{ 98, 421, -39.0 },
std::tuple<int, int, double>{ 98, 430, -33.0 },
std::tuple<int, int, double>{ 98, 438, 23.0 },
std::tuple<int, int, double>{ 98, 499, -15.0 },
std::tuple<int, int, double>{ 98, 500, -12.0 },
std::tuple<int, int, double>{ 98, 501, -8.0 },
std::tuple<int, int, double>{ 98, 502, -58.0 },
std::tuple<int, int, double>{ 98, 503, -48.0 },
std::tuple<int, int, double>{ 98, 504, -10.0 },
std::tuple<int, int, double>{ 98, 505, -11.0 },
std::tuple<int, int, double>{ 98, 506, -31.0 },
std::tuple<int, int, double>{ 98, 507, -11.0 },
std::tuple<int, int, double>{ 98, 508, -28.0 },
std::tuple<int, int, double>{ 98, 509, -19.0 },
std::tuple<int, int, double>{ 98, 510, -13.0 },
std::tuple<int, int, double>{ 98, 511, -88.0 },
std::tuple<int, int, double>{ 98, 512, -58.0 },
std::tuple<int, int, double>{ 98, 513, -12.0 },
std::tuple<int, int, double>{ 98, 514, -9.0 },
std::tuple<int, int, double>{ 98, 515, -25.0 },
std::tuple<int, int, double>{ 98, 516, -9.0 },
std::tuple<int, int, double>{ 98, 517, -9.0 },
std::tuple<int, int, double>{ 98, 518, -10.0 },
std::tuple<int, int, double>{ 98, 519, -11.0 },
std::tuple<int, int, double>{ 98, 520, -13.0 },
std::tuple<int, int, double>{ 98, 521, -13.0 },
std::tuple<int, int, double>{ 98, 522, -10.0 },
std::tuple<int, int, double>{ 98, 523, -24.0 },
std::tuple<int, int, double>{ 98, 524, -12.0 },
std::tuple<int, int, double>{ 98, 525, -12.0 },
std::tuple<int, int, double>{ 98, 526, -33.0 },
std::tuple<int, int, double>{ 98, 527, -15.0 },
std::tuple<int, int, double>{ 98, 528, -67.0 },
std::tuple<int, int, double>{ 98, 529, -18.0 },
std::tuple<int, int, double>{ 98, 530, -9.0 },
std::tuple<int, int, double>{ 98, 531, -12.0 },
std::tuple<int, int, double>{ 98, 532, -16.0 },
std::tuple<int, int, double>{ 98, 533, -52.0 },
std::tuple<int, int, double>{ 98, 534, -14.0 },
std::tuple<int, int, double>{ 98, 535, -9.0 },
std::tuple<int, int, double>{ 98, 536, -20.0 },
std::tuple<int, int, double>{ 98, 537, -46.0 },
std::tuple<int, int, double>{ 98, 538, -20.0 },
std::tuple<int, int, double>{ 98, 539, -18.0 },
std::tuple<int, int, double>{ 98, 540, -11.0 },
std::tuple<int, int, double>{ 98, 541, -12.0 },
std::tuple<int, int, double>{ 98, 542, -16.0 },
std::tuple<int, int, double>{ 98, 543, -82.0 },
std::tuple<int, int, double>{ 98, 544, -17.0 },
std::tuple<int, int, double>{ 98, 545, -9.0 },
std::tuple<int, int, double>{ 98, 546, -66.0 },
std::tuple<int, int, double>{ 98, 547, -25.0 },
std::tuple<int, int, double>{ 99, 0, 20.0 },
std::tuple<int, int, double>{ 99, 11, 13.0 },
std::tuple<int, int, double>{ 99, 21, 15.0 },
std::tuple<int, int, double>{ 99, 30, 78.0 },
std::tuple<int, int, double>{ 99, 41, 52.0 },
std::tuple<int, int, double>{ 99, 52, 11.0 },
std::tuple<int, int, double>{ 99, 79, 31.0 },
std::tuple<int, int, double>{ 99, 90, 20.0 },
std::tuple<int, int, double>{ 99, 100, 18.0 },
std::tuple<int, int, double>{ 99, 109, 95.0 },
std::tuple<int, int, double>{ 99, 120, 63.0 },
std::tuple<int, int, double>{ 99, 131, 13.0 },
std::tuple<int, int, double>{ 99, 159, 10.0 },
std::tuple<int, int, double>{ 99, 172, 11.0 },
std::tuple<int, int, double>{ 99, 184, 12.0 },
std::tuple<int, int, double>{ 99, 197, 14.0 },
std::tuple<int, int, double>{ 99, 217, 11.0 },
std::tuple<int, int, double>{ 99, 229, 26.0 },
std::tuple<int, int, double>{ 99, 242, 13.0 },
std::tuple<int, int, double>{ 99, 253, 13.0 },
std::tuple<int, int, double>{ 99, 267, 36.0 },
std::tuple<int, int, double>{ 99, 280, 17.0 },
std::tuple<int, int, double>{ 99, 294, 73.0 },
std::tuple<int, int, double>{ 99, 308, 20.0 },
std::tuple<int, int, double>{ 99, 366, 10.0 },
std::tuple<int, int, double>{ 99, 378, 27.0 },
std::tuple<int, int, double>{ 99, 391, 50.0 },
std::tuple<int, int, double>{ 99, 404, 22.0 },
std::tuple<int, int, double>{ 100, 2, 20.0 },
std::tuple<int, int, double>{ 100, 13, 13.0 },
std::tuple<int, int, double>{ 100, 23, 15.0 },
std::tuple<int, int, double>{ 100, 32, 78.0 },
std::tuple<int, int, double>{ 100, 43, 52.0 },
std::tuple<int, int, double>{ 100, 81, 31.0 },
std::tuple<int, int, double>{ 100, 92, 20.0 },
std::tuple<int, int, double>{ 100, 102, 18.0 },
std::tuple<int, int, double>{ 100, 111, 95.0 },
std::tuple<int, int, double>{ 100, 122, 63.0 },
std::tuple<int, int, double>{ 100, 161, 10.0 },
std::tuple<int, int, double>{ 100, 199, 14.0 },
std::tuple<int, int, double>{ 100, 256, 13.0 },
std::tuple<int, int, double>{ 100, 270, 36.0 },
std::tuple<int, int, double>{ 100, 283, 17.0 },
std::tuple<int, int, double>{ 100, 297, 73.0 },
std::tuple<int, int, double>{ 100, 311, 20.0 },
std::tuple<int, int, double>{ 100, 358, 16.0 },
std::tuple<int, int, double>{ 100, 368, 10.0 },
std::tuple<int, int, double>{ 100, 381, 27.0 },
std::tuple<int, int, double>{ 100, 393, 50.0 },
std::tuple<int, int, double>{ 100, 406, 22.0 },
std::tuple<int, int, double>{ 100, 419, 19.0 },
std::tuple<int, int, double>{ 101, 3, -19.0 },
std::tuple<int, int, double>{ 101, 14, -12.0 },
std::tuple<int, int, double>{ 101, 24, -14.0 },
std::tuple<int, int, double>{ 101, 33, -77.0 },
std::tuple<int, int, double>{ 101, 44, -51.0 },
std::tuple<int, int, double>{ 101, 61, -11.0 },
std::tuple<int, int, double>{ 101, 67, -33.0 },
std::tuple<int, int, double>{ 101, 74, -11.0 },
std::tuple<int, int, double>{ 101, 82, -30.0 },
std::tuple<int, int, double>{ 101, 93, -19.0 },
std::tuple<int, int, double>{ 101, 103, -17.0 },
std::tuple<int, int, double>{ 101, 112, -94.0 },
std::tuple<int, int, double>{ 101, 123, -62.0 },
std::tuple<int, int, double>{ 101, 140, -9.0 },
std::tuple<int, int, double>{ 101, 146, -27.0 },
std::tuple<int, int, double>{ 101, 153, -9.0 },
std::tuple<int, int, double>{ 101, 162, -9.0 },
std::tuple<int, int, double>{ 101, 174, -10.0 },
std::tuple<int, int, double>{ 101, 186, -11.0 },
std::tuple<int, int, double>{ 101, 200, -13.0 },
std::tuple<int, int, double>{ 101, 210, -14.0 },
std::tuple<int, int, double>{ 101, 219, -10.0 },
std::tuple<int, int, double>{ 101, 231, -25.0 },
std::tuple<int, int, double>{ 101, 257, -12.0 },
std::tuple<int, int, double>{ 101, 271, -35.0 },
std::tuple<int, int, double>{ 101, 284, -16.0 },
std::tuple<int, int, double>{ 101, 298, -72.0 },
std::tuple<int, int, double>{ 101, 312, -19.0 },
std::tuple<int, int, double>{ 101, 323, -9.0 },
std::tuple<int, int, double>{ 101, 369, -9.0 },
std::tuple<int, int, double>{ 101, 382, -26.0 },
std::tuple<int, int, double>{ 101, 394, -49.0 },
std::tuple<int, int, double>{ 101, 407, -21.0 },
std::tuple<int, int, double>{ 101, 420, -18.0 },
std::tuple<int, int, double>{ 101, 438, -12.0 },
std::tuple<int, int, double>{ 102, 4, 20.0 },
std::tuple<int, int, double>{ 102, 15, 13.0 },
std::tuple<int, int, double>{ 102, 25, 15.0 },
std::tuple<int, int, double>{ 102, 34, 78.0 },
std::tuple<int, int, double>{ 102, 45, 52.0 },
std::tuple<int, int, double>{ 102, 62, 12.0 },
std::tuple<int, int, double>{ 102, 68, 34.0 },
std::tuple<int, int, double>{ 102, 75, 12.0 },
std::tuple<int, int, double>{ 102, 83, 31.0 },
std::tuple<int, int, double>{ 102, 94, 20.0 },
std::tuple<int, int, double>{ 102, 104, 18.0 },
std::tuple<int, int, double>{ 102, 113, 95.0 },
std::tuple<int, int, double>{ 102, 124, 63.0 },
std::tuple<int, int, double>{ 102, 141, 10.0 },
std::tuple<int, int, double>{ 102, 147, 28.0 },
std::tuple<int, int, double>{ 102, 154, 10.0 },
std::tuple<int, int, double>{ 102, 163, 10.0 },
std::tuple<int, int, double>{ 102, 175, 11.0 },
std::tuple<int, int, double>{ 102, 187, 12.0 },
std::tuple<int, int, double>{ 102, 201, 14.0 },
std::tuple<int, int, double>{ 102, 211, 15.0 },
std::tuple<int, int, double>{ 102, 220, 11.0 },
std::tuple<int, int, double>{ 102, 232, 26.0 },
std::tuple<int, int, double>{ 102, 258, 13.0 },
std::tuple<int, int, double>{ 102, 272, 36.0 },
std::tuple<int, int, double>{ 102, 285, 17.0 },
std::tuple<int, int, double>{ 102, 299, 73.0 },
std::tuple<int, int, double>{ 102, 313, 20.0 },
std::tuple<int, int, double>{ 102, 324, 10.0 },
std::tuple<int, int, double>{ 102, 332, 13.0 },
std::tuple<int, int, double>{ 102, 370, 10.0 },
std::tuple<int, int, double>{ 102, 383, 27.0 },
std::tuple<int, int, double>{ 102, 395, 50.0 },
std::tuple<int, int, double>{ 102, 408, 22.0 },
std::tuple<int, int, double>{ 102, 421, 19.0 },
std::tuple<int, int, double>{ 102, 430, 12.0 },
std::tuple<int, int, double>{ 103, 8, 20.0 },
std::tuple<int, int, double>{ 103, 19, 13.0 },
std::tuple<int, int, double>{ 103, 38, 78.0 },
std::tuple<int, int, double>{ 103, 49, 52.0 },
std::tuple<int, int, double>{ 103, 58, 11.0 },
std::tuple<int, int, double>{ 103, 64, 12.0 },
std::tuple<int, int, double>{ 103, 70, 34.0 },
std::tuple<int, int, double>{ 103, 77, 12.0 },
std::tuple<int, int, double>{ 103, 87, 31.0 },
std::tuple<int, int, double>{ 103, 98, 20.0 },
std::tuple<int, int, double>{ 103, 117, 95.0 },
std::tuple<int, int, double>{ 103, 128, 63.0 },
std::tuple<int, int, double>{ 103, 137, 13.0 },
std::tuple<int, int, double>{ 103, 143, 10.0 },
std::tuple<int, int, double>{ 103, 149, 28.0 },
std::tuple<int, int, double>{ 103, 156, 10.0 },
std::tuple<int, int, double>{ 104, 9, 20.0 },
std::tuple<int, int, double>{ 104, 20, 13.0 },
std::tuple<int, int, double>{ 104, 29, 15.0 },
std::tuple<int, int, double>{ 104, 39, 78.0 },
std::tuple<int, int, double>{ 104, 50, 52.0 },
std::tuple<int, int, double>{ 104, 59, 11.0 },
std::tuple<int, int, double>{ 104, 65, 12.0 },
std::tuple<int, int, double>{ 104, 71, 34.0 },
std::tuple<int, int, double>{ 104, 78, 12.0 },
std::tuple<int, int, double>{ 104, 88, 31.0 },
std::tuple<int, int, double>{ 104, 99, 20.0 },
std::tuple<int, int, double>{ 104, 108, 18.0 },
std::tuple<int, int, double>{ 104, 118, 95.0 },
std::tuple<int, int, double>{ 104, 129, 63.0 },
std::tuple<int, int, double>{ 104, 138, 13.0 },
std::tuple<int, int, double>{ 104, 144, 10.0 },
std::tuple<int, int, double>{ 104, 150, 28.0 },
std::tuple<int, int, double>{ 104, 157, 10.0 },
std::tuple<int, int, double>{ 104, 170, 10.0 },
std::tuple<int, int, double>{ 104, 182, 11.0 },
std::tuple<int, int, double>{ 104, 194, 12.0 },
std::tuple<int, int, double>{ 104, 208, 14.0 },
std::tuple<int, int, double>{ 104, 215, 15.0 },
std::tuple<int, int, double>{ 104, 227, 11.0 },
std::tuple<int, int, double>{ 104, 239, 26.0 },
std::tuple<int, int, double>{ 104, 252, 13.0 },
std::tuple<int, int, double>{ 104, 265, 13.0 },
std::tuple<int, int, double>{ 104, 279, 36.0 },
std::tuple<int, int, double>{ 104, 292, 17.0 },
std::tuple<int, int, double>{ 104, 306, 73.0 },
std::tuple<int, int, double>{ 104, 319, 20.0 },
std::tuple<int, int, double>{ 104, 328, 10.0 },
std::tuple<int, int, double>{ 104, 336, 13.0 },
std::tuple<int, int, double>{ 104, 345, 17.0 },
std::tuple<int, int, double>{ 104, 354, 56.0 },
std::tuple<int, int, double>{ 104, 364, 16.0 },
std::tuple<int, int, double>{ 104, 377, 10.0 },
std::tuple<int, int, double>{ 104, 390, 27.0 },
std::tuple<int, int, double>{ 104, 402, 50.0 },
std::tuple<int, int, double>{ 104, 415, 22.0 },
std::tuple<int, int, double>{ 104, 428, 19.0 },
std::tuple<int, int, double>{ 104, 434, 12.0 },
std::tuple<int, int, double>{ 104, 444, 13.0 },
std::tuple<int, int, double>{ 104, 452, 17.0 },
std::tuple<int, int, double>{ 104, 460, 89.0 },
std::tuple<int, int, double>{ 104, 468, 18.0 },
std::tuple<int, int, double>{ 104, 477, 10.0 },
std::tuple<int, int, double>{ 104, 485, 71.0 },
std::tuple<int, int, double>{ 104, 493, 27.0 },
std::tuple<int, int, double>{ 105, 54, -10.0 },
std::tuple<int, int, double>{ 105, 133, -12.0 },
std::tuple<int, int, double>{ 105, 245, -12.0 },
std::tuple<int, int, double>{ 106, 54, 11.0 },
std::tuple<int, int, double>{ 106, 133, 13.0 },
std::tuple<int, int, double>{ 106, 245, 13.0 },
std::tuple<int, int, double>{ 107, 2, 1.0 },
std::tuple<int, int, double>{ 107, 3, -1.0 },
std::tuple<int, int, double>{ 107, 4, 1.0 },
std::tuple<int, int, double>{ 108, 5, 1.0 },
std::tuple<int, int, double>{ 108, 6, 1.0 },
std::tuple<int, int, double>{ 109, 13, 1.0 },
std::tuple<int, int, double>{ 109, 14, -1.0 },
std::tuple<int, int, double>{ 109, 15, 1.0 },
std::tuple<int, int, double>{ 110, 16, 1.0 },
std::tuple<int, int, double>{ 110, 17, 1.0 },
std::tuple<int, int, double>{ 111, 23, 1.0 },
std::tuple<int, int, double>{ 111, 24, -1.0 },
std::tuple<int, int, double>{ 111, 25, 1.0 },
std::tuple<int, int, double>{ 112, 26, 1.0 },
std::tuple<int, int, double>{ 112, 27, 1.0 },
std::tuple<int, int, double>{ 113, 32, 1.0 },
std::tuple<int, int, double>{ 113, 33, -1.0 },
std::tuple<int, int, double>{ 113, 34, 1.0 },
std::tuple<int, int, double>{ 114, 35, 1.0 },
std::tuple<int, int, double>{ 114, 36, 1.0 },
std::tuple<int, int, double>{ 115, 43, 1.0 },
std::tuple<int, int, double>{ 115, 44, -1.0 },
std::tuple<int, int, double>{ 115, 45, 1.0 },
std::tuple<int, int, double>{ 116, 46, 1.0 },
std::tuple<int, int, double>{ 116, 47, 1.0 },
std::tuple<int, int, double>{ 117, 55, 1.0 },
std::tuple<int, int, double>{ 117, 56, 1.0 },
std::tuple<int, int, double>{ 118, 61, -1.0 },
std::tuple<int, int, double>{ 118, 62, 1.0 },
std::tuple<int, int, double>{ 119, 67, -1.0 },
std::tuple<int, int, double>{ 119, 68, 1.0 },
std::tuple<int, int, double>{ 120, 74, -1.0 },
std::tuple<int, int, double>{ 120, 75, 1.0 },
std::tuple<int, int, double>{ 121, 81, 1.0 },
std::tuple<int, int, double>{ 121, 82, -1.0 },
std::tuple<int, int, double>{ 121, 83, 1.0 },
std::tuple<int, int, double>{ 122, 84, 1.0 },
std::tuple<int, int, double>{ 122, 85, 1.0 },
std::tuple<int, int, double>{ 123, 92, 1.0 },
std::tuple<int, int, double>{ 123, 93, -1.0 },
std::tuple<int, int, double>{ 123, 94, 1.0 },
std::tuple<int, int, double>{ 124, 95, 1.0 },
std::tuple<int, int, double>{ 124, 96, 1.0 },
std::tuple<int, int, double>{ 125, 102, 1.0 },
std::tuple<int, int, double>{ 125, 103, -1.0 },
std::tuple<int, int, double>{ 125, 104, 1.0 },
std::tuple<int, int, double>{ 126, 105, 1.0 },
std::tuple<int, int, double>{ 126, 106, 1.0 },
std::tuple<int, int, double>{ 127, 111, 1.0 },
std::tuple<int, int, double>{ 127, 112, -1.0 },
std::tuple<int, int, double>{ 127, 113, 1.0 },
std::tuple<int, int, double>{ 128, 114, 1.0 },
std::tuple<int, int, double>{ 128, 115, 1.0 },
std::tuple<int, int, double>{ 129, 122, 1.0 },
std::tuple<int, int, double>{ 129, 123, -1.0 },
std::tuple<int, int, double>{ 129, 124, 1.0 },
std::tuple<int, int, double>{ 130, 125, 1.0 },
std::tuple<int, int, double>{ 130, 126, 1.0 },
std::tuple<int, int, double>{ 131, 134, 1.0 },
std::tuple<int, int, double>{ 131, 135, 1.0 },
std::tuple<int, int, double>{ 132, 140, -1.0 },
std::tuple<int, int, double>{ 132, 141, 1.0 },
std::tuple<int, int, double>{ 133, 146, -1.0 },
std::tuple<int, int, double>{ 133, 147, 1.0 },
std::tuple<int, int, double>{ 134, 153, -1.0 },
std::tuple<int, int, double>{ 134, 154, 1.0 },
std::tuple<int, int, double>{ 135, 161, 1.0 },
std::tuple<int, int, double>{ 135, 162, -1.0 },
std::tuple<int, int, double>{ 135, 163, 1.0 },
std::tuple<int, int, double>{ 136, 164, 1.0 },
std::tuple<int, int, double>{ 136, 165, 1.0 },
std::tuple<int, int, double>{ 137, 174, -1.0 },
std::tuple<int, int, double>{ 137, 175, 1.0 },
std::tuple<int, int, double>{ 138, 176, 1.0 },
std::tuple<int, int, double>{ 138, 177, 1.0 },
std::tuple<int, int, double>{ 139, 186, -1.0 },
std::tuple<int, int, double>{ 139, 187, 1.0 },
std::tuple<int, int, double>{ 140, 188, 1.0 },
std::tuple<int, int, double>{ 140, 189, 1.0 },
std::tuple<int, int, double>{ 141, 199, 1.0 },
std::tuple<int, int, double>{ 141, 200, -1.0 },
std::tuple<int, int, double>{ 141, 201, 1.0 },
std::tuple<int, int, double>{ 142, 202, 1.0 },
std::tuple<int, int, double>{ 142, 203, 1.0 },
std::tuple<int, int, double>{ 143, 210, -1.0 },
std::tuple<int, int, double>{ 143, 211, 1.0 },
std::tuple<int, int, double>{ 144, 219, -1.0 },
std::tuple<int, int, double>{ 144, 220, 1.0 },
std::tuple<int, int, double>{ 145, 221, 1.0 },
std::tuple<int, int, double>{ 145, 222, 1.0 },
std::tuple<int, int, double>{ 146, 231, -1.0 },
std::tuple<int, int, double>{ 146, 232, 1.0 },
std::tuple<int, int, double>{ 147, 233, 1.0 },
std::tuple<int, int, double>{ 147, 234, 1.0 },
std::tuple<int, int, double>{ 148, 246, 1.0 },
std::tuple<int, int, double>{ 148, 247, 1.0 },
std::tuple<int, int, double>{ 149, 256, 1.0 },
std::tuple<int, int, double>{ 149, 257, -1.0 },
std::tuple<int, int, double>{ 149, 258, 1.0 },
std::tuple<int, int, double>{ 150, 259, 1.0 },
std::tuple<int, int, double>{ 150, 260, 1.0 },
std::tuple<int, int, double>{ 151, 270, 1.0 },
std::tuple<int, int, double>{ 151, 271, -1.0 },
std::tuple<int, int, double>{ 151, 272, 1.0 },
std::tuple<int, int, double>{ 152, 273, 1.0 },
std::tuple<int, int, double>{ 152, 274, 1.0 },
std::tuple<int, int, double>{ 153, 283, 1.0 },
std::tuple<int, int, double>{ 153, 284, -1.0 },
std::tuple<int, int, double>{ 153, 285, 1.0 },
std::tuple<int, int, double>{ 154, 286, 1.0 },
std::tuple<int, int, double>{ 154, 287, 1.0 },
std::tuple<int, int, double>{ 155, 297, 1.0 },
std::tuple<int, int, double>{ 155, 298, -1.0 },
std::tuple<int, int, double>{ 155, 299, 1.0 },
std::tuple<int, int, double>{ 156, 300, 1.0 },
std::tuple<int, int, double>{ 156, 301, 1.0 },
std::tuple<int, int, double>{ 157, 311, 1.0 },
std::tuple<int, int, double>{ 157, 312, -1.0 },
std::tuple<int, int, double>{ 157, 313, 1.0 },
std::tuple<int, int, double>{ 158, 323, -1.0 },
std::tuple<int, int, double>{ 158, 324, 1.0 },
std::tuple<int, int, double>{ 159, 332, 1.0 },
std::tuple<int, int, double>{ 160, 368, 1.0 },
std::tuple<int, int, double>{ 160, 369, -1.0 },
std::tuple<int, int, double>{ 160, 370, 1.0 },
std::tuple<int, int, double>{ 161, 371, 1.0 },
std::tuple<int, int, double>{ 161, 372, 1.0 },
std::tuple<int, int, double>{ 162, 381, 1.0 },
std::tuple<int, int, double>{ 162, 382, -1.0 },
std::tuple<int, int, double>{ 162, 383, 1.0 },
std::tuple<int, int, double>{ 163, 384, 1.0 },
std::tuple<int, int, double>{ 163, 385, 1.0 },
std::tuple<int, int, double>{ 164, 393, 1.0 },
std::tuple<int, int, double>{ 164, 394, -1.0 },
std::tuple<int, int, double>{ 164, 395, 1.0 },
std::tuple<int, int, double>{ 165, 396, 1.0 },
std::tuple<int, int, double>{ 165, 397, 1.0 },
std::tuple<int, int, double>{ 166, 406, 1.0 },
std::tuple<int, int, double>{ 166, 407, -1.0 },
std::tuple<int, int, double>{ 166, 408, 1.0 },
std::tuple<int, int, double>{ 167, 409, 1.0 },
std::tuple<int, int, double>{ 167, 410, 1.0 },
std::tuple<int, int, double>{ 168, 419, 1.0 },
std::tuple<int, int, double>{ 168, 420, -1.0 },
std::tuple<int, int, double>{ 168, 421, 1.0 },
std::tuple<int, int, double>{ 169, 422, 1.0 },
std::tuple<int, int, double>{ 169, 423, 1.0 },
std::tuple<int, int, double>{ 170, 430, 1.0 },
std::tuple<int, int, double>{ 171, 1, 1.0 },
std::tuple<int, int, double>{ 171, 12, 1.0 },
std::tuple<int, int, double>{ 171, 22, 1.0 },
std::tuple<int, int, double>{ 171, 31, 1.0 },
std::tuple<int, int, double>{ 171, 42, 1.0 },
std::tuple<int, int, double>{ 171, 53, 1.0 },
std::tuple<int, int, double>{ 171, 60, 1.0 },
std::tuple<int, int, double>{ 171, 66, 1.0 },
std::tuple<int, int, double>{ 171, 73, 1.0 },
std::tuple<int, int, double>{ 171, 80, 1.0 },
std::tuple<int, int, double>{ 171, 91, 1.0 },
std::tuple<int, int, double>{ 171, 101, 1.0 },
std::tuple<int, int, double>{ 171, 110, 1.0 },
std::tuple<int, int, double>{ 171, 121, 1.0 },
std::tuple<int, int, double>{ 171, 132, 1.0 },
std::tuple<int, int, double>{ 171, 139, 1.0 },
std::tuple<int, int, double>{ 171, 145, 1.0 },
std::tuple<int, int, double>{ 171, 152, 1.0 },
std::tuple<int, int, double>{ 171, 160, 1.0 },
std::tuple<int, int, double>{ 171, 173, 1.0 },
std::tuple<int, int, double>{ 171, 185, 1.0 },
std::tuple<int, int, double>{ 171, 198, 1.0 },
std::tuple<int, int, double>{ 171, 209, 1.0 },
std::tuple<int, int, double>{ 171, 218, 1.0 },
std::tuple<int, int, double>{ 171, 230, 1.0 },
std::tuple<int, int, double>{ 171, 244, 1.0 },
std::tuple<int, int, double>{ 171, 255, 1.0 },
std::tuple<int, int, double>{ 171, 269, 1.0 },
std::tuple<int, int, double>{ 171, 282, 1.0 },
std::tuple<int, int, double>{ 171, 296, 1.0 },
std::tuple<int, int, double>{ 171, 310, 1.0 },
std::tuple<int, int, double>{ 171, 322, 1.0 },
std::tuple<int, int, double>{ 171, 331, 1.0 },
std::tuple<int, int, double>{ 171, 339, 1.0 },
std::tuple<int, int, double>{ 171, 348, 1.0 },
std::tuple<int, int, double>{ 171, 357, 1.0 },
std::tuple<int, int, double>{ 171, 367, 1.0 },
std::tuple<int, int, double>{ 171, 380, 1.0 },
std::tuple<int, int, double>{ 171, 392, 1.0 },
std::tuple<int, int, double>{ 171, 405, 1.0 },
std::tuple<int, int, double>{ 171, 418, 1.0 },
std::tuple<int, int, double>{ 171, 429, 1.0 },
std::tuple<int, int, double>{ 171, 437, 1.0 },
std::tuple<int, int, double>{ 171, 446, 1.0 },
std::tuple<int, int, double>{ 171, 454, 1.0 },
std::tuple<int, int, double>{ 171, 462, 1.0 },
std::tuple<int, int, double>{ 171, 471, 1.0 },
std::tuple<int, int, double>{ 171, 479, 1.0 },
std::tuple<int, int, double>{ 171, 487, 1.0 },
std::tuple<int, int, double>{ 171, 494, -49.0 },
std::tuple<int, int, double>{ 172, 7, 1.0 },
std::tuple<int, int, double>{ 172, 18, 1.0 },
std::tuple<int, int, double>{ 172, 28, 1.0 },
std::tuple<int, int, double>{ 172, 37, 1.0 },
std::tuple<int, int, double>{ 172, 48, 1.0 },
std::tuple<int, int, double>{ 172, 57, 1.0 },
std::tuple<int, int, double>{ 172, 63, 1.0 },
std::tuple<int, int, double>{ 172, 69, 1.0 },
std::tuple<int, int, double>{ 172, 76, 1.0 },
std::tuple<int, int, double>{ 172, 86, 1.0 },
std::tuple<int, int, double>{ 172, 97, 1.0 },
std::tuple<int, int, double>{ 172, 107, 1.0 },
std::tuple<int, int, double>{ 172, 116, 1.0 },
std::tuple<int, int, double>{ 172, 127, 1.0 },
std::tuple<int, int, double>{ 172, 136, 1.0 },
std::tuple<int, int, double>{ 172, 142, 1.0 },
std::tuple<int, int, double>{ 172, 148, 1.0 },
std::tuple<int, int, double>{ 172, 155, 1.0 },
std::tuple<int, int, double>{ 172, 166, 1.0 },
std::tuple<int, int, double>{ 172, 178, 1.0 },
std::tuple<int, int, double>{ 172, 190, 1.0 },
std::tuple<int, int, double>{ 172, 204, 1.0 },
std::tuple<int, int, double>{ 172, 212, 1.0 },
std::tuple<int, int, double>{ 172, 223, 1.0 },
std::tuple<int, int, double>{ 172, 235, 1.0 },
std::tuple<int, int, double>{ 172, 248, 1.0 },
std::tuple<int, int, double>{ 172, 261, 1.0 },
std::tuple<int, int, double>{ 172, 275, 1.0 },
std::tuple<int, int, double>{ 172, 288, 1.0 },
std::tuple<int, int, double>{ 172, 302, 1.0 },
std::tuple<int, int, double>{ 172, 315, 1.0 },
std::tuple<int, int, double>{ 172, 325, 1.0 },
std::tuple<int, int, double>{ 172, 333, 1.0 },
std::tuple<int, int, double>{ 172, 341, 1.0 },
std::tuple<int, int, double>{ 172, 350, 1.0 },
std::tuple<int, int, double>{ 172, 360, 1.0 },
std::tuple<int, int, double>{ 172, 373, 1.0 },
std::tuple<int, int, double>{ 172, 386, 1.0 },
std::tuple<int, int, double>{ 172, 398, 1.0 },
std::tuple<int, int, double>{ 172, 411, 1.0 },
std::tuple<int, int, double>{ 172, 424, 1.0 },
std::tuple<int, int, double>{ 172, 431, 1.0 },
std::tuple<int, int, double>{ 172, 440, 1.0 },
std::tuple<int, int, double>{ 172, 448, 1.0 },
std::tuple<int, int, double>{ 172, 456, 1.0 },
std::tuple<int, int, double>{ 172, 464, 1.0 },
std::tuple<int, int, double>{ 172, 473, 1.0 },
std::tuple<int, int, double>{ 172, 481, 1.0 },
std::tuple<int, int, double>{ 172, 489, 1.0 },
std::tuple<int, int, double>{ 172, 495, -49.0 },
std::tuple<int, int, double>{ 173, 10, 1.0 },
std::tuple<int, int, double>{ 173, 40, 1.0 },
std::tuple<int, int, double>{ 173, 51, 1.0 },
std::tuple<int, int, double>{ 173, 89, 1.0 },
std::tuple<int, int, double>{ 173, 119, 1.0 },
std::tuple<int, int, double>{ 173, 130, 1.0 },
std::tuple<int, int, double>{ 173, 195, 1.0 },
std::tuple<int, int, double>{ 173, 240, 1.0 },
std::tuple<int, int, double>{ 173, 266, 1.0 },
std::tuple<int, int, double>{ 173, 293, 1.0 },
std::tuple<int, int, double>{ 173, 307, 1.0 },
std::tuple<int, int, double>{ 173, 320, 1.0 },
std::tuple<int, int, double>{ 173, 329, 1.0 },
std::tuple<int, int, double>{ 173, 337, 1.0 },
std::tuple<int, int, double>{ 173, 346, 1.0 },
std::tuple<int, int, double>{ 173, 355, 1.0 },
std::tuple<int, int, double>{ 173, 365, 1.0 },
std::tuple<int, int, double>{ 173, 403, 1.0 },
std::tuple<int, int, double>{ 173, 416, 1.0 },
std::tuple<int, int, double>{ 173, 435, 1.0 },
std::tuple<int, int, double>{ 173, 445, 1.0 },
std::tuple<int, int, double>{ 173, 453, 1.0 },
std::tuple<int, int, double>{ 173, 461, 1.0 },
std::tuple<int, int, double>{ 173, 469, 1.0 },
std::tuple<int, int, double>{ 173, 478, 1.0 },
std::tuple<int, int, double>{ 173, 486, 1.0 },
std::tuple<int, int, double>{ 173, 496, -26.0 },
std::tuple<int, int, double>{ 174, 72, 1.0 },
std::tuple<int, int, double>{ 174, 151, 1.0 },
std::tuple<int, int, double>{ 174, 309, 1.0 },
std::tuple<int, int, double>{ 174, 356, 1.0 },
std::tuple<int, int, double>{ 174, 470, 1.0 },
std::tuple<int, int, double>{ 174, 497, -5.0 },
std::tuple<int, int, double>{ 175, 158, 1.0 },
std::tuple<int, int, double>{ 175, 171, 1.0 },
std::tuple<int, int, double>{ 175, 183, 1.0 },
std::tuple<int, int, double>{ 175, 196, 1.0 },
std::tuple<int, int, double>{ 175, 216, 1.0 },
std::tuple<int, int, double>{ 175, 228, 1.0 },
std::tuple<int, int, double>{ 175, 241, 1.0 },
std::tuple<int, int, double>{ 175, 498, -7.0 },
};
Vec<std::string> rnames{
"R1002", "R1003", "R1004", "R1005", "R1006", "R1007", "R1008", "R1009",
"R1010", "R1011", "R1012", "R1013", "R1014", "R1015", "R1016", "R1017",
"R1018", "R1019", "R1020", "R1021", "R1022", "R1023", "R1024", "R1025",
"R1026", "R1027", "R1028", "R1029", "R1030", "R1031", "R1032", "R1033",
"R1034", "R1035", "R1036", "R1037", "R1038", "R1039", "R1040", "R1041",
"R1042", "R1043", "R1044", "R1045", "R1046", "R1047", "R1048", "R1049",
"R1050", "R1051", "R1052", "R1053", "R1054", "R1055", "R1056", "R1057",
"R1058", "R1059", "R1060", "R1061", "R1062", "R1063", "R1064", "R1065",
"R1066", "R1067", "R1068", "R1069", "R1070", "R1071", "R1072", "R1073",
"R1074", "R1075", "R1076", "R1077", "R1078", "R1079", "R1080", "R1081",
"R1082", "R1083", "R1084", "R1085", "R1086", "R1087", "R1088", "R1089",
"R1090", "R1091", "R1092", "R1093", "R1094", "R1095", "R1096", "R1097",
"R1098", "R1099", "R1100", "R1101", "R1102", "R1103", "R1104", "R1105",
"R1106", "R1107", "R1108", "R1109", "R1110", "R1111", "R1112", "R1113",
"R1114", "R1115", "R1116", "R1117", "R1118", "R1119", "R1120", "R1121",
"R1122", "R1123", "R1124", "R1125", "R1126", "R1127", "R1128", "R1129",
"R1130", "R1131", "R1132", "R1133", "R1134", "R1135", "R1136", "R1137",
"R1138", "R1139", "R1140", "R1141", "R1142", "R1143", "R1144", "R1145",
"R1146", "R1147", "R1148", "R1149", "R1150", "R1151", "R1152", "R1153",
"R1154", "R1155", "R1156", "R1157", "R1158", "R1159", "R1160", "R1161",
"R1162", "R1163", "R1164", "R1165", "R1166", "R1167", "R1168", "R1169",
"R1170", "R1171", "R1172", "R1173", "R1174", "R1175", "R1176", "R1177",
};
Vec<std::string> cnames{
"C1001", "C1002", "C1003", "C1004", "C1005", "C1006", "C1007", "C1008",
"C1009", "C1010", "C1011", "C1012", "C1013", "C1014", "C1015", "C1016",
"C1017", "C1018", "C1019", "C1020", "C1021", "C1022", "C1023", "C1024",
"C1025", "C1026", "C1027", "C1028", "C1029", "C1030", "C1031", "C1032",
"C1033", "C1034", "C1035", "C1036", "C1037", "C1038", "C1039", "C1040",
"C1041", "C1042", "C1043", "C1044", "C1045", "C1046", "C1047", "C1048",
"C1049", "C1050", "C1051", "C1052", "C1053", "C1054", "C1055", "C1056",
"C1057", "C1058", "C1059", "C1060", "C1061", "C1062", "C1063", "C1064",
"C1065", "C1066", "C1067", "C1068", "C1069", "C1070", "C1071", "C1072",
"C1073", "C1074", "C1075", "C1076", "C1077", "C1078", "C1079", "C1080",
"C1081", "C1082", "C1083", "C1084", "C1085", "C1086", "C1087", "C1088",
"C1089", "C1090", "C1091", "C1092", "C1093", "C1094", "C1095", "C1096",
"C1097", "C1098", "C1099", "C1100", "C1101", "C1102", "C1103", "C1104",
"C1105", "C1106", "C1107", "C1108", "C1109", "C1110", "C1111", "C1112",
"C1113", "C1114", "C1115", "C1116", "C1117", "C1118", "C1119", "C1120",
"C1121", "C1122", "C1123", "C1124", "C1125", "C1126", "C1127", "C1128",
"C1129", "C1130", "C1131", "C1132", "C1133", "C1134", "C1135", "C1136",
"C1137", "C1138", "C1139", "C1140", "C1141", "C1142", "C1143", "C1144",
"C1145", "C1146", "C1147", "C1148", "C1149", "C1150", "C1151", "C1152",
"C1153", "C1154", "C1155", "C1156", "C1157", "C1158", "C1159", "C1160",
"C1161", "C1162", "C1163", "C1164", "C1165", "C1166", "C1167", "C1168",
"C1169", "C1170", "C1171", "C1172", "C1173", "C1174", "C1175", "C1176",
"C1177", "C1178", "C1179", "C1180", "C1181", "C1182", "C1183", "C1184",
"C1185", "C1186", "C1187", "C1188", "C1189", "C1190", "C1191", "C1192",
"C1193", "C1194", "C1195", "C1196", "C1197", "C1198", "C1199", "C1200",
"C1201", "C1202", "C1203", "C1204", "C1205", "C1206", "C1207", "C1208",
"C1209", "C1210", "C1211", "C1212", "C1213", "C1214", "C1215", "C1216",
"C1217", "C1218", "C1219", "C1220", "C1221", "C1222", "C1223", "C1224",
"C1225", "C1226", "C1227", "C1228", "C1229", "C1230", "C1231", "C1232",
"C1233", "C1234", "C1235", "C1236", "C1237", "C1238", "C1239", "C1240",
"C1241", "C1242", "C1243", "C1244", "C1245", "C1246", "C1247", "C1248",
"C1249", "C1250", "C1251", "C1252", "C1253", "C1254", "C1255", "C1256",
"C1257", "C1258", "C1259", "C1260", "C1261", "C1262", "C1263", "C1264",
"C1265", "C1266", "C1267", "C1268", "C1269", "C1270", "C1271", "C1272",
"C1273", "C1274", "C1275", "C1276", "C1277", "C1278", "C1279", "C1280",
"C1281", "C1282", "C1283", "C1284", "C1285", "C1286", "C1287", "C1288",
"C1289", "C1290", "C1291", "C1292", "C1293", "C1294", "C1295", "C1296",
"C1297", "C1298", "C1299", "C1300", "C1301", "C1302", "C1303", "C1304",
"C1305", "C1306", "C1307", "C1308", "C1309", "C1310", "C1311", "C1312",
"C1313", "C1314", "C1315", "C1316", "C1317", "C1318", "C1319", "C1320",
"C1321", "C1322", "C1323", "C1324", "C1325", "C1326", "C1327", "C1328",
"C1329", "C1330", "C1331", "C1332", "C1333", "C1334", "C1335", "C1336",
"C1337", "C1338", "C1339", "C1340", "C1341", "C1342", "C1343", "C1344",
"C1345", "C1346", "C1347", "C1348", "C1349", "C1350", "C1351", "C1352",
"C1353", "C1354", "C1355", "C1356", "C1357", "C1358", "C1359", "C1360",
"C1361", "C1362", "C1363", "C1364", "C1365", "C1366", "C1367", "C1368",
"C1369", "C1370", "C1371", "C1372", "C1373", "C1374", "C1375", "C1376",
"C1377", "C1378", "C1379", "C1380", "C1381", "C1382", "C1383", "C1384",
"C1385", "C1386", "C1387", "C1388", "C1389", "C1390", "C1391", "C1392",
"C1393", "C1394", "C1395", "C1396", "C1397", "C1398", "C1399", "C1400",
"C1401", "C1402", "C1403", "C1404", "C1405", "C1406", "C1407", "C1408",
"C1409", "C1410", "C1411", "C1412", "C1413", "C1414", "C1415", "C1416",
"C1417", "C1418", "C1419", "C1420", "C1421", "C1422", "C1423", "C1424",
"C1425", "C1426", "C1427", "C1428", "C1429", "C1430", "C1431", "C1432",
"C1433", "C1434", "C1435", "C1436", "C1437", "C1438", "C1439", "C1440",
"C1441", "C1442", "C1443", "C1444", "C1445", "C1446", "C1447", "C1448",
"C1449", "C1450", "C1451", "C1452", "C1453", "C1454", "C1455", "C1456",
"C1457", "C1458", "C1459", "C1460", "C1461", "C1462", "C1463", "C1464",
"C1465", "C1466", "C1467", "C1468", "C1469", "C1470", "C1471", "C1472",
"C1473", "C1474", "C1475", "C1476", "C1477", "C1478", "C1479", "C1480",
"C1481", "C1482", "C1483", "C1484", "C1485", "C1486", "C1487", "C1488",
"C1489", "C1490", "C1491", "C1492", "C1493", "C1494", "C1495", "C1496",
"C1497", "C1498", "C1499", "C1500", "C1501", "C1502", "C1503", "C1504",
"C1505", "C1506", "C1507", "C1508", "C1509", "C1510", "C1511", "C1512",
"C1513", "C1514", "C1515", "C1516", "C1517", "C1518", "C1519", "C1520",
"C1521", "C1522", "C1523", "C1524", "C1525", "C1526", "C1527", "C1528",
"C1529", "C1530", "C1531", "C1532", "C1533", "C1534", "C1535", "C1536",
"C1537", "C1538", "C1539", "C1540", "C1541", "C1542", "C1543", "C1544",
"C1545", "C1546", "C1547", "C1548",
};
int nCols = 548;
int nRows = 176;
ProblemBuilder<double> pb;
pb.reserve( 1711, 176, 548 );
pb.setNumRows( nRows );
pb.setNumCols( nCols );
pb.setObjAll( coeffobj );
pb.setObjOffset( 0.0 );
pb.setColLbAll( lbs );
pb.setColLbInfAll( lbInf );
pb.setColUbAll( ubs );
pb.setColUbInfAll( ubInf );
pb.setColIntegralAll( isIntegral );
pb.setRowLhsInfAll( lhsIsInf );
pb.setRowRhsInfAll( rhsIsInf );
pb.setRowLhsAll( lhs );
pb.setRowRhsAll( rhs );
pb.setRowNameAll( rnames );
pb.addEntryAll( entries );
pb.setColNameAll( cnames );
pb.setProblemName( "p0548.hpp" );
Problem<double> problem = pb.build();
/// PROBLEM BUILDER CODE END
return problem;
}
} // namespace instances
} // namespace papilo
#endif
| 123,791
|
C++
|
.h
| 2,151
| 49.762436
| 79
| 0.495351
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,865
|
clusol.h
|
lgottwald_PaPILO/external/lusol/clusol.h
|
#ifndef CLUSOL_H_
#define CLUSOL_H_
#include <stdint.h>
void clu1fac(
int64_t* m,
int64_t* n,
int64_t* nelem,
int64_t* lena,
int64_t* luparm,
double* parmlu,
double* a,
int64_t* indc,
int64_t* indr,
int64_t* p,
int64_t* q,
int64_t* lenc,
int64_t* lenr,
int64_t* locc,
int64_t* locr,
int64_t* iploc,
int64_t* iqloc,
int64_t* ipinv,
int64_t* iqinv,
double* w,
int64_t* inform);
void clu6sol(
int64_t* mode,
int64_t* m,
int64_t* n,
double* v,
double* w,
int64_t* lena,
int64_t* luparm,
double* parmlu,
double* a,
int64_t* indc,
int64_t* indr,
int64_t* p,
int64_t* q,
int64_t* lenc,
int64_t* lenr,
int64_t* locc,
int64_t* locr,
int64_t* inform);
void clu8rpc(
int64_t* mode1,
int64_t* mode2,
int64_t* m,
int64_t* n,
int64_t* jrep,
double* v,
double* w,
int64_t* lena,
int64_t* luparm,
double* parmlu,
double* a,
int64_t* indc,
int64_t* indr,
int64_t* p,
int64_t* q,
int64_t* lenc,
int64_t* lenr,
int64_t* locc,
int64_t* locr,
int64_t* inform,
double* diag,
double* vnorm);
void clu6mul(
int64_t* mode,
int64_t* m,
int64_t* n,
double* v,
double* w,
int64_t* lena,
int64_t* luparm,
double* parmlu,
double* a,
int64_t* indc,
int64_t* indr,
int64_t* p,
int64_t* q,
int64_t* lenc,
int64_t* lenr,
int64_t* locc,
int64_t* locr);
void clu8adc(
int64_t* mode,
int64_t* m,
int64_t* n,
double* v,
double* w,
int64_t* lena,
int64_t* luparm,
double* parmlu,
double* a,
int64_t* indc,
int64_t* indr,
int64_t* p,
int64_t* q,
int64_t* lenc,
int64_t* lenr,
int64_t* locc,
int64_t* locr,
int64_t* inform,
double* diag,
double* vnorm);
void clu8adr(
int64_t* m,
int64_t* n,
double* w,
int64_t* lena,
int64_t* luparm,
double* parmlu,
double* a,
int64_t* indc,
int64_t* indr,
int64_t* p,
int64_t* q,
int64_t* lenc,
int64_t* lenr,
int64_t* locc,
int64_t* locr,
int64_t* inform,
double* diag);
void clu8dlc(
int64_t* m,
int64_t* n,
int64_t* jdel,
int64_t* lena,
int64_t* luparm,
double* parmlu,
double* a,
int64_t* indc,
int64_t* indr,
int64_t* p,
int64_t* q,
int64_t* lenc,
int64_t* lenr,
int64_t* locc,
int64_t* locr,
int64_t* inform);
void clu8dlr(
int64_t* mode,
int64_t* m,
int64_t* n,
int64_t* idel,
double* v,
double* w,
int64_t* lena,
int64_t* luparm,
double* parmlu,
double* a,
int64_t* indc,
int64_t* indr,
int64_t* p,
int64_t* q,
int64_t* lenc,
int64_t* lenr,
int64_t* locc,
int64_t* locr,
int64_t* inform);
void clu8mod(
int64_t* mode,
int64_t* m,
int64_t* n,
double* beta,
double* v,
double* w,
int64_t* lena,
int64_t* luparm,
double* parmlu,
double* a,
int64_t* indc,
int64_t* indr,
int64_t* p,
int64_t* q,
int64_t* lenc,
int64_t* lenr,
int64_t* locc,
int64_t* locr,
int64_t* inform);
void clu8rpr(
int64_t* mode1,
int64_t* mode2,
int64_t* m,
int64_t* n,
int64_t* irep,
double* v,
double* w,
double* wnew,
int64_t* lena,
int64_t* luparm,
double* parmlu,
double* a,
int64_t* indc,
int64_t* indr,
int64_t* p,
int64_t* q,
int64_t* lenc,
int64_t* lenr,
int64_t* locc,
int64_t* locr,
int64_t* inform);
#endif // CLUSOL_H_
| 3,296
|
C++
|
.h
| 204
| 13.235294
| 19
| 0.627597
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,902
|
harness_preload.h
|
lgottwald_PaPILO/external/tbb/src/test/harness_preload.h
|
/*
Copyright (c) 2005-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file is intended for preloading (via compiler options such as -include) into every test.
// Alas, not all compilers have such options, so the file is "optional".
// Only add here things that are necessary for *every* test!
// In particular, avoid including other headers.
// Since this file can be omitted, checking compiler-specific conditions is strongly recommended.
#ifndef harness_preload_H
#define harness_preload_H
#if __GNUC__>=5 && !__INTEL_COMPILER && !__clang__ && __GXX_EXPERIMENTAL_CXX0X__
// GCC 5 has added -Wsuggest-override, but unfortunately enables it even in pre-C++11 mode.
// We only want to use it for C++11 though.
#pragma GCC diagnostic warning "-Wsuggest-override"
#define __TBB_TEST_USE_WSUGGEST_OVERRIDE 1
#endif
// TODO: consider adding a similar option for clang
#if __TBB_TEST_NO_EXCEPTIONS
// This code breaks our own recommendations above, and it's deliberate:
// it includes another file, but that file should only have macros and pragmas;
// it does not check for compiler, as that is checked in the included file.
// The file also defines TBB_USE_EXCEPTIONS=0, which is set for all tests via makefiles anyway.
#include "tbb/tbb_disable_exceptions.h"
#endif
#endif /* harness_preload_H */
| 1,851
|
C++
|
.h
| 34
| 51.882353
| 97
| 0.75885
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
1,536,903
|
harness_allocator_overload.h
|
lgottwald_PaPILO/external/tbb/src/test/harness_allocator_overload.h
|
/*
Copyright (c) 2005-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef tbb_test_harness_allocator_overload_H
#define tbb_test_harness_allocator_overload_H
#include "../tbbmalloc/proxy.h" // for MALLOC_UNIXLIKE_OVERLOAD_ENABLED, MALLOC_ZONE_OVERLOAD_ENABLED
#include "tbb/tbb_config.h" // for __TBB_WIN8UI_SUPPORT
// Skip configurations with unsupported system malloc overload:
// skip unsupported MSVCs, WIN8UI and MINGW (it doesn't define _MSC_VER),
// no support for MSVC 2015 and greater in debug for now,
// don't use defined(_MSC_VER), because result of using defined() in macro expansion is undefined
#define MALLOC_WINDOWS_OVERLOAD_ENABLED ((_WIN32||_WIN64) && !__TBB_WIN8UI_SUPPORT && _MSC_VER >= 1500 && !(_MSC_VER >= 1900 && _DEBUG))
// Skip configurations with unsupported system malloc overload:
// * overload via linking with -lmalloc_proxy is broken in offload,
// as the library is loaded too late in that mode,
// * LD_PRELOAD mechanism is broken in offload
#define HARNESS_SKIP_TEST ((!MALLOC_WINDOWS_OVERLOAD_ENABLED && !MALLOC_UNIXLIKE_OVERLOAD_ENABLED && !MALLOC_ZONE_OVERLOAD_ENABLED) || __TBB_MIC_OFFLOAD)
#endif // tbb_test_harness_allocator_overload_H
| 1,731
|
C++
|
.h
| 27
| 61.185185
| 153
| 0.755896
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
1,536,906
|
harness_tsx.h
|
lgottwald_PaPILO/external/tbb/src/test/harness_tsx.h
|
/*
Copyright (c) 2005-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Header that includes Intel(R) Transactional Synchronization Extensions (Intel(R) TSX) specific test functions
#if __TBB_TSX_AVAILABLE
#define __TBB_TSX_TESTING_ENABLED_FOR_THIS_COMPILER (__INTEL_COMPILER || __GNUC__ || _MSC_VER || __SUNPRO_CC)
#if __TBB_TSX_TESTING_ENABLED_FOR_THIS_COMPILER
#include "harness_defs.h"
inline static bool IsInsideTx()
{
return __TBB_machine_is_in_transaction() != 0;
}
#if _MSC_VER
#include <intrin.h> // for __cpuid
#endif
// TODO: consider reusing tbb_misc.cpp:cpu_has_speculation() instead of code duplication.
bool have_TSX() {
bool result = false;
const int hle_ebx_mask = 1<<4;
const int rtm_ebx_mask = 1<<11;
#if _MSC_VER
int info[4] = {0,0,0,0};
const int reg_ebx = 1;
int old_ecx = 0;
__cpuidex(info, 7, old_ecx);
result = (info[reg_ebx] & rtm_ebx_mask)!=0;
if( result ) ASSERT( (info[reg_ebx] & hle_ebx_mask)!=0, NULL );
#elif __GNUC__ || __SUNPRO_CC
int32_t reg_ebx = 0;
int32_t reg_eax = 7;
int32_t reg_ecx = 0;
__asm__ __volatile__ ( "movl %%ebx, %%esi\n"
"cpuid\n"
"movl %%ebx, %0\n"
"movl %%esi, %%ebx\n"
: "=a"(reg_ebx) : "0" (reg_eax), "c" (reg_ecx) : "esi",
#if __TBB_x86_64
"ebx",
#endif
"edx"
);
result = (reg_ebx & rtm_ebx_mask)!=0 ;
if( result ) ASSERT( (reg_ebx & hle_ebx_mask)!=0, NULL );
#endif
return result;
}
#endif /* __TBB_TSX_TESTING_ENABLED_FOR_THIS_COMPILER */
#endif /* __TBB_TSX_AVAILABLE */
| 2,238
|
C++
|
.h
| 57
| 32.824561
| 112
| 0.611878
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,908
|
papilolib.h
|
lgottwald_PaPILO/src/papilolib.h
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef __PAPILOLIB_H__
#define __PAPILOLIB_H__
#include "papilolib_export.h"
#ifdef __cplusplus
extern "C"
{
#endif
#include <stddef.h>
#include <stdint.h>
/// Enum type to specify the rows with a single side value
typedef enum Papilo_RowType
{
PAPILO_ROW_TYPE_GREATER = 0,
PAPILO_ROW_TYPE_LESSER = 1,
PAPILO_ROW_TYPE_EQUAL = 2,
} PAPILO_ROW_TYPE;
typedef struct Papilo_Problem PAPILO_PROBLEM;
/// Create a new problem datastructure. Reserves space for the given number
/// of rows, columns, and nonzeros to prevent unnecessary reallocation
/// during problem creation. The given value of infinity is used to
/// determine the finiteness of bounds and rowsides. The name pointer and
/// the space hints are optional and can be NULL/0.
PAPILOLIB_EXPORT PAPILO_PROBLEM*
papilo_problem_create( double infinity, const char* name, int nnz_hint,
int row_hint, int col_hint );
/// Free the problem datastructure
PAPILOLIB_EXPORT void
papilo_problem_free( PAPILO_PROBLEM* );
/// Add columns (variables) to the problem and returns the index of the first
/// new column or -1 if it does not exist (i.e. num == 0).
/// If colnames is NULL generic names are used.
PAPILOLIB_EXPORT int
papilo_problem_add_cols( PAPILO_PROBLEM* problem, int num, const double* lb,
const double* ub, const unsigned char* integral,
const double* obj, const char** colnames );
/// Adds a column (variable) to the problem and returns its index.
/// If colnames is NULL a generic name is used.
PAPILOLIB_EXPORT int
papilo_problem_add_col( PAPILO_PROBLEM* problem, double lb, double ub,
unsigned char integral, double obj,
const char* colname );
/// returns number of columns
PAPILOLIB_EXPORT int
papilo_problem_get_num_cols( PAPILO_PROBLEM* problem );
/// returns number of rows
PAPILOLIB_EXPORT int
papilo_problem_get_num_rows( PAPILO_PROBLEM* problem );
/// returns number of columns
PAPILOLIB_EXPORT int
papilo_problem_get_num_nonzeros( PAPILO_PROBLEM* problem );
/// Change columns lower bound
PAPILOLIB_EXPORT void
papilo_problem_change_col_lb( PAPILO_PROBLEM* problem, int col, double lb );
/// Change columns upper bound
PAPILOLIB_EXPORT void
papilo_problem_change_col_ub( PAPILO_PROBLEM* problem, int col, double ub );
/// Change columns integrality restrictions
PAPILOLIB_EXPORT void
papilo_problem_change_col_integral( PAPILO_PROBLEM* problem, int col,
unsigned char integral );
/// Change columns objective coefficient
PAPILOLIB_EXPORT void
papilo_problem_change_col_obj( PAPILO_PROBLEM* problem, int col,
double obj );
/// Add simple linear constraints (no ranged rows) to the problem and returns
/// the index of the first new row or -1 if it does not exist (i.e. num ==
/// 0). If rownames is NULL generic names are used.
PAPILOLIB_EXPORT int
papilo_problem_add_simple_rows( PAPILO_PROBLEM* problem, int num,
const unsigned char* rowtypes,
const double* side, const char** rownames );
/// Add linear constraints with given left and right hand sides to the
/// problem and returns the
/// index of the first new row or -1 if it does not exist (i.e. num == 0).
/// If rownames is NULL generic names are used. The rows can be a ranged row
/// if both lhs and rhs are finite.
PAPILOLIB_EXPORT int
papilo_problem_add_generic_rows( PAPILO_PROBLEM* problem, int num,
const double* lhs, const double* rhs,
const char** rownames );
/// Add one simple linear constraint (no ranged row) to the problem and
/// returns its index. If rowname is NULL generic names are used.
PAPILOLIB_EXPORT int
papilo_problem_add_simple_row( PAPILO_PROBLEM* problem,
unsigned char rowtype, double side,
const char* rowname );
/// Add one linear constraints with given left and right hand side to the
/// problem and returns its index. If the rowname is NULL generic names are
/// used. The row can be a ranged row if both lhs and rhs are finite.
PAPILOLIB_EXPORT int
papilo_problem_add_generic_row( PAPILO_PROBLEM* problem, double lhs,
double rhs, const char* rowname );
/// Add a nonzero entry for the given column to the given constraint
PAPILOLIB_EXPORT void
papilo_problem_add_nonzero( PAPILO_PROBLEM* problem, int row, int col,
double val );
/// Add the nonzero entries for the given columns to the given row
PAPILOLIB_EXPORT void
papilo_problem_add_nonzeros_row( PAPILO_PROBLEM* problem, int row, int num,
const int* cols, const double* vals );
/// Add the nonzero entries for the given column to the given rows
PAPILOLIB_EXPORT void
papilo_problem_add_nonzeros_col( PAPILO_PROBLEM* problem, int col, int num,
const int* rows, const double* vals );
/// Add the nonzero entries given in compressed sparse row format. The array
/// rowstart must have size at least nrows + 1 and the arrays cols and vals
/// must have size at least rowstart[nrows].
PAPILOLIB_EXPORT void
papilo_problem_add_nonzeros_csr( PAPILO_PROBLEM* problem,
const int* rowstart, const int* cols,
const double* vals );
/// Add the nonzero entries given in compressed sparse column format. The
/// array colstart must have size at least ncols + 1 and the arrays rows and
/// vals must have size at least colstart[ncols].
PAPILOLIB_EXPORT void
papilo_problem_add_nonzeros_csc( PAPILO_PROBLEM* problem,
const int* colstart, const int* rows,
const double* vals );
/// Solver type for presolve library
typedef struct Papilo_Solver PAPILO_SOLVER;
/// Create a new solver datastructure
PAPILOLIB_EXPORT PAPILO_SOLVER*
papilo_solver_create();
/// Set callback for message output. If the callback is set to NULL output is
/// printed to stdout. The level argument is set as follows:
/// 1 - errors, 2 - warnings, 3 - info, 4 - extra
PAPILOLIB_EXPORT void
papilo_solver_set_trace_callback( PAPILO_SOLVER* solver,
void ( *thetracecb )( int level,
const char* data,
size_t size,
void* usrptr ),
void* usrptr );
/// Free the problem datastructure
PAPILOLIB_EXPORT void
papilo_solver_free( PAPILO_SOLVER* );
/// Return values for setting solver parameters
typedef enum Papilo_ParamResult
{
/// parameter was successfully changed
PAPILO_PARAM_CHANGED = 0,
/// parameter does not exist
PAPILO_PARAM_NOT_FOUND = 1,
/// parameter is of a different type
PAPILO_PARAM_WRONG_TYPE = 2,
/// parameter was set to an invalid value
PAPILO_PARAM_INVALID_VALUE = 3,
} PAPILO_PARAM_RESULT;
/// Set bool parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_param_bool( PAPILO_SOLVER* solver, const char* key,
unsigned int val );
/// Set real parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_param_real( PAPILO_SOLVER* solver, const char* key,
double val );
/// Set integer parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_param_int( PAPILO_SOLVER* solver, const char* key,
int val );
/// Set character parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_param_char( PAPILO_SOLVER* solver, const char* key,
char val );
/// Set string parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_param_string( PAPILO_SOLVER* solver, const char* key,
const char* val );
/// Set real parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_mip_param_real( PAPILO_SOLVER* solver, const char* key,
double val );
/// Set integer parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_mip_param_int( PAPILO_SOLVER* solver, const char* key,
int val );
/// Set boolean parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_mip_param_bool( PAPILO_SOLVER* solver, const char* key,
unsigned int val );
/// Set 64bit integer parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_mip_param_int64( PAPILO_SOLVER* solver, const char* key,
int64_t val );
/// Set character parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_mip_param_char( PAPILO_SOLVER* solver, const char* key,
char val );
/// Set string parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_mip_param_string( PAPILO_SOLVER* solver, const char* key,
const char* val );
/// Set real parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_lp_param_real( PAPILO_SOLVER* solver, const char* key,
double val );
/// Set integer parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_lp_param_int( PAPILO_SOLVER* solver, const char* key,
int val );
/// Set boolean parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_lp_param_bool( PAPILO_SOLVER* solver, const char* key,
unsigned int val );
/// Set 64bit integer parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_lp_param_int64( PAPILO_SOLVER* solver, const char* key,
int64_t val );
/// Set character parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_lp_param_char( PAPILO_SOLVER* solver, const char* key,
char val );
/// Set string parameter with given key to the given value
PAPILOLIB_EXPORT PAPILO_PARAM_RESULT
papilo_solver_set_lp_param_string( PAPILO_SOLVER* solver, const char* key,
const char* val );
/// Return values for solving
typedef enum Papilo_SolveResult
{
/// problem was solved to optimality
PAPILO_SOLVE_RESULT_OPTIMAL = 0,
/// solving stopped early with a feasible solution due to limits or
/// interrupts
PAPILO_SOLVE_RESULT_FEASIBLE = 1,
/// solving stopped early and without a solution due to limits or
/// interrupts
PAPILO_SOLVE_RESULT_STOPPED = 2,
/// problem was detected to be unbounded or infeasible
PAPILO_SOLVE_RESULT_UNBND_OR_INFEAS = 3,
/// problem was detected to be unbounded
PAPILO_SOLVE_RESULT_UNBOUNDED = 4,
/// problem was detected to be infeasible
PAPILO_SOLVE_RESULT_INFEASIBLE = 5,
} PAPILO_SOLVE_RESULT;
/// Load the problem into the solver, the problem datastructure will be empty
/// afterwards and can be reused to build another problem
PAPILOLIB_EXPORT void
papilo_solver_load_problem( PAPILO_SOLVER* solver, PAPILO_PROBLEM* problem );
/// Write the problem to an mps file. Must be called after the problem
/// was loaded into the solver. If the filename ends with .gz or .bz2 the
/// file is written compressed
PAPILOLIB_EXPORT void
papilo_solver_write_mps( PAPILO_SOLVER* solver, const char* filename );
/// Set the maximum number of threads to be used when the solver is
/// started. Can be -1 to determine the number of threads automatically
/// based on the hardware (default behavior), or a number larger or equal
/// to 1.
PAPILOLIB_EXPORT
void
papilo_solver_set_num_threads( PAPILO_SOLVER* solver, int numthreads );
typedef struct
{
PAPILO_SOLVE_RESULT solve_result;
const double* bestsol;
double bestsol_obj;
double bestsol_intviol;
double bestsol_boundviol;
double bestsol_consviol;
double dualbound;
double presolvetime;
double solvingtime;
} PAPILO_SOLVING_INFO;
/// Start the solving process
PAPILOLIB_EXPORT PAPILO_SOLVING_INFO*
papilo_solver_start( PAPILO_SOLVER* solver );
#ifdef __cplusplus
}
#endif
#endif
| 15,322
|
C++
|
.h
| 291
| 43.522337
| 80
| 0.615128
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,912
|
Objective.hpp
|
lgottwald_PaPILO/src/papilo/core/Objective.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef _PAPILO_CORE_OBJECTIVE_HPP_
#define _PAPILO_CORE_OBJECTIVE_HPP_
#include "papilo/misc/Vec.hpp"
namespace papilo
{
/// type to store an objective function
template <typename REAL>
struct Objective
{
/// dense vector of objective coefficients
Vec<REAL> coefficients;
/// offset of objective function
REAL offset;
template <typename Archive>
void
serialize( Archive& ar, const unsigned int version )
{
ar& coefficients;
ar& offset;
}
};
} // namespace papilo
#endif
| 2,278
|
C++
|
.h
| 45
| 48.577778
| 79
| 0.454382
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,913
|
Postsolve.hpp
|
lgottwald_PaPILO/src/papilo/core/Postsolve.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef _PAPILO_CORE_POSTSOLVE_HPP_
#define _PAPILO_CORE_POSTSOLVE_HPP_
#include "papilo/core/Problem.hpp"
#include "papilo/misc/KktChecker.hpp"
#include "papilo/misc/MultiPrecision.hpp"
#include "papilo/misc/Num.hpp"
#include "papilo/misc/StableSum.hpp"
#include "papilo/misc/Vec.hpp"
#include "papilo/misc/compress_vector.hpp"
#include "papilo/misc/fmt.hpp"
#include "papilo/misc/tbb.hpp"
#include <fstream>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/tmpdir.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/list.hpp>
#include <boost/serialization/utility.hpp>
#include <boost/serialization/vector.hpp>
namespace papilo
{
/// possible types of post solving
enum class PostsolveType : int
{
kPrimal = 0,
kFull = 1,
};
enum class ReductionType : int
{
kFixedCol = 0,
kSubstitutedCol = 1,
kParallelCol = 2,
kSaveRow = 3,
kSaveCol = 4
};
enum class PostsolveStatus : int
{
kOk,
kFail
};
// forward declarations
template <typename REAL>
class SparseVectorView;
struct IndexRange;
/// type to store necessary data for post solve
template <typename REAL>
class Postsolve
{
public:
unsigned int nColsOriginal;
unsigned int nRowsOriginal;
/// mapping of reduced problems column indices to column indices in the
/// original problem
Vec<int> origcol_mapping;
/// mapping of reduced problems row indices to row indices in the original
/// problem
Vec<int> origrow_mapping;
// set to full for development of postsolve,
// later will not be default value
// PostsolveType postsolveType = PostsolveType::kFull;
PostsolveType postsolveType = PostsolveType::kPrimal;
Vec<ReductionType> types;
Vec<int> indices;
Vec<REAL> values;
Vec<int> start;
Problem<REAL> problem;
Num<REAL> num;
// #define CHECK_KKT
#ifndef CHECK_KKT
using Kkt = KktChecker<REAL, CheckLevel::No_check>;
#else
using Kkt = KktChecker<REAL, CheckLevel::Check>;
#endif
mutable Kkt checker;
Postsolve() {}
Postsolve( const Problem<REAL>& problem, const Num<REAL>& num )
: problem( problem ), num( num )
{
int nrows = problem.getNRows();
int ncols = problem.getNCols();
origrow_mapping.reserve( nrows );
origrow_mapping.reserve( ncols );
for( int i = 0; i < nrows; ++i )
origrow_mapping.push_back( i );
for( int i = 0; i < ncols; ++i )
origcol_mapping.push_back( i );
nColsOriginal = ncols;
nRowsOriginal = nrows;
start.push_back( 0 );
// release excess storage in original problem copy
this->problem.compress( true );
}
int
notifySavedRow( int row, const SparseVectorView<REAL>& coefficients,
REAL lhs, REAL rhs, const RowFlags& flags );
void
notifyModifiedRow( int row );
void
notifyFixedCol( int col, REAL val );
void
notifySubstitution( int col, SparseVectorView<REAL> equalityLHS,
REAL equalityRHS );
/// col1 = col2scale * col2 and are merged into a new column y = col2 +
/// col2scale * col1 which takes over the index of col2
void
notifyParallelCols( int col1, bool col1integral, bool col1lbinf,
const REAL& col1lb, bool col1ubinf, const REAL& col1ub,
int col2, bool col2integral, bool col2lbinf,
const REAL& col2lb, bool col2ubinf, const REAL& col2ub,
const REAL& col2scale );
void
compress( const Vec<int>& rowmapping, const Vec<int>& colmapping,
bool full = false )
{
tbb::parallel_invoke(
[this, &colmapping, full]() {
compress_vector( colmapping, origcol_mapping );
if( full )
origcol_mapping.shrink_to_fit();
},
[this, &rowmapping, full]() {
// update information about rows that is stored by index
compress_vector( rowmapping, origrow_mapping );
if( full )
origrow_mapping.shrink_to_fit();
} );
}
template <typename Archive>
void
serialize( Archive& ar, const unsigned int version )
{
ar& nColsOriginal;
ar& nRowsOriginal;
ar& origcol_mapping;
ar& origrow_mapping;
ar& postsolveType;
ar& types;
ar& indices;
ar& values;
ar& start;
ar& problem;
ar& num;
}
PostsolveStatus
undo( const Solution<REAL>& reducedSolution,
Solution<REAL>& originalSolution ) const;
const Problem<REAL>&
getOriginalProblem() const
{
return problem;
}
const Num<REAL>&
getNum() const
{
return num;
}
Kkt&
getChecker()
{
return checker;
}
private:
void
finishNotify()
{
assert( types.size() == start.size() );
assert( values.size() == indices.size() );
start.push_back( values.size() );
}
Vec<int> row_stack_index;
};
#ifdef PAPILO_USE_EXTERN_TEMPLATES
extern template class Postsolve<double>;
extern template class Postsolve<Quad>;
extern template class Postsolve<Rational>;
#endif
template <typename REAL>
void
Postsolve<REAL>::notifyFixedCol( int col, REAL val )
{
types.push_back( ReductionType::kFixedCol );
indices.push_back( origcol_mapping[col] );
values.push_back( val );
finishNotify();
}
// template <typename REAL>
// void
// Postsolve<REAL>::notifySavedRow( int row,
// const SparseVectorView<REAL>& coefficients,
// REAL lhs, REAL rhs, const RowFlags& flags )
// {
// const REAL* coefs = coefficients.getValues();
// const int* columns = coefficients.getIndices();
// const int length = coefficients.getLength();
// types.push_back( ReductionType::kSaveRow );
// indices.push_back( origrow_mapping[row] );
// values.push_back( (double)length );
// // LB
// if( flags.test( RowFlag::kLhsInf ) )
// indices.push_back( 1 );
// else
// indices.push_back( 0 );
// values.push_back( lhs );
// // UB
// if( flags.test( RowFlag::kRhsInf ) )
// indices.push_back( 1 );
// else
// indices.push_back( 0 );
// values.push_back( rhs );
// for( int i = 0; i < length; ++i )
// {
// indices.push_back( columns[i] );
// values.push_back( coefs[i] );
// }
// finishNotify();
// }
template <typename REAL>
void
Postsolve<REAL>::notifyModifiedRow( int row )
{
int origrow = origrow_mapping[row];
row_stack_index[origrow] = -1;
}
template <typename REAL>
int
Postsolve<REAL>::notifySavedRow( int row,
const SparseVectorView<REAL>& coefficients,
REAL lhs, REAL rhs, const RowFlags& flags )
{
// initialize arrays if necessary
if( row_stack_index.size() == 0 )
{
int nrows = problem.getNRows();
row_stack_index.resize( nrows, -1 );
}
// check if row is valid on the postsolve stack
if( row_stack_index[row] >= 0 )
return row_stack_index[row];
const REAL* coefs = coefficients.getValues();
const int* columns = coefficients.getIndices();
const int length = coefficients.getLength();
types.push_back( ReductionType::kSaveRow );
int stack_index = indices.size();
indices.push_back( origrow_mapping[row] );
values.push_back( (double)length );
// LB
if( flags.test( RowFlag::kLhsInf ) )
indices.push_back( 1 );
else
indices.push_back( 0 );
values.push_back( lhs );
// UB
if( flags.test( RowFlag::kRhsInf ) )
indices.push_back( 1 );
else
indices.push_back( 0 );
values.push_back( rhs );
for( int i = 0; i < length; ++i )
{
indices.push_back( columns[i] );
values.push_back( coefs[i] );
}
finishNotify();
row_stack_index[row] = stack_index;
return stack_index;
}
template <typename REAL>
void
Postsolve<REAL>::notifySubstitution( int col,
SparseVectorView<REAL> equalityLHS,
REAL equalityRHS )
{
const REAL* coefs = equalityLHS.getValues();
const int* columns = equalityLHS.getIndices();
const int length = equalityLHS.getLength();
assert( length > 1 );
types.push_back( ReductionType::kSubstitutedCol );
values.push_back( equalityRHS );
// values.insert( values.end(), coefs, coefs + length );
indices.push_back( origcol_mapping[col] );
for( int i = 0; i < length; ++i )
{
indices.push_back( origcol_mapping[columns[i]] );
values.push_back( coefs[i] );
}
finishNotify();
}
/// col1 = col2scale * col2 and are merged into a new column y = col2 +
/// col2scale * col1 which takes over the index of col2
template <typename REAL>
void
Postsolve<REAL>::notifyParallelCols( int col1, bool col1integral,
bool col1lbinf, const REAL& col1lb,
bool col1ubinf, const REAL& col1ub,
int col2, bool col2integral,
bool col2lbinf, const REAL& col2lb,
bool col2ubinf, const REAL& col2ub,
const REAL& col2scale )
{
// encode the finiteness of the bounds in one integer and store it as
// value for column 1
int col1BoundFlags = 0;
int col2BoundFlags = 0;
if( col1integral )
col1BoundFlags |= static_cast<int>( ColFlag::kIntegral );
if( col1lbinf )
col1BoundFlags |= static_cast<int>( ColFlag::kLbInf );
if( col1ubinf )
col1BoundFlags |= static_cast<int>( ColFlag::kUbInf );
if( col2integral )
col2BoundFlags |= static_cast<int>( ColFlag::kIntegral );
if( col2lbinf )
col2BoundFlags |= static_cast<int>( ColFlag::kLbInf );
if( col2ubinf )
col2BoundFlags |= static_cast<int>( ColFlag::kUbInf );
// add all information
indices.push_back( origcol_mapping[col1] );
indices.push_back( col1BoundFlags );
indices.push_back( origcol_mapping[col2] );
indices.push_back( col2BoundFlags );
indices.push_back( -1 ); // last index slot is not used
values.push_back( col1lb );
values.push_back( col1ub );
values.push_back( col2lb );
values.push_back( col2ub );
values.push_back( col2scale );
// add the range and the type of the reduction
types.push_back( ReductionType::kParallelCol );
finishNotify();
}
template <typename REAL>
PostsolveStatus
Postsolve<REAL>::undo( const Solution<REAL>& reducedSolution,
Solution<REAL>& originalSolution ) const
{
const Vec<REAL>& reducedSol = reducedSolution.primal;
Vec<REAL>& origSol = originalSolution.primal;
if( reducedSolution.type == SolutionType::kPrimalDual )
{
originalSolution.type = SolutionType::kPrimalDual;
}
origSol.clear();
origSol.resize( nColsOriginal );
for( int k = 0; k < reducedSol.size(); ++k )
{
int origcol = origcol_mapping[k];
origSol[origcol] = reducedSol[k];
}
if( originalSolution.type == SolutionType::kPrimalDual )
{
assert( reducedSolution.col_dual.size() == origcol_mapping.size() );
originalSolution.col_dual.clear();
originalSolution.col_dual.resize( nColsOriginal );
for( int k = 0; k < origcol_mapping.size(); k++ )
{
int origcol = origcol_mapping[k];
originalSolution.col_dual[origcol] = reducedSolution.col_dual[k];
}
assert( reducedSolution.row_dual.size() == origrow_mapping.size() );
originalSolution.row_dual.clear();
originalSolution.row_dual.resize( nRowsOriginal );
for( int k = 0; k < origrow_mapping.size(); k++ )
{
int origrow = origrow_mapping[k];
originalSolution.row_dual[origrow] = reducedSolution.row_dual[k];
}
}
// If problem has been reduced, check solution of reduced problem returned by
// solver.
// At the moment not all row and column changes are notified. The check
// below handles the case when some trivial presolve elimination is applied,
// but types.size() is still zero.
if( ( reducedSolution.row_dual.size() != 0 &&
nRowsOriginal != reducedSolution.row_dual.size() ) ||
nColsOriginal != reducedSolution.primal.size() )
{
// originalSoluiton is already the reduced solution padded with zeros
auto kktState =
checker.initState( ProblemType::kReduced, originalSolution,
origcol_mapping, origrow_mapping, checker.level );
if( originalSolution.type == SolutionType::kPrimalDual )
checker.level = CheckLevel::Solver_and_primal_feas;
// checker.setLevel( CheckLevel::After_each_postsolve_step);
checker.checkSolution( kktState );
}
for( int i = types.size() - 1; i >= 0; --i )
{
auto type = types[i];
int first = start[i];
int last = start[i + 1];
switch( type )
{
case ReductionType::kSaveRow:
{
int row = indices[first];
int length = (int)values[first];
bool lb_inf = false;
bool ub_inf = false;
if( indices[1] )
lb_inf = true;
if( indices[2] )
ub_inf = true;
checker.addRowToProblem( row, length, &values[3], &indices[3],
values[1], values[2], lb_inf, ub_inf );
break;
}
case ReductionType::kFixedCol:
{
int col = indices[first];
// todo: move to checker
// assert( !solSet[col] );
// solSet[col] = true;
origSol[col] = values[first];
break;
}
case ReductionType::kSubstitutedCol:
{
int col = indices[first];
// assert( !solSet[col] );
REAL side = values[first];
REAL colCoef = 0.0;
StableSum<REAL> sumcols;
for( int j = first + 1; j < last; ++j )
{
if( indices[j] == col )
colCoef = values[j];
else
{
// assert( solSet[indices[j]] );
sumcols.add( origSol[indices[j]] * values[j] );
}
}
sumcols.add( -side );
assert( colCoef != 0.0 );
origSol[col] = ( -sumcols.get() ) / colCoef;
// solSet[col] = true;
break;
}
case ReductionType::kParallelCol:
{
constexpr int IS_INTEGRAL = static_cast<int>( ColFlag::kIntegral );
constexpr int IS_LBINF = static_cast<int>( ColFlag::kLbInf );
constexpr int IS_UBINF = static_cast<int>( ColFlag::kUbInf );
assert( last - first == 5 );
int col1 = indices[first];
int col1boundFlags = indices[first + 1];
int col2 = indices[first + 2];
int col2boundFlags = indices[first + 3];
const REAL& col1lb = values[first];
const REAL& col1ub = values[first + 1];
const REAL& col2lb = values[first + 2];
const REAL& col2ub = values[first + 3];
const REAL& col2scale = values[first + 4];
const REAL& solval = origSol[col2];
// assert( !solSet[col1] );
// assert( solSet[col2] );
// fmt::print( "uncrushing solval {} for parallel cols with scale
// {}: col1 "
// "([{},{}], {}) col2 ([{},{}], {})\n",
// solval,
// col2scale,
// col1boundFlags & IS_LBINF
// ? -std::numeric_limits<double>::infinity()
// : double( col1lb ),
// col1boundFlags& IS_UBINF
// ? std::numeric_limits<double>::infinity()
// : double( col1ub ),
// col1boundFlags& IS_INTEGRAL ? "int." : "cont.",
// col2boundFlags& IS_LBINF
// ? -std::numeric_limits<double>::infinity()
// : double( col2lb ),
// col2boundFlags& IS_UBINF
// ? std::numeric_limits<double>::infinity()
// : double( col2ub ),
// col2boundFlags& IS_INTEGRAL ? "int." : "cont." );
REAL col1val;
REAL col2val;
if( col1boundFlags & IS_INTEGRAL )
{
assert( !( col1boundFlags & IS_LBINF ) );
assert( !( col1boundFlags & IS_UBINF ) );
assert( !( col2boundFlags & IS_LBINF ) );
assert( !( col2boundFlags & IS_UBINF ) );
assert( col2boundFlags & IS_INTEGRAL );
col1val = col1lb;
while( num.isFeasLE( col1val, col1ub ) )
{
col2val = solval - col1val * col2scale;
if( num.isFeasIntegral( col2val ) &&
num.isFeasGE( col2val, col2lb ) &&
num.isFeasLE( col2val, col2ub ) )
break;
col1val += 1;
}
}
else
{
REAL col2valGuess;
if( !( col2boundFlags & IS_LBINF ) )
col2valGuess = col2lb;
else if( !( col2boundFlags & IS_UBINF ) )
col2valGuess = col2ub;
else
col2valGuess = 0;
col1val = ( solval - col2valGuess ) / col2scale;
// check if value for column 1 is feasible
if( !( col1boundFlags & IS_LBINF ) &&
num.isFeasLT( col1val, col1lb ) )
{
// lower bound was violated -> set column 1 to lower bound
col1val = col1lb;
// compute new value for column1
col2val = solval - col2scale * col1val;
}
else if( !( col1boundFlags & IS_UBINF ) &&
num.isFeasGT( col1val, col1ub ) )
{
// upper bound was violated -> set column 1 to lower bound
col1val = col1ub;
// compute new value for column 2
col2val = solval - col2scale * col1val;
}
else
{
// guess was feasible
col2val = col2valGuess;
}
// domains should be valid now, except for integrality of column
// 2 which could still be violated
assert( ( col1boundFlags & IS_LBINF ) ||
num.isFeasGE( col1val, col1lb ) );
assert( ( col1boundFlags & IS_UBINF ) ||
num.isFeasLE( col1val, col1ub ) );
assert( ( col2boundFlags & IS_LBINF ) ||
num.isFeasGE( col2val, col2lb ) );
assert( ( col2boundFlags & IS_UBINF ) ||
num.isFeasLE( col2val, col2ub ) );
// maybe integrality is violated now for column 2, then we round
// further in the direction that we already moved to column 2 to
if( ( col2boundFlags & IS_INTEGRAL ) &&
!num.isFeasIntegral( col2val ) )
{
// round in the direction that we moved away from when we
// corrected the bound violation for column 1 otherwise we
// will violate the bounds of column 1 again
if( col2val > col2valGuess )
col2val = ceil( col2val );
else
col2val = floor( col2val );
// recompute value for column 1
col1val = solval - col1val * col2scale;
}
}
// bounds and integrality should hold now within feasibility
// tolerance
assert( ( col1boundFlags & IS_LBINF ) ||
num.isFeasGE( col1val, col1lb ) );
assert( ( col1boundFlags & IS_UBINF ) ||
num.isFeasLE( col1val, col1ub ) );
assert( !( col1boundFlags & IS_INTEGRAL ) ||
num.isFeasIntegral( col1val ) );
assert( ( col2boundFlags & IS_LBINF ) ||
num.isFeasGE( col2val, col2lb ) );
assert( ( col2boundFlags & IS_UBINF ) ||
num.isFeasLE( col2val, col2ub ) );
assert( !( col2boundFlags & IS_INTEGRAL ) ||
num.isFeasIntegral( col2val ) );
assert( num.isFeasEq( solval, col2scale * col1val + col2val ) );
// solSet[col1] = true;
origSol[col1] = col1val;
origSol[col2] = col2val;
break;
}
}
// intermediate kkt check
if( checker.level == CheckLevel::After_each_postsolve_step )
{
auto kktStatePostsolvedProblem = checker.initState(
ProblemType::kPostsolved, originalSolution, checker.level );
checker.checkIntermediate( kktStatePostsolvedProblem );
}
}
// todo: move to checker
// assert( std::all_of( solSet.begin(), solSet.end(),
// []( uint8_t isset ) { return isset; } ) );
auto kktStateOriginalProblem = checker.initState(
ProblemType::kOriginal, originalSolution, checker.level );
checker.checkSolution( kktStateOriginalProblem );
return PostsolveStatus::kOk;
}
} // namespace papilo
#endif
| 22,987
|
C++
|
.h
| 614
| 29.947883
| 80
| 0.570595
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,915
|
ProbingView.hpp
|
lgottwald_PaPILO/src/papilo/core/ProbingView.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef _PAPILO_CORE_PROBING_VIEW_HPP_
#define _PAPILO_CORE_PROBING_VIEW_HPP_
#include "papilo/core/Problem.hpp"
#include "papilo/core/SingleRow.hpp"
#include "papilo/io/Message.hpp"
#include "papilo/misc/MultiPrecision.hpp"
#include "papilo/misc/Vec.hpp"
namespace papilo
{
template <typename REAL>
struct ProbingBoundChg
{
REAL bound;
unsigned int col : 31;
unsigned int upper : 1;
ProbingBoundChg( bool upper, int col, REAL bound )
{
this->upper = upper ? 1 : 0;
this->col = static_cast<unsigned int>( col );
this->bound = bound;
}
};
template <typename REAL>
struct ProbingSubstitution
{
REAL col2scale;
REAL col2const;
int col1;
int col2;
ProbingSubstitution( int col1, REAL col2scale, int col2, REAL col2const )
: col2scale( col2scale ), col2const( col2const ), col1( col1 ),
col2( col2 )
{
}
};
template <typename REAL>
class ProbingView
{
public:
ProbingView( const Problem<REAL>& problem, const Num<REAL>& num );
void
setMinIntDomRed( const REAL& minintdomred )
{
this->minintdomred = minintdomred;
}
void
setMinContDomRed( const REAL& mincontdomred )
{
this->mincontdomred = mincontdomred;
}
void
reset();
void
setProbingColumn( int col, bool value )
{
// remember probing column and probed value
probingCol = col;
probingValue = value;
// fix upper/lower bound of probed column
if( value )
changeLb( col, 1.0 );
else
changeUb( col, 0.0 );
}
void
activityChanged( ActivityChange actchange, int rowid,
RowActivity<REAL>& activity );
void
changeLb( int col, REAL newlb );
void
changeUb( int col, REAL newub );
void
storeImplications();
bool
analyzeImplications();
void
propagateDomains();
bool
isInfeasible() const
{
return infeasible;
}
int
getNumSubstitutions() const
{
return static_cast<int>( substitutions.size() );
}
Vec<ProbingBoundChg<REAL>>&
getProbingBoundChanges()
{
return boundChanges;
}
Vec<ProbingSubstitution<REAL>>&
getProbingSubstitutions()
{
return substitutions;
}
const Vec<ProbingBoundChg<REAL>>&
getProbingBoundChanges() const
{
return boundChanges;
}
const Vec<ProbingSubstitution<REAL>>&
getProbingSubstitutions() const
{
return substitutions;
}
int64_t
getAmountOfWork() const
{
return amountofwork;
}
const Vec<REAL>&
getProbingLowerBounds() const
{
return probing_lower_bounds;
}
const Vec<REAL>&
getProbingUpperBounds() const
{
return probing_upper_bounds;
}
const Vec<ColFlags>&
getProbingDomainFlags() const
{
return probing_domain_flags;
}
void
clearResults()
{
amountofwork = 0;
boundChanges.clear();
substitutions.clear();
}
private:
// reference to problem and numerics class
const Problem<REAL>& problem;
const Num<REAL>& num;
REAL minintdomred;
REAL mincontdomred;
// datastructures used for probing
Vec<int> changed_lbs;
Vec<int> changed_ubs;
Vec<int> changed_activities;
Vec<REAL> probing_lower_bounds;
Vec<REAL> probing_upper_bounds;
Vec<ColFlags> probing_domain_flags;
Vec<RowActivity<REAL>> probing_activities;
Vec<int> prop_activities;
Vec<int> next_prop_activities;
bool infeasible;
int round;
int probingCol;
bool probingValue;
// datastructures for storing result of probing on one value
Vec<ProbingBoundChg<REAL>> otherValueImplications;
bool otherValueInfeasible;
// results of probing and statistics
Vec<ProbingBoundChg<REAL>> boundChanges;
Vec<ProbingSubstitution<REAL>> substitutions;
int64_t amountofwork;
};
#ifdef PAPILO_USE_EXTERN_TEMPLATES
extern template class ProbingView<double>;
extern template class ProbingView<Quad>;
extern template class ProbingView<Rational>;
#endif
template <typename REAL>
ProbingView<REAL>::ProbingView( const Problem<REAL>& problem,
const Num<REAL>& num )
: problem( problem ), num( num ),
probing_lower_bounds( problem.getLowerBounds() ),
probing_upper_bounds( problem.getUpperBounds() ),
probing_domain_flags( problem.getColFlags() ),
probing_activities( problem.getRowActivities() )
{
round = -2;
infeasible = false;
amountofwork = 0;
probingCol = -1;
probingValue = false;
otherValueInfeasible = false;
minintdomred = num.getFeasTol() * 1000;
mincontdomred = 0.3;
}
template <typename REAL>
void
ProbingView<REAL>::reset()
{
const Vec<int>& rowsize = problem.getConstraintMatrix().getRowSizes();
const auto& orig_lbs = problem.getLowerBounds();
for( int i : changed_lbs )
{
if( i < 0 )
{
int c = -i - 1;
assert( !probing_domain_flags[c].test( ColFlag::kLbUseless ) &&
problem.getColFlags()[c].test( ColFlag::kLbUseless ) );
probing_domain_flags[c].set( ColFlag::kLbUseless );
#ifndef NDEBUG
probing_lower_bounds[c] = orig_lbs[c];
#endif
}
else
probing_lower_bounds[i] = orig_lbs[i];
}
changed_lbs.clear();
const auto& orig_ubs = problem.getUpperBounds();
for( int i : changed_ubs )
{
if( i < 0 )
{
int c = -i - 1;
assert( !probing_domain_flags[c].test( ColFlag::kUbUseless ) &&
problem.getColFlags()[c].test( ColFlag::kUbUseless ) );
probing_domain_flags[c].set( ColFlag::kUbUseless );
#ifndef NDEBUG
probing_upper_bounds[c] = orig_ubs[c];
#endif
}
else
probing_upper_bounds[i] = orig_ubs[i];
}
changed_ubs.clear();
const auto& orig_activities = problem.getRowActivities();
for( int i : changed_activities )
{
amountofwork += rowsize[i];
probing_activities[i] = orig_activities[i];
}
changed_activities.clear();
// reset should result in original domains and activities
assert( std::equal( orig_lbs.begin(), orig_lbs.end(),
probing_lower_bounds.begin() ) );
assert( std::equal( orig_ubs.begin(), orig_ubs.end(),
probing_upper_bounds.begin() ) );
assert( std::equal(
orig_activities.begin(), orig_activities.end(),
probing_activities.begin(),
[]( const RowActivity<REAL>& a, const RowActivity<REAL>& b ) {
return a.ninfmax == b.ninfmax && a.ninfmin == b.ninfmin &&
a.min == b.min && a.max == b.max &&
a.lastchange == b.lastchange;
} ) );
round = -2;
prop_activities.clear();
next_prop_activities.clear();
infeasible = false;
probingCol = -1;
}
template <typename REAL>
void
ProbingView<REAL>::activityChanged( ActivityChange actchange, int rowid,
RowActivity<REAL>& activity )
{
const auto& consMatrix = problem.getConstraintMatrix();
const auto& lhs = consMatrix.getLeftHandSides();
const auto& rhs = consMatrix.getRightHandSides();
const auto& rflags = consMatrix.getRowFlags();
// mark the lastchange fields with round values starting from -2
// and counting backward By doing this we avoid that we need to
// alter the lastchange field after copying the original activities
// since they are always larger or equal to -1
if( activity.lastchange > -2 )
changed_activities.push_back(
rowid ); // activity was changed for the first time
if( activity.lastchange != round )
next_prop_activities.push_back( rowid );
activity.lastchange = round;
// check if the updated activity is reliable or if it is zero relative to
// the initial activity
const RowActivity<REAL>& origactivity = problem.getRowActivities()[rowid];
bool unreliable;
if( actchange == ActivityChange::kMin )
unreliable = ( activity.ninfmin <= 1 && activity.min != 0 &&
origactivity.min != 0 &&
num.isZero( activity.min / origactivity.min ) );
else
unreliable = ( activity.ninfmax <= 1 && activity.max != 0 &&
origactivity.max != 0 &&
num.isZero( activity.max / origactivity.max ) );
if( unreliable )
{
auto rowvec = problem.getConstraintMatrix().getRowCoefficients( rowid );
activity = compute_row_activity( rowvec.getValues(), rowvec.getIndices(),
rowvec.getLength(), probing_lower_bounds,
probing_upper_bounds,
probing_domain_flags, round );
}
// check for infeasibility
if( actchange == ActivityChange::kMin && activity.ninfmin == 0 &&
!rflags[rowid].test( RowFlag::kRhsInf ) &&
num.isFeasLT( rhs[rowid], activity.min ) &&
num.isSafeLT( rhs[rowid], activity.min ) )
{
Message::debug( this,
"[{}:{}] probing on col {} with val {} is infeasible min "
"activity is {:.15}, right hand side is {:.15}, and "
"original max activity was {:.15}\n",
__FILE__, __LINE__, probingCol, probingValue,
double( activity.min ), double( rhs[rowid] ),
double( problem.getRowActivities()[rowid].min ) );
infeasible = true;
}
if( actchange == ActivityChange::kMax && activity.ninfmax == 0 &&
!rflags[rowid].test( RowFlag::kLhsInf ) &&
num.isFeasGT( lhs[rowid], activity.max ) &&
num.isSafeGT( lhs[rowid], activity.max ) )
{
Message::debug( this,
"[{}:{}] probing on col {} with val {} is infeasible max "
"activity is {:.15}, left hand side is {:.15}, and "
"original max activity was {:.15}\n",
__FILE__, __LINE__, probingCol, probingValue,
double( activity.max ), double( lhs[rowid] ),
double( problem.getRowActivities()[rowid].max ) );
infeasible = true;
}
}
template <typename REAL>
void
ProbingView<REAL>::changeLb( int col, REAL newlb )
{
const auto& consMatrix = problem.getConstraintMatrix();
auto colvec = consMatrix.getColumnCoefficients( col );
const auto& orig_lbs = problem.getLowerBounds();
// bound must be tighter than current domains
bool lbinf = probing_domain_flags[col].test( ColFlag::kLbUseless );
assert( lbinf || probing_lower_bounds[col] != newlb );
Message::debug( this, "changing probing lower bound of col {} to {}\n", col,
double( newlb ) );
if( lbinf )
{
// bound was not altered yet, store the negative (index + 1) to
// indicate that the infinity flag was altered
probing_domain_flags[col].unset( ColFlag::kLbUseless );
changed_lbs.push_back( -col - 1 );
}
else if( probing_lower_bounds[col] == orig_lbs[col] &&
!problem.getColFlags()[col].test( ColFlag::kLbUseless ) )
// if bound was not altered yet remember it in the index vector
changed_lbs.push_back( col );
// change the bound in the domain vector
REAL oldlb = probing_lower_bounds[col];
probing_lower_bounds[col] = newlb;
// update the probing activities by using the column view
update_activities_after_boundchange(
colvec.getValues(), colvec.getIndices(), colvec.getLength(),
BoundChange::kLower, oldlb, newlb, lbinf, probing_activities,
[this]( ActivityChange actChange, int rowid,
RowActivity<REAL>& activity ) {
activityChanged( actChange, rowid, activity );
},
true );
}
template <typename REAL>
void
ProbingView<REAL>::changeUb( int col, REAL newub )
{
const auto& consMatrix = problem.getConstraintMatrix();
auto colvec = consMatrix.getColumnCoefficients( col );
const auto& orig_ubs = problem.getUpperBounds();
// bound must be tighter than current domains
bool ubinf = probing_domain_flags[col].test( ColFlag::kUbUseless );
assert( ubinf || probing_upper_bounds[col] != newub );
Message::debug( this, "changing probing upper bound of col {} to {}\n", col,
double( newub ) );
if( ubinf )
{
// bound was not altered yet, store the negative (index + 1) to
// indicate that the infinity flag was altered
probing_domain_flags[col].unset( ColFlag::kUbUseless );
changed_ubs.push_back( -col - 1 );
}
else if( probing_upper_bounds[col] == orig_ubs[col] &&
!problem.getColFlags()[col].test( ColFlag::kUbUseless ) )
// if bound was not altered yet remember it in the index vector
changed_ubs.push_back( col );
// change the bound in the domain vector
REAL oldub = probing_upper_bounds[col];
probing_upper_bounds[col] = newub;
// update the probing activities by using the column view
update_activities_after_boundchange(
colvec.getValues(), colvec.getIndices(), colvec.getLength(),
BoundChange::kUpper, oldub, newub, ubinf, probing_activities,
[this]( ActivityChange actChange, int rowid,
RowActivity<REAL>& activity ) {
activityChanged( actChange, rowid, activity );
},
true );
}
template <typename REAL>
void
ProbingView<REAL>::storeImplications()
{
otherValueInfeasible = isInfeasible();
if( otherValueInfeasible )
return;
otherValueImplications.clear();
otherValueImplications.reserve( changed_lbs.size() + changed_ubs.size() -
1 );
for( int c : changed_lbs )
{
int col = c < 0 ? -c - 1 : c;
if( col == probingCol )
continue;
otherValueImplications.emplace_back(
ProbingBoundChg<REAL>( false, col, probing_lower_bounds[col] ) );
}
for( int c : changed_ubs )
{
int col = c < 0 ? -c - 1 : c;
if( col == probingCol )
continue;
otherValueImplications.emplace_back(
ProbingBoundChg<REAL>( true, col, probing_upper_bounds[col] ) );
}
}
template <typename REAL>
bool
ProbingView<REAL>::analyzeImplications()
{
const auto& orig_ubs = problem.getUpperBounds();
const auto& orig_lbs = problem.getLowerBounds();
const Vec<ColFlags>& orig_domain_flags = problem.getColFlags();
// check infeasibility
if( otherValueInfeasible )
{
// both probing values are infeasible
if( infeasible )
return true;
// only the other probing value is infeasible, so store all changed
// bounds as bound changes note that this includes the fixing of the
// probing column to the probed value
boundChanges.reserve( boundChanges.size() + changed_lbs.size() +
changed_ubs.size() );
for( int c : changed_lbs )
{
int col = c < 0 ? -c - 1 : c;
assert( c >= 0 ||
( !probing_domain_flags[col].test( ColFlag::kLbUseless ) &&
orig_domain_flags[col].test( ColFlag::kLbUseless ) ) );
assert( c < 0 ||
( !probing_domain_flags[col].test( ColFlag::kLbUseless ) &&
!orig_domain_flags[col].test( ColFlag::kLbUseless ) ) );
assert( c < 0 || probing_lower_bounds[col] > orig_lbs[col] );
boundChanges.emplace_back(
ProbingBoundChg<REAL>( false, col, probing_lower_bounds[col] ) );
}
for( int c : changed_ubs )
{
int col = c < 0 ? -c - 1 : c;
assert( c >= 0 ||
( !probing_domain_flags[col].test( ColFlag::kUbUseless ) &&
orig_domain_flags[col].test( ColFlag::kUbUseless ) ) );
assert( c < 0 ||
( !probing_domain_flags[col].test( ColFlag::kUbUseless ) &&
!orig_domain_flags[col].test( ColFlag::kUbUseless ) ) );
assert( c < 0 || probing_upper_bounds[col] < orig_ubs[col] );
boundChanges.emplace_back(
ProbingBoundChg<REAL>( true, col, probing_upper_bounds[col] ) );
}
return false;
}
boundChanges.reserve( boundChanges.size() + otherValueImplications.size() +
1 );
if( infeasible )
{
if( probingValue )
{
// probing to 1 is infeasible, fix probing column to 0
boundChanges.emplace_back(
ProbingBoundChg<REAL>( true, probingCol, 0.0 ) );
}
else
{
// probing to 0 is infeasible, fix probing column to 1
boundChanges.emplace_back(
ProbingBoundChg<REAL>( false, probingCol, 1.0 ) );
}
}
assert( !otherValueInfeasible );
for( const ProbingBoundChg<REAL>& boundChg : otherValueImplications )
{
bool impliedFixing =
( boundChg.upper &&
!orig_domain_flags[boundChg.col].test( ColFlag::kLbUseless ) &&
orig_lbs[boundChg.col] == boundChg.bound ) ||
( !boundChg.upper &&
!orig_domain_flags[boundChg.col].test( ColFlag::kUbUseless ) &&
orig_ubs[boundChg.col] == boundChg.bound );
// only this probing branch is infeasible, so add all implications of
// the other value as bound change
if( infeasible )
{
boundChanges.emplace_back( boundChg );
continue;
}
bool fixed =
( !probing_domain_flags[boundChg.col].test( ColFlag::kUnbounded ) &&
probing_lower_bounds[boundChg.col] ==
probing_upper_bounds[boundChg.col] );
if( impliedFixing && fixed &&
!num.isFeasEq( probing_lower_bounds[boundChg.col], boundChg.bound ) )
{ // column is fixed to different values in both probing branches
REAL zerofixval;
REAL onefixval;
// Determine the fixed values for probing with value 0 and 1
if( probingValue )
{
zerofixval = boundChg.bound;
onefixval = probing_lower_bounds[boundChg.col];
}
else
{
zerofixval = probing_lower_bounds[boundChg.col];
onefixval = boundChg.bound;
}
int col1 = boundChg.col;
int col2 = probingCol;
REAL scale = onefixval - zerofixval;
// in case both columns are binary, we keep the one whith the
// smaller index
if( col1 < col2 && abs( scale ) == 1 &&
( zerofixval == 1 || zerofixval == 0 ) &&
probing_domain_flags[col1].test( ColFlag::kIntegral ) )
std::swap( col1, col2 );
// add the corresponding substitution.
substitutions.emplace_back(
ProbingSubstitution<REAL>( col1, scale, col2, zerofixval ) );
}
else if( boundChg.upper &&
!probing_domain_flags[boundChg.col].test( ColFlag::kUbInf ) &&
( orig_domain_flags[boundChg.col].test( ColFlag::kUbInf ) ||
orig_ubs[boundChg.col] > probing_upper_bounds[boundChg.col] ) )
{
assert( orig_domain_flags[boundChg.col].test( ColFlag::kUbInf ) ||
orig_ubs[boundChg.col] > boundChg.bound );
// upper bound is tightened in both probing branches
boundChanges.emplace_back( ProbingBoundChg<REAL>(
true, boundChg.col,
num.max( boundChg.bound, probing_upper_bounds[boundChg.col] ) ) );
}
else if( !boundChg.upper &&
!probing_domain_flags[boundChg.col].test( ColFlag::kLbInf ) &&
( orig_domain_flags[boundChg.col].test( ColFlag::kLbInf ) ||
orig_lbs[boundChg.col] < probing_lower_bounds[boundChg.col] ) )
{
assert( orig_domain_flags[boundChg.col].test( ColFlag::kLbInf ) ||
orig_lbs[boundChg.col] < boundChg.bound );
// lower bound is tightened in both probing branches
boundChanges.emplace_back( ProbingBoundChg<REAL>(
false, boundChg.col,
num.min( boundChg.bound, probing_lower_bounds[boundChg.col] ) ) );
}
}
return false;
}
template <typename REAL>
void
ProbingView<REAL>::propagateDomains()
{
const auto& consMatrix = problem.getConstraintMatrix();
const auto& lhs = consMatrix.getLeftHandSides();
const auto& rhs = consMatrix.getRightHandSides();
const auto& rflags = consMatrix.getRowFlags();
int nchgs = 0;
using std::swap;
swap( prop_activities, next_prop_activities );
next_prop_activities.clear();
while( !prop_activities.empty() )
{
int curr_round = round--;
Message::debug( this,
"starting probing propagation round {} on {} rows\n",
-curr_round - 2, prop_activities.size() );
for( int candrow : prop_activities )
{
bool propagate = false;
if( !rflags[candrow].test( RowFlag::kRhsInf ) &&
probing_activities[candrow].ninfmin <= 1 )
propagate = true;
if( !rflags[candrow].test( RowFlag::kLhsInf ) &&
probing_activities[candrow].ninfmax <= 1 )
propagate = true;
if( !propagate )
continue;
auto rowvec = consMatrix.getRowCoefficients( candrow );
propagate_row(
rowvec.getValues(), rowvec.getIndices(), rowvec.getLength(),
probing_activities[candrow], lhs[candrow], rhs[candrow],
rflags[candrow], probing_lower_bounds, probing_upper_bounds,
probing_domain_flags,
[this, &nchgs]( BoundChange bndChg, int colid, REAL newbound ) {
if( num.isHugeVal( newbound ) )
return;
bool isint = probing_domain_flags[colid].test(
ColFlag::kIntegral, ColFlag::kImplInt );
if( bndChg == BoundChange::kLower )
{
if( isint )
newbound = num.feasCeil( newbound );
if( !probing_domain_flags[colid].test( ColFlag::kUbInf ) &&
newbound > probing_upper_bounds[colid] )
{
if( num.isFeasGT( newbound,
probing_upper_bounds[colid] ) )
{
Message::debug( this,
"[{}:{}] probing on col {} with "
"val {} is infeasible\n",
__FILE__, __LINE__, probingCol,
probingValue );
infeasible = true;
return;
}
newbound = probing_upper_bounds[colid];
}
REAL delta = newbound - probing_lower_bounds[colid];
bool finiteDomain =
!probing_domain_flags[colid].test( ColFlag::kUbInf );
REAL mindomred = isint ? minintdomred : mincontdomred;
if( probing_domain_flags[colid].test(
ColFlag::kLbUseless ) ||
( finiteDomain && delta > 0 &&
( delta / ( probing_upper_bounds[colid] -
probing_lower_bounds[colid] ) >=
mindomred ) ) )
changeLb( colid, newbound );
}
else
{
assert( bndChg == BoundChange::kUpper );
if( isint )
newbound = num.feasFloor( newbound );
if( !probing_domain_flags[colid].test( ColFlag::kLbInf ) &&
newbound < probing_lower_bounds[colid] )
{
if( num.isFeasLT( newbound,
probing_lower_bounds[colid] ) )
{
Message::debug( this,
"[{}:{}] probing on col {} with "
"val {} is infeasible\n",
__FILE__, __LINE__, probingCol,
probingValue );
infeasible = true;
return;
}
newbound = probing_lower_bounds[colid];
}
REAL delta = probing_upper_bounds[colid] - newbound;
bool finiteDomain =
!probing_domain_flags[colid].test( ColFlag::kLbInf );
REAL mindomred = isint ? minintdomred : mincontdomred;
if( probing_domain_flags[colid].test(
ColFlag::kUbUseless ) ||
( finiteDomain && delta > 0 &&
( delta / ( probing_upper_bounds[colid] -
probing_lower_bounds[colid] ) >=
mindomred ) ) )
changeUb( colid, newbound );
}
} );
if( infeasible )
return;
}
swap( prop_activities, next_prop_activities );
next_prop_activities.clear();
}
}
} // namespace papilo
#endif
| 27,084
|
C++
|
.h
| 695
| 29.932374
| 80
| 0.571837
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,916
|
RowFlags.hpp
|
lgottwald_PaPILO/src/papilo/core/RowFlags.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef _PAPILO_CORE_ROW_FLAGS_HPP_
#define _PAPILO_CORE_ROW_FLAGS_HPP_
#include "papilo/misc/Flags.hpp"
namespace papilo
{
enum class RowFlag : uint8_t
{
NONE = 0,
kLhsInf = 1 << 0,
kRhsInf = 1 << 1,
kEquation = 1 << 2,
kIntegral = 1 << 3,
kRedundant = 1 << 4,
};
using RowFlags = Flags<RowFlag>;
} // namespace papilo
#endif
| 2,111
|
C++
|
.h
| 39
| 52.512821
| 79
| 0.422072
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,918
|
Solution.hpp
|
lgottwald_PaPILO/src/papilo/core/Solution.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef _PAPILO_CORE_SOLUTION_HPP_
#define _PAPILO_CORE_SOLUTION_HPP_
namespace papilo
{
enum class SolutionType
{
kPrimal,
kPrimalDual
};
template <typename REAL>
class Solution
{
public:
SolutionType type;
Vec<REAL> primal;
Vec<REAL> col_dual;
Vec<REAL> row_dual;
// Default type primal only.
Solution() : type( SolutionType::kPrimal ) {}
Solution( SolutionType type_ ) : type( type_ ) {}
Solution( SolutionType type_, Vec<REAL> values )
: type( type_ ), primal( std::move( values ) )
{
}
Solution( Vec<REAL> values )
: type( SolutionType::kPrimal ), primal( std::move( values ) )
{
}
Solution( Vec<REAL> primal_values, Vec<REAL> dual_col_values,
Vec<REAL> dual_row_values )
: type( SolutionType::kPrimalDual ),
primal( std::move( primal_values ) ),
col_dual( std::move( dual_col_values ) ),
row_dual( std::move( dual_row_values ) )
{
}
};
/*
template <typename REAL>
class PrimalSolution : public Solution<REAL>
{
public:
PrimalSolution() : Solution<REAL>( SolutionType::kPrimal ) {}
PrimalSolution( std::vector<REAL> values )
: Solution<REAL>( SolutionType::kPrimal, values )
{
}
};
template <typename REAL>
class PrimalDualSolution : public Solution<REAL>
{
public:
std::vector<REAL> col_dual;
std::vector<REAL> row_dual;
PrimalDualSolution() : Solution<REAL>( SolutionType::kPrimalDual ) {}
PrimalDualSolution( std::vector<REAL> primal_values )
: Solution<REAL>( SolutionType::kPrimal, primal_values )
{
}
};
*/
} // namespace papilo
#endif
| 3,382
|
C++
|
.h
| 85
| 36.729412
| 79
| 0.513398
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,536,922
|
ProblemBuilder.hpp
|
lgottwald_PaPILO/src/papilo/core/ProblemBuilder.hpp
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
/* */
/* Copyright (C) 2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 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 Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef _PAPILO_CORE_PROBLEM_BUILDER_HPP_
#define _PAPILO_CORE_PROBLEM_BUILDER_HPP_
namespace papilo
{
#include "papilo/core/MatrixBuffer.hpp"
#include "papilo/core/Problem.hpp"
#include "papilo/misc/String.hpp"
#include "papilo/misc/Vec.hpp"
template <typename REAL>
class ProblemBuilder
{
public:
/// Sets the number of columns to the given value. The information of columns
/// that already exist is kept, new columns are continuous and fixed to zero.
/// If the number of columns is reduced, then the information for the removed
/// columns is lost.
void
setNumCols( int ncols )
{
// allocate column information
obj.coefficients.resize( ncols );
domains.lower_bounds.resize( ncols );
domains.upper_bounds.resize( ncols );
domains.flags.resize( ncols );
colnames.resize( ncols );
}
/// Sets the number of rows to the given value. The information of rows that
/// already exist is kept, new rows are qualities with right hand side zero.
/// If the number of rows is reduced, then the information for the removed
/// rows is lost.
void
setNumRows( int nrows )
{
// allocate row information
lhs.resize( nrows );
rhs.resize( nrows );
rflags.resize( nrows );
rownames.resize( nrows );
}
/// Returns the current number of rows
int
getNumRows() const
{
return static_cast<int>( rflags.size() );
}
/// Returns the current number of cols
int
getNumCols() const
{
return static_cast<int>( domains.flags.size() );
}
/// reserve storage for the given number of non-zeros
void
reserve( int nnz, int nrows, int ncols )
{
matrix_buffer.reserve( nnz );
// reserve space for row information
lhs.reserve( nrows );
rhs.reserve( nrows );
rflags.reserve( nrows );
rownames.reserve( nrows );
// reserve space for column information
obj.coefficients.reserve( ncols );
domains.lower_bounds.reserve( ncols );
domains.upper_bounds.reserve( ncols );
domains.flags.reserve( ncols );
colnames.reserve( ncols );
}
/// change the objective coefficient of a column
void
setObj( int col, REAL val )
{
obj.coefficients[col] = std::move( val );
}
/// change the objective coefficient of all columns
void
setObjAll( Vec<REAL> values )
{
assert( values.size() == obj.coefficients.size() );
for( int c = 0; c < values.size(); ++c )
obj.coefficients[c] = std::move( values[c] );
}
/// change the objectives constant offset
void
setObjOffset( REAL val )
{
obj.offset = std::move( val );
}
void
setColLbInf( int col, bool isInfinite )
{
if( isInfinite )
domains.flags[col].set( ColFlag::kLbInf );
else
domains.flags[col].unset( ColFlag::kLbInf );
}
void
setColLbInfAll( Vec<uint8_t> isInfinite )
{
assert( domains.flags.size() == isInfinite.size() );
for( int c = 0; c < isInfinite.size(); ++c )
setColLbInf( c, isInfinite[c] );
}
void
setColUbInf( int col, bool isInfinite )
{
if( isInfinite )
domains.flags[col].set( ColFlag::kUbInf );
else
domains.flags[col].unset( ColFlag::kUbInf );
}
void
setColUbInfAll( Vec<uint8_t> isInfinite )
{
assert( domains.flags.size() == isInfinite.size() );
for( int c = 0; c < isInfinite.size(); ++c )
setColUbInf( c, isInfinite[c] );
}
void
setColLb( int col, REAL lb )
{
domains.lower_bounds[col] = std::move( lb );
}
void
setColLbAll( Vec<REAL> lbs )
{
assert( lbs.size() == domains.lower_bounds.size() );
for( int c = 0; c < lbs.size(); ++c )
domains.lower_bounds[c] = std::move( lbs[c] );
}
void
setColUb( int col, REAL ub )
{
domains.upper_bounds[col] = std::move( ub );
}
void
setColUbAll( Vec<REAL> ubs )
{
assert( ubs.size() == domains.upper_bounds.size() );
for( int c = 0; c < ubs.size(); ++c )
domains.upper_bounds[c] = std::move( ubs[c] );
}
void
setColIntegral( int col, bool isIntegral )
{
if( isIntegral )
domains.flags[col].set( ColFlag::kIntegral );
else
domains.flags[col].unset( ColFlag::kIntegral );
}
void
setColIntegralAll( Vec<uint8_t> isIntegral )
{
assert( isIntegral.size() == domains.flags.size() );
for( int c = 0; c < isIntegral.size(); ++c )
setColIntegral( c, isIntegral[c] );
}
void
setRowLhsInf( int row, bool isInfinite )
{
if( isInfinite )
rflags[row].set( RowFlag::kLhsInf );
else
rflags[row].unset( RowFlag::kLhsInf );
}
void
setRowLhsInfAll( Vec<uint8_t> isInfinite )
{
assert( isInfinite.size() == rflags.size() );
for( int r = 0; r < isInfinite.size(); ++r )
setRowLhsInf( r, isInfinite[r] );
}
void
setRowRhsInf( int row, bool isInfinite )
{
if( isInfinite )
rflags[row].set( RowFlag::kRhsInf );
else
rflags[row].unset( RowFlag::kRhsInf );
}
void
setRowRhsInfAll( Vec<uint8_t> isInfinite )
{
assert( isInfinite.size() == rflags.size() );
for( int r = 0; r < isInfinite.size(); ++r )
setRowRhsInf( r, isInfinite[r] );
}
void
setRowLhs( int row, REAL lhsval )
{
lhs[row] = std::move( lhsval );
}
void
setRowLhsAll( Vec<REAL> lhsvals )
{
assert( lhsvals.size() == lhs.size() );
for( int r = 0; r < lhsvals.size(); ++r )
lhs[r] = std::move( lhsvals[r] );
}
void
setRowRhs( int row, REAL rhsval )
{
rhs[row] = std::move( rhsval );
}
void
setRowRhsAll( Vec<REAL> rhsvals )
{
assert( rhsvals.size() == rhs.size() );
for( int r = 0; r < rhsvals.size(); ++r )
rhs[r] = std::move( rhsvals[r] );
}
/// add a nonzero entry for the given row and column
void
addEntry( int row, int col, const REAL& val )
{
assert( val != 0 );
matrix_buffer.addEntry( row, col, val );
}
/// add all given entries given in tripel: (row,col,val)
void
addEntryAll( Vec<std::tuple<int, int, REAL>> entries )
{
for( auto trp : entries )
addEntry( std::get<0>( trp ), std::get<1>( trp ), std::get<2>( trp ) );
}
/// add the nonzero entries for the given row
template <typename R>
void
addRowEntries( int row, int len, const int* cols, const R* vals )
{
for( int i = 0; i != len; ++i )
{
assert( vals[i] != 0 );
matrix_buffer.addEntry( row, cols[i], REAL{ vals[i] } );
}
}
template <typename Str>
void
setRowName( int row, Str&& name )
{
rownames[row] = String( name );
}
template <typename Str>
void
setRowNameAll( Vec<Str> names )
{
assert( rownames.size() == names.size() );
for( int r = 0; r < names.size(); ++r )
rownames[r] = String( names[r] );
}
template <typename Str>
void
setColName( int col, Str&& name )
{
colnames[col] = String( name );
}
template <typename Str>
void
setColNameAll( Vec<Str> names )
{
assert( colnames.size() == names.size() );
for( int c = 0; c < names.size(); ++c )
colnames[c] = String( names[c] );
}
template <typename Str>
void
setProblemName( Str&& name )
{
probname = String( name );
}
/// add the nonzero entries for the given column
template <typename R>
void
addColEntries( int col, int len, const int* rows, const R* vals )
{
for( int i = 0; i != len; ++i )
{
assert( vals[i] != 0 );
matrix_buffer.addEntry( rows[i], col, REAL{ vals[i] } );
}
}
Problem<REAL>
build()
{
Problem<REAL> problem;
int nrows = lhs.size();
int ncols = obj.coefficients.size();
problem.setName( std::move( probname ) );
problem.setConstraintMatrix( ConstraintMatrix<REAL>{
matrix_buffer.buildCSR( nrows, ncols ),
matrix_buffer.buildCSC( nrows, ncols ), std::move( lhs ),
std::move( rhs ), std::move( rflags ) } );
matrix_buffer.clear();
problem.setObjective( std::move( obj ) );
problem.setVariableDomains( std::move( domains ) );
problem.setVariableNames( std::move( colnames ) );
problem.setConstraintNames( std::move( rownames ) );
return problem;
}
private:
MatrixBuffer<REAL> matrix_buffer;
Objective<REAL> obj;
VariableDomains<REAL> domains;
Vec<REAL> lhs;
Vec<REAL> rhs;
Vec<RowFlags> rflags;
Vec<String> rownames;
Vec<String> colnames;
String probname;
};
} // namespace papilo
#endif
| 10,557
|
C++
|
.h
| 334
| 26.458084
| 80
| 0.565461
|
lgottwald/PaPILO
| 39
| 2
| 2
|
LGPL-3.0
|
9/20/2024, 10:44:43 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.