file_name
stringlengths
6
86
file_path
stringlengths
45
249
content
stringlengths
47
6.26M
file_size
int64
47
6.26M
language
stringclasses
1 value
extension
stringclasses
1 value
repo_name
stringclasses
767 values
repo_stars
int64
8
14.4k
repo_forks
int64
0
1.17k
repo_open_issues
int64
0
788
repo_created_at
stringclasses
767 values
repo_pushed_at
stringclasses
767 values
PaperComponentHandle.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bukkit/paper/src/main/java/com/discordsrv/bukkit/component/PaperComponentHandle.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.bukkit.component; import com.discordsrv.api.component.MinecraftComponent; import com.discordsrv.common.component.ComponentFactory; import com.discordsrv.common.component.util.ComponentUtil; import net.kyori.adventure.platform.bukkit.BukkitComponentSerializer; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.util.function.Function; public class PaperComponentHandle<T> { public static final boolean IS_PAPER_ADVENTURE; private static final MethodHandles.Lookup LOOKUP; static { boolean isPaperAdventure = false; try { Class.forName("io.papermc.paper.event.player.AsyncChatEvent"); isPaperAdventure = true; } catch (ClassNotFoundException ignored) {} IS_PAPER_ADVENTURE = isPaperAdventure; LOOKUP = IS_PAPER_ADVENTURE ? MethodHandles.lookup() : null; } private final MethodHandle handle; private final Function<T, String> legacy; public PaperComponentHandle(Class<T> targetClass, String methodName, Function<T, String> legacy) { this.legacy = legacy; MethodHandle handle = null; if (IS_PAPER_ADVENTURE) { try { MethodType methodType = MethodType.methodType(ComponentFactory.UNRELOCATED_ADVENTURE_COMPONENT); handle = LOOKUP.findVirtual(targetClass, methodName, methodType); } catch (Throwable ignored) {} } this.handle = handle; } public MinecraftComponent getComponent(T target) { if (handle != null) { Object unrelocated = null; try { unrelocated = handle.invoke(target); } catch (Throwable ignored) {} if (unrelocated != null) { return ComponentUtil.fromUnrelocated(unrelocated); } } if (legacy == null) { return null; } String legacyOutput = legacy.apply(target); return legacyOutput != null ? ComponentUtil.toAPI(BukkitComponentSerializer.legacy().deserialize(legacyOutput)) : null; } }
3,014
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
PaperBanList.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bukkit/paper/src/main/java/com/discordsrv/bukkit/ban/PaperBanList.java
package com.discordsrv.bukkit.ban; import org.bukkit.BanEntry; import org.bukkit.BanList; import org.bukkit.Server; import java.time.Instant; import java.util.UUID; public final class PaperBanList { public static final boolean IS_AVAILABLE; static { boolean is = false; try { BanList.Type.valueOf("PROFILE"); is = true; } catch (IllegalArgumentException ignored) {} IS_AVAILABLE = is; } private PaperBanList() {} public static BanList<UUID> banList(Server server) { return server.getBanList(BanList.Type.PROFILE); } public static BanEntry<?> getBanEntry(Server server, UUID playerUUID) { return banList(server).getBanEntry(playerUUID); } public static void addBan(Server server, UUID playerUUID, Instant until, String reason, String punisher) { banList(server).addBan(playerUUID, reason, until, punisher); } public static void removeBan(Server server, UUID playerUUID) { banList(server).pardon(playerUUID); } }
1,057
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
PaperPlayer.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bukkit/paper/src/main/java/com/discordsrv/bukkit/player/PaperPlayer.java
package com.discordsrv.bukkit.player; import org.bukkit.entity.Player; import java.util.Locale; public final class PaperPlayer { private PaperPlayer() {} private static final boolean localeMethodExists; private static final boolean getLocaleMethodExists; static { Class<?> playerClass = Player.class; boolean locale = false, getLocale = false; try { playerClass.getMethod("locale"); locale = true; } catch (ReflectiveOperationException ignored) {} try { playerClass.getMethod("getLocale"); getLocale = true; } catch (ReflectiveOperationException ignored) {} localeMethodExists = locale; getLocaleMethodExists = getLocale; } @SuppressWarnings("deprecation") public static Locale getLocale(Player player) { if (localeMethodExists) { return player.locale(); } else if (getLocaleMethodExists) { return Locale.forLanguageTag(player.getLocale()); } else { return null; } } }
1,089
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
DiscordSRVBungeeLoader.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bungee/loader/src/main/java/com/discordsrv/bungee/loader/DiscordSRVBungeeLoader.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.bungee.loader; import dev.vankka.dependencydownload.jarinjar.loader.exception.LoadingException; import dev.vankka.mcdependencydownload.bungee.loader.BungeeLoader; import org.jetbrains.annotations.NotNull; import java.net.URL; import java.util.logging.Level; @SuppressWarnings("unused") // Used by Bungee public class DiscordSRVBungeeLoader extends BungeeLoader { @Override public @NotNull String getBootstrapClassName() { return "com.discordsrv.bungee.DiscordSRVBungeeBootstrap"; } @Override public @NotNull URL getJarInJarResource() { URL resource = getClass().getClassLoader().getResource("bungee.jarinjar"); if (resource == null) { throw new IllegalStateException("Jar does not contain jarinjar"); } return resource; } @Override public void handleLoadingException(LoadingException exception) { getLogger().logp(Level.SEVERE, null, null, exception.getCause(), exception::getMessage); } }
1,845
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
BungeeDiscordSRV.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bungee/src/main/java/com/discordsrv/bungee/BungeeDiscordSRV.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.bungee; import com.discordsrv.bungee.command.game.handler.BungeeCommandHandler; import com.discordsrv.bungee.console.BungeeConsole; import com.discordsrv.bungee.player.BungeePlayerProvider; import com.discordsrv.bungee.plugin.BungeePluginManager; import com.discordsrv.common.ProxyDiscordSRV; import com.discordsrv.common.command.game.handler.ICommandHandler; import com.discordsrv.common.config.configurate.manager.ConnectionConfigManager; import com.discordsrv.common.config.configurate.manager.MainConfigManager; import com.discordsrv.common.config.configurate.manager.MessagesConfigManager; import com.discordsrv.common.config.connection.ConnectionConfig; import com.discordsrv.common.config.main.MainConfig; import com.discordsrv.common.config.messages.MessagesConfig; import com.discordsrv.common.debug.data.OnlineMode; import com.discordsrv.common.plugin.PluginManager; import com.discordsrv.common.scheduler.StandardScheduler; import net.kyori.adventure.platform.bungeecord.BungeeAudiences; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.plugin.Plugin; import org.jetbrains.annotations.NotNull; public class BungeeDiscordSRV extends ProxyDiscordSRV<DiscordSRVBungeeBootstrap, MainConfig, ConnectionConfig, MessagesConfig> { private BungeeAudiences audiences; private final StandardScheduler scheduler; private final BungeeConsole console; private final BungeePlayerProvider playerProvider; private final BungeePluginManager pluginManager; private BungeeCommandHandler commandHandler; public BungeeDiscordSRV(DiscordSRVBungeeBootstrap bootstrap) { super(bootstrap); this.scheduler = new StandardScheduler(this); this.console = new BungeeConsole(this); this.playerProvider = new BungeePlayerProvider(this); this.pluginManager = new BungeePluginManager(this); load(); } public Plugin plugin() { return bootstrap.getPlugin(); } public ProxyServer proxy() { return plugin().getProxy(); } public BungeeAudiences audiences() { return audiences; } @Override public StandardScheduler scheduler() { return scheduler; } @Override public BungeeConsole console() { return console; } @Override public @NotNull BungeePlayerProvider playerProvider() { return playerProvider; } @Override public PluginManager pluginManager() { return pluginManager; } @Override public OnlineMode onlineMode() { return OnlineMode.of(proxy().getConfig().isOnlineMode()); } @Override public ICommandHandler commandHandler() { return commandHandler; } @Override public ConnectionConfigManager<ConnectionConfig> connectionConfigManager() { return null; } @Override public MainConfigManager<MainConfig> configManager() { return null; } @Override public MessagesConfigManager<MessagesConfig> messagesConfigManager() { return null; } @Override protected void enable() throws Throwable { // Player related this.audiences = BungeeAudiences.create(bootstrap.getPlugin()); this.commandHandler = new BungeeCommandHandler(this); super.enable(); } }
4,156
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
DiscordSRVBungeeBootstrap.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bungee/src/main/java/com/discordsrv/bungee/DiscordSRVBungeeBootstrap.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.bungee; import com.discordsrv.common.bootstrap.IBootstrap; import com.discordsrv.common.bootstrap.LifecycleManager; import com.discordsrv.common.logging.Logger; import com.discordsrv.common.logging.backend.impl.JavaLoggerImpl; import dev.vankka.dependencydownload.classpath.ClasspathAppender; import dev.vankka.dependencydownload.jarinjar.classloader.JarInJarClassLoader; import dev.vankka.mcdependencydownload.bungee.bootstrap.BungeeBootstrap; import net.md_5.bungee.api.plugin.Plugin; import java.io.IOException; import java.nio.file.Path; public class DiscordSRVBungeeBootstrap extends BungeeBootstrap implements IBootstrap { private final Logger logger; private final LifecycleManager lifecycleManager; private BungeeDiscordSRV discordSRV; // Don't change these parameters public DiscordSRVBungeeBootstrap(JarInJarClassLoader classLoader, Plugin plugin) throws IOException { super(classLoader, plugin); this.logger = new JavaLoggerImpl(plugin.getLogger()); this.lifecycleManager = new LifecycleManager( logger, plugin.getDataFolder().toPath(), new String[] {"dependencies/runtimeDownload-bungee.txt"}, getClasspathAppender() ); } @Override public void onEnable() { lifecycleManager.loadAndEnable(() -> this.discordSRV = new BungeeDiscordSRV(this)); } @Override public void onDisable() { lifecycleManager.disable(discordSRV); } @Override public Logger logger() { return logger; } @Override public ClasspathAppender classpathAppender() { return getClasspathAppender(); } @Override public ClassLoader classLoader() { return getClassLoader(); } @Override public LifecycleManager lifecycleManager() { return lifecycleManager; } @Override public Path dataDirectory() { return getPlugin().getDataFolder().toPath(); } }
2,841
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
BungeeCommandHandler.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bungee/src/main/java/com/discordsrv/bungee/command/game/handler/BungeeCommandHandler.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.bungee.command.game.handler; import com.discordsrv.bungee.BungeeDiscordSRV; import com.discordsrv.bungee.command.game.sender.BungeeCommandSender; import com.discordsrv.common.command.game.abstraction.GameCommand; import com.discordsrv.common.command.game.handler.BasicCommandHandler; import com.discordsrv.common.command.game.sender.ICommandSender; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.plugin.Command; import net.md_5.bungee.api.plugin.TabExecutor; import java.util.Arrays; /** * BungeeCord has not concept of Brigadier. */ public class BungeeCommandHandler extends BasicCommandHandler { private final BungeeDiscordSRV discordSRV; public BungeeCommandHandler(BungeeDiscordSRV discordSRV) { this.discordSRV = discordSRV; } @Override public void registerCommand(GameCommand command) { super.registerCommand(command); discordSRV.proxy().getPluginManager().registerCommand(discordSRV.plugin(), new BungeeCommand(command)); } public ICommandSender getSender(CommandSender sender) { if (sender instanceof ProxiedPlayer) { return discordSRV.playerProvider().player((ProxiedPlayer) sender); } else if (sender == discordSRV.proxy().getConsole()) { return discordSRV.console(); } else { return new BungeeCommandSender(discordSRV, sender, () -> discordSRV.audiences().sender(sender)); } } public class BungeeCommand extends Command implements TabExecutor { private final GameCommand command; public BungeeCommand(GameCommand command) { super(command.getLabel(), command.getRequiredPermission()); this.command = command; } @Override public void execute(CommandSender sender, String[] args) { BungeeCommandHandler.this.execute(getSender(sender), command.getLabel(), Arrays.asList(args)); } @Override public Iterable<String> onTabComplete(CommandSender sender, String[] args) { return BungeeCommandHandler.this.suggest(getSender(sender), command.getLabel(), Arrays.asList(args)); } } }
3,077
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
BungeeCommandSender.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bungee/src/main/java/com/discordsrv/bungee/command/game/sender/BungeeCommandSender.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.bungee.command.game.sender; import com.discordsrv.bungee.BungeeDiscordSRV; import com.discordsrv.common.command.game.sender.ICommandSender; import net.kyori.adventure.audience.Audience; import net.md_5.bungee.api.CommandSender; import org.jetbrains.annotations.NotNull; import java.util.function.Supplier; public class BungeeCommandSender implements ICommandSender { protected final BungeeDiscordSRV discordSRV; protected final CommandSender commandSender; protected final Supplier<Audience> audience; public BungeeCommandSender(BungeeDiscordSRV discordSRV, CommandSender commandSender, Supplier<Audience> audience) { this.discordSRV = discordSRV; this.commandSender = commandSender; this.audience = audience; } @Override public boolean hasPermission(String permission) { return commandSender.hasPermission(permission); } @Override public void runCommand(String command) { discordSRV.proxy().getPluginManager().dispatchCommand(commandSender, command); } @Override public @NotNull Audience audience() { return audience.get(); } }
1,994
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
BungeePluginManager.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bungee/src/main/java/com/discordsrv/bungee/plugin/BungeePluginManager.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.bungee.plugin; import com.discordsrv.bungee.BungeeDiscordSRV; import com.discordsrv.common.plugin.Plugin; import com.discordsrv.common.plugin.PluginManager; import net.md_5.bungee.api.plugin.PluginDescription; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; public class BungeePluginManager implements PluginManager { private final BungeeDiscordSRV discordSRV; public BungeePluginManager(BungeeDiscordSRV discordSRV) { this.discordSRV = discordSRV; } @Override public boolean isPluginEnabled(String pluginName) { return discordSRV.proxy().getPluginManager().getPlugin(pluginName) != null; } @Override public List<Plugin> getPlugins() { return discordSRV.proxy().getPluginManager().getPlugins().stream() .map(plugin -> { PluginDescription description = plugin.getDescription(); return new Plugin( description.getName(), description.getVersion(), Collections.singletonList(description.getAuthor()) ); }) .collect(Collectors.toList()); } }
2,090
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
BungeeConsole.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bungee/src/main/java/com/discordsrv/bungee/console/BungeeConsole.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.bungee.console; import com.discordsrv.bungee.BungeeDiscordSRV; import com.discordsrv.bungee.command.game.sender.BungeeCommandSender; import com.discordsrv.bungee.console.executor.BungeeCommandExecutorProvider; import com.discordsrv.common.command.game.executor.CommandExecutorProvider; import com.discordsrv.common.console.Console; import com.discordsrv.common.logging.backend.LoggingBackend; import com.discordsrv.common.logging.backend.impl.JavaLoggerImpl; public class BungeeConsole extends BungeeCommandSender implements Console { private final LoggingBackend loggingBackend; private final BungeeCommandExecutorProvider executorProvider; public BungeeConsole(BungeeDiscordSRV discordSRV) { super(discordSRV, discordSRV.proxy().getConsole(), () -> discordSRV.audiences().console()); this.loggingBackend = JavaLoggerImpl.getRoot(); this.executorProvider = new BungeeCommandExecutorProvider(discordSRV); } @Override public LoggingBackend loggingBackend() { return loggingBackend; } @Override public CommandExecutorProvider commandExecutorProvider() { return executorProvider; } }
2,020
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
BungeeCommandExecutorProvider.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bungee/src/main/java/com/discordsrv/bungee/console/executor/BungeeCommandExecutorProvider.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.bungee.console.executor; import com.discordsrv.bungee.BungeeDiscordSRV; import com.discordsrv.common.command.game.executor.CommandExecutor; import com.discordsrv.common.command.game.executor.CommandExecutorProvider; import net.kyori.adventure.text.Component; import java.util.function.Consumer; public class BungeeCommandExecutorProvider implements CommandExecutorProvider { private final BungeeDiscordSRV discordSRV; public BungeeCommandExecutorProvider(BungeeDiscordSRV discordSRV) { this.discordSRV = discordSRV; } @Override public CommandExecutor getConsoleExecutor(Consumer<Component> componentConsumer) { return new BungeeCommandExecutor(discordSRV, componentConsumer); } }
1,579
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
BungeeCommandExecutor.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bungee/src/main/java/com/discordsrv/bungee/console/executor/BungeeCommandExecutor.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.bungee.console.executor; import com.discordsrv.bungee.BungeeDiscordSRV; import com.discordsrv.common.command.game.executor.CommandExecutor; import net.kyori.adventure.text.Component; import net.md_5.bungee.api.CommandSender; import java.util.function.Consumer; public class BungeeCommandExecutor implements CommandExecutor { private final BungeeDiscordSRV discordSRV; private final CommandSender commandSender; public BungeeCommandExecutor(BungeeDiscordSRV discordSRV, Consumer<Component> componentConsumer) { this.discordSRV = discordSRV; this.commandSender = new BungeeCommandExecutorProxy( discordSRV.proxy().getConsole(), componentConsumer ).getProxy(); } @Override public void runCommand(String command) { discordSRV.proxy().getPluginManager().dispatchCommand(commandSender, command); } }
1,745
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
BungeeCommandExecutorProxyTemplate.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bungee/src/main/java/com/discordsrv/bungee/console/executor/BungeeCommandExecutorProxyTemplate.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.bungee.console.executor; import dev.vankka.dynamicproxy.processor.Original; import dev.vankka.dynamicproxy.processor.Proxy; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.chat.BaseComponent; import java.util.function.Consumer; @Proxy(value = CommandSender.class, className = "BungeeCommandExecutorProxy") public abstract class BungeeCommandExecutorProxyTemplate implements CommandSender { @Original private final CommandSender commandSender; private final Consumer<Component> componentConsumer; public BungeeCommandExecutorProxyTemplate(CommandSender commandSender, Consumer<Component> componentConsumer) { this.commandSender = commandSender; this.componentConsumer = componentConsumer; } private void forwardComponent(Component component) { this.componentConsumer.accept(component); } @Override public void sendMessage(BaseComponent... message) { commandSender.sendMessage(message); forwardComponent(BungeeComponentSerializer.get().deserialize(message)); } @Override public void sendMessage(BaseComponent message) { commandSender.sendMessage(message); forwardComponent(BungeeComponentSerializer.get().deserialize(new BaseComponent[]{message})); } @Override @SuppressWarnings({"deprecation", "RedundantSuppression"}) public void sendMessage(String message) { commandSender.sendMessage(message); forwardComponent(LegacyComponentSerializer.legacySection().deserialize(message)); } @Override @SuppressWarnings({"deprecation", "RedundantSuppression"}) public void sendMessages(String... messages) { commandSender.sendMessages(messages); forwardComponent(LegacyComponentSerializer.legacySection().deserialize(String.join("\n", messages))); } }
2,897
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
package-info.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bungee/src/main/java/com/discordsrv/bungee/component/package-info.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.bungee.component;
871
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
BungeeComponentUtil.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bungee/src/main/java/com/discordsrv/bungee/component/util/BungeeComponentUtil.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.bungee.component.util; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer; import net.md_5.bungee.api.chat.BaseComponent; import net.md_5.bungee.api.chat.TextComponent; public final class BungeeComponentUtil { private BungeeComponentUtil() {} public static Component fromLegacy(String legacy) { BaseComponent[] components = TextComponent.fromLegacyText(legacy); return BungeeComponentSerializer.get().deserialize(components); } }
1,387
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
BungeePlayer.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bungee/src/main/java/com/discordsrv/bungee/player/BungeePlayer.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.bungee.player; import com.discordsrv.bungee.BungeeDiscordSRV; import com.discordsrv.bungee.command.game.sender.BungeeCommandSender; import com.discordsrv.bungee.component.util.BungeeComponentUtil; import com.discordsrv.common.DiscordSRV; import com.discordsrv.common.player.IPlayer; import com.discordsrv.common.player.provider.model.SkinInfo; import net.kyori.adventure.identity.Identity; import net.kyori.adventure.text.Component; import net.md_5.bungee.api.connection.ProxiedPlayer; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Locale; public class BungeePlayer extends BungeeCommandSender implements IPlayer { private final ProxiedPlayer player; private final Identity identity; public BungeePlayer(BungeeDiscordSRV discordSRV, ProxiedPlayer player) { super(discordSRV, player, () -> discordSRV.audiences().player(player)); this.player = player; this.identity = Identity.identity(player.getUniqueId()); } @Override public DiscordSRV discordSRV() { return discordSRV; } @Override public @NotNull String username() { return commandSender.getName(); } @Override public @Nullable SkinInfo skinInfo() { return null; } @Override public @Nullable Locale locale() { return player.getLocale(); } @Override public @NotNull Identity identity() { return identity; } @Override public @NotNull Component displayName() { return BungeeComponentUtil.fromLegacy(player.getDisplayName()); } }
2,460
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
BungeePlayerProvider.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/bungee/src/main/java/com/discordsrv/bungee/player/BungeePlayerProvider.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.bungee.player; import com.discordsrv.bungee.BungeeDiscordSRV; import com.discordsrv.common.player.provider.AbstractPlayerProvider; import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.event.PlayerDisconnectEvent; import net.md_5.bungee.api.event.PostLoginEvent; import net.md_5.bungee.api.plugin.Listener; import net.md_5.bungee.event.EventHandler; public class BungeePlayerProvider extends AbstractPlayerProvider<BungeePlayer, BungeeDiscordSRV> implements Listener { public BungeePlayerProvider(BungeeDiscordSRV discordSRV) { super(discordSRV); } @Override public void subscribe() { discordSRV.proxy().getPluginManager().registerListener(discordSRV.plugin(), this); // Add players that are already connected for (ProxiedPlayer player : discordSRV.proxy().getPlayers()) { addPlayer(player, true); } } @EventHandler(priority = Byte.MIN_VALUE) // Runs first public void onPostLogin(PostLoginEvent event) { addPlayer(event.getPlayer(), false); } private void addPlayer(ProxiedPlayer player, boolean initial) { addPlayer(player.getUniqueId(), new BungeePlayer(discordSRV, player), initial); } @EventHandler(priority = Byte.MAX_VALUE) // Runs last public void onDisconnect(PlayerDisconnectEvent event) { removePlayer(event.getPlayer().getUniqueId()); } public BungeePlayer player(ProxiedPlayer player) { BungeePlayer srvPlayer = player(player.getUniqueId()); if (srvPlayer == null) { throw new IllegalStateException("Player not available"); } return srvPlayer; } }
2,530
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
DiscordSRVTranslation.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/i18n/src/main/java/com/discordsrv/config/DiscordSRVTranslation.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.config; import com.discordsrv.bukkit.config.manager.BukkitConfigManager; import com.discordsrv.bukkit.config.manager.BukkitConnectionConfigManager; import com.discordsrv.common.config.Config; import com.discordsrv.common.config.configurate.annotation.Untranslated; import com.discordsrv.common.config.configurate.manager.abstraction.ConfigurateConfigManager; import com.discordsrv.common.config.configurate.manager.abstraction.TranslatedConfigManager; import com.discordsrv.common.logging.backend.impl.JavaLoggerImpl; import org.spongepowered.configurate.CommentedConfigurationNode; import org.spongepowered.configurate.ConfigurateException; import org.spongepowered.configurate.ConfigurationNode; import org.spongepowered.configurate.objectmapping.ObjectMapper; import org.spongepowered.configurate.objectmapping.meta.Processor; import org.spongepowered.configurate.serialize.SerializationException; import org.spongepowered.configurate.yaml.YamlConfigurationLoader; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; /** * A java application to generate a translation file that has comments as options. */ public final class DiscordSRVTranslation { private static final Path DATA_DIRECTORY = Paths.get("."); private static final List<TranslatedConfigManager<? extends Config, ?>> CONFIGS = Arrays.asList( new BukkitConfigManager(DATA_DIRECTORY), new BukkitConnectionConfigManager(DATA_DIRECTORY) ); public static void main(String[] args) throws ConfigurateException { new DiscordSRVTranslation().run(); } private DiscordSRVTranslation() {} public void run() throws ConfigurateException { Processor.Factory<Untranslated, Object> untranslatedProcessorFactory = (data, v1) -> (v2, destination) -> { try { Untranslated.Type type = data.value(); if (type.isValue()) { if (type.isComment()) { destination.set(null); } else { destination.set(""); } } else if (type.isComment() && destination instanceof CommentedConfigurationNode) { ((CommentedConfigurationNode) destination).comment(null); } } catch (SerializationException e) { e.printStackTrace(); System.exit(1); } }; CommentedConfigurationNode node = CommentedConfigurationNode.root(); for (ConfigurateConfigManager<?, ?> configManager : CONFIGS) { Config config = (Config) configManager.createConfiguration(); String fileIdentifier = config.getFileName(); ConfigurationNode commentSection = node.node(fileIdentifier + "_comments"); String header = configManager.nodeOptions(false).header(); if (header != null) { commentSection.node("$header").set(header); } ObjectMapper.Factory mapperFactory = configManager.objectMapperBuilder(false) .addProcessor(Untranslated.class, untranslatedProcessorFactory) .build(); TranslationConfigManagerProxy<?> configManagerProxy = new TranslationConfigManagerProxy<>(DATA_DIRECTORY, JavaLoggerImpl.getRoot(), mapperFactory, configManager); CommentedConfigurationNode configurationNode = configManagerProxy.getDefaultNode(mapperFactory); convertCommentsToOptions(configurationNode, commentSection); processUnwantedValues(configurationNode); ConfigurationNode section = node.node(fileIdentifier); ConfigurationNode configSection = section.set(configurationNode); section.set(configSection); } YamlConfigurationLoader.builder() .path(Paths.get("i18n", "build", "source.yaml")) .build() .save(node); } public void processUnwantedValues(ConfigurationNode node) throws SerializationException { Map<Object, ? extends ConfigurationNode> children = node.childrenMap(); Object value; if (children.isEmpty() && (!((value = node.get(Object.class)) instanceof String) || ((String) value).isEmpty())) { node.set(null); return; } boolean allChildrenEmpty = true; for (ConfigurationNode child : children.values()) { processUnwantedValues(child); if (child.virtual() || child.isNull() || child.empty()) { allChildrenEmpty = false; break; } } if (!allChildrenEmpty) { node.set(null); } } public void convertCommentsToOptions(ConfigurationNode node, ConfigurationNode commentParent) throws SerializationException { if (node instanceof CommentedConfigurationNode) { CommentedConfigurationNode commentedNode = (CommentedConfigurationNode) node; String comment = commentedNode.comment(); if (comment != null) { List<Object> path = new ArrayList<>(Arrays.asList(commentedNode.path().array())); path.add("_comment"); commentParent.node(path).set(comment); } } if (node.empty()) { node.set(null); return; } for (ConfigurationNode value : node.childrenMap().values()) { convertCommentsToOptions(value, commentParent); } } }
6,487
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
TranslationConfigManagerProxy.java
/FileExtraction/Java_unseen/DiscordSRV_Ascension/i18n/src/main/java/com/discordsrv/config/TranslationConfigManagerProxy.java
/* * This file is part of DiscordSRV, licensed under the GPLv3 License * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package com.discordsrv.config; import com.discordsrv.common.config.configurate.manager.abstraction.ConfigurateConfigManager; import com.discordsrv.common.config.configurate.manager.loader.YamlConfigLoaderProvider; import com.discordsrv.common.logging.Logger; import org.spongepowered.configurate.objectmapping.ObjectMapper; import org.spongepowered.configurate.yaml.YamlConfigurationLoader; import java.nio.file.Path; public class TranslationConfigManagerProxy<C> extends ConfigurateConfigManager<C, YamlConfigurationLoader> implements YamlConfigLoaderProvider { private final ObjectMapper.Factory objectMapper; private final ConfigurateConfigManager<C, ?> configManager; public TranslationConfigManagerProxy(Path dataDirectory, Logger logger, ObjectMapper.Factory objectMapper, ConfigurateConfigManager<C, ?> configManager) { super(dataDirectory, logger); this.objectMapper = objectMapper; this.configManager = configManager; } @Override public ObjectMapper.Factory objectMapper() { return objectMapper != null ? objectMapper : super.objectMapper(); } @Override public ObjectMapper.Factory cleanObjectMapper() { return objectMapper != null ? objectMapper : super.cleanObjectMapper(); } @Override public String fileName() { return "none"; } @Override public C createConfiguration() { return configManager.createConfiguration(); } }
2,307
Java
.java
DiscordSRV/Ascension
17
3
1
2021-07-29T01:14:02Z
2024-05-08T00:28:36Z
CleanFolderReceiver.java
/FileExtraction/Java_unseen/xddxdd_lantian-nolitter/app/src/main/java/lantian/nolitter/CleanFolderReceiver.java
package lantian.nolitter; import android.Manifest; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.preference.PreferenceManager; import android.support.v4.content.ContextCompat; import android.widget.Toast; import java.io.IOException; import java.util.List; public class CleanFolderReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { /* Decode package name */ String pkg = intent.getDataString(); if (pkg.startsWith("package:")) pkg = pkg.substring(8); if (pkg.isEmpty()) return; /* Check if is enabled */ if (!PreferenceManager.getDefaultSharedPreferences(context).getBoolean("remove_after_uninstall", true)) return; /* Check if have sdcard access permission */ if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { Toast.makeText(context, pkg + context.getString(R.string.ui_failClear), Toast.LENGTH_SHORT).show(); return; } /* Check if it is replace not uninstall */ PackageManager pm = context.getPackageManager(); List<PackageInfo> existingPkgs = pm.getInstalledPackages(PackageManager.COMPONENT_ENABLED_STATE_DEFAULT); for (PackageInfo existingPkg : existingPkgs) { if (existingPkg.packageName.equals(pkg)) return; } /* Delete files and folders */ Toast.makeText(context, pkg + context.getString(R.string.ui_isUninstalled), Toast.LENGTH_SHORT).show(); Runtime runtime = Runtime.getRuntime(); try { runtime.exec("rm -r /sdcard/Android/files/" + pkg); /* Deal with some apps that use sdcard relative position */ runtime.exec("rm -r /sdcard/Android/files/Android/data/" + pkg); Toast.makeText(context, pkg + context.getString(R.string.ui_isCleared), Toast.LENGTH_SHORT).show(); } catch (IOException e) { Toast.makeText(context, pkg + context.getString(R.string.ui_failClear), Toast.LENGTH_SHORT).show(); } } }
2,314
Java
.java
xddxdd/lantian-nolitter
64
10
2
2017-01-31T04:55:43Z
2017-08-13T07:55:39Z
SettingsFragment.java
/FileExtraction/Java_unseen/xddxdd_lantian-nolitter/app/src/main/java/lantian/nolitter/SettingsFragment.java
package lantian.nolitter; import android.content.ComponentName; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.net.Uri; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceFragment; import android.preference.PreferenceManager; import android.support.v7.app.AlertDialog; import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; public class SettingsFragment extends PreferenceFragment { public static SharedPreferences prefs; @Override @SuppressWarnings("deprecation") public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.settings); prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); getPreferenceScreen().removePreference(findPreference("hidden")); findPreference("banned_ui").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { ltChooseApp("banned", Constants.banned); return false; } }); findPreference("forced_ui").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { ltChooseApp("forced", Constants.forced); return false; } }); findPreference("author").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://lantian.pub")); startActivity(browserIntent); return false; } }); findPreference("source").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/xddxdd/lantian-nolitter")); startActivity(browserIntent); return false; } }); findPreference("about_xinternalsd").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/pylerSM/XInternalSD")); startActivity(browserIntent); return false; } }); findPreference("showicon").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { Boolean isVisible = (Boolean) newValue; if (isVisible) { getActivity().getPackageManager().setComponentEnabledSetting(new ComponentName(getActivity(), MainActivity.class), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); } else { getActivity().getPackageManager().setComponentEnabledSetting(new ComponentName(getActivity(), MainActivity.class), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); } return true; } }); } @Override public void onPause() { // From https://forum.xda-developers.com/xposed/how-to-save-load-module-settings-t3640881 super.onPause(); // Set preferences permissions to be world readable // Workaround for Android N and above since MODE_WORLD_READABLE will cause security exception and FC. final File dataDir = new File(getActivity().getApplicationInfo().dataDir); final File prefsDir = new File(dataDir, "shared_prefs"); final File prefsFile = new File(prefsDir, getPreferenceManager().getSharedPreferencesName() + ".xml"); if (prefsFile.exists()) { dataDir.setReadable(true, false); dataDir.setExecutable(true, false); prefsDir.setReadable(true, false); prefsDir.setExecutable(true, false); prefsFile.setReadable(true, false); prefsFile.setExecutable(true, false); } } public boolean ltChooseApp(final String key, final String defaults) { // Get app info final List<ApplicationInfo> appInfo; if (prefs.getBoolean("enable_system", false)) { appInfo = getActivity().getPackageManager().getInstalledApplications(PackageManager.GET_META_DATA); } else { appInfo = new ArrayList<>(); for (ApplicationInfo appInfoSingle : getActivity().getPackageManager().getInstalledApplications(PackageManager.GET_META_DATA)) { if ((appInfoSingle.flags & ApplicationInfo.FLAG_SYSTEM) == 0) { appInfo.add(appInfoSingle); } } } Collections.sort(appInfo, new ApplicationInfo.DisplayNameComparator(getActivity().getPackageManager())); // Get current settings ArrayList<String> banned = new ArrayList<>(Arrays.asList(prefs.getString(key, defaults).split(","))); // Form arrays final String[] appTitles = new String[appInfo.size()]; boolean[] appCared = new boolean[appInfo.size()]; for (int i = 0; i < appInfo.size(); i++) { appTitles[i] = appInfo.get(i).loadLabel(getActivity().getPackageManager()).toString(); appCared[i] = banned.contains(appInfo.get(i).packageName); } // Make the dialog AlertDialog.Builder dialog = new AlertDialog.Builder(getActivity()); dialog.setTitle(R.string.ui_chooseApp); dialog.setMultiChoiceItems(appTitles, appCared, new DialogInterface.OnMultiChoiceClickListener() { @Override public void onClick(DialogInterface dialog, int which, boolean isChecked) { ArrayList<String> banned = new ArrayList<>(Arrays.asList(prefs.getString(key, defaults).split(","))); if (isChecked) { banned.add(appInfo.get(which).packageName); } else { banned.remove(appInfo.get(which).packageName); } String newBanned = ""; for (String bannedFragment : banned) { if (!bannedFragment.trim().isEmpty()) newBanned += bannedFragment.trim() + ","; } prefs.edit().putString(key, newBanned).apply(); } }); dialog.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); dialog.show(); return false; } }
7,471
Java
.java
xddxdd/lantian-nolitter
64
10
2
2017-01-31T04:55:43Z
2017-08-13T07:55:39Z
MainActivity.java
/FileExtraction/Java_unseen/xddxdd_lantian-nolitter/app/src/main/java/lantian/nolitter/MainActivity.java
package lantian.nolitter; import android.Manifest; import android.content.pm.PackageManager; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.widget.Toast; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 233); } SettingsFragment mySettings = new SettingsFragment(); getFragmentManager().beginTransaction().replace(android.R.id.content, mySettings).commit(); } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) { switch (requestCode) { case 233: { if (!(grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED)) { Toast.makeText(this, R.string.ui_failPermission, Toast.LENGTH_SHORT).show(); } } } } }
1,500
Java
.java
xddxdd/lantian-nolitter
64
10
2
2017-01-31T04:55:43Z
2017-08-13T07:55:39Z
XposedHook.java
/FileExtraction/Java_unseen/xddxdd_lantian-nolitter/app/src/main/java/lantian/nolitter/XposedHook.java
package lantian.nolitter; import android.content.pm.ApplicationInfo; import android.os.Build; import android.os.Environment; import java.io.File; import java.net.URI; import java.util.ArrayList; import java.util.Arrays; import de.robv.android.xposed.IXposedHookLoadPackage; import de.robv.android.xposed.IXposedHookZygoteInit; import de.robv.android.xposed.XC_MethodHook; import de.robv.android.xposed.XSharedPreferences; import de.robv.android.xposed.XposedBridge; import de.robv.android.xposed.XposedHelpers; import de.robv.android.xposed.callbacks.XC_LoadPackage; public class XposedHook implements IXposedHookZygoteInit, IXposedHookLoadPackage { private XSharedPreferences prefs; @Override public void initZygote(StartupParam startupParam) throws Throwable { prefs = new XSharedPreferences("lantian.nolitter"); prefs.makeWorldReadable(); } public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) throws Throwable { XC_MethodHook noLitterStr = new XC_MethodHook() { @Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable { if (param.args[0].toString().startsWith("/lantian")) return; String path = param.args[0].toString(); if(path.startsWith("/data/")) return; if(path.startsWith("/system/")) return; if(path.startsWith("/cache/")) return; if (path.startsWith("/proc/")) return; if (path.startsWith("/sys/")) return; if (path.startsWith("/vendor/")) return; String newPath; if (prefs.getBoolean("separate_app", true)) { newPath = doReplace(path, lpparam.packageName, Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)); } else { newPath = doReplace(path, "", Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)); } if (!path.equals(newPath)) { param.args[0] = newPath; //XposedBridge.log("[NoLitter] " + lpparam.packageName + ": Redirecting " + path + " -> " + newPath); } } }; XC_MethodHook noLitterStrStr = new XC_MethodHook() { @Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable { if (param.args[0] == null || param.args[0].toString().isEmpty()) { String path = param.args[1].toString(); if (path.startsWith("/data/")) return; if (path.startsWith("/system/")) return; if (path.startsWith("/cache/")) return; if (path.startsWith("/proc/")) return; if (path.startsWith("/sys/")) return; if (path.startsWith("/vendor/")) return; String newPath; if (prefs.getBoolean("separate_app", true)) { newPath = doReplace(path, lpparam.packageName, Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)); } else { newPath = doReplace(path, "", Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)); } if (!path.equals(newPath)) { param.args[1] = newPath; //XposedBridge.log("[NoLitter] " + lpparam.packageName + ": Redirecting " + path + " -> " + newPath); } } else { String path = param.args[0].toString() + "/" + param.args[1].toString(); path = path.replace("//", "/"); if (path.startsWith("/data/")) return; if (path.startsWith("/system/")) return; if (path.startsWith("/cache/")) return; if (path.startsWith("/proc/")) return; if (path.startsWith("/sys/")) return; if (path.startsWith("/vendor/")) return; String newPath; if (prefs.getBoolean("separate_app", true)) { newPath = doReplace(path, lpparam.packageName, Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)); } else { newPath = doReplace(path, "", Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)); } if (!path.equals(newPath)) { param.args[0] = null; param.args[1] = newPath; //XposedBridge.log("[NoLitter] " + lpparam.packageName + ": Redirecting " + path + " -> " + newPath); } } } }; XC_MethodHook noLitterFileStr = new XC_MethodHook() { @Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable { if (param.args[0] == null || ((File) param.args[0]).getAbsolutePath().isEmpty()) { String path = param.args[1].toString(); if (path.startsWith("/data/")) return; if (path.startsWith("/system/")) return; if (path.startsWith("/cache/")) return; if (path.startsWith("/proc/")) return; if (path.startsWith("/sys/")) return; if (path.startsWith("/vendor/")) return; String newPath; if (prefs.getBoolean("separate_app", true)) { newPath = doReplace(path, lpparam.packageName, Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)); } else { newPath = doReplace(path, "", Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)); } if (!path.equals(newPath)) { param.args[1] = newPath; //XposedBridge.log("[NoLitter] " + lpparam.packageName + ": Redirecting " + path + " -> " + newPath); } } else { String path = ((File) param.args[0]).getAbsolutePath() + "/" + param.args[1].toString(); path = path.replace("//", "/"); if (path.startsWith("/data/")) return; if (path.startsWith("/system/")) return; if (path.startsWith("/cache/")) return; if (path.startsWith("/proc/")) return; if (path.startsWith("/sys/")) return; if (path.startsWith("/vendor/")) return; String newPath; if (prefs.getBoolean("separate_app", true)) { newPath = doReplace(path, lpparam.packageName, Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)); } else { newPath = doReplace(path, "", Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)); } if (!path.equals(newPath)) { param.args[0] = null; param.args[1] = newPath; //XposedBridge.log("[NoLitter] " + lpparam.packageName + ": Redirecting " + path + " -> " + newPath); } } } }; // XInternalSD Hook XC_MethodHook changeDirHook = new XC_MethodHook() { @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { File oldFile = (File) param.getResult(); if (oldFile == null) return; String oldDir = oldFile.getAbsolutePath() + "/"; String newDir; if (prefs.getBoolean("separate_app", true)) { newDir = doReplace(oldDir, lpparam.packageName, Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)); } else { newDir = doReplace(oldDir, "", Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)); } File newDirPath = new File(newDir); param.setResult(newDirPath); } }; XC_MethodHook changeDirsHook = new XC_MethodHook() { @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { // https://github.com/pylerSM/XInternalSD/issues/15 File[] oldDirPaths = (File[]) param.getResult(); ArrayList<File> newDirPaths = new ArrayList<>(); for (File oldFile : oldDirPaths) { String oldDir = oldFile.getPath() + "/"; String newDir; if (prefs.getBoolean("separate_app", true)) { newDir = doReplace(oldDir, lpparam.packageName, Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)); } else { newDir = doReplace(oldDir, "", Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)); } File newDirPath = new File(newDir); newDirPaths.add(newDirPath); } File[] appendedDirPaths = newDirPaths.toArray(new File[newDirPaths.size()]); param.setResult(appendedDirPaths); } }; prefs.reload(); ArrayList<String> banned = new ArrayList<>(Arrays.asList(prefs.getString("banned", Constants.banned).split(","))); if (banned.contains(lpparam.packageName)) XposedBridge.log("[NoLitter] " + lpparam.packageName + ": ignored"); if (!lpparam.packageName.equals("lantian.nolitter")) { if (!banned.contains(lpparam.packageName)) { if (prefs.getBoolean("enable_system", false)) { try { // User allows to hook system apps XposedHelpers.findAndHookConstructor(File.class, String.class, noLitterStr); XposedHelpers.findAndHookConstructor(File.class, String.class, String.class, noLitterStrStr); XposedHelpers.findAndHookConstructor(File.class, File.class, String.class, noLitterFileStr); if (Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)) { XposedBridge.log("[NoLitter] " + lpparam.packageName + ": forced"); // Copied from XInternalSD XposedHelpers.findAndHookMethod(Environment.class, "getExternalStorageDirectory", changeDirHook); XposedHelpers.findAndHookMethod(XposedHelpers.findClass( "android.app.ContextImpl", lpparam.classLoader), "getExternalFilesDir", String.class, changeDirHook); XposedHelpers.findAndHookMethod(XposedHelpers.findClass( "android.app.ContextImpl", lpparam.classLoader), "getObbDir", changeDirHook); XposedHelpers.findAndHookMethod(Environment.class, "getExternalStoragePublicDirectory", String.class, changeDirHook); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { XposedHelpers.findAndHookMethod(XposedHelpers.findClass( "android.app.ContextImpl", lpparam.classLoader), "getExternalFilesDirs", String.class, changeDirsHook); XposedHelpers.findAndHookMethod(XposedHelpers.findClass( "android.app.ContextImpl", lpparam.classLoader), "getObbDirs", changeDirsHook); } } else { XposedBridge.log("[NoLitter] " + lpparam.packageName + ": hooked"); } } catch (NullPointerException npe) { /* Avoid spamming Xposed log */ } } else { // User don't want to hook system apps try { if ((lpparam.appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) { // Not system app XposedHelpers.findAndHookConstructor(File.class, String.class, noLitterStr); XposedHelpers.findAndHookConstructor(File.class, String.class, String.class, noLitterStrStr); XposedHelpers.findAndHookConstructor(File.class, File.class, String.class, noLitterFileStr); if (Arrays.asList(prefs.getString("forced", Constants.forced).split(",")).contains(lpparam.packageName)) { XposedBridge.log("[NoLitter] " + lpparam.packageName + ": forced"); // Copied from XInternalSD XposedHelpers.findAndHookMethod(Environment.class, "getExternalStorageDirectory", changeDirHook); XposedHelpers.findAndHookMethod(XposedHelpers.findClass( "android.app.ContextImpl", lpparam.classLoader), "getExternalFilesDir", String.class, changeDirHook); XposedHelpers.findAndHookMethod(XposedHelpers.findClass( "android.app.ContextImpl", lpparam.classLoader), "getObbDir", changeDirHook); XposedHelpers.findAndHookMethod(Environment.class, "getExternalStoragePublicDirectory", String.class, changeDirHook); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { XposedHelpers.findAndHookMethod(XposedHelpers.findClass( "android.app.ContextImpl", lpparam.classLoader), "getExternalFilesDirs", String.class, changeDirsHook); XposedHelpers.findAndHookMethod(XposedHelpers.findClass( "android.app.ContextImpl", lpparam.classLoader), "getObbDirs", changeDirsHook); } } else { XposedBridge.log("[NoLitter] " + lpparam.packageName + ": hooked"); } } else { XposedBridge.log("[NoLitter] " + lpparam.packageName + ": system, ignored"); } } catch (NullPointerException npe) { /* Avoid spamming Xposed log */ } } } } } private String doReplace(String path, String pkgName, Boolean forceMode) { String storageDir; for (String storagePath : prefs.getString("sdcard", Constants.sdcard).split("\n")) { if(storagePath.isEmpty()) continue; if (storagePath.trim().endsWith("/")) { storageDir = storagePath.trim().substring(0, storagePath.length() - 1); } else { storageDir = storagePath.trim(); } if (path.startsWith(storageDir)) { // Check if is root dir itself if (path.equals(storageDir + "/") || path.equals(storageDir)) { if (forceMode) { if (pkgName.isEmpty()) { return storageDir + "/Android/files/"; } else { return storageDir + "/Android/files/" + pkgName + "/"; } } else { return storageDir; } } if(path.startsWith(storageDir + "/Android")) return path; String newPath = path.substring(storageDir.length() + 1, path.length()); File fPath = new File("/lantian" + storageDir + "/" + newPath.split("/")[0]); Boolean fExists = new File(URI.create(fPath.toURI().toString().replaceFirst("/lantian", "")).normalize()).exists(); if (fExists) { return path; } else if (pkgName.isEmpty()) { return storageDir + "/Android/files/" + newPath; } else { return storageDir + "/Android/files/" + pkgName + "/" + newPath; } } } return path; } }
17,897
Java
.java
xddxdd/lantian-nolitter
64
10
2
2017-01-31T04:55:43Z
2017-08-13T07:55:39Z
Constants.java
/FileExtraction/Java_unseen/xddxdd_lantian-nolitter/app/src/main/java/lantian/nolitter/Constants.java
package lantian.nolitter; class Constants { static final String sdcard = "/data/media/0\n" + "/mnt/runtime/default/emulated/0\n" + "/mnt/runtime/default/sdcard0\n" + "/mnt/runtime/default/self/primary\n" + "/mnt/runtime/read/emulated/0\n" + "/mnt/runtime/write/emulated/0\n" + "/mnt/sdcard\n" + "/mnt/shell/emulated/0\n" + "/mnt/user/0/primary\n" + "/sdcard\n" + "/storage/emulated/0\n" + "/storage/emulated/legacy\n" + "/storage/sdcard0\n" + "/storage/self/primary"; static final String banned = "com.android.systemui,pl.solidexplorer2,com.mixplorer,com.cyanogenmod.filemanager,nextapp.fx,pl.mkexplorer.kormateusz,com.lonelycatgames.Xplore,bin.mt,com.estrongs.android.pop,com.speedsoftware.rootexplorer,bin.mt.plus,com.fooview.android.fooview,com.One.WoodenLetter"; static final String forced = "com.baidu.BaiduMap,com.sdu.didi.psnger,com.tencent.mm,com.autonavi.minimap,com.netease.pris"; }
1,062
Java
.java
xddxdd/lantian-nolitter
64
10
2
2017-01-31T04:55:43Z
2017-08-13T07:55:39Z
LrsCServlet.java
/FileExtraction/Java_unseen/gambitproject_gte/web-service/src/lse/math/games/web/LrsCServlet.java
package lse.math.games.web; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.util.Arrays; import java.util.LinkedList; import java.util.Vector; import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import lse.math.games.Rational; import lse.math.games.matrix.Bimatrix; import lse.math.games.io.ColumnTextWriter; /** * @author Martin Prause * adapted by Rahul Savani */ @SuppressWarnings("serial") public class LrsCServlet extends AbstractRESTServlet { private static final Logger log = Logger.getLogger(LrsCServlet.class.getName()); private String os; //program1=Create H-representation private String program1=""; //program2=Solve equation system private String program2=""; //program3=Estimate process time private String program3=""; //program4=Clique process private String program4=""; public void init(ServletConfig config) throws ServletException { super.init(config); os=System.getProperty("os.name"); if (os.startsWith("Windows")){ program1="prepare_nash.exe"; program2="nash.exe"; program3="lrs.exe"; program4="coclique3.exe"; } else { program1="prepare_nash"; program2="nash"; program3="lrs"; program4="coclique3"; } outputPath = Paths.get(System.getProperty("user.dir")).resolve("game-output"); } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/plain"); log.info("Processing new request"); Bimatrix game = null; File[] f= new File[3]; //Later we need different temp files; String consoleOutput=""; String estimate=request.getParameter("es"); Rational[][] a = parseMultiRowRatParam(request, "a"); Rational[][] b = parseMultiRowRatParam(request, "b"); String[] rowNames = request.getParameter("r") != null ? request.getParameter("r").split(" ") : null; String[] colNames = request.getParameter("c") != null ? request.getParameter("c").split(" ") : null; String algo = request.getParameter("algo"); String pathToAlgo=request.getParameter("d"); String maxSeconds=request.getParameter("ms"); int nrows = 0; int ncols = 0; //Check payoff matrix if (a != null) { nrows = a.length; ncols = a.length > 0 ? a[0].length : 0; log.info("Processing bimatrix with nrows " + nrows + " and ncols " + ncols); if(!checkDimensions(a, nrows, ncols)) { addError(request, "A (" + nrows + "x" + ncols + ") is incomplete: " + request.getParameter("a")); } } else { addError(request, "Unable to parse A: " + request.getParameter("a")); } if (b != null && a != null) { if(!checkDimensions(b, nrows, ncols)) { int nrowsb = a.length; int ncolsb = a.length > 0 ? a[0].length : 0; addError(request, "Dimensions of B (" + nrowsb + "x" + ncolsb + ") do not match A"); } } else { addError(request, "Unable to parse B: " + request.getParameter("b")); } if (rowNames != null && rowNames.length != nrows) { addError(request, "Row names length does not match pay matrix " + Arrays.toString(rowNames)); } if (colNames != null && colNames.length != ncols) { addError(request, "Col names length does not match pay matrix " + Arrays.toString(colNames)); } if (!this.hasErrors(request)) { game = new Bimatrix(new String[]{"A" , "B"}, a, b, rowNames, colNames); if (estimate.equals("0")) { try { //Create the tempfiles for (int i=0;i<3;i++){ f[i]=File.createTempFile("game","lrs",outputPath.toFile()); log.info(f[i].getCanonicalPath()); } //Write the game to a file FileWriter fstream= new FileWriter(f[0]); BufferedWriter out = new BufferedWriter(fstream); out.write(game.printFormat()); out.close(); Runtime rt=Runtime.getRuntime(); Process p=null; //Call external program and create H-Representation String[] cmdArray1 = new String[]{pathToAlgo+program1, f[0].getCanonicalPath(), f[1].getCanonicalPath(), f[2].getCanonicalPath()}; p = rt.exec(cmdArray1); p.waitFor(); //Call external program and calculate equilibria String[] cmdArray2 = new String[]{pathToAlgo+program2, f[1].getCanonicalPath(), f[2].getCanonicalPath()}; p = rt.exec(cmdArray2); //Read consoleOutput String line; String lineSeparator = System.getProperty("line.separator"); BufferedReader bri = new BufferedReader(new InputStreamReader(p.getInputStream())); while ((line = bri.readLine()) != null) { consoleOutput+=line+lineSeparator; } bri.close(); p.waitFor(); } catch (IOException e1){ addError(request, e1.getMessage()); log.log(Level.SEVERE,e1.toString()); } catch(Throwable e2) { addError(request, e2.getMessage()); log.log(Level.SEVERE,e2.toString()); } finally { //Delete files for (int i=0;i<3;i++){ if (f[i]!=null) { f[i].delete(); } } } try { this.writeResponseHeader(request, response); if (game != null) { StringBuilder outStrBuilder=new StringBuilder(); outStrBuilder.append("Strategic form: "); outStrBuilder.append(lineSeparator); outStrBuilder.append(lineSeparator); outStrBuilder.append(game.printFormatHTML()); outStrBuilder.append(lineSeparator); outStrBuilder.append(lineSeparator); outStrBuilder.append("EE = Extreme Equilibrium, EP = Expected Payoffs"); outStrBuilder.append(lineSeparator); outStrBuilder.append(lineSeparator); outStrBuilder.append("Rational:"); outStrBuilder.append(lineSeparator); outStrBuilder.append(lineSeparator); StringBuilder clique=new StringBuilder(); outStrBuilder.append(formatOutput(processOutput(consoleOutput,true,clique))); outStrBuilder.append(lineSeparator); outStrBuilder.append("Decimal:"); outStrBuilder.append(lineSeparator); outStrBuilder.append(lineSeparator); outStrBuilder.append(formatOutput(processOutput(consoleOutput,false,clique))); outStrBuilder.append(processClique(pathToAlgo,clique)); File outFile=File.createTempFile("stratform-lrs-all-",".txt",outputPath.toFile()); //Write the game to a file FileWriter fstream= new FileWriter(outFile); BufferedWriter out = new BufferedWriter(fstream); out.write(outStrBuilder.toString()); out.close(); response.getWriter().println(outStrBuilder.toString()); } } catch (Exception ex) { response.getWriter().println(ex.getMessage()); } } else if (estimate.equals("1")) { try { //Create the tempfiles for (int i=0;i<3;i++){ f[i]=File.createTempFile("game","lrs",outputPath.toFile()); log.info(f[i].getCanonicalPath()); } //Write the game to a file FileWriter fstream= new FileWriter(f[0]); BufferedWriter out = new BufferedWriter(fstream); out.write(game.printFormat()); out.close(); Runtime rt=Runtime.getRuntime(); Process p=null; //Call external program and create H-Representation String[] cmdArray1 = new String[]{pathToAlgo+program1, f[0].getCanonicalPath(), f[1].getCanonicalPath(), f[2].getCanonicalPath()}; p = rt.exec(cmdArray1); p.waitFor(); //Add parameters to the outputfile of the H-representation String lineSeparator = System.getProperty("line.separator"); fstream= new FileWriter(f[1],true); out = new BufferedWriter(fstream); out.write(lineSeparator+"maxdepth 5"); out.write(lineSeparator+"estimates 1"); out.close(); //Call external program and estimate the process time String[] cmdArray2 = new String[]{pathToAlgo+program3,f[1].getCanonicalPath()}; p = rt.exec(cmdArray2); //Read consoleOutput String line; String bases="0"; String nodes="0"; String time="0"; int startIndex=-1; int endIndex=-1; BufferedReader bri = new BufferedReader(new InputStreamReader(p.getInputStream())); while ((line = bri.readLine()) != null) { if (line.startsWith("*Estimates")){ log.info(line); startIndex=line.indexOf("bases="); endIndex=line.indexOf(" ",startIndex); bases=line.substring(startIndex+6,endIndex).trim(); consoleOutput+=lineSeparator+"Bases:"+bases; log.info(bases); } else if (line.startsWith("*Total number")){ log.info(line); startIndex=line.indexOf("evaluated:"); endIndex=line.indexOf(" ",startIndex); nodes=line.substring(startIndex+10,line.length()).trim(); consoleOutput+=lineSeparator+"Nodes:"+nodes; log.info(nodes); } else if (line.startsWith("*Estimated total")){ log.info(line); startIndex=line.indexOf("time="); endIndex=line.indexOf(" ",startIndex); time=line.substring(startIndex+5,endIndex).trim(); consoleOutput+=lineSeparator+"Time(sec):"+time; log.info(time); } } bri.close(); p.waitFor(); int _bases=0; int _nodes=0; double _time=0; double esTime=0; String esTimeText="Estimation:"; try { _bases=Integer.parseInt(bases); _nodes=Integer.parseInt(nodes); _time=Double.parseDouble(time); if ((_nodes>0) && (_time>0)) { esTime=(_bases/_nodes)*_time; esTimeText+=Math.round(esTime); } else { esTimeText+="0"; } } catch (Exception e) { addError(request, e.getMessage()); log.log(Level.SEVERE,e.toString()); } consoleOutput+=lineSeparator+esTimeText; consoleOutput+=lineSeparator+"MaxSeconds:"+maxSeconds; log.log(Level.SEVERE,consoleOutput); } catch (IOException e1){ addError(request, e1.getMessage()); log.log(Level.SEVERE,e1.toString()); } catch(Throwable e2) { addError(request, e2.getMessage()); log.log(Level.SEVERE,e2.toString()); } finally { //Delete files for (int i=0;i<3;i++){ if (f[i]!=null) { f[i].delete(); } } } try { this.writeResponseHeader(request, response); if (game != null) { response.getWriter().println("STEP"); response.getWriter().println(consoleOutput); } } catch (Exception ex) { response.getWriter().println(ex.getMessage()); } } } } private <T> boolean checkDimensions(T[][] mat, int row, int col) { if (mat.length != row) return false; for (int i = 0; i < row; ++i) { if (mat[i].length != col) return false; } return true; } private Rational[][] parseMultiRowRatParam(HttpServletRequest request, String name) { String matStr = request.getParameter(name); if (matStr != null) { try { return parseRatMatrix(matStr); } catch (NumberFormatException ex) { addError(request, name + " matrix has invalid entries: " + ex.getMessage() + "\r\n" + matStr); } } return null; } private Rational[][] parseRatMatrix(String matStr) { String[] vecStrArr = matStr.trim().split("\\r\\n"); Rational[][] mat = new Rational[vecStrArr.length][]; for (int i = 0; i < mat.length; ++i) { mat[i] = parseRatVector(vecStrArr[i].trim()); } return mat; } private Rational[] parseRatVector(String vecStr) { String[] strArr = vecStr.split(",?\\s+"); Rational[] vec = new Rational[strArr.length]; for (int i = 0; i < vec.length; ++i) { vec[i] = Rational.valueOf(strArr[i]); } return vec; } public static void printRow(String name, Rational value, ColumnTextWriter colpp, boolean excludeZero) { Rational.printRow(name, value, colpp, excludeZero); } private String processClique(String pathToAlgo,StringBuilder cliqueInput){ String ret=new String(""); File[] f= new File[2]; //Not working on windows if (program4.equals("")) return ret; try { //Create the tempfiles for (int i=0;i<2;i++){ f[i]=File.createTempFile("clique","lrs",outputPath.toFile()); log.info(f[i].getCanonicalPath()); } //Write cliqueInput to File FileWriter fstream= new FileWriter(f[0]); BufferedWriter out = new BufferedWriter(fstream); out.write(cliqueInput.toString()); out.close(); Runtime rt=Runtime.getRuntime(); Process p=null; //Call external program String[] cmdArray1 = new String[]{pathToAlgo+program4, "<"+f[0].getCanonicalPath()}; p = rt.exec(pathToAlgo+program4); OutputStream os = p.getOutputStream(); OutputStreamWriter osr = new OutputStreamWriter(os); BufferedWriter bw=new BufferedWriter(osr); bw.write(cliqueInput.toString()); bw.flush(); bw.close(); String line; String lineSeparator = System.getProperty("line.separator"); BufferedReader bri = new BufferedReader(new InputStreamReader(p.getInputStream())); while ((line = bri.readLine()) != null) { ret+=line+lineSeparator; } bri.close(); p.waitFor(); } catch (IOException e1){ log.log(Level.SEVERE,e1.toString()); } catch(Throwable e2) { log.log(Level.SEVERE,e2.toString()); } finally { //Delete files for (int i=0;i<2;i++){ if (f[i]!=null) { f[i].delete(); } } } return ret; } private String processOutput(String s,Boolean rational,StringBuilder clique_string){ String lines[] = s.split("\\r?\\n"); String ts=""; Boolean start=false; int eq=0; String ret=""; if (clique_string==null){ clique_string=new StringBuilder(); } else { clique_string.setLength(0); } LinkedList<String> indexP1=new LinkedList<String>(); LinkedList<String> indexP2=new LinkedList<String>(); for (int i=0;i<lines.length;i++){ if ((lines[i]!=null) && (lines[i].length()>=5) && (lines[i].substring(0,4).equals("*Num"))) { start=false; } if (start) { if ((lines[i]!=null) && (lines[i].length()>=1)) { eq++; LinkedList<String> lp1=new LinkedList<String>(); LinkedList<String> lp2=new LinkedList<String>(); while ((lines[i]!=null) && (lines[i].length()>=1)) { String d1[] = lines[i].split("\\s+"); if (d1[0].trim().equals("1")) { lp1.add(lines[i]); } if (d1[0].trim().equals("2")) { lp2.add(lines[i]); } i++; } if (lp1.size()>lp2.size()){ while (lp2.size()<lp1.size()) { if (lp2.size()>0) { String d1=lp2.get(lp2.size()-1); lp2.add(new String(d1)); } else { lp2.add(new String("")); } } } if (lp1.size()<lp2.size()){ while (lp1.size()<lp2.size()) { if (lp1.size()>0) { String d1=lp1.get(lp1.size()-1); lp1.add(new String(d1)); } else { lp1.add(new String("")); } } } for (int k1=0;k1<lp1.size();k1++) { String iP1=lp1.get(k1); String iP2=lp2.get(k1); int indexEqP1=0; int indexEqP2=0; for (int n=0;n<indexP1.size();n++){ if (indexP1.get(n).equals(iP1)) indexEqP1=n+1; } if (indexEqP1==0){ indexP1.add(iP1); indexEqP1=indexP1.size(); } for (int n=0;n<indexP2.size();n++){ if (indexP2.get(n).equals(iP2)) indexEqP2=n+1; } if (indexEqP2==0){ indexP2.add(iP2); indexEqP2=indexP2.size(); } String p2[] = lp1.get(k1).split("\\s+"); String p1[] = lp2.get(k1).split("\\s+"); if (k1>0) { eq++; } ret+="EE "+eq+" P1: ("+indexEqP1+") "; clique_string.append(indexEqP1+" "); for (int j=1;j<p2.length-1;j++){ if (rational) { ret+=p2[j]+" "; }else { ts=Double.toString((Math.round(Rational.valueOf(p2[j]).doubleValue() *100000.)/100000.)); if (ts.equals("0.0")) { ts="0"; } ret+=ts+" "; } } if (rational) { ret+="EP= "+p1[p1.length-1]+" "; } else { ts=Double.toString((Math.round(Rational.valueOf(p1[p1.length-1]).doubleValue() *100000.)/100000.)); if (ts.equals("0.0")) { ts="0"; } ret+="EP= "+ts+" "; } ret+="P2: ("+indexEqP2+") "; clique_string.append(indexEqP2); clique_string.append(System.getProperty("line.separator")); for (int j=1;j<p1.length-1;j++){ if (rational) { ret+=p1[j]+" "; } else { ts=Double.toString((Math.round(Rational.valueOf(p1[j]).doubleValue() *100000.)/100000.)); if (ts.equals("0.0")) { ts="0"; } ret+=ts+" "; } } if (rational) { ret+="EP= "+p2[p2.length-1]+System.getProperty("line.separator") ; } else { ts=Double.toString((Math.round(Rational.valueOf(p2[p2.length-1]).doubleValue() *100000.)/100000.)); if (ts.equals("0.0")) { ts="0"; } ret+="EP= "+ts +System.getProperty("line.separator") ; } } } /* if ((lines[i]!=null) && (lines[i].length()>=1)) { eq++; String p1[] = lines[i].split("\\s+"); i++; String p2[] = lines[i].split("\\s+"); ret+="EE "+eq+" P1: ("+eq+") "; for (int j=1;j<p2.length-1;j++){ if (rational) { ret+=p2[j]+" "; }else { ts=Double.toString((Math.round(Rational.valueOf(p2[j]).doubleValue() *100000.)/100000.)); ret+=ts+" "; } } if (rational) { ret+="EP= "+p1[p1.length-1]+" "; } else { ts=Double.toString((Math.round(Rational.valueOf(p1[p1.length-1]).doubleValue() *100000.)/100000.)); ret+="EP= "+ts+" "; } ret+="P2: ("+eq+") "; for (int j=1;j<p1.length-1;j++){ if (rational) { ret+=p1[j]+" "; } else { ts=Double.toString((Math.round(Rational.valueOf(p1[j]).doubleValue() *100000.)/100000.)); ret+=ts+" "; } } if (rational) { ret+="EP= "+p2[p2.length-1]+System.getProperty("line.separator") ; } else { ts=Double.toString((Math.round(Rational.valueOf(p2[p2.length-1]).doubleValue() *100000.)/100000.)); ret+="EP= "+ts +System.getProperty("line.separator") ; } } */ } if ((lines[i]!=null) && (lines[i].length()>=5) && (lines[i].substring(0,4).equals("****"))) { start=true; } } return ret; } private String formatOutput(String s){ String lines[] = s.split("\\r?\\n"); Vector<Integer> l=new Vector<Integer>(); for (int i=0;i<lines.length;i++){ String p1[] = lines[i].split("\\s+"); if (i==0) { for (int j=0;j<p1.length;j++) { l.add(p1[j].length()); } } else { for (int j=0;j<p1.length;j++) { if (((int)l.get(j)) < p1[j].length()) { l.setElementAt(p1[j].length(), j); } } } } String ret=""; for (int i=0;i<lines.length;i++){ String p1[] = lines[i].split("\\s+"); for (int j=0;j<p1.length;j++) { int k=(int)l.get(j)-p1[j].length(); for (int n=0;n<k;n++){ ret+=" "; } ret+=p1[j]+" "; } ret+=System.getProperty("line.separator") ; } return ret; } }
21,158
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
AlgoInterface.java
/FileExtraction/Java_unseen/gambitproject_gte/web-service/src/lse/math/games/web/AlgoInterface.java
package lse.math.games.web; import java.util.logging.Logger; public class AlgoInterface { private native String callnative(String s); private static final Logger log = Logger.getLogger(AlgoInterface.class.getName()); public AlgoInterface(){ System.loadLibrary("setupnash3"); } public void startExtern(){ log.info(this.callnative("Blabla123 ")); log.info("sdf"); } }
410
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
AbstractRESTServlet.java
/FileExtraction/Java_unseen/gambitproject_gte/web-service/src/lse/math/games/web/AbstractRESTServlet.java
package lse.math.games.web; import java.io.IOException; import java.io.PrintWriter; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * @author Mark Egesdal * adapted by Rahul Savani */ @SuppressWarnings("serial") public abstract class AbstractRESTServlet extends HttpServlet { private static final Logger log = Logger.getLogger(AbstractRESTServlet.class.getName()); private static final String ERROR = "error"; private static final String WARNING = "warning"; String lineSeparator = System.getProperty("line.separator"); protected Path outputPath = Paths.get(System.getProperty("user.dir")).resolve("game-output"); protected Long parseRandomSeed(String s) { Long seed = null; if (s != null) { if ("auto".equals(s)) { seed = (long) (Math.random() * Long.MAX_VALUE); } else if (!"none".equals(s)){ try { seed = Long.valueOf(s); } catch (NumberFormatException ex) { // ignore log.warning("Seed not formatted correctly... Ignored: " + s); } } } return seed; } protected boolean hasWarnings(HttpServletRequest request) { return hasMessages(request, WARNING); } protected void addWarning(HttpServletRequest request, String msg) { addMessage(request, WARNING, msg); } protected void writeWarnings(HttpServletRequest request, PrintWriter out) { writeMessages(request, WARNING, out); } protected boolean hasErrors(HttpServletRequest request) { return hasMessages(request, ERROR); } protected void addError(HttpServletRequest request, String msg) { addMessage(request, ERROR, msg); } protected void writeErrors(HttpServletRequest request, PrintWriter out) { writeMessages(request, ERROR, out); } private boolean hasMessages(HttpServletRequest request, String attr) { return request.getAttribute(attr) != null; } private void addMessage(HttpServletRequest request, String attr, String msg) { @SuppressWarnings("unchecked") List<String> messages = (List<String>) request.getAttribute(attr); if (messages == null) { messages = new ArrayList<String>(); request.setAttribute(attr, messages); } log.info(msg); messages.add(msg); } private void writeMessages(HttpServletRequest request, String attr, PrintWriter out) { @SuppressWarnings("unchecked") List<String> messages = (List<String>) request.getAttribute(attr); if (messages != null) { for (String msg : messages) { out.println(msg); } } } protected void writeResponseHeader(HttpServletRequest request, HttpServletResponse response) throws IOException { if (this.hasErrors(request)) { response.getWriter().println("ERROR"); response.getWriter().println(); log.info("ERROR"); this.writeErrors(request, response.getWriter()); } else { response.getWriter().println("SUCCESS"); log.info("SUCCESS"); } response.getWriter().println(); } }
3,230
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
NativeServlet.java
/FileExtraction/Java_unseen/gambitproject_gte/web-service/src/lse/math/games/web/NativeServlet.java
package lse.math.games.web; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.File; import java.util.Arrays; import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import lse.math.games.Rational; import lse.math.games.matrix.Bimatrix; import lse.math.games.io.ColumnTextWriter; /** * @author Martin Prause */ @SuppressWarnings("serial") public class NativeServlet extends AbstractRESTServlet { private static final Logger log = Logger.getLogger(NativeServlet.class.getName()); private String os; private String program1=""; public void init(ServletConfig config) throws ServletException { super.init(config); os=System.getProperty("os.name"); } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/plain"); log.info("Processing new request"); Bimatrix game = null; File[] f= new File[3]; //Later we need different temp files; String consoleOutput=""; if (os.startsWith("Windows")){ program1=request.getParameter("bw");; } else { program1=request.getParameter("bl"); } try { Rational[][] a = parseMultiRowRatParam(request, "a"); Rational[][] b = parseMultiRowRatParam(request, "b"); String[] rowNames = request.getParameter("r") != null ? request.getParameter("r").split(" ") : null; String[] colNames = request.getParameter("c") != null ? request.getParameter("c").split(" ") : null; String algo = request.getParameter("algo"); String pathToAlgo=request.getParameter("d"); int nrows = 0; int ncols = 0; if (a != null) { nrows = a.length; ncols = a.length > 0 ? a[0].length : 0; log.info("Processing bimatrix with nrows " + nrows + " and ncols " + ncols); if(!checkDimensions(a, nrows, ncols)) { addError(request, "A (" + nrows + "x" + ncols + ") is incomplete: " + request.getParameter("a")); } } else { addError(request, "Unable to parse A: " + request.getParameter("a")); } if (b != null && a != null) { if(!checkDimensions(b, nrows, ncols)) { int nrowsb = a.length; int ncolsb = a.length > 0 ? a[0].length : 0; addError(request, "Dimensions of B (" + nrowsb + "x" + ncolsb + ") do not match A"); } } else { addError(request, "Unable to parse B: " + request.getParameter("b")); } if (rowNames != null && rowNames.length != nrows) { addError(request, "Row names length does not match pay matrix " + Arrays.toString(rowNames)); } if (colNames != null && colNames.length != ncols) { addError(request, "Col names length does not match pay matrix " + Arrays.toString(colNames)); } if (!this.hasErrors(request)) { game = new Bimatrix(new String[]{"A" , "B"}, a, b, rowNames, colNames); log.info(game.toString()); log.info(pathToAlgo); try { //Create the tempfiles for (int i=0;i<3;i++){ if (i==0) { f[i]=File.createTempFile("game","native"); } else { f[i]=File.createTempFile("temp","native"); } log.info(f[i].getCanonicalPath()); } //Write the game to a file FileWriter fstream= new FileWriter(f[0]); BufferedWriter out = new BufferedWriter(fstream); out.write(game.printFormat()); out.close(); Runtime rt=Runtime.getRuntime(); Process p=null; //Call external program String[] cmdArray1 = new String[]{pathToAlgo+program1, f[0].getCanonicalPath(), f[1].getCanonicalPath(), f[2].getCanonicalPath()}; p = rt.exec(cmdArray1); p.waitFor(); //Read consoleOutput String line; String lineSeparator = System.getProperty("line.separator"); BufferedReader bri = new BufferedReader(new InputStreamReader(p.getInputStream())); while ((line = bri.readLine()) != null) { consoleOutput+=line+lineSeparator; } bri.close(); p.waitFor(); } catch (IOException e1){ log.log(Level.SEVERE,e1.toString()); } catch(Throwable e2) { log.log(Level.SEVERE,e2.toString()); } finally { //Delete files for (int i=0;i<3;i++){ if (f[i]!=null) { f[i].delete(); } } } } //has !errors } catch (Exception ex) { addError(request, ex.getMessage()); } try { this.writeResponseHeader(request, response); if (game != null) { response.getWriter().println("NormalForm " + game.nrows() + " " + game.ncols()); response.getWriter().println(game.printFormat()); response.getWriter().println("From native Algo:"); response.getWriter().println(consoleOutput); } } catch (Exception ex) { response.getWriter().println(ex.getMessage()); } } private <T> boolean checkDimensions(T[][] mat, int row, int col) { if (mat.length != row) return false; for (int i = 0; i < row; ++i) { if (mat[i].length != col) return false; } return true; } private Rational[][] parseMultiRowRatParam(HttpServletRequest request, String name) { String matStr = request.getParameter(name); if (matStr != null) { try { return parseRatMatrix(matStr); } catch (NumberFormatException ex) { addError(request, name + " matrix has invalid entries: " + ex.getMessage() + "\r\n" + matStr); } } return null; } private Rational[][] parseRatMatrix(String matStr) { String[] vecStrArr = matStr.trim().split("\\r\\n"); Rational[][] mat = new Rational[vecStrArr.length][]; for (int i = 0; i < mat.length; ++i) { mat[i] = parseRatVector(vecStrArr[i].trim()); } return mat; } private Rational[] parseRatVector(String vecStr) { String[] strArr = vecStr.split(",?\\s+"); Rational[] vec = new Rational[strArr.length]; for (int i = 0; i < vec.length; ++i) { vec[i] = Rational.valueOf(strArr[i]); } return vec; } public static void printRow(String name, Rational value, ColumnTextWriter colpp, boolean excludeZero) { Rational.printRow(name, value, colpp, excludeZero); } }
7,010
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
BimatrixServlet.java
/FileExtraction/Java_unseen/gambitproject_gte/web-service/src/lse/math/games/web/BimatrixServlet.java
package lse.math.games.web; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.DataInputStream; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.Random; import java.util.logging.Logger; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import lse.math.games.Rational; import lse.math.games.lrs.LrsAlgorithm; import lse.math.games.lrs.Lrs; import lse.math.games.matrix.Bimatrix; import lse.math.games.matrix.BimatrixSolver; import lse.math.games.matrix.BipartiteClique; import lse.math.games.matrix.Equilibria; import lse.math.games.matrix.Equilibrium; import lse.math.games.io.ColumnTextWriter; import lse.math.games.lcp.LemkeAlgorithm; import lse.math.games.lcp.LemkeAlgorithm.LemkeException; /** * @author Mark Egesdal */ @SuppressWarnings("serial") public class BimatrixServlet extends AbstractRESTServlet { private static final Logger log = Logger.getLogger(BimatrixServlet.class.getName()); private Lrs lrs; private BimatrixSolver solver = new BimatrixSolver(); public void init(ServletConfig config) throws ServletException { super.init(config); lrs = new LrsAlgorithm(); } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/plain"); log.info("Processing new request"); Bimatrix game = null; Rational[] xPriors = null; Rational[] yPriors = null; Long seed = null; Equilibria eqs = null; try { Rational[][] a = parseMultiRowRatParam(request, "a"); Rational[][] b = parseMultiRowRatParam(request, "b"); String[] rowNames = request.getParameter("r") != null ? request.getParameter("r").split(" ") : null; String[] colNames = request.getParameter("c") != null ? request.getParameter("c").split(" ") : null; String algo = request.getParameter("algo"); xPriors = parseSingleRowRatParam(request, "x"); yPriors = parseSingleRowRatParam(request, "y"); seed = this.parseRandomSeed(request.getParameter("s")); int nrows = 0; int ncols = 0; if (a != null) { nrows = a.length; ncols = a.length > 0 ? a[0].length : 0; log.info("Processing bimatrix with nrows " + nrows + " and ncols " + ncols); if(!checkDimensions(a, nrows, ncols)) { addError(request, "A (" + nrows + "x" + ncols + ") is incomplete: " + request.getParameter("a")); } } else { addError(request, "Unable to parse A: " + request.getParameter("a")); } if (b != null && a != null) { if(!checkDimensions(b, nrows, ncols)) { int nrowsb = a.length; int ncolsb = a.length > 0 ? a[0].length : 0; addError(request, "Dimensions of B (" + nrowsb + "x" + ncolsb + ") do not match A"); } } else { addError(request, "Unable to parse B: " + request.getParameter("b")); } if (rowNames != null && rowNames.length != nrows) { //if (rowNames.length != 0 || nrows != 1) { addError(request, "Row names length does not match pay matrix " + Arrays.toString(rowNames)); //} } if (colNames != null && colNames.length != ncols) { //if (colNames.length != 0 || ncols != 1) { addError(request, "Col names length does not match pay matrix " + Arrays.toString(colNames)); //} } if (!this.hasErrors(request)) { game = new Bimatrix(new String[]{"A" , "B"}, a, b, rowNames, colNames); log.info(game.toString()); if (algo != null && algo.equals("menum")) { log.info("lrs enumerate"); if (nrows + ncols > 30) { // TODO: add this logic to solver and throw an exception addError(request, "Dimensions are too large (we restrict rows + cols < 31)"); } else { eqs = solver.findAllEq(lrs, a, b); log.info("equilibria found"); } } else { log.info("lemke"); Equilibrium eq = null; LemkeAlgorithm lemke = new LemkeAlgorithm(); try { // 0. Compute and print prior beliefs Random prng = seed != null ? new Random(seed) : null; if (xPriors == null) { xPriors = solver.computePriorBeliefs(nrows, prng); } else if (prng != null) { this.addWarning(request, "Manual priors for rows override randomization"); } if (yPriors == null) { yPriors = solver.computePriorBeliefs(ncols, prng); } else if (prng != null) { this.addWarning(request, "Manual priors for columns override randomization"); } eq = solver.findOneEquilibrium(lemke, a, b, xPriors, yPriors, response.getWriter()); } catch (LemkeException ex) { //TODO: write better error output for ray termination, etc. addError(request, ex.getMessage()); } if (eq != null) { log.info("equilibrium found"); eqs = new Equilibria(); eqs.add(eq); } } } } catch (Exception ex) { addError(request, ex.getMessage()); } try { this.writeResponseHeader(request, response); if (game != null) { response.getWriter().println("NormalForm " + game.nrows() + " " + game.ncols()); response.getWriter().println(game.toString()); } if (xPriors != null && yPriors != null) { printPriors(xPriors, yPriors, seed, game, response.getWriter()); } if (eqs != null) { if (eqs.count() > 1) { printResultCompact(eqs, game, response.getWriter()); } else { printResultOld(eqs, game, response.getWriter()); } } } catch (Exception ex) { response.getWriter().println(ex.getMessage()); } } private void printPriors(Rational[] xPriors, Rational[] yPriors, Long seed, Bimatrix game, PrintWriter output) { ColumnTextWriter colpp = new ColumnTextWriter(); colpp.writeCol("Priors"); colpp.endRow(); if (seed != null) { colpp.writeCol("seed"); colpp.writeCol(seed.toString()); colpp.endRow(); colpp.endRow(); } for (int i = 0; i < game.nrows(); ++i) { printRow(game.row(i), xPriors[i], colpp, false); } colpp.endRow(); for (int j = 0; j < game.ncols(); ++j) { printRow(game.col(j), yPriors[j], colpp, false); } colpp.alignLeft(0); output.println(colpp.toString()); } private <T> boolean checkDimensions(T[][] mat, int row, int col) { if (mat.length != row) return false; for (int i = 0; i < row; ++i) { if (mat[i].length != col) return false; } return true; } private Rational[][] parseMultiRowRatParam(HttpServletRequest request, String name) { String matStr = request.getParameter(name); if (matStr != null) { try { return parseRatMatrix(matStr); } catch (NumberFormatException ex) { addError(request, name + " matrix has invalid entries: " + ex.getMessage() + "\r\n" + matStr); } } return null; } private Rational[] parseSingleRowRatParam(HttpServletRequest request, String name) { String vecStr = request.getParameter(name); if (vecStr != null) { try { return parseRatVector(vecStr); } catch (NumberFormatException ex) { addError(request, name + " vector has invalid entries: " + vecStr); } } return null; } private Rational[][] parseRatMatrix(String matStr) { String[] vecStrArr = matStr.trim().split("\\r\\n"); Rational[][] mat = new Rational[vecStrArr.length][]; for (int i = 0; i < mat.length; ++i) { mat[i] = parseRatVector(vecStrArr[i].trim()); } return mat; } private Rational[] parseRatVector(String vecStr) { String[] strArr = vecStr.split(",?\\s+"); Rational[] vec = new Rational[strArr.length]; for (int i = 0; i < vec.length; ++i) { vec[i] = Rational.valueOf(strArr[i]); } return vec; } /*private void printHeader(Bimatrix game, ColumnTextWriter colpp, Equilibria eqs) { if (eqs.count() > 1) { colpp.writeCol(""); } colpp.alignLeft(); for(int i = 0; i < game.nrows(); ++i) { boolean hasNonZeroEntry = false; for (Equilibrium eq : eqs) { if (!eq.probVec1[i].isZero()) { hasNonZeroEntry = true; break; } } if (hasNonZeroEntry) { colpp.writeCol(game.row(i)); } else { colpp.writeCol(""); } } colpp.writeCol("\u00A3" + game.firstPlayer()); colpp.writeCol(" "); if (eqs.count() > 1) { colpp.writeCol(""); } colpp.alignLeft(); for(int j = 0; j < game.ncols(); ++j) { boolean hasNonZeroEntry = false; for (Equilibrium eq : eqs) { if (!eq.probVec2[j].isZero()) { hasNonZeroEntry = true; break; } } if (hasNonZeroEntry) { colpp.writeCol(game.col(j)); } else { colpp.writeCol(""); } } colpp.writeCol("\u00A3" + game.secondPlayer()); colpp.endRow(); }*/ private void printResultCompact(Equilibria eqs, Bimatrix game, PrintWriter out) throws IOException { ColumnTextWriter colpp = new ColumnTextWriter(); if (eqs.count() > 1) { out.println("Equilibria " + eqs.count()); } for (Equilibrium eq : eqs) { colpp.writeCol("x" + eq.getVertex1()); for (int i = 0; i < eq.probVec1.length; ++i) { Rational prob = eq.probVec1[i]; if (!prob.isZero()) { colpp.writeCol(game.row(i) + ":"); colpp.alignLeft(); colpp.writeCol(String.format("%.3f", prob.doubleValue())); } else { colpp.writeCol(""); colpp.writeCol(""); } } colpp.writeCol(" \u00A3" + String.format("%.2f", eq.payoff1.doubleValue())); colpp.writeCol(" y" + eq.getVertex2()); for (int j = 0; j < eq.probVec2.length; ++j) { Rational prob = eq.probVec2[j]; if (!prob.isZero()) { colpp.writeCol(game.col(j) + ":"); colpp.alignLeft(); colpp.writeCol(String.format("%.3f", prob.doubleValue())); } else { colpp.writeCol(""); colpp.writeCol(""); } } colpp.writeCol(" \u00A3" + String.format("%.2f", eq.payoff2.doubleValue())); colpp.endRow(); colpp.writeCol(""); for (int i = 0; i < eq.probVec1.length; ++i) { Rational prob = eq.probVec1[i]; colpp.writeCol(""); if (!prob.isZero()) { colpp.writeCol(prob.toString()); } else { colpp.writeCol(""); } } colpp.writeCol(eq.payoff1.toString()); colpp.writeCol(""); for (int j = 0; j < eq.probVec2.length; ++j) { Rational prob = eq.probVec2[j]; colpp.writeCol(""); if (!prob.isZero()) { colpp.writeCol(prob.toString()); } else { colpp.writeCol(""); } } colpp.writeCol(eq.payoff2.toString()); colpp.endRow(); colpp.endRow(); } out.print(colpp.toString()); if (eqs.count() > 1) { out.println("Cliques"); for (BipartiteClique clique : eqs.cliques()) { StringBuilder sb = new StringBuilder(); if (eqs.count() > 1) { sb.append(" {"); for (int i = 0; i < clique.left.length; ++i) { if (i > 0) { sb.append(", "); } sb.append("x" + clique.left[i]); } sb.append("} x {"); for (int i = 0; i < clique.right.length; ++i) { if (i > 0) { sb.append(", "); } sb.append("y" + clique.right[i]); } sb.append("}"); } out.println(sb.toString()); } } } // This is a first attempt to display cliques and equilibria together... it has a bug with only // displaying one payoff per player instead of one per strategy of the other player // (i.e. if pl 1 has 2 eq and pl 2 has 3, pl 1 should have 3 pays and pl 2 should have 2) // It is a good format for displaying a single result, which is how it is currently used. private void printResultOld(Equilibria eqs, Bimatrix game, PrintWriter out) throws IOException { ColumnTextWriter colpp = new ColumnTextWriter(); if (eqs.count() > 1) { colpp.writeCol("Equilibria " + eqs.count()); colpp.endRow(); } for (BipartiteClique clique : eqs.cliques()) { StringBuilder sb = new StringBuilder(); if (eqs.count() > 1) { sb.append(" {"); for (int i = 0; i < clique.left.length; ++i) { if (i > 0) { sb.append(", "); } sb.append(clique.left[i]); } sb.append("} x {"); for (int i = 0; i < clique.right.length; ++i) { if (i > 0) { sb.append(", "); } sb.append(clique.right[i]); } sb.append("}"); } colpp.writeCol("Equilibrium" + sb.toString()); colpp.endRow(); Rational payX = null; Rational payY = null; for (int i = 0; i < clique.left.length; ++i) { Equilibrium x = eqs.getByVertex1(clique.left[i]); if (payX == null) { payX = x.payoff1; } for (int j = 0; j < x.probVec1.length; ++j) { printRow(game.row(j), x.probVec1[j], colpp, true); } colpp.endRow(); } for (int i = 0; i < clique.right.length; ++i) { Equilibrium y = eqs.getByVertex2(clique.right[i]); if (payY == null) { payY = y.payoff2; } for (int j = 0; j < y.probVec2.length; ++j) { printRow(game.col(j), y.probVec2[j], colpp, true); } colpp.endRow(); } printRow("\u00A3" + game.firstPlayer(), payX, colpp, false); printRow("\u00A3" + game.secondPlayer(), payY, colpp, false); colpp.endRow(); } colpp.alignLeft(0); out.print(colpp.toString()); } public static void printRow(String name, Rational value, ColumnTextWriter colpp, boolean excludeZero) { Rational.printRow(name, value, colpp, excludeZero); } /*private void printResult(Equilibrium eq, ColumnTextWriter colpp, boolean printVertex) { if (printVertex) { colpp.writeCol("x" + (eq.getVertex1() > 0 ? eq.getVertex1() : "")); } for (Rational coord : eq.probVec1) { if (!coord.isZero()) { colpp.writeCol(coord.toString()); } else { colpp.writeCol(""); } } colpp.writeCol(eq.payoff1.toString()); colpp.writeCol(""); if (printVertex) { colpp.writeCol("y" + (eq.getVertex1() > 0 ? eq.getVertex2() : "")); } for (Rational coord : eq.probVec2) { if (!coord.isZero()) { colpp.writeCol(coord.toString()); } else { colpp.writeCol(""); } } colpp.writeCol(eq.payoff2.toString()); colpp.endRow(); }*/ /*private void printMatrix(String name, Rational[][] matrix, String[] rowNames, String[] colNames, PrintWriter out) { ColumnTextWriter colpp = new ColumnTextWriter(); colpp.writeCol(name); colpp.alignLeft(); for (String colName : colNames) { colpp.writeCol(colName); } colpp.endRow(); //out.println(name + " " + rows + " " + cols); for(int i = 0; i < matrix.length; ++i) { colpp.writeCol(rowNames[i]); Rational[] row = matrix[i]; for (Rational entry : row) { colpp.writeCol(entry.toString()); } colpp.endRow(); } log.info(colpp.toString()); out.println(colpp.toString()); }*/ }
15,738
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
LCPServlet.java
/FileExtraction/Java_unseen/gambitproject_gte/web-service/src/lse/math/games/web/LCPServlet.java
package lse.math.games.web; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import lse.math.games.Rational; import lse.math.games.lcp.LemkeAlgorithm; import lse.math.games.lcp.LemkeAlgorithm.LemkeException; import lse.math.games.lcp.LemkeAlgorithm.RayTerminationException; import lse.math.games.lcp.LemkeAlgorithm.TrivialSolutionException; import lse.math.games.lcp.LCP; /** * @author Mark Egesdal */ public class LCPServlet extends HttpServlet { private static final long serialVersionUID = 1L; private String jsppage; public void init(ServletConfig config) throws ServletException { super.init(config); jsppage = config.getInitParameter("jsppage"); } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(jsppage); dispatcher.forward(request,response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { boolean inputOk = true; LCP lcp = null; Rational[] d = parseSingleRowParam(request, "d"); if (d == null) inputOk = false; else { lcp = new LCP(d.length); for (int i = 0; i < lcp.size(); ++i) { lcp.setd(i, d[i]); } } Rational[] q = parseSingleRowParam(request, "q"); if (q == null) inputOk = false; else if (lcp != null) { if (q.length != lcp.size()) { inputOk = false; request.setAttribute("qerror", "q vector does not match dimension of d vector"); } else { for (int i = 0; i < lcp.size(); ++i) { lcp.setq(i, q[i]); } } } Rational[][] M = parseMultiRowParam(request, "M"); if (M == null) inputOk = false; else if (lcp != null) { if (M.length != lcp.size()) { inputOk = false; request.setAttribute("Merror", "M matrix does not match dimension of d vector"); } else { for (int i = 0; i < lcp.size(); ++i) { if (M[i].length == lcp.size()) { for (int j = 0; j < lcp.size(); ++j) { lcp.setM(i, j, M[i][j]); } } else { inputOk = false; request.setAttribute("Merror", "M matrix is not square"); } } } } if (inputOk) { solve(request, lcp); } else { request.setAttribute("error", "Invalid inputs:"); } doGet(request, response); } private void solve(HttpServletRequest request, LCP lcp) { LemkeAlgorithm lemke = new LemkeAlgorithm(); try { //lemke.init(lcp); Rational[] z = lemke.run(lcp); String[] zStr = new String[z.length]; for (int i = 0; i < zStr.length; ++i) { zStr[i] = z[i].toString(); } request.setAttribute("z", zStr); } catch (TrivialSolutionException ex) { String[] zStr = new String[lcp.size()]; for (int i = 0; i < zStr.length; ++i) { zStr[i] = "0"; } request.setAttribute("z", zStr); } catch (RayTerminationException ex) { request.setAttribute("nosolz", ex.getMessage()); } catch (LemkeException ex) { request.setAttribute("error", ex.getMessage()); } } private Rational[] parseSingleRowParam(HttpServletRequest request, String name) { Rational[] vec = null; try { String vecStr = request.getParameter(name); vec = parseVector(vecStr); } catch (NumberFormatException ex) { request.setAttribute(name + "error", name + " vector has invalid entries"); } return vec; } private Rational[][] parseMultiRowParam(HttpServletRequest request, String name) { Rational[][] mat = null; try { String matStr = request.getParameter(name); mat = parseMatrix(matStr); } catch (NumberFormatException ex) { mat = null; request.setAttribute(name + "error", name + " matrix has invalid entries"); } return mat; } private Rational[][] parseMatrix(String matStr) { String[] vecStrArr = matStr.split("\\r\\n"); Rational[][] mat = new Rational[vecStrArr.length][]; for (int i = 0; i < mat.length; ++i) { mat[i] = parseVector(vecStrArr[i]); } return mat; } private Rational[] parseVector(String vecStr) { String[] strArr = vecStr.split(",?\\s+"); Rational[] vec = new Rational[strArr.length]; for (int i = 0; i < vec.length; ++i) { vec[i] = Rational.valueOf(strArr[i]); } return vec; } }
4,899
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
TreeServlet.java
/FileExtraction/Java_unseen/gambitproject_gte/web-service/src/lse/math/games/web/TreeServlet.java
package lse.math.games.web; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.StringReader; import java.util.Map; import java.util.Map.Entry; import java.util.logging.Logger; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import lse.math.games.Rational; import lse.math.games.io.ColumnTextWriter; import lse.math.games.io.ExtensiveFormXMLReader; import lse.math.games.lcp.LCP; import lse.math.games.lcp.LemkeAlgorithm; import lse.math.games.lcp.LemkeAlgorithm.LemkeException; //import lse.math.games.lcp.LemkeAlgorithm.LemkeInitException; import lse.math.games.lcp.LemkeAlgorithm.RayTerminationException; import lse.math.games.tree.ExtensiveForm; import lse.math.games.tree.Move; import lse.math.games.tree.Player; import lse.math.games.tree.SequenceForm; import lse.math.games.tree.SequenceForm.ImperfectRecallException; import lse.math.games.tree.SequenceForm.InvalidPlayerException; import org.w3c.dom.Document; import org.xml.sax.InputSource; import org.xml.sax.SAXException; /** * @author Mark Egesdal */ @SuppressWarnings("serial") public class TreeServlet extends AbstractRESTServlet { private static final Logger log = Logger.getLogger(TreeServlet.class.getName()); /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/plain"); log.info("Processing new request"); SequenceForm seqForm = null; String solutionStr = null; try { // 0. See if we have a seed for random priors Long seed = this.parseRandomSeed(request.getParameter("s")); // 1. pull XML out of request returning any errors String xmlStr = request.getParameter("g"); if (xmlStr == null) { this.addError(request, "g parameter is missing"); return; } else { // 2. load XML into ExtensiveForm returning any errors ExtensiveForm tree = null; try { DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(new InputSource(new StringReader(xmlStr))); ExtensiveFormXMLReader reader = new ExtensiveFormXMLReader(); tree = reader.load(doc); } catch (ParserConfigurationException ex) { this.addError(request, "unable to configure xml parser"); } catch (SAXException ex) { this.addError(request, "unable to parse xml"); } if (tree != null) { String parameters=tree.getParameter(); if (parameters==null) { System.out.println("Without parameters"); // 3. Convert to SequenceForm returning any errors try { seqForm = new SequenceForm(tree, seed); } catch (ImperfectRecallException ex) { this.addError(request, ex.getMessage()); } if (seqForm != null) { // 4. Retrieve LCP and run through Lemke Rational[] z = null; try { LCP lcp = seqForm.getLemkeLCP(); log.info(lcp.toString()); LemkeAlgorithm lemke = new LemkeAlgorithm(); //lemke.init(lcp); z = lemke.run(lcp); } catch (InvalidPlayerException ex) { this.addError(request, ex.getMessage()); } catch (RayTerminationException ex) { //TODO: give special treatment this.addError(request, ex.getMessage()); } catch (LemkeException ex) { this.addError(request, ex.getMessage()); } if (z != null) { // 5. Parse Lemke solution into behavior strategy equilibrium Map<Player,Map<Move,Rational>> plProbs = seqForm.parseLemkeSolution(z); Map<Player,Rational> epayoffs = SequenceForm.expectedPayoffs(plProbs, tree); ColumnTextWriter colpp = new ColumnTextWriter(); colpp.writeCol("Equilibrium"); colpp.endRow(); boolean firsttime = true; for (Player pl = tree.firstPlayer(); pl != null; pl = pl.next) { if (firsttime) { firsttime = false; } else { colpp.endRow(); } for (Entry<Move,Rational> entry : plProbs.get(pl).entrySet()) { colpp.writeCol(entry.getKey().toString()); colpp.writeCol(entry.getValue().toString()); colpp.endRow(); } } colpp.endRow(); for (Player pl = tree.firstPlayer(); pl != null; pl = pl.next) { colpp.writeCol("\u00A3" + pl.toString()); colpp.writeCol(epayoffs.get(pl).toString()); colpp.endRow(); } colpp.alignLeft(0); solutionStr = colpp.toString(); } } } else { System.out.println("Iterate over parameters"); double start=Double.parseDouble((parameters.substring(0, parameters.indexOf("...")))); double end=Double.parseDouble((parameters.substring(parameters.indexOf("...")+3,parameters.length()))); solutionStr=""; while (start<end) { tree.setTreeParameter(String.valueOf(start)); solutionStr +=System.getProperty("line.separator")+"Parameter: "+start+System.getProperty("line.separator"); solutionStr +=tree.toString(); solutionStr +=System.getProperty("line.separator"); // 3. Convert to SequenceForm returning any errors try { seqForm = new SequenceForm(tree, seed); } catch (ImperfectRecallException ex) { this.addError(request, ex.getMessage()); } if (seqForm != null) { // 4. Retrieve LCP and run through Lemke Rational[] z = null; try { LCP lcp = seqForm.getLemkeLCP(); log.info(lcp.toString()); LemkeAlgorithm lemke = new LemkeAlgorithm(); //lemke.init(lcp); z = lemke.run(lcp); } catch (InvalidPlayerException ex) { this.addError(request, ex.getMessage()); } catch (RayTerminationException ex) { //TODO: give special treatment this.addError(request, ex.getMessage()); } catch (LemkeException ex) { this.addError(request, ex.getMessage()); } if (z != null) { // 5. Parse Lemke solution into behavior strategy equilibrium Map<Player,Map<Move,Rational>> plProbs = seqForm.parseLemkeSolution(z); Map<Player,Rational> epayoffs = SequenceForm.expectedPayoffs(plProbs, tree); ColumnTextWriter colpp = new ColumnTextWriter(); colpp.writeCol("Equilibrium"); colpp.endRow(); boolean firsttime = true; for (Player pl = tree.firstPlayer(); pl != null; pl = pl.next) { if (firsttime) { firsttime = false; } else { colpp.endRow(); } for (Entry<Move,Rational> entry : plProbs.get(pl).entrySet()) { colpp.writeCol(entry.getKey().toString()); colpp.writeCol(entry.getValue().toString()); colpp.endRow(); } } colpp.endRow(); for (Player pl = tree.firstPlayer(); pl != null; pl = pl.next) { colpp.writeCol("\u00A3" + pl.toString()); colpp.writeCol(epayoffs.get(pl).toString()); colpp.endRow(); } colpp.alignLeft(0); solutionStr += colpp.toString(); } } start=start+1; } } } } } catch (Exception ex) { this.addError(request, ex.toString()); ex.printStackTrace(); } this.writeResponseHeader(request, response); File outFile=File.createTempFile("seqform-lemke-",".txt",outputPath.toFile()); //Write the game to a file FileWriter fstream= new FileWriter(outFile); BufferedWriter out = new BufferedWriter(fstream); if (seqForm != null) { response.getWriter().println("SequenceForm"); response.getWriter().println(seqForm.toString()); out.write(seqForm.toString()); } if (solutionStr != null) { response.getWriter().println(solutionStr); out.write(solutionStr); } out.close(); } }
8,964
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
RationalTest.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/test/src/lse/math/games/RationalTest.java
package lse.math.games; import org.junit.Test; import static org.junit.Assert.*; public class RationalTest { @Test public void testLargeCrossProductAdd() { //NOTE: longMax is odd since it is 0111...111 in bits Rational a = new Rational(Long.MAX_VALUE, (Long.MAX_VALUE - 1) / 2); Rational b = new Rational(-3, 2); a = a.add(b); Rational result = new Rational((Long.MAX_VALUE - 1) / 2 + 2, Long.MAX_VALUE - 1); assertEquals(result, a); } @Test public void testPositiveNumAddEq() { Rational a = Rational.valueOf(1127L); Rational b = Rational.valueOf(1011L); a = a.add(b); assertTrue(a.compareTo(2138L) == 0); assertEquals(a.doubleValue(), 2138D, 0.000000001); } @Test public void testPositiveNumMulEq() { Rational a = Rational.valueOf(27L); Rational b = Rational.valueOf(11L); a = a.multiply(b); assertTrue(a.compareTo(297L) == 0); assertEquals(a.doubleValue(), 297D, 0.000000001); } @Test public void testPositiveReciprocal() { Rational a = Rational.valueOf(4L); a = a.reciprocate(); assertEquals(new Rational(1, 4), a); assertEquals(a.doubleValue(), 0.25D, 0.000000001); } @Test public void testNegativeNumMulEq() { Rational a = Rational.valueOf(27L); Rational b = Rational.valueOf(-11L); a = a.multiply(b); assertTrue(a.compareTo(-297L) == 0); assertEquals(a.doubleValue(), -297D, 0.000000001); } @Test public void testDoubleNegativeNumMulEq() { Rational a = Rational.valueOf(-27L); Rational b = Rational.valueOf(-11L); a = a.multiply(b); assertTrue(a.compareTo(297L) == 0); assertEquals(297D, a.doubleValue(), 0.000000001); } @Test public void testFractionReduction() { Rational a = new Rational(3,5); Rational b = new Rational(10,7); a = a.multiply(b); assertEquals(new Rational(6, 7), a); } @Test public void testPositiveNumbertoString() { Rational a = new Rational(3, 4); assertEquals("3/4", a.toString()); } @Test public void testNegativeNumeratortoString() { Rational a = new Rational(-3, 4); assertEquals("-3/4", a.toString()); } @Test public void testNegativeDenominatortoString() { Rational a = new Rational(3, -4); assertEquals("-3/4", a.toString()); } @Test public void testFractionReductionIntoString() { Rational a = new Rational(-6, -8); assertEquals("3/4", a.toString()); } @Test public void testLargeNumAndDen() { Rational r = new Rational(Long.MAX_VALUE, Long.MAX_VALUE); assertEquals(1.0, r.doubleValue(), 0.000000001); assertEquals("1", r.toString()); } @Test public void testLargeNegNumAndDen() { Rational r = new Rational(Long.MIN_VALUE + 1, Long.MIN_VALUE + 1); assertEquals(1.0, r.doubleValue(), 0.000000001); assertEquals("1", r.toString()); } @Test public void testLargeNumLargeNegDen() { Rational r = new Rational(Long.MAX_VALUE, Long.MIN_VALUE + 1); assertEquals(-1.0, r.doubleValue(), 0.000000001); assertEquals("-1", r.toString()); } @Test public void testLargeNegNumLargeDen() { Rational r = new Rational(Long.MIN_VALUE + 1, Long.MAX_VALUE); assertEquals(-1.0, r.doubleValue(), 0.000000001); assertEquals("-1", r.toString()); } @Test public void testLargeDen() { Rational r = new Rational(1L, Long.MAX_VALUE); assertEquals(String.format("1/%s", Long.MAX_VALUE), r.toString()); } @Test public void testLargeNum() { Rational r = new Rational(Long.MAX_VALUE, 1L); assertEquals((double) Long.MAX_VALUE, r.doubleValue(), 0.000000001); assertEquals(String.format("%s", Long.MAX_VALUE), r.toString()); } @Test public void testDoubleConversion() { double dv = (double)(Long.MAX_VALUE - 1024L); assertEquals(Long.MAX_VALUE - 1023L, (long) dv); //expected consistent? small rounding error double value = 0.00000000000000001; Rational r = Rational.valueOf(value); assertEquals(value, r.doubleValue(), 0.00000000000000001); assertEquals("1/100000000000000000", r.toString()); assertEquals(new Rational(1, 100000000000000000L), r); } @Test public void testDoubleConversionMinuteFloorDiff() { { double value = 0.5D / Long.MAX_VALUE; Rational r = Rational.valueOf(value); assertEquals(value, r.doubleValue(), 0.000000001); } } @Test public void testFlipWithLargeNum() { Rational r = Rational.valueOf(Long.MAX_VALUE); assertTrue(r.compareTo(Long.MAX_VALUE) == 0); r = r.reciprocate(); assertEquals(new Rational(1, Long.MAX_VALUE), r); } @Test public void testGCD() { long gcd = Rational.gcd(Long.MIN_VALUE + 1, Long.MAX_VALUE); assertEquals(Long.MAX_VALUE, gcd); } @Test public void testReduceLargeNegNum() { Rational r = new Rational(Long.MIN_VALUE + 1, Long.MAX_VALUE); //reduce done in constructor assertTrue(r.compareTo(-1L) == 0); } }
5,956
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
ExtensiveFormXMLReaderTest.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/test/src/lse/math/games/tree/ExtensiveFormXMLReaderTest.java
package lse.math.games.tree; import static org.junit.Assert.*; import java.io.IOException; import java.io.StringReader; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import lse.math.games.io.ExtensiveFormXMLReader; import org.junit.Test; import org.w3c.dom.Document; import org.xml.sax.InputSource; import org.xml.sax.SAXException; public class ExtensiveFormXMLReaderTest { @Test public void testLoad() throws ParserConfigurationException, SAXException, IOException { String xmlStr = "<extensiveForm>" + "<node player=\"A\">" + "<node iset=\"B:1\" player=\"B\" move=\"L\">" + "<outcome move=\"a\">" + "<payoff player=\"A\" value=\"11\"/>" + "<payoff player=\"B\" value=\"3\"/>" + "</outcome>" + "<outcome move=\"b\">" + "<payoff player=\"A\" value=\"3\"/>" + "<payoff player=\"B\" value=\"0\"/>" + "</outcome>" + "</node>" + "<node player=\"A\" move=\"R\">" + "<node move=\"S\">" + "<node iset=\"B:1\" prob=\"0.5\">" + "<outcome move=\"a\">" + "<payoff player=\"A\" value=\"0\"/>" + "<payoff player=\"B\" value=\"0\"/>" + "</outcome>" + "<outcome move=\"b\">" + "<payoff player=\"A\" value=\"0\"/>" + "<payoff player=\"B\" value=\"10\"/>" + "</outcome>" + "</node>" + "<node iset=\"B:2\" player=\"B\" prob=\"0.5\">" + "<outcome move=\"c\">" + "<payoff player=\"A\" value=\"0\"/>" + "<payoff player=\"B\" value=\"4\"/>" + "</outcome>" + "<outcome move=\"d\">" + "<payoff player=\"A\" value=\"24\"/>" + "<payoff player=\"B\" value=\"0\"/>" + "</outcome>" + "</node>" + "</node>" + "<node iset=\"B:2\" move=\"T\">" + "<outcome move=\"c\">" + "<payoff player=\"A\" value=\"6\"/>" + "<payoff player=\"B\" value=\"0\"/>" + "</outcome>" + "<outcome move=\"d\">" + "<payoff player=\"A\" value=\"0\"/>" + "<payoff player=\"B\" value=\"1\"/>" + "</outcome>" + "</node>" + "</node>" + "</node>" + "</extensiveForm>"; DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(new InputSource(new StringReader(xmlStr))); ExtensiveFormXMLReader reader = new ExtensiveFormXMLReader(); ExtensiveForm tree = reader.load(doc); String[] treeGrid = { "node leaf iset player parent reachedby outcome pay1 pay2", " 0 0 0 A ", " 1 0 B:1 B 0 L ", " 2 1 1 a 0 11 3", " 3 1 1 b 1 3 0", " 4 0 2 A 0 R ", " 5 0 3 ! 4 S ", " 6 0 B:1 B 5 !(1/2) ", " 7 1 6 a 2 0 0", " 8 1 6 b 3 0 10", " 9 0 B:2 B 5 !(1/2) ", " 10 1 9 c 4 0 4", " 11 1 9 d 5 24 0", " 12 0 B:2 B 4 T ", " 13 1 12 c 6 6 0", " 14 1 12 d 7 0 1" }; assertArrayEquals(treeGrid, tree.toString().split("[\\r\\n]+")); } }
3,901
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
SequenceFormTest.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/test/src/lse/math/games/tree/SequenceFormTest.java
package lse.math.games.tree; import static org.junit.Assert.*; import java.io.IOException; import java.io.StringReader; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import lse.math.games.Rational; import lse.math.games.io.ExtensiveFormXMLReader; import lse.math.games.lcp.LCP; import lse.math.games.tree.SequenceForm.ImperfectRecallException; import lse.math.games.tree.SequenceForm.InvalidPlayerException; import org.junit.Test; import org.w3c.dom.Document; import org.xml.sax.InputSource; import org.xml.sax.SAXException; public class SequenceFormTest { @Test public void testSimpleSequenceFormConstruction() throws ImperfectRecallException, InvalidPlayerException { ExtensiveForm tree = new ExtensiveForm(); Player p1 = tree.createPlayer("I"); Player p2 = tree.createPlayer("II"); Iset h0 = tree.createIset(Player.CHANCE); Iset h11 = tree.createIset(p1); Iset h12 = tree.createIset(p1); Iset h21 = tree.createIset(p2); Iset h22 = tree.createIset(p2); tree.addToIset(tree.root(), h11); Node L = tree.createNode(); tree.addToIset(L, h21); L.reachedby = tree.createMove(); L.reachedby.setIset(h11); tree.root().addChild(L); Node R = tree.createNode(); tree.addToIset(R, h12); R.reachedby = tree.createMove(); R.reachedby.setIset(h11); tree.root().addChild(R); Node S = tree.createNode(); tree.addToIset(S, h0); S.reachedby = tree.createMove(); S.reachedby.setIset(h12); R.addChild(S); Node T = tree.createNode(); tree.addToIset(T, h22); T.reachedby = tree.createMove(); T.reachedby.setIset(h12); R.addChild(T); Node x1 = tree.createNode(); tree.addToIset(x1, h21); x1.reachedby = tree.createMove(); x1.reachedby.prob = Rational.valueOf("1/2"); x1.reachedby.setIset(h0); S.addChild(x1); Node x2 = tree.createNode(); tree.addToIset(x2, h22); x2.reachedby = tree.createMove(); x2.reachedby.prob = Rational.valueOf("1/2"); x2.reachedby.setIset(h0); S.addChild(x2); // Outcomes Node o1 = tree.createNode(); o1.reachedby = tree.createMove(); o1.reachedby.setIset(h21); Outcome pay1 = tree.createOutcome(o1); pay1.setPay(tree.firstPlayer(), Rational.valueOf(11)); pay1.setPay(tree.firstPlayer().next, Rational.valueOf(3)); L.addChild(o1); Node o2 = tree.createNode(); o2.reachedby = tree.createMove(); o2.reachedby.setIset(h21); Outcome pay2 = tree.createOutcome(o2); pay2.setPay(tree.firstPlayer(), Rational.valueOf(3)); pay2.setPay(tree.firstPlayer().next, Rational.valueOf(0)); L.addChild(o2); Node o3 = tree.createNode(); o3.reachedby = o1.reachedby; Outcome pay3 = tree.createOutcome(o3); pay3.setPay(tree.firstPlayer(), Rational.valueOf(0)); pay3.setPay(tree.firstPlayer().next, Rational.valueOf(0)); x1.addChild(o3); Node o4 = tree.createNode(); o4.reachedby = o2.reachedby; Outcome pay4 = tree.createOutcome(o4); pay4.setPay(tree.firstPlayer(), Rational.valueOf(0)); pay4.setPay(tree.firstPlayer().next, Rational.valueOf(10)); x1.addChild(o4); Node o5 = tree.createNode(); o5.reachedby = tree.createMove(); o5.reachedby.setIset(h22); Outcome pay5 = tree.createOutcome(o5); pay5.setPay(tree.firstPlayer(), Rational.valueOf(0)); pay5.setPay(tree.firstPlayer().next, Rational.valueOf(4)); x2.addChild(o5); Node o6 = tree.createNode(); o6.reachedby = tree.createMove(); o6.reachedby.setIset(h22); Outcome pay6 = tree.createOutcome(o6); pay6.setPay(tree.firstPlayer(), Rational.valueOf(24)); pay6.setPay(tree.firstPlayer().next, Rational.valueOf(0)); x2.addChild(o6); Node o7 = tree.createNode(); o7.reachedby = o5.reachedby; Outcome pay7 = tree.createOutcome(o7); pay7.setPay(tree.firstPlayer(), Rational.valueOf(6)); pay7.setPay(tree.firstPlayer().next, Rational.valueOf(0)); T.addChild(o7); Node o8 = tree.createNode(); o8.reachedby = o6.reachedby; Outcome pay8 = tree.createOutcome(o8); pay8.setPay(tree.firstPlayer(), Rational.valueOf(0)); pay8.setPay(tree.firstPlayer().next, Rational.valueOf(1)); T.addChild(o8); tree.autoname(); SequenceForm seq = new SequenceForm(tree); //System.out.println(seq.toString()); //assertEquals("dksl", seq.toString()); LCP lcp = seq.getLemkeLCP(); assertEquals(16, lcp.size()); String[] rows = { " M d q", " . . . . . . . . . . . . . -1 1 . 0 0", " . . . . . . . . . 14 22 . . . -1 . 18 0", " . . . . . . . . . . . . . . -1 1 0 0", " . . . . . . . . . 25/2 25/2 25/2 1/2 . . -1 19 0", " . . . . . . . . . . . 19 25 . . -1 22 0", " . . . . . . . . 1 . . . . . . . 1 -1", " . . . . . . . . -1 1 1 . . . . . 0 0", " . . . . . . . . -1 . . 1 1 . . . 0 0", " . . . . . -1 1 1 . . . . . . . . 0 0", " . 8 . 11/2 . . -1 . . . . . . . . . 43/8 0", " . 11 . 1/2 . . -1 . . . . . . . . . 45/8 0", " . . . 7/2 11 . . -1 . . . . . . . . 29/8 0", " . . . 11/2 10 . . -1 . . . . . . . . 31/8 0", " 1 . . . . . . . . . . . . . . . 1 -1", "-1 1 1 . . . . . . . . . . . . . 0 0", " . . -1 1 1 . . . . . . . . . . . 0 0" }; //System.out.println(lcp.toString()); assertArrayEquals(rows, lcp.toString().split("[\\r\\n]+")); } @Test public void testOneChoiceTree() throws SAXException, IOException, ParserConfigurationException, ImperfectRecallException, InvalidPlayerException { String xmlStr = "<extensiveForm>"+ "<node player=\"1\">"+ "<outcome move=\"L\">"+ "<payoff player=\"1\" value=\"13\"/>"+ "<payoff player=\"2\" value=\"14\"/>"+ "</outcome>"+ "<outcome move=\"R\">"+ "<payoff player=\"1\" value=\"21\"/>"+ "<payoff player=\"2\" value=\"0\"/>"+ "</outcome>"+ "</node>"+ "</extensiveForm>"; DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(new InputSource(new StringReader(xmlStr))); ExtensiveFormXMLReader reader = new ExtensiveFormXMLReader(); ExtensiveForm tree = reader.load(doc); //assertFalse(tree.root().terminal); SequenceForm seqForm = new SequenceForm(tree); LCP lcp = seqForm.getLemkeLCP(); assertEquals(7,lcp.size()); } @Test public void testNoChoiceTree() throws SAXException, IOException, ParserConfigurationException, ImperfectRecallException, InvalidPlayerException { String xmlStr = "<extensiveForm>"+ "<outcome>"+ "<payoff player=\"1\" value=\"13\"/>"+ "<payoff player=\"2\" value=\"14\"/>"+ "</outcome>"+ "</extensiveForm>"; DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(new InputSource(new StringReader(xmlStr))); ExtensiveFormXMLReader reader = new ExtensiveFormXMLReader(); ExtensiveForm tree = reader.load(doc); //assertFalse(tree.root().terminal); SequenceForm seqForm = new SequenceForm(tree); LCP lcp = seqForm.getLemkeLCP(); assertEquals(4,lcp.size()); } }
7,768
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
TableauTest.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/test/src/lse/math/games/lcp/TableauTest.java
package lse.math.games.lcp; import static org.junit.Assert.*; import org.junit.Test; public class TableauTest { @Test public void testPosPivot() { int sizeBasis = 2; Tableau M = new Tableau(sizeBasis); for (int i = 0; i < sizeBasis; ++i) { for (int j = 0; j <= M.RHS(); ++j) { long value = (i + 1) + j * 10; M.set(i, j, value); assertEquals(value, M.get(i, j)); } } assertEquals(1, M.get(0, 0)); //pivot entry assertEquals(11, M.get(0, 1)); //same row, diff col assertEquals(2, M.get(1, 0)); //same col, diff row assertEquals(12, M.get(1, 1)); //diff row, diff col //M.pivotOnRowCol(0, 0); M.pivot(M.vars().w(1), M.vars().z(0)); assertEquals(-1, M.get(0, 0)); //pivot entry: A[row,col] = det = -1 assertEquals(11, M.get(0, 1)); //same row, diff col: unchanged assertEquals(-2, M.get(1, 0)); //same col, diff row: negative assertEquals(10, M.get(1, 1)); //diff row, diff col: A[i,j] = (A[i,j] A[row,col] - A[i,col] A[row,j]) / det = (12*1 - 2*11)/-1 } @Test public void testNegCol() { int sizeBasis = 3; Tableau M = new Tableau(sizeBasis); for (int i = 0; i < sizeBasis; ++i) { for (int j = 0; j <= M.RHS(); ++j) { int value = i + j * 10; M.set(i, j, value); } } M.negCol(1); assertEquals( 20, M.get(0, 2)); assertEquals(-10, M.get(0, 1)); assertEquals(-11, M.get(1, 1)); //not sure I understand this assignment? assertEquals(-12, M.get(2, 1)); //not sure why determinent starts as negative 1? } @Test public void testPositiveValuesRatioTest() { int sizeBasis = 2; Tableau M = new Tableau(sizeBasis); for (int i = 0; i < sizeBasis; ++i) { for (int j = 0; j <= M.RHS(); ++j) { int value = (i+1) + j * 10; M.set(i, j, value); } } int sgn = M.ratioTest(0, 1, 0, 1); /* sign of A[a,testcol] / A[a,col] - A[b,testcol] / A[b,col] */ // A[0,1] / A[0,0] - A[1,1] / A[1,0] = 5 assertEquals(1, sgn); sgn = M.ratioTest(1, 0, 0, 1); // A[1,1] / A[1,0] - A[0,1] / A[0,0] = -5 assertEquals(-1, sgn); } }
2,635
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
LemkeAlgorithmTest.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/test/src/lse/math/games/lcp/LemkeAlgorithmTest.java
package lse.math.games.lcp; import lse.math.games.Rational; import lse.math.games.lcp.LemkeAlgorithm.InvalidLCPException; //import lse.math.games.lcp.LemkeAlgorithm.OnInitDelegate; import lse.math.games.lcp.LemkeAlgorithm.RayTerminationException; import lse.math.games.lcp.LemkeAlgorithm.TrivialSolutionException; import org.junit.Test; import static org.junit.Assert.*; public class LemkeAlgorithmTest { LCP lcp; Rational[] cov; private void SetUp(int[][] M, int[] q, int[] d) { lcp = new LCP(q.length); if (M.length > 0) { lcp.intratmatcpy(M, false, false, M.length, M[0].length, 0, 0); for(int i = 0; i < M.length; ++i) for (int j = 0; j < M[i].length; ++j) assertTrue(lcp.M(i,j).compareTo(M[i][j]) == 0); } for (int i = 0; i < q.length; ++i) { lcp.setq(i, Rational.valueOf(q[i])); } assertFalse("Trivial LCP", lcp.isTrivial()); for (int i = 0; i < d.length; ++i) { lcp.setd(i, Rational.valueOf(d[i])); } } /*@Test public void testLemkeInit() { int[][] M = new int[][] { { 2, 1 }, { 1, 3 } }; int[] q = new int[] { -1, -1 }; int[] d = new int[] { 2, 1 }; SetUp(M, q, d); LemkeAlgorithm algo = new LemkeAlgorithm(); algo.onInit = new OnInitDelegate() { public void onInit(String value, Tableau A) { assertEquals("After filltableau", value); } }; //TODO: change back to addeq for chained delegates try { algo.run(lcp); } catch (InvalidLCPException ex) { assertTrue(ex.getMessage(), false); } catch (RayTerminationException ex) { assertTrue(ex.getMessage(), false); } catch (TrivialSolutionException ex) { assertTrue(ex.getMessage(), false); } // TODO: I merged init and solve... this test is invalid... needs fixing assertEquals(2, algo.A.get(0, 0)); }*/ @Test public void testLemkeRun() { int[][] M = new int[][] { { 0, -1, 2}, { 2, 0, -2 }, { -1, 1, 0} }; int[] q = new int[] { -3, 6, -1 }; int[] d = new int[] { 1, 1, 1 }; SetUp(M, q, d); LemkeAlgorithm algo = new LemkeAlgorithm(); //StringWriter output = new StringWriter(); //LemkeWriter lemkeWriter = new LemkeWriter(output, output); //lemkeWriter.outtabl(algo.A); //Assert.True(false, output.ToString()); Rational[] z = null; try { z = algo.run(lcp); } catch (RayTerminationException ex) { assertTrue(ex.getMessage(), false); } catch (InvalidLCPException ex) { assertTrue(ex.getMessage(), false); } catch (TrivialSolutionException ex) { assertTrue(ex.getMessage(), false); } assertEquals(3, z.length); assertEquals(0, z[0].doubleValue(), 0.000000001); assertEquals(1, z[1].doubleValue(), 0.000000001); assertEquals(3, z[2].doubleValue(), 0.000000001); } }
3,250
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
TableauVariablesTest.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/test/src/lse/math/games/lcp/TableauVariablesTest.java
package lse.math.games.lcp; import org.junit.Test; import static org.junit.Assert.*; public class TableauVariablesTest { @Test public void testVariableAssignments() { int n = 4; TableauVariables vars = new TableauVariables(n); for (int i = 0; i <= n; ++i) { int var = vars.z(i); assertEquals(i, var); assertEquals(i, vars.col(var)); assertEquals(var, vars.colVar(i)); assertFalse(String.format("z%d should NOT be basic", i), vars.isBasic(var)); } for (int i = 1; i <= n; ++i) { int var = vars.w(i); assertEquals(i + n, var); assertEquals(i - 1, vars.row(var)); assertEquals(var, vars.rowVar(i - 1)); assertTrue(String.format("w%d should be basic", i), vars.isBasic(var)); } } @Test public void testSwap() { int n = 4; TableauVariables vars = new TableauVariables(n); int leaveVar = vars.w(1); int enterVar = vars.z(0); int row = vars.row(leaveVar); int col = vars.col(enterVar); vars.swap(vars.z(0), vars.w(1), row, col); assertEquals(col, vars.col(leaveVar)); assertEquals(row, vars.row(enterVar)); assertEquals(leaveVar, vars.colVar(col)); assertEquals(enterVar, vars.rowVar(row)); } @Test public void testComplement() { TableauVariables vars = new TableauVariables(4); for (int i = 1; i <= vars.size(); ++i) { int var = vars.complement(vars.z(i)); assertEquals(vars.w(i), var); } try { vars.complement(vars.z(0)); assertFalse("Should not be able to get complement of z0", true); } catch (Exception ex) { } } }
1,974
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
LexicographicMethodTest.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/test/src/lse/math/games/lcp/LexicographicMethodTest.java
package lse.math.games.lcp; import lse.math.games.lcp.LemkeAlgorithm.RayTerminationException; import org.junit.Test; import static org.junit.Assert.*; public class LexicographicMethodTest { @Test public void testLexMinVar() { Tableau A = new Tableau(2); A.set(0, 0, 2); A.set(0, 1, 2); A.set(0, 2, 1); A.set(0, 3, -1); A.set(1, 0, 1); A.set(1, 1, 1); A.set(1, 2, 3); A.set(1, 3, -1); LexicographicMethod lex = new LexicographicMethod(A.vars().size(), null); try { int leave = lex.lexminratio(A, 0); assertFalse(lex.z0leave()); assertEquals(4, leave); } catch (RayTerminationException ex) { assertTrue(ex.getMessage(), false); } try { int leave = lex.lexminratio(A, 1); assertFalse(lex.z0leave()); assertEquals(4, leave); } catch (RayTerminationException ex) { assertTrue(ex.getMessage(), false); } try { int leave = lex.lexminratio(A, 2); assertFalse(lex.z0leave()); assertEquals(3, leave); } catch (RayTerminationException ex) { assertTrue(ex.getMessage(), false); } try { lex.lexminratio(A, 3); assertFalse("Should have thrown exception", true); } catch (RuntimeException ex) { assertEquals("Basic variable w1 should be cobasic.", ex.getMessage()); } catch (RayTerminationException ex) { assertTrue(ex.getMessage(), false); } try { lex.lexminratio(A, 4); assertFalse("Should have thrown exception", true); } catch (RuntimeException ex) { assertEquals("Basic variable w2 should be cobasic.", ex.getMessage()); } catch (RayTerminationException ex) { assertTrue(ex.getMessage(), false); } } @Test public void test1000LexMinVarOnLargeTableu() { Tableau A = new Tableau(1000); for (int i = 0; i < 1000; ++i) for (int j = 0; j < 1002; ++j) { if (j == 0) A.set(i, j, 1); else A.set(i, j, (i - (j-1)) * ((j * 17) - (i * 63))); } LexicographicMethod lex = new LexicographicMethod(A.vars().size(), null); long before = System.currentTimeMillis(); for (int i = 0; i < 1000; ++i) { try { int leave = lex.lexminratio(A, 0); assertFalse(lex.z0leave()); assertEquals(1001, leave); } catch (RayTerminationException ex) { assertTrue(ex.getMessage() + " " + i, false); } } long duration = System.currentTimeMillis() - before; assertTrue(String.valueOf(duration), duration < 10000000); // less than 10 seconds } @Test public void testMinRatioTest() { Tableau A = new Tableau(2); A.set(0, 0, 2); A.set(0, 1, 2); A.set(0, 2, 1); A.set(0, 3, -1); A.set(1, 0, 1); A.set(1, 1, 1); A.set(1, 2, 3); A.set(1, 3, -1); LexicographicMethod lex = new LexicographicMethod(A.vars().size(), null); int[] candidates = new int[] { 0, 1 }; int numcand = candidates.length; assertEquals(2, numcand); assertEquals(0, candidates[0]); int col = 1; int testcol = 2; /* sign of A[l_0,t] / A[l_0,col] - A[l_i,t] / A[l_i,col] */ /* should be 1/2 - 3/1 = -5/2 */ int sgn = A.ratioTest(candidates[0], candidates[1], col, testcol); assertEquals(-1, sgn); numcand = lex.minRatioTest(A, col, testcol, candidates, numcand); assertEquals(1, numcand); assertEquals(0, candidates[0]); col = 2; testcol = 1; /* sign of A[l_0,t] / A[l_0,col] - A[l_i,t] / A[l_i,col] */ /* should be 2/1 - 1/3 = 5/3 */ sgn = A.ratioTest(candidates[0], candidates[1], col, testcol); assertEquals(1, sgn); numcand = 2; numcand = lex.minRatioTest(A, col, testcol, candidates, numcand); assertEquals(1, numcand); assertEquals(1, candidates[0]); } }
4,759
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
LrsAlgorithmTest.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/test/src/lse/math/games/lrs/LrsAlgorithmTest.java
package lse.math.games.lrs; import static org.junit.Assert.*; import java.util.logging.Level; import java.util.logging.Logger; import lse.math.games.Rational; import org.junit.Test; import org.junit.BeforeClass; //TODO: add incidence checks where missing public class LrsAlgorithmTest { @BeforeClass public static void oneTimeSetup() { // Enable for better coverage (slower tests) // Logger.getLogger(LrsAlgorithm.class.getName()).setLevel(Level.ALL); Logger.getLogger(LrsAlgorithm.class.getName()).setLevel(Level.WARNING); } // TODO: move to new style... and finish @Test public void testH2VCross4() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] matrix = new Rational[][] { { Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("-1")}, { Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("-1"), Rational.valueOf("1"), Rational.valueOf("-1")}, { Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("-1")}, { Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("-1")}, { Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("-1"), Rational.valueOf("1")}, { Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("1"), Rational.valueOf("1")}, { Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("1")}, { Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("1")}, { Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("-1"), Rational.valueOf("-1"), Rational.valueOf("1")}, { Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("-1"), Rational.valueOf("1"), Rational.valueOf("1")}, { Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("1")}, { Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("1")}, { Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("-1"), Rational.valueOf("-1")}, { Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("1"), Rational.valueOf("-1")}, { Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("-1")}, { Rational.valueOf("1"), Rational.valueOf("-1"), Rational.valueOf("-1"), Rational.valueOf("-1"), Rational.valueOf("-1")} }; VPolygon result = lrs.run(new HPolygon(matrix, false)); assertEquals(8, result.vertices.size()); } @Test public void testH2VCyclic17_8() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] ine = convert(new String[] { "1 -72 516 -4608 36156 -294912 2349516 -18874368 150850236", "1 -63 381 -3087 20901 -151263 1049061 -7411887 51738501", "1 -54 264 -1944 10956 -69984 410124 -2519424 14971836", "1 -45 165 -1125 4917 -28125 130845 -703125 3370917", "1 -36 84 -576 1596 -9216 27084 -147456 445116", "1 -27 21 -243 21 -2187 -3219 -19683 -85659", "1 -18 -24 -72 -564 -288 -9204 -1152 -142404", "1 -9 -51 -9 -699 -9 -9771 -9 -144699", "1 0 -60 0 -708 0 -9780 0 -144708", "1 9 -51 9 -699 9 -9771 9 -144699", "1 18 -24 72 -564 288 -9204 1152 -142404", "1 27 21 243 21 2187 -3219 19683 -85659", "1 36 84 576 1596 9216 27084 147456 445116", "1 45 165 1125 4917 28125 130845 703125 3370917", "1 54 264 1944 10956 69984 410124 2519424 14971836", "1 63 381 3087 20901 151263 1049061 7411887 51738501", "1 72 516 4608 36156 294912 2349516 18874368 150850236" }); Rational[][] ext = convert(new String[] { "1 -761/200200 29531/7207200 -267/114400 1069/1372800 -9/57200 1/52800 -1/800800 1/28828800", "1 -3568/205205 20101/1846845 -391/117260 1/2145 -1/469040 -1/127920 3/3283280 -1/29549520", "1 -3724/80795 41563/2908620 -989/1292720 -3317/7756320 47/646360 1/3878160 -1/1292720 1/23268960", "1 -5341/97240 17621/1166880 89/700128 -53/74880 79/875160 29/7001280 -1/700128 1/14002560", "1 -1/14 869/54600 49/23400 -1283/1029600 1/9360 1/64350 -1/327600 1/7207200", "1 -215/2002 1321/90090 527/68640 -31/12480 1/13728 1/17160 -1/120120 1/2882880", "1 -320/4851 -6338/315315 3/385 1/3640 -1/3696 1/80080 1/388080 -1/5045040", "1 4900/274131 -27683/1096524 -1987/1462032 281/265824 23/731016 -3/162448 -1/4386096 1/8772192", "1 245/9152 -42137/1647360 -3889/1647360 7409/6589440 1/14976 -71/3294720 -1/1647360 1/6589440", "1 1008/16445 -1949/1036035 -1801/460460 -8/31395 149/1841840 43/5525520 -1/1841840 -1/16576560", "1 16/247 -23/2925 -1201/222300 -163/1222650 5/35568 97/9781200 -1/889200 -1/9781200", "1 0 -10861/330330 0 389/251680 0 -1/34320 0 1/5285280", "1 245/24453 -4226/122265 -73/59280 2243/1304160 1/21736 -23/652080 -1/1956240 1/3912480", "1 320/4851 -6338/315315 -3/385 1/3640 1/3696 1/80080 -1/388080 -1/5045040", "1 -245/24453 -4226/122265 73/59280 2243/1304160 -1/21736 -23/652080 1/1956240 1/3912480", "1 0 -26581/720720 0 269/137280 0 -1/22880 0 1/2882880", "1 -992/10855 -1607/97695 2099/195390 -157/1563120 -1159/3126240 79/3126240 11/3126240 -1/3126240", "1 -784/22815 -7771/182520 103/30420 2293/973440 -43/486720 -1/20280 1/1460160 1/2920320", "1 -49/2010 -1552/33165 13/6432 651/235840 -1/32160 -1/16080 0 1/2122560", "1 2368/49335 -6542/148005 -101/9867 641/394680 19/34320 3/263120 -1/157872 -1/2368080", "1 -343/7670 -1454/34515 5663/1104480 5339/2208960 -193/1104480 -31/552240 1/552240 1/2208960", "1 -196/5555 -6257/133320 71/18180 4639/1599840 -1/7920 -29/399960 1/799920 1/1599840", "1 -320/3223 -1802/145035 189/16115 -63/128920 -21/51568 29/773520 1/257840 -1/2320560", "1 -65/1111 -2054/49995 1999/266640 1303/533280 -1/3333 -17/266640 1/266640 1/1599840", "1 -50/1001 -4483/96096 67/10296 499/164736 -1/3744 -7/82368 1/288288 1/1153152", "1 -16/247 -23/2925 1201/222300 -163/1222650 -5/35568 97/9781200 1/889200 -1/9781200", "1 0 -6659/318240 0 3643/4667520 0 -29/2333760 0 1/14002560", "1 -4900/274131 -27683/1096524 1987/1462032 281/265824 -23/731016 -3/162448 1/4386096 1/8772192", "1 -245/9152 -42137/1647360 3889/1647360 7409/6589440 -1/14976 -71/3294720 1/1647360 1/6589440", "1 -136/1705 -443/132990 10709/1595880 -29/66495 -1121/6383520 109/6383520 1/709280 -1/6383520", "1 -49/1023 -18805/638352 10679/2553408 7451/5106816 -265/2553408 -37/1276704 1/1276704 1/5106816", "1 -1519/27170 -9133/326040 5281/978120 1853/1304160 -317/1956240 -31/978120 1/652080 1/3912480", "1 -560/6721 -1/100815 8407/1209780 -413/604890 -175/967824 113/4839120 7/4839120 -1/4839120", "1 -265/4004 -6191/240240 719/102960 547/411840 -5/20592 -7/205920 1/360360 1/2882880", "1 -1008/16445 -1949/1036035 1801/460460 -8/31395 -149/1841840 43/5525520 1/1841840 -1/16576560", "1 -5488/77363 551/232089 12607/2785068 -677/1392534 -1043/11140272 137/11140272 7/11140272 -1/11140272", "1 -4304/59345 901/178035 1921/427284 -349/534105 -769/8545680 137/8545680 1/1709136 -1/8545680", "1 -588/13871 66259/3994848 -3221/1997424 -6967/15979392 199/1997424 -1/726336 -1/998712 1/15979392", "1 -6811/131560 14617/789360 -4061/4736160 -2477/3157440 313/2368080 1/364320 -1/526240 1/9472320", "1 -925/13156 659/30360 457/473616 -7121/4736160 85/473616 19/1184040 -1/236808 1/4736160", "1 -1425/12298 11809/442728 3077/442728 -6037/1770912 193/885456 4/55341 -1/80496 1/1770912", "1 -776/6253 -635/112554 753/50024 -1/1014 -105/200096 31/600288 1/200096 -1/1800864", "1 -161/1872 -9143/209664 2957/279552 1801/559104 -83/279552 -11/139776 1/419328 1/1677312", "1 -287/3630 -15209/304920 1471/152460 4799/1219680 -149/609840 -31/304920 1/609840 1/1219680", "1 -496/36465 -5419/109395 -1907/437580 1519/437580 1213/1750320 -1/159120 -1/102960 -1/1750320", "1 -119/1222 -12955/307944 1331/102648 1277/410592 -95/205296 -3/34216 1/205296 1/1231776", "1 -161/1760 -3643/73920 5483/443520 3499/887040 -193/443520 -13/110880 1/221760 1/887040", "1 -1200/9317 -1/83853 43/2772 -271/167706 -731/1341648 97/1341648 1/191664 -1/1341648", "1 -675/6028 -8441/217008 3497/217008 223/78912 -151/217008 -41/434016 1/108504 1/868032", "1 -185/1716 -2429/51480 4957/308880 87/22880 -1/1404 -41/308880 1/102960 1/617760", "1 -1304/13585 73/12540 737/88920 -1997/1956240 -863/3912480 119/3912480 7/3912480 -1/3912480", "1 -2744/31317 -1537/57816 2359/250536 607/334048 -127/501072 -1/22776 1/501072 1/3006432", "1 -2989/31460 -4493/188760 12241/1132560 329/205920 -401/1132560 -1/21780 1/283140 1/2265120", "1 -400/4147 109/11310 1201/149292 -2027/1492920 -125/597168 119/2985840 1/597168 -1/2985840", "1 -475/4576 -2683/137280 2059/164736 2029/1647360 -5/10296 -37/823680 1/164736 1/1647360", "1 -80/1001 2903/294294 9005/1765764 -3155/3531528 -745/7063056 1/49392 5/7063056 -1/7063056", "1 -272/3445 2869/227370 6403/1364220 -333/303160 -487/5456880 139/5456880 1/1818960 -1/5456880", "1 -308/7839 26137/1536444 -631/292656 -227/585312 17/146328 -1/292656 -1/877968 1/12291552", "1 -7301/150852 35065/1810224 -1409/905112 -5479/7240896 145/905112 1/3620448 -1/452556 1/7240896", "1 -4975/74514 21059/894168 -1/74514 -613/397408 139/596112 1/74514 -1/198704 1/3576672", "1 -925/8118 641/20295 239/43296 -1627/432960 5/14432 1/13530 -1/64944 1/1298880", "1 -1600/11979 466/59895 21/1331 -133/53240 -35/63888 1/9680 1/191664 -1/958320", "1 -475/3663 -593/18315 131/6512 141/65120 -5/4884 -3/32560 1/58608 1/586080", "1 -5/39 -4283/102960 2153/102960 1349/411840 -23/20592 -29/205920 1/51480 1/411840", "1 -400/4161 1999/137313 1379/183084 -329/183084 -7/38544 13/244112 1/732336 -1/2197008", "1 -2725/24024 -3691/288288 3/208 1/1664 -3/4576 -1/27456 1/96096 1/1153152", "1 -6544/84903 4085/254709 589/145548 -197/145548 -35/582192 19/582192 1/4075344 -1/4075344", "1 -2597/69520 42611/2502720 -2059/834240 -1117/3336960 13/104280 -3/556160 -1/834240 1/10010880", "1 -49/1060 9587/489720 -829/419760 -593/839520 37/209880 -1/419760 -1/419760 1/5876640", "1 -515/8008 5821/240240 -131/205920 -623/411840 1/3744 1/102960 -1/180180 1/2882880", "1 -16/143 8717/257400 16/3575 -1327/343200 1/2288 1/14300 -1/57200 1/1029600", "1 -14/12727 621/254540 -18353/9163440 15289/18326880 -179/916344 239/9163440 -17/9163440 1/18326880", "1 7/3575 -61/143000 -6199/5148000 9019/10296000 -269/1029600 103/2574000 -1/321750 1/10296000", "1 79/32890 -7297/1184040 47/39468 1213/1578720 -311/789360 29/394680 -1/157872 1/4736160", "1 -323/11440 -2473/137280 68/6435 -851/1647360 -277/411840 1/5760 -7/411840 1/1647360", "1 -41/275 -61/10725 881/39600 -4451/1029600 -1/2475 113/514800 -1/39600 1/1029600", "1 -2368/49335 -6542/148005 101/9867 641/394680 -19/34320 3/263120 1/157872 -1/2368080", "1 49/1023 -18805/638352 -10679/2553408 7451/5106816 265/2553408 -37/1276704 -1/1276704 1/5106816", "1 1519/27170 -9133/326040 -5281/978120 1853/1304160 317/1956240 -31/978120 -1/652080 1/3912480", "1 265/4004 -6191/240240 -719/102960 547/411840 5/20592 -7/205920 -1/360360 1/2882880", "1 4304/59345 901/178035 -1921/427284 -349/534105 769/8545680 137/8545680 -1/1709136 -1/8545680", "1 3724/80795 41563/2908620 989/1292720 -3317/7756320 -47/646360 1/3878160 1/1292720 1/23268960", "1 5341/97240 17621/1166880 -89/700128 -53/74880 -79/875160 29/7001280 1/700128 1/14002560", "1 560/6721 -1/100815 -8407/1209780 -413/604890 175/967824 113/4839120 -7/4839120 -1/4839120", "1 1/14 869/54600 -49/23400 -1283/1029600 -1/9360 1/64350 1/327600 1/7207200", "1 5488/77363 551/232089 -12607/2785068 -677/1392534 1043/11140272 137/11140272 -7/11140272 -1/11140272", "1 136/1705 -443/132990 -10709/1595880 -29/66495 1121/6383520 109/6383520 -1/709280 -1/6383520", "1 784/22815 -7771/182520 -103/30420 2293/973440 43/486720 -1/20280 -1/1460160 1/2920320", "1 343/7670 -1454/34515 -5663/1104480 5339/2208960 193/1104480 -31/552240 -1/552240 1/2208960", "1 65/1111 -2054/49995 -1999/266640 1303/533280 1/3333 -17/266640 -1/266640 1/1599840", "1 320/3223 -1802/145035 -189/16115 -63/128920 21/51568 29/773520 -1/257840 -1/2320560", "1 215/2002 1321/90090 -527/68640 -31/12480 -1/13728 1/17160 1/120120 1/2882880", "1 992/10855 -1607/97695 -2099/195390 -157/1563120 1159/3126240 79/3126240 -11/3126240 -1/3126240", "1 49/2010 -1552/33165 -13/6432 651/235840 1/32160 -1/16080 0 1/2122560", "1 196/5555 -6257/133320 -71/18180 4639/1599840 1/7920 -29/399960 -1/799920 1/1599840", "1 50/1001 -4483/96096 -67/10296 499/164736 1/3744 -7/82368 -1/288288 1/1153152", "1 -64/731 -1334/28509 109/6579 997/684216 -89/105264 47/1368432 1/105264 -1/1368432", "1 0 -5917/93834 0 2035/500448 0 -23/250224 0 1/1501344", "1 49/3881 -758/11643 -1369/558864 4921/1117728 37/279432 -61/558864 -1/558864 1/1117728", "1 83/2750 -278/4125 -2363/396000 3799/792000 133/396000 -13/99000 -1/198000 1/792000", "1 64/625 -898/20625 -109/5625 463/495000 89/90000 59/990000 -1/90000 -1/990000", "1 41/275 -61/10725 -881/39600 -4451/1029600 1/2475 113/514800 1/39600 1/1029600", "1 64/731 -1334/28509 -109/6579 997/684216 89/105264 47/1368432 -1/105264 -1/1368432", "1 -49/3881 -758/11643 1369/558864 4921/1117728 -37/279432 -61/558864 1/558864 1/1117728", "1 0 -1565/23056 0 4033/830016 0 -5/37728 0 1/830016", "1 36/2035 -1159/16280 -29/8140 289/53280 61/293040 -1/6105 -1/293040 1/586080", "1 -64/625 -898/20625 109/5625 463/495000 -89/90000 59/990000 1/90000 -1/990000", "1 -83/2750 -278/4125 2363/396000 3799/792000 -133/396000 -13/99000 1/198000 1/792000", "1 -36/2035 -1159/16280 29/8140 289/53280 -61/293040 -1/6105 1/293040 1/586080", "1 0 -79/1040 0 2569/411840 0 -43/205920 0 1/411840", "1 496/36465 -5419/109395 1907/437580 1519/437580 -1213/1750320 -1/159120 1/102960 -1/1750320", "1 2744/31317 -1537/57816 -2359/250536 607/334048 127/501072 -1/22776 -1/501072 1/3006432", "1 2989/31460 -4493/188760 -12241/1132560 329/205920 401/1132560 -1/21780 -1/283140 1/2265120", "1 475/4576 -2683/137280 -2059/164736 2029/1647360 5/10296 -37/823680 -1/164736 1/1647360", "1 2725/24024 -3691/288288 -3/208 1/1664 3/4576 -1/27456 -1/96096 1/1153152", "1 6544/84903 4085/254709 -589/145548 -197/145548 35/582192 19/582192 -1/4075344 -1/4075344", "1 308/7839 26137/1536444 631/292656 -227/585312 -17/146328 -1/292656 1/877968 1/12291552", "1 2597/69520 42611/2502720 2059/834240 -1117/3336960 -13/104280 -3/556160 1/834240 1/10010880", "1 3568/205205 20101/1846845 391/117260 1/2145 1/469040 -1/127920 -3/3283280 -1/29549520", "1 7301/150852 35065/1810224 1409/905112 -5479/7240896 -145/905112 1/3620448 1/452556 1/7240896", "1 49/1060 9587/489720 829/419760 -593/839520 -37/209880 -1/419760 1/419760 1/5876640", "1 400/4161 1999/137313 -1379/183084 -329/183084 7/38544 13/244112 -1/732336 -1/2197008", "1 4975/74514 21059/894168 1/74514 -613/397408 -139/596112 1/74514 1/198704 1/3576672", "1 515/8008 5821/240240 131/205920 -623/411840 -1/3744 1/102960 1/180180 1/2882880", "1 272/3445 2869/227370 -6403/1364220 -333/303160 487/5456880 139/5456880 -1/1818960 -1/5456880", "1 588/13871 66259/3994848 3221/1997424 -6967/15979392 -199/1997424 -1/726336 1/998712 1/15979392", "1 6811/131560 14617/789360 4061/4736160 -2477/3157440 -313/2368080 1/364320 1/526240 1/9472320", "1 400/4147 109/11310 -1201/149292 -2027/1492920 125/597168 119/2985840 -1/597168 -1/2985840", "1 925/13156 659/30360 -457/473616 -7121/4736160 -85/473616 19/1184040 1/236808 1/4736160", "1 80/1001 2903/294294 -9005/1765764 -3155/3531528 745/7063056 1/49392 -5/7063056 -1/7063056", "1 1304/13585 73/12540 -737/88920 -1997/1956240 863/3912480 119/3912480 -7/3912480 -1/3912480", "1 161/1872 -9143/209664 -2957/279552 1801/559104 83/279552 -11/139776 -1/419328 1/1677312", "1 119/1222 -12955/307944 -1331/102648 1277/410592 95/205296 -3/34216 -1/205296 1/1231776", "1 675/6028 -8441/217008 -3497/217008 223/78912 151/217008 -41/434016 -1/108504 1/868032", "1 475/3663 -593/18315 -131/6512 141/65120 5/4884 -3/32560 -1/58608 1/586080", "1 1600/11979 466/59895 -21/1331 -133/53240 35/63888 1/9680 -1/191664 -1/958320", "1 925/8118 641/20295 -239/43296 -1627/432960 -5/14432 1/13530 1/64944 1/1298880", "1 16/143 8717/257400 -16/3575 -1327/343200 -1/2288 1/14300 1/57200 1/1029600", "1 1200/9317 -1/83853 -43/2772 -271/167706 731/1341648 97/1341648 -1/191664 -1/1341648", "1 1425/12298 11809/442728 -3077/442728 -6037/1770912 -193/885456 4/55341 1/80496 1/1770912", "1 776/6253 -635/112554 -753/50024 -1/1014 105/200096 31/600288 -1/200096 -1/1800864", "1 287/3630 -15209/304920 -1471/152460 4799/1219680 149/609840 -31/304920 -1/609840 1/1219680", "1 161/1760 -3643/73920 -5483/443520 3499/887040 193/443520 -13/110880 -1/221760 1/887040", "1 185/1716 -2429/51480 -4957/308880 87/22880 1/1404 -41/308880 -1/102960 1/617760", "1 5/39 -4283/102960 -2153/102960 1349/411840 23/20592 -29/205920 -1/51480 1/411840", "1 -80/7709 -1231/23127 2525/277524 115/30836 -1115/1110096 1/85392 5/370032 -1/1110096", "1 196/2951 -7681/106236 -4153/424944 5129/849888 61/212472 -5/32688 -1/424944 1/849888", "1 343/4168 -3767/50016 -2065/150048 3841/600192 43/75024 -55/300096 -1/150048 1/600192", "1 293/2794 -2605/33528 -1973/100584 299/44704 205/201168 -1/4572 -1/67056 1/402336", "1 121/890 -613/8010 -3601/128160 1679/256320 221/128160 -1/4005 -1/32040 1/256320", "1 448/2495 -514/22455 -763/22455 -427/179640 623/359280 79/359280 -7/359280 -1/359280", "1 271/1415 332/12735 -5191/203760 -3571/407520 -1/50940 73/203760 11/203760 1/407520", "1 53/275 841/26400 -193/7920 -3011/316800 -19/79200 59/158400 1/15840 1/316800", "1 592/3641 -365/10923 -3997/131076 -7/10923 805/524304 73/524304 -1/58256 -1/524304", "1 743/4004 725/48048 -49/1872 -199/27456 5/20592 1/3168 1/24024 1/576576", "1 752/5057 -607/15171 -5015/182052 43/91026 991/728208 5/56016 -11/728208 -1/728208", "1 245/4436 -4061/53232 -145/19962 1435/212928 5/39924 -59/319392 0 1/638784", "1 147/2068 -1003/12408 -281/24816 3281/446688 1/2376 -17/74448 -1/223344 1/446688", "1 1161/12320 -2103/24640 -123/7040 337/42240 19/21120 -1/3520 -1/73920 1/295680", "1 82/645 -1343/15480 -1241/46440 57/6880 157/92880 -2/5805 -1/30960 1/185760", "1 -112/5885 -893/17655 2383/211860 719/211860 -977/847440 29/847440 13/847440 -1/847440", "1 127/3190 -107/1320 -19/5220 3499/459360 -1/7920 -13/57420 1/229680 1/459360", "1 243/4400 -773/8800 -27/3520 2719/316800 3/17600 -23/79200 0 1/316800", "1 45/572 -547/5720 -161/11440 2009/205920 7/10296 -1/2640 -1/102960 1/205920", "1 5/44 -1069/10560 -769/31680 1369/126720 5/3168 -31/63360 -1/31680 1/126720", "1 4976/199485 -2969/199485 -877/265980 673/265980 -119/354640 -17/1063920 19/3191760 -1/3191760", "1 1666/19305 -2479/617760 -2731/205920 1103/823680 9/22880 -19/411840 -1/308880 1/2471040", "1 2303/22880 -29/31680 -233/14976 1589/1647360 59/102960 -41/823680 -1/164736 1/1647360", "1 69/572 1217/257400 -3203/171600 73/343200 29/34320 -1/21450 -1/85800 1/1029600", "1 85/594 2303/154440 -47/2145 -89/68640 25/20592 -1/51480 -7/308880 1/617760", "1 212/2925 4231/152100 -523/202800 -437/202800 -1/270400 43/811200 1/2433600 -1/2433600", "1 98/3175 18643/990600 4803/1320800 -787/2641600 -213/1320800 -1/123825 1/660400 1/7924800", "1 11711/404910 29753/1619640 141/35992 -149/719840 -181/1079760 -1/89980 1/647856 1/6478560", "1 1168/95535 12343/1241955 1237/331188 529/827970 127/6623760 -61/6623760 -5/3974256 -1/19871280", "1 229/5850 25931/1146600 166/47775 -23/31200 -181/764400 -1/191100 1/327600 1/4586400", "1 1911/51920 20759/934560 2423/623040 -787/1246080 -157/623040 -1/103840 1/311520 1/3738240", "1 1520/15741 2533/78705 -697/104940 -337/104940 1/7632 13/139920 -1/1259280 -1/1259280", "1 1555/27324 16553/546480 251/91080 -1277/728640 -7/18216 1/121440 1/136620 1/2185920", "1 1325/24596 1211/40248 3067/885456 -2887/1770912 -17/40248 1/885456 7/885456 1/1770912", "1 109/1430 10357/411840 -3301/823680 -3067/1647360 19/299520 139/3294720 -1/3294720 -1/3294720", "1 10976/320463 49265/2563704 217/71214 -461/1139424 -245/1709136 -1/213642 7/5127408 1/10254816", "1 3577/82940 2617/114840 7907/2985840 -5041/5971680 -607/2985840 -1/1492920 1/373230 1/5971680", "1 240/2431 5999/218790 -1201/145860 -23/8840 25/116688 41/583440 -1/583440 -1/1750320", "1 45/728 21467/720720 229/160160 -251/137280 -5/16016 1/68640 1/160160 1/2882880", "1 2352/30173 947/41778 -1801/362076 -1151/724152 149/1448304 49/1448304 -1/1448304 -1/4344912", "1 1616/16445 6901/296010 -47/5148 -2467/1184040 601/2368080 127/2368080 -1/473616 -1/2368080", "1 1372/16211 -2525/194532 -3927/259376 1/416 15/32422 -59/778128 -1/259376 1/1556256", "1 49/468 -2881/245232 -521/27248 245/108992 61/81744 -5/54496 -1/122616 1/980928", "1 4825/35046 -1147/140184 -109/4248 317/186912 13/10384 -5/46728 -5/280368 1/560736", "1 115/616 19/9240 -249/7040 -1/14080 3/1408 -1/10560 -1/24640 1/295680", "1 320/2101 1222/31515 -189/10505 -469/84040 21/33616 103/504240 -1/168080 -1/504240", "1 15/137 104/2055 -153/120560 -1237/241120 -9/12056 31/361680 3/120560 1/723360", "1 950/9009 7439/144144 1/3432 -139/27456 -1/1144 1/13728 1/36036 1/576576", "1 6800/46629 1333/46629 -1171/62172 -62/15543 19/27632 35/248688 -5/746064 -1/746064", "1 7075/61776 11603/247104 -29/7488 -1613/329472 -1/1872 5/54912 5/247104 1/988416", "1 16/117 1399/66807 -1657/89076 -125/44538 241/356304 35/356304 -7/1068912 -1/1068912", "1 539/6840 -449/27360 -367/25080 1183/401280 43/100320 -1/10560 -1/300960 1/1203840", "1 1029/10340 -13/792 -2359/124080 743/248160 23/31020 -1/8272 -1/124080 1/744480", "1 155/1144 -139/9360 -5491/205920 1139/411840 5/3744 -1/6435 -1/51480 1/411840", "1 250/1287 -361/51480 -45/1144 31/22880 17/6864 -1/5720 -1/20592 1/205920", "1 34/2041 -2287/146952 -1033/587808 1531/587808 -1033/2351232 -23/2351232 17/2351232 -1/2351232", "1 1078/15093 -3083/120744 -835/53664 439/107328 79/160992 -5/40248 -1/241488 1/965952", "1 1127/11874 -4159/142488 -341/15832 291/63328 29/31664 -1/5937 -1/94992 1/569952", "1 853/6006 -2501/72072 -347/10296 215/41184 19/10296 -5/20592 -1/36036 1/288288", "1 923/3780 -149/3780 -35/576 29/5760 1/240 -1/2880 -1/12096 1/120960", "1 1312/5265 149/5265 -35/702 -259/28080 49/18720 29/56160 -1/33696 -1/168480", "1 1373/6210 233/3105 -163/6624 -1007/66240 -31/33120 1/1840 1/9936 1/198720", "1 32/147 283/3528 -5/231 -39/2464 -5/3696 1/1848 1/8624 1/155232", "1 56/267 179/17622 -3031/70488 -175/35244 7/3168 85/281952 -7/281952 -1/281952", "1 1303/6006 4429/72072 -287/10296 -535/41184 -7/20592 5/10296 1/13104 1/288288", "1 1648/9321 1/27963 -1367/37284 -23/9321 271/149136 9/49712 -1/49712 -1/447408", "1 49/766 -5237/193032 -193/13788 3491/772128 149/386064 -1/6894 -1/386064 1/772128", "1 49/568 -109/3408 -4463/224928 2383/449856 181/224928 -23/112464 -1/112464 1/449856", "1 409/3080 -149/3696 -511/15840 23/3520 7/3960 -1/3168 -1/36960 1/221760", "1 74/305 -1151/21960 -1373/21960 689/87840 97/21960 -23/43920 -1/10980 1/87840", "1 16/1195 -1757/118305 -29/31548 131/52580 -313/630960 -1/630960 1/126192 -1/1892880", "1 229/4180 -4327/150480 -5/418 1003/200640 1/4180 -17/100320 0 1/601920", "1 361/4796 -1009/28776 -275/15696 2113/345312 5/7848 -43/172656 -1/172656 1/345312", "1 25/208 -647/13728 -2471/82368 1351/164736 133/82368 -17/41184 -1/41184 1/164736", "1 50/209 -1069/15048 -17/264 241/20064 47/10032 -1/1254 -1/10032 1/60192", "1 224/27885 808/418275 -1259/278850 547/371800 -59/446160 -31/2230800 7/2230800 -1/6692400", "1 196/7293 1862/109395 -3475/350064 989/3500640 29/87516 -47/1750320 -1/350064 1/3500640", "1 49/1430 1323/57200 -3071/257400 -59/228800 53/102960 -29/1029600 -1/171600 1/2059200", "1 7/143 41/1144 -7/450 -1601/1029600 7/7920 -1/51480 -7/514800 1/1029600", "1 35/429 685/10296 -4547/205920 -2221/411840 71/41184 1/20592 -1/25740 1/411840", "1 56/1443 958/21645 133/57720 -263/76960 -17/92352 41/461760 1/461760 -1/1385280", "1 196/14625 1421/73125 97/15600 -47/1560000 -37/156000 -7/390000 1/468000 1/4680000", "1 49/3993 8771/479160 12211/1916640 479/3833280 -91/383328 -1/43560 1/479160 1/3833280", "1 32/7293 5912/765765 6431/1531530 5693/6126120 131/2450448 -137/12252240 -23/12252240 -1/12252240", "1 49/2769 637/25560 1041/147680 -467/886080 -11/29536 -1/55380 1/221520 1/2658240", "1 49/3014 1421/60280 797/108504 -701/2170080 -83/217008 -7/271260 1/217008 1/2170080", "1 160/2937 520/8811 -67/88110 -1957/352440 -13/140976 23/140976 1/704880 -1/704880", "1 10/363 1135/30492 43/5040 -313/174240 -41/60984 -1/121968 1/87120 1/1219680", "1 175/6864 25/704 2273/247104 -493/329472 -1/1404 -1/44928 1/82368 1/988416", "1 28/715 148/3575 -23/39600 -1501/514800 -1/31680 137/2059200 1/2059200 -1/2059200", "1 245/15873 2009/95238 439/78144 -499/2031744 -17/78144 -1/84656 1/507936 1/6095232", "1 49/2431 2597/97240 121/19890 -2741/3500640 -115/350064 -1/109395 7/1750320 1/3500640", "1 80/1573 80/1573 -1201/283140 -1201/283140 25/226512 25/226512 -1/1132560 -1/1132560", "1 35/1144 355/9152 1373/205920 -3431/1647360 -23/41184 1/164736 1/102960 1/1647360", "1 784/20735 784/20735 -1801/746460 -1801/746460 149/2985840 149/2985840 -1/2985840 -1/2985840", "1 112/2431 48/1105 -2603/437580 -467/145860 67/350064 133/1750320 -1/583440 -1/1750320", "1 1960/79911 1078/79911 -2279/213096 631/852384 77/213096 -17/426192 -1/319644 1/2557152", "1 490/15171 3479/182052 -9839/728208 461/1456416 109/182052 -35/728208 -5/728208 1/1456416", "1 175/3531 2725/84744 -733/37664 -199/225984 43/37664 -1/18832 -1/56496 1/677952", "1 10/99 205/2772 -47/1320 -61/10560 1/352 0 -1/15840 1/221760", "1 64/693 64/693 -3/275 -3/275 1/2640 1/2640 -1/277200 -1/277200", "1 140/2277 355/4554 57/5060 -279/40480 -5/3036 1/12144 1/22770 1/364320", "1 25/429 125/1638 277/20592 -265/41184 -19/10296 1/20592 1/20592 1/288288", "1 800/11121 200/3033 -289/22242 -593/88968 97/177936 37/177936 -1/177936 -1/533808", "1 350/5577 4975/66924 551/89232 -1189/178464 -53/44616 3/29744 1/29744 1/535392", "1 160/2769 2888/58149 -1489/116298 -1993/465192 493/930384 115/930384 -5/930384 -1/930384", "1 98/4323 2989/259380 -1213/115280 703/691680 1/2882 -17/345840 -1/345840 1/2075040", "1 49/1628 49/2960 -3953/293040 829/1172160 35/58608 -1/15840 -1/146520 1/1172160", "1 175/3718 425/14872 -2677/133848 -137/535392 29/24336 -1/12168 -5/267696 1/535392", "1 175/1716 725/10296 -1087/27456 -263/54912 89/27456 -1/13728 -1/13728 1/164736", "1 7/1105 3/4420 -2503/636480 3973/2545920 -911/5091840 -61/5091840 19/5091840 -1/5091840", "1 196/9633 245/28899 -1681/154128 857/616512 115/308256 -3/51376 -1/308256 1/1849536", "1 49/1783 539/42792 -7393/513504 1255/1027008 341/513504 -5/64188 -1/128376 1/1027008", "1 35/781 433/18744 -5099/224928 241/449856 79/56232 -25/224928 -5/224928 1/449856", "1 14/123 503/7380 -89/1640 -157/39360 3/656 -1/6560 -1/9840 1/118080", "1 32/213 416/3195 -89/2130 -43/2130 17/6816 31/34080 -1/34080 -1/102240", "1 7/48 953/5760 -7/3840 -787/30720 -11/3072 1/1280 1/5120 1/92160", "1 35/242 247/1452 149/34848 -1829/69696 -157/34848 13/17424 1/4356 1/69696", "1 80/913 188/2739 -949/32868 -103/11952 433/262944 95/262944 -5/262944 -1/262944", "1 35/286 883/6864 -79/7488 -3149/164736 -149/82368 25/41184 5/41184 1/164736", "1 224/3653 488/10959 -1463/65754 -1175/263016 623/526032 95/526032 -7/526032 -1/526032", "1 49/2635 147/21080 -7883/758880 2479/1517760 253/758880 -13/189720 -1/379440 1/1517760", "1 147/5830 49/4664 -967/69960 1339/839520 29/46640 -1/10494 -1/139920 1/839520", "1 21/506 199/10120 -61/2760 449/364320 25/18216 -3/20240 -1/45540 1/364320", "1 7/64 39/640 -511/9216 -191/92160 11/2304 -13/46080 -1/9216 1/92160", "1 32/5731 8/28655 -1829/515790 293/187560 -173/825264 -37/4126320 17/4126320 -1/4126320", "1 2/121 89/16940 -7/720 2329/1219680 17/60984 -7/87120 -1/609840 1/1219680", "1 105/4664 151/18656 -731/55968 1361/671616 47/83952 -13/111936 -1/167904 1/671616", "1 75/2002 125/8008 -73/3432 85/41184 3/2288 -1/5148 -1/48048 1/288288", "1 25/242 25/484 -179/3168 31/69696 173/34848 -1/2178 -1/8712 1/69696", "1 -32/7293 5912/765765 -6431/1531530 5693/6126120 -131/2450448 -137/12252240 23/12252240 -1/12252240", "1 -245/15873 2009/95238 -439/78144 -499/2031744 17/78144 -1/84656 -1/507936 1/6095232", "1 -49/2431 2597/97240 -121/19890 -2741/3500640 115/350064 -1/109395 -7/1750320 1/3500640", "1 -35/1144 355/9152 -1373/205920 -3431/1647360 23/41184 1/164736 -1/102960 1/1647360", "1 -350/5577 4975/66924 -551/89232 -1189/178464 53/44616 3/29744 -1/29744 1/535392", "1 -160/2769 2888/58149 1489/116298 -1993/465192 -493/930384 115/930384 5/930384 -1/930384", "1 -1960/79911 1078/79911 2279/213096 631/852384 -77/213096 -17/426192 1/319644 1/2557152", "1 -98/4323 2989/259380 1213/115280 703/691680 -1/2882 -17/345840 1/345840 1/2075040", "1 -224/27885 808/418275 1259/278850 547/371800 59/446160 -31/2230800 -7/2230800 -1/6692400", "1 -490/15171 3479/182052 9839/728208 461/1456416 -109/182052 -35/728208 5/728208 1/1456416", "1 -49/1628 49/2960 3953/293040 829/1172160 -35/58608 -1/15840 1/146520 1/1172160", "1 -800/11121 200/3033 289/22242 -593/88968 -97/177936 37/177936 1/177936 -1/533808", "1 -175/3531 2725/84744 733/37664 -199/225984 -43/37664 -1/18832 1/56496 1/677952", "1 -175/3718 425/14872 2677/133848 -137/535392 -29/24336 -1/12168 5/267696 1/535392", "1 -112/2431 48/1105 2603/437580 -467/145860 -67/350064 133/1750320 1/583440 -1/1750320", "1 -196/7293 1862/109395 3475/350064 989/3500640 -29/87516 -47/1750320 1/350064 1/3500640", "1 -49/1430 1323/57200 3071/257400 -59/228800 -53/102960 -29/1029600 1/171600 1/2059200", "1 -80/1573 80/1573 1201/283140 -1201/283140 -25/226512 25/226512 1/1132560 -1/1132560", "1 -7/143 41/1144 7/450 -1601/1029600 -7/7920 -1/51480 7/514800 1/1029600", "1 -784/20735 784/20735 1801/746460 -1801/746460 -149/2985840 149/2985840 1/2985840 -1/2985840", "1 -28/715 148/3575 23/39600 -1501/514800 1/31680 137/2059200 -1/2059200 -1/2059200", "1 -196/14625 1421/73125 -97/15600 -47/1560000 37/156000 -7/390000 -1/468000 1/4680000", "1 -49/2769 637/25560 -1041/147680 -467/886080 11/29536 -1/55380 -1/221520 1/2658240", "1 -10/363 1135/30492 -43/5040 -313/174240 41/60984 -1/121968 -1/87120 1/1219680", "1 -140/2277 355/4554 -57/5060 -279/40480 5/3036 1/12144 -1/22770 1/364320", "1 -64/693 64/693 3/275 -3/275 -1/2640 1/2640 1/277200 -1/277200", "1 -10/99 205/2772 47/1320 -61/10560 -1/352 0 1/15840 1/221760", "1 -175/1716 725/10296 1087/27456 -263/54912 -89/27456 -1/13728 1/13728 1/164736", "1 -160/2937 520/8811 67/88110 -1957/352440 13/140976 23/140976 -1/704880 -1/704880", "1 -35/429 685/10296 4547/205920 -2221/411840 -71/41184 1/20592 1/25740 1/411840", "1 -56/1443 958/21645 -133/57720 -263/76960 17/92352 41/461760 -1/461760 -1/1385280", "1 -49/3993 8771/479160 -12211/1916640 479/3833280 91/383328 -1/43560 -1/479160 1/3833280", "1 -49/3014 1421/60280 -797/108504 -701/2170080 83/217008 -7/271260 -1/217008 1/2170080", "1 -175/6864 25/704 -2273/247104 -493/329472 1/1404 -1/44928 -1/82368 1/988416", "1 -25/429 125/1638 -277/20592 -265/41184 19/10296 1/20592 -1/20592 1/288288", "1 -224/64805 424/64805 -4697/1166490 1601/1555320 -749/9331920 -101/9331920 7/3110640 -1/9331920", "1 -392/36465 1862/109395 -349/51480 989/3500640 223/875160 -47/1750320 -1/437580 1/3500640", "1 -98/6845 49/2220 -1579/197136 -251/1971360 103/246420 -31/985680 -1/197136 1/1971360", "1 -1/44 1247/36960 -667/63360 -367/295680 71/88704 -1/31680 -1/73920 1/887040", "1 -7/129 1177/15480 -547/30960 -1561/247680 55/24768 1/30960 -7/123840 1/247680", "1 -64/669 1088/10035 11/10035 -149/10035 13/32112 97/160560 -1/160560 -1/160560", "1 -28/183 727/5490 473/10980 -1591/87840 -11/2196 19/43920 1/5490 1/87840", "1 -35/209 173/1254 1627/30096 -1127/60192 -97/15048 1/2736 7/30096 1/60192", "1 -32/649 584/9735 -299/58410 -163/25960 47/93456 103/467280 -1/155760 -1/467280", "1 -14/143 797/8580 1901/102960 -797/68640 -23/10296 31/102960 1/11440 1/205920", "1 -224/6695 856/20085 -149/24102 -1697/482040 421/964080 107/964080 -1/192816 -1/964080", "1 -98/9985 637/39940 -9757/1437840 141/319520 22/89865 -47/1437840 -1/479280 1/2875680", "1 -49/3740 931/44880 -1091/134640 149/1615680 167/403920 -1/24480 -1/201960 1/1615680", "1 -63/3014 1923/60280 -131/12056 -641/723360 59/72336 -3/60280 -1/72336 1/723360", "1 -7/138 101/1380 -83/4320 -367/66240 47/19872 -1/49680 -1/16560 1/198720", "1 -32/10483 312/52415 -3643/943470 4033/3773880 -151/1509552 -73/7547760 19/7547760 -1/7547760", "1 -7/803 471/32120 -7823/1156320 1459/2312640 53/231264 -23/578160 -1/578160 1/2312640", "1 -105/8998 689/35992 -883/107976 463/1295712 29/71984 -17/323928 -1/215952 1/1295712", "1 -75/4004 475/16016 -7/624 -37/82368 17/20592 -1/13728 -1/72072 1/576576", "1 -25/539 75/1078 -233/11088 -101/22176 1/396 -1/11088 -5/77616 1/155232", "1 -1168/95535 12343/1241955 -1237/331188 529/827970 -127/6623760 -61/6623760 5/3974256 -1/19871280", "1 -10976/320463 49265/2563704 -217/71214 -461/1139424 245/1709136 -1/213642 -7/5127408 1/10254816", "1 -3577/82940 2617/114840 -7907/2985840 -5041/5971680 607/2985840 -1/1492920 -1/373230 1/5971680", "1 -45/728 21467/720720 -229/160160 -251/137280 5/16016 1/68640 -1/160160 1/2882880", "1 -7075/61776 11603/247104 29/7488 -1613/329472 1/1872 5/54912 -5/247104 1/988416", "1 -16/117 1399/66807 1657/89076 -125/44538 -241/356304 35/356304 7/1068912 -1/1068912", "1 -1372/16211 -2525/194532 3927/259376 1/416 -15/32422 -59/778128 1/259376 1/1556256", "1 -539/6840 -449/27360 367/25080 1183/401280 -43/100320 -1/10560 1/300960 1/1203840", "1 -4976/199485 -2969/199485 877/265980 673/265980 119/354640 -17/1063920 -19/3191760 -1/3191760", "1 -49/468 -2881/245232 521/27248 245/108992 -61/81744 -5/54496 1/122616 1/980928", "1 -1029/10340 -13/792 2359/124080 743/248160 -23/31020 -1/8272 1/124080 1/744480", "1 -6800/46629 1333/46629 1171/62172 -62/15543 -19/27632 35/248688 5/746064 -1/746064", "1 -4825/35046 -1147/140184 109/4248 317/186912 -13/10384 -5/46728 5/280368 1/560736", "1 -155/1144 -139/9360 5491/205920 1139/411840 -5/3744 -1/6435 1/51480 1/411840", "1 -1616/16445 6901/296010 47/5148 -2467/1184040 -601/2368080 127/2368080 1/473616 -1/2368080", "1 -1666/19305 -2479/617760 2731/205920 1103/823680 -9/22880 -19/411840 1/308880 1/2471040", "1 -2303/22880 -29/31680 233/14976 1589/1647360 -59/102960 -41/823680 1/164736 1/1647360", "1 -240/2431 5999/218790 1201/145860 -23/8840 -25/116688 41/583440 1/583440 -1/1750320", "1 -69/572 1217/257400 3203/171600 73/343200 -29/34320 -1/21450 1/85800 1/1029600", "1 -2352/30173 947/41778 1801/362076 -1151/724152 -149/1448304 49/1448304 1/1448304 -1/4344912", "1 -109/1430 10357/411840 3301/823680 -3067/1647360 -19/299520 139/3294720 1/3294720 -1/3294720", "1 -98/3175 18643/990600 -4803/1320800 -787/2641600 213/1320800 -1/123825 -1/660400 1/7924800", "1 -229/5850 25931/1146600 -166/47775 -23/31200 181/764400 -1/191100 -1/327600 1/4586400", "1 -1555/27324 16553/546480 -251/91080 -1277/728640 7/18216 1/121440 -1/136620 1/2185920", "1 -15/137 104/2055 153/120560 -1237/241120 9/12056 31/361680 -3/120560 1/723360", "1 -320/2101 1222/31515 189/10505 -469/84040 -21/33616 103/504240 1/168080 -1/504240", "1 -115/616 19/9240 249/7040 -1/14080 -3/1408 -1/10560 1/24640 1/295680", "1 -250/1287 -361/51480 45/1144 31/22880 -17/6864 -1/5720 1/20592 1/205920", "1 -1520/15741 2533/78705 697/104940 -337/104940 -1/7632 13/139920 1/1259280 -1/1259280", "1 -85/594 2303/154440 47/2145 -89/68640 -25/20592 -1/51480 7/308880 1/617760", "1 -212/2925 4231/152100 523/202800 -437/202800 1/270400 43/811200 -1/2433600 -1/2433600", "1 -11711/404910 29753/1619640 -141/35992 -149/719840 181/1079760 -1/89980 -1/647856 1/6478560", "1 -1911/51920 20759/934560 -2423/623040 -787/1246080 157/623040 -1/103840 -1/311520 1/3738240", "1 -1325/24596 1211/40248 -3067/885456 -2887/1770912 17/40248 1/885456 -7/885456 1/1770912", "1 -950/9009 7439/144144 -1/3432 -139/27456 1/1144 1/13728 -1/36036 1/576576", "1 -35/46904 691/375232 -1457/844272 10993/13508352 -179/844272 19/614016 -1/422136 1/13508352", "1 7/5291 -131/211640 -157/190476 61/76960 -19/69264 89/1904760 -1/253968 1/7619040", "1 9/48620 -4319/875160 223/134640 13/24480 -53/134640 37/437580 -7/875160 1/3500640", "1 -41/1232 -97/8736 71/6336 -17/12672 -1/1584 17/82368 -1/44352 1/1153152", "1 -743/4004 725/48048 49/1872 -199/27456 -5/20592 1/3168 -1/24024 1/576576", "1 -752/5057 -607/15171 5015/182052 43/91026 -991/728208 5/56016 11/728208 -1/728208", "1 -196/2951 -7681/106236 4153/424944 5129/849888 -61/212472 -5/32688 1/424944 1/849888", "1 -245/4436 -4061/53232 145/19962 1435/212928 -5/39924 -59/319392 0 1/638784", "1 -127/3190 -107/1320 19/5220 3499/459360 1/7920 -13/57420 -1/229680 1/459360", "1 112/5885 -893/17655 -2383/211860 719/211860 977/847440 29/847440 -13/847440 -1/847440", "1 323/11440 -2473/137280 -68/6435 -851/1647360 277/411840 1/5760 7/411840 1/1647360", "1 80/7709 -1231/23127 -2525/277524 115/30836 1115/1110096 1/85392 -5/370032 -1/1110096", "1 -343/4168 -3767/50016 2065/150048 3841/600192 -43/75024 -55/300096 1/150048 1/600192", "1 -147/2068 -1003/12408 281/24816 3281/446688 -1/2376 -17/74448 1/223344 1/446688", "1 -243/4400 -773/8800 27/3520 2719/316800 -3/17600 -23/79200 0 1/316800", "1 -592/3641 -365/10923 3997/131076 -7/10923 -805/524304 73/524304 1/58256 -1/524304", "1 -293/2794 -2605/33528 1973/100584 299/44704 -205/201168 -1/4572 1/67056 1/402336", "1 -1161/12320 -2103/24640 123/7040 337/42240 -19/21120 -1/3520 1/73920 1/295680", "1 -45/572 -547/5720 161/11440 2009/205920 -7/10296 -1/2640 1/102960 1/205920", "1 -16/371 -1423/28938 31/1908 13/3816 -11/7632 5/99216 1/53424 -1/694512", "1 0 -11209/131040 0 17/1920 0 -1/4160 0 1/524160", "1 49/5144 -2839/30864 -673/185184 3649/370368 31/92592 -55/185184 -1/185184 1/370368", "1 83/3476 -187/1896 -1151/125136 2743/250272 109/125136 -23/62568 -1/62568 1/250272", "1 51/1138 -4171/40968 -239/13656 641/54624 47/27312 -1/2276 -1/27312 1/163872", "1 144/2777 -941/24993 -217/11108 14/8331 77/44432 19/133296 -1/44432 -1/399888", "1 201/6268 -1741/225648 -799/75216 -529/300864 41/75216 11/50144 1/37608 1/902592", "1 29/940 -373/62040 -341/33840 -1451/744480 1/2115 83/372240 1/33840 1/744480", "1 16/337 -989/22242 -217/12132 721/266904 77/48528 47/533808 -1/48528 -1/533808", "1 41/1232 -97/8736 -71/6336 -17/12672 1/1584 17/82368 1/44352 1/1153152", "1 16/371 -1423/28938 -31/1908 13/3816 11/7632 5/99216 -1/53424 -1/694512", "1 -49/5144 -2839/30864 673/185184 3649/370368 -31/92592 -55/185184 1/185184 1/370368", "1 0 -361/3542 0 415/36432 0 -7/18216 0 1/255024", "1 6/385 -263/2310 -1/165 317/23760 7/11880 -1/1980 -1/83160 1/166320", "1 59/1448 -1075/8688 -839/52128 1591/104256 85/52128 -17/26064 -1/26064 1/104256", "1 -16/337 -989/22242 217/12132 721/266904 -77/48528 47/533808 1/48528 -1/533808", "1 -83/3476 -187/1896 1151/125136 2743/250272 -109/125136 -23/62568 1/62568 1/250272", "1 -6/385 -263/2310 1/165 317/23760 -7/11880 -1/1980 1/83160 1/166320", "1 0 -193/1430 0 133/7920 0 -37/51480 0 1/102960", "1 25/836 -797/5016 -19/1584 67/3168 1/792 -31/30096 -1/30096 1/60192", "1 20/2951 -3151/212472 5/10896 55/21792 -25/43584 1/566592 5/566592 -1/1699776", "1 784/21879 -5827/175032 -23/2244 101/17952 1/2992 -5/29172 -1/350064 1/700128", "1 833/17268 -4211/103608 -3095/207216 2831/414432 157/207216 -25/103608 -1/103608 1/414432", "1 643/8844 -2845/53064 -289/11792 19/2144 5/2948 -13/35376 -1/35376 1/212256", "1 713/5850 -133/1800 -9/200 121/10400 31/7800 -3/5200 -1/11700 1/93600", "1 536/7875 -239/15750 -529/21000 -11/10500 181/84000 23/84000 -1/36000 -1/252000", "1 1163/38250 281/153000 -491/51000 -587/204000 37/102000 13/51000 11/306000 1/612000", "1 599/21120 343/126720 -445/50688 -1501/506880 67/253440 1/3960 1/25344 1/506880", "1 248/3729 -925/44748 -719/29832 29/59664 235/119328 7/39776 -1/39776 -1/357984", "1 1093/32604 -5/17784 -109/10032 -17/6688 5/10032 2/8151 1/32604 1/782496", "1 656/10491 -1487/62946 -215/9684 29/19368 67/38736 55/503568 -11/503568 -1/503568", "1 35/1076 -4603/135576 -265/30128 155/25824 5/30128 -3/15064 0 1/542304", "1 98/2167 -557/13002 -263/19503 2371/312048 89/156024 -23/78012 -1/156024 1/312048", "1 4/55 -379/6270 -226/9405 1609/150480 59/37620 -37/75240 -1/37620 1/150480", "1 113/800 -1399/14400 -499/9600 323/19200 11/2400 -3/3200 -1/9600 1/57600", "1 48/9515 -2333/171270 373/342540 1583/685080 -857/1370160 19/1370160 13/1370160 -1/1370160", "1 159/5720 -319/9360 -107/15840 2609/411840 -7/102960 -47/205920 1/205920 1/411840", "1 64/1595 -427/9570 -32/2871 643/76560 4/14355 -41/114840 0 1/229680", "1 10/143 -293/4290 -1/45 103/7920 1/792 -17/25740 -1/51480 1/102960", "1 15/88 -1097/7920 -983/15840 839/31680 17/3168 -13/7920 -1/7920 1/31680", "1 7/1625 -1/1625 -2863/936000 1529/936000 -913/3744000 -31/3744000 17/3744000 -1/3744000", "1 49/3588 49/21528 -6611/688896 3023/1377792 229/688896 -7/86112 -1/344448 1/1377792", "1 49/2677 245/64248 -2473/192744 617/256992 245/385488 -11/96372 -1/128496 1/770976", "1 35/1199 223/28776 -1757/86328 83/31392 11/7848 -31/172656 -1/43164 1/345312", "1 1/15 293/12600 -463/10080 209/100800 11/2520 -17/50400 -1/10080 1/100800", "1 16/375 148/5625 -107/4500 -517/90000 77/36000 79/180000 -1/36000 -1/180000", "1 1/60 743/50400 -241/40320 -1741/403200 -1/40320 29/100800 1/20160 1/403200", "1 1/66 389/27720 -103/20790 -467/110880 -5/33264 23/83160 1/18480 1/332640", "1 40/1111 64/3333 -1693/79992 -29/9999 551/319968 7/29088 -7/319968 -1/319968", "1 35/1859 673/44616 -1037/133848 -2177/535392 47/267696 37/133848 1/24336 1/535392", "1 16/533 160/11193 -2447/134316 -29/22386 725/537264 73/537264 -1/59696 -1/537264", "1 49/3875 49/31000 -1261/139500 2659/1116000 149/558000 -13/139500 -1/558000 1/1116000", "1 49/2860 49/17160 -97/7920 1679/617760 173/308880 -7/51480 -1/154440 1/617760", "1 21/748 47/7480 -899/44880 889/269280 1/748 -31/134640 -1/44880 1/269280", "1 1/14 43/1960 -893/17640 289/70560 17/3528 -19/35280 -1/8820 1/70560", "1 16/4213 -16/21065 -409/151668 403/252780 -167/606672 -1/275760 1/202224 -1/3033360", "1 1/88 19/24640 -23/2772 109/42240 1/5544 -47/443520 0 1/887040", "1 63/4048 3/1760 -923/80960 1489/485760 1/2208 -13/80960 -1/242880 1/485760", "1 15/572 5/1144 -661/34320 839/205920 25/20592 -1/3432 -1/51480 1/205920", "1 5/66 5/264 -661/11880 113/15840 25/4752 -1/1188 -1/7920 1/47520", "1 7/11154 -953/1338480 -28/83655 319/486720 -7/24336 151/2676960 -7/1338480 1/5353920", "1 -41/23760 -1849/617760 67/31680 1/5760 -1/2640 41/411840 -1/95040 1/2471040", "1 -1093/32604 -5/17784 109/10032 -17/6688 -5/10032 2/8151 -1/32604 1/782496", "1 -1303/6006 4429/72072 287/10296 -535/41184 7/20592 5/10296 -1/13104 1/288288", "1 -1648/9321 1/27963 1367/37284 -23/9321 -271/149136 9/49712 1/49712 -1/447408", "1 -1078/15093 -3083/120744 835/53664 439/107328 -79/160992 -5/40248 1/241488 1/965952", "1 -49/766 -5237/193032 193/13788 3491/772128 -149/386064 -1/6894 1/386064 1/772128", "1 -229/4180 -4327/150480 5/418 1003/200640 -1/4180 -17/100320 0 1/601920", "1 -16/1195 -1757/118305 29/31548 131/52580 313/630960 -1/630960 -1/126192 -1/1892880", "1 -79/32890 -7297/1184040 -47/39468 1213/1578720 311/789360 29/394680 1/157872 1/4736160", "1 -34/2041 -2287/146952 1033/587808 1531/587808 1033/2351232 -23/2351232 -17/2351232 -1/2351232", "1 -1127/11874 -4159/142488 341/15832 291/63328 -29/31664 -1/5937 1/94992 1/569952", "1 -49/568 -109/3408 4463/224928 2383/449856 -181/224928 -23/112464 1/112464 1/449856", "1 -361/4796 -1009/28776 275/15696 2113/345312 -5/7848 -43/172656 1/172656 1/345312", "1 -56/267 179/17622 3031/70488 -175/35244 -7/3168 85/281952 7/281952 -1/281952", "1 -853/6006 -2501/72072 347/10296 215/41184 -19/10296 -5/20592 1/36036 1/288288", "1 -409/3080 -149/3696 511/15840 23/3520 -7/3960 -1/3168 1/36960 1/221760", "1 -25/208 -647/13728 2471/82368 1351/164736 -133/82368 -17/41184 1/41184 1/164736", "1 -656/10491 -1487/62946 215/9684 29/19368 -67/38736 55/503568 11/503568 -1/503568", "1 -784/21879 -5827/175032 23/2244 101/17952 -1/2992 -5/29172 1/350064 1/700128", "1 -35/1076 -4603/135576 265/30128 155/25824 -5/30128 -3/15064 0 1/542304", "1 -159/5720 -319/9360 107/15840 2609/411840 7/102960 -47/205920 -1/205920 1/411840", "1 -407/19296 -2545/77184 101/25728 667/102912 5/12864 -13/51456 -1/77184 1/308736", "1 -16/5193 -815/67509 -161/90012 7/3462 245/360048 11/360048 -11/1080144 -1/1080144", "1 43/174006 -2935/696024 -19/11048 17/44192 25/66288 1/11048 13/1392048 1/2784096", "1 13/32120 -2209/578160 -659/385440 233/770880 139/385440 3/32120 1/96360 1/2312640", "1 -48/9515 -2333/171270 -373/342540 1583/685080 857/1370160 19/1370160 -13/1370160 -1/1370160", "1 -9/48620 -4319/875160 -223/134640 13/24480 53/134640 37/437580 7/875160 1/3500640", "1 -20/2951 -3151/212472 -5/10896 55/21792 25/43584 1/566592 -5/566592 -1/1699776", "1 -833/17268 -4211/103608 3095/207216 2831/414432 -157/207216 -25/103608 1/103608 1/414432", "1 -98/2167 -557/13002 263/19503 2371/312048 -89/156024 -23/78012 1/156024 1/312048", "1 -64/1595 -427/9570 32/2871 643/76560 -4/14355 -41/114840 0 1/229680", "1 -221/6972 -1871/41832 89/11952 215/23904 1/5976 -5/11952 -1/83664 1/167328", "1 -248/3729 -925/44748 719/29832 29/59664 -235/119328 7/39776 1/39776 -1/357984", "1 -643/8844 -2845/53064 289/11792 19/2144 -5/2948 -13/35376 1/35376 1/212256", "1 -4/55 -379/6270 226/9405 1609/150480 -59/37620 -37/75240 1/37620 1/150480", "1 -10/143 -293/4290 1/45 103/7920 -1/792 -17/25740 1/51480 1/102960", "1 -175/2904 -1297/17424 203/11616 119/7744 -7/11616 -5/5808 0 1/69696", "1 -16/5949 -1669/154674 9/2644 11/5288 -23/31728 3/137488 1/95184 -1/1237392", "1 0 -4033/189696 0 5/1024 0 -59/379392 0 1/758784", "1 49/64296 -3037/128592 -83/85728 947/171456 3/14288 -17/85728 -1/257184 1/514368", "1 83/41580 -2179/83160 -47/18480 1/160 31/55440 -1/3960 -1/83160 1/332640", "1 17/4450 -1459/53400 -87/17800 473/71200 39/35600 -2/6675 -1/35600 1/213600", "1 48/15725 -389/47175 -243/62900 22/15725 207/251600 49/754800 -3/251600 -1/754800", "1 67/40900 -1189/490800 -327/163600 23/654400 57/163600 103/981600 1/81800 1/1963200", "1 29/18540 -871/407880 -47/24720 -17/543840 1/3090 29/271920 1/74160 1/1631520", "1 16/5535 -1183/121770 -3/820 97/54120 23/29520 13/324720 -1/88560 -1/974160", "1 41/23760 -1849/617760 -67/31680 1/5760 1/2640 41/411840 1/95040 1/2471040", "1 16/5949 -1669/154674 -9/2644 11/5288 23/31728 3/137488 -1/95184 -1/1237392", "1 -49/64296 -3037/128592 83/85728 947/171456 -3/14288 -17/85728 1/257184 1/514368", "1 0 -1145/41382 0 731/110352 0 -5/18392 0 1/331056", "1 2/1375 -823/24750 -23/12375 1619/198000 41/99000 -19/49500 -1/99000 1/198000", "1 59/14400 -221/5760 -101/19200 373/38400 23/19200 -1/1920 -1/28800 1/115200", "1 -16/5535 -1183/121770 3/820 97/54120 -23/29520 13/324720 1/88560 -1/974160", "1 -83/41580 -2179/83160 47/18480 1/160 -31/55440 -1/3960 1/83160 1/332640", "1 -2/1375 -823/24750 23/12375 1619/198000 -41/99000 -19/49500 1/99000 1/198000", "1 0 -593/12870 0 31/2640 0 -1/1560 0 1/102960", "1 5/1188 -799/11880 -43/7920 283/15840 1/792 -1/880 -1/23760 1/47520", "1 -7/3432 113/411840 109/45760 -217/549120 -3/9152 1/8320 -1/68640 1/1647360", "1 -35/1859 673/44616 1037/133848 -2177/535392 -47/267696 37/133848 -1/24336 1/535392", "1 -35/286 883/6864 79/7488 -3149/164736 149/82368 25/41184 -5/41184 1/164736", "1 -224/3653 488/10959 1463/65754 -1175/263016 -623/526032 95/526032 7/526032 -1/526032", "1 -196/9633 245/28899 1681/154128 857/616512 -115/308256 -3/51376 1/308256 1/1849536", "1 -49/2635 147/21080 7883/758880 2479/1517760 -253/758880 -13/189720 1/379440 1/1517760", "1 -2/121 89/16940 7/720 2329/1219680 -17/60984 -7/87120 1/609840 1/1219680", "1 -32/5731 8/28655 1829/515790 293/187560 173/825264 -37/4126320 -17/4126320 -1/4126320", "1 -7/3575 -61/143000 6199/5148000 9019/10296000 269/1029600 103/2574000 1/321750 1/10296000", "1 -7/1105 3/4420 2503/636480 3973/2545920 911/5091840 -61/5091840 -19/5091840 -1/5091840", "1 -49/1783 539/42792 7393/513504 1255/1027008 -341/513504 -5/64188 1/128376 1/1027008", "1 -147/5830 49/4664 967/69960 1339/839520 -29/46640 -1/10494 1/139920 1/839520", "1 -105/4664 151/18656 731/55968 1361/671616 -47/83952 -13/111936 1/167904 1/671616", "1 -80/913 188/2739 949/32868 -103/11952 -433/262944 95/262944 5/262944 -1/262944", "1 -35/781 433/18744 5099/224928 241/449856 -79/56232 -25/224928 5/224928 1/449856", "1 -21/506 199/10120 61/2760 449/364320 -25/18216 -3/20240 1/45540 1/364320", "1 -75/2002 125/8008 73/3432 85/41184 -3/2288 -1/5148 1/48048 1/288288", "1 -16/533 160/11193 2447/134316 -29/22386 -725/537264 73/537264 1/59696 -1/537264", "1 -49/3588 49/21528 6611/688896 3023/1377792 -229/688896 -7/86112 1/344448 1/1377792", "1 -49/3875 49/31000 1261/139500 2659/1116000 -149/558000 -13/139500 1/558000 1/1116000", "1 -1/88 19/24640 23/2772 109/42240 -1/5544 -47/443520 0 1/887040", "1 -70/7197 -13/86364 2519/345456 1913/690912 -11/172728 -41/345456 -1/345456 1/690912", "1 -160/50001 -136/150003 97/42858 263/171432 107/342864 1/342864 -13/2400048 -1/2400048", "1 -5/4503 -463/756504 287/432288 629/864576 119/432288 11/216144 1/216144 1/6052032", "1 -7/6974 -83/139480 731/1255320 3439/5021280 137/502128 67/1255320 13/2510640 1/5021280", "1 -16/4213 -16/21065 409/151668 403/252780 167/606672 -1/275760 -1/202224 -1/3033360", "1 -7/5291 -131/211640 157/190476 61/76960 19/69264 89/1904760 1/253968 1/7619040", "1 -7/1625 -1/1625 2863/936000 1529/936000 913/3744000 -31/3744000 -17/3744000 -1/3744000", "1 -49/2677 245/64248 2473/192744 617/256992 -245/385488 -11/96372 1/128496 1/770976", "1 -49/2860 49/17160 97/7920 1679/617760 -173/308880 -7/51480 1/154440 1/617760", "1 -63/4048 3/1760 923/80960 1489/485760 -1/2208 -13/80960 1/242880 1/485760", "1 -5/372 11/31248 17/1674 61/17856 -1/3348 -5/26784 0 1/374976", "1 -40/1111 64/3333 1693/79992 -29/9999 -551/319968 7/29088 7/319968 -1/319968", "1 -35/1199 223/28776 1757/86328 83/31392 -11/7848 -31/172656 1/43164 1/345312", "1 -21/748 47/7480 899/44880 889/269280 -1/748 -31/134640 1/44880 1/269280", "1 -15/572 5/1144 661/34320 839/205920 -25/20592 -1/3432 1/51480 1/205920", "1 -25/1078 25/12936 7/396 109/22176 -1/1008 -1/2772 1/77616 1/155232", "1 7/286 1007/34320 -7/20592 -2111/411840 1/2574 53/205920 -1/20592 1/411840", "1 14/143 797/8580 -1901/102960 -797/68640 23/10296 31/102960 -1/11440 1/205920", "1 224/6695 856/20085 149/24102 -1697/482040 -421/964080 107/964080 1/192816 -1/964080", "1 392/36465 1862/109395 349/51480 989/3500640 -223/875160 -47/1750320 1/437580 1/3500640", "1 98/9985 637/39940 9757/1437840 141/319520 -22/89865 -47/1437840 1/479280 1/2875680", "1 7/803 471/32120 7823/1156320 1459/2312640 -53/231264 -23/578160 1/578160 1/2312640", "1 32/10483 312/52415 3643/943470 4033/3773880 151/1509552 -73/7547760 -19/7547760 -1/7547760", "1 14/12727 621/254540 18353/9163440 15289/18326880 179/916344 239/9163440 17/9163440 1/18326880", "1 224/64805 424/64805 4697/1166490 1601/1555320 749/9331920 -101/9331920 -7/3110640 -1/9331920", "1 98/6845 49/2220 1579/197136 -251/1971360 -103/246420 -31/985680 1/197136 1/1971360", "1 49/3740 931/44880 1091/134640 149/1615680 -167/403920 -1/24480 1/201960 1/1615680", "1 105/8998 689/35992 883/107976 463/1295712 -29/71984 -17/323928 1/215952 1/1295712", "1 32/649 584/9735 299/58410 -163/25960 -47/93456 103/467280 1/155760 -1/467280", "1 1/44 1247/36960 667/63360 -367/295680 -71/88704 -1/31680 1/73920 1/887040", "1 63/3014 1923/60280 131/12056 -641/723360 -59/72336 -3/60280 1/72336 1/723360", "1 75/4004 475/16016 7/624 -37/82368 -17/20592 -1/13728 1/72072 1/576576", "1 1217/8580 2881/102960 -1073/51480 -1471/411840 73/51480 1/15840 -1/25740 1/411840", "1 2384/36699 3313/110097 -23/48932 -353/146796 -23/195728 1/15056 1/587184 -1/1761552", "1 4900/184977 13381/739908 4285/986544 -265/1973088 -5/27404 -1/75888 5/2959632 1/5919264", "1 833/33652 21223/1211472 5513/1211472 -139/4845888 -223/1211472 -41/2422944 1/605736 1/4845888", "1 611/26950 16301/970200 221/46200 19/184800 -17/92400 -1/46200 1/646800 1/3880800", "1 784/84425 6451/759825 343/92100 133/168850 203/4052400 -37/4052400 -7/4052400 -1/12157200", "1 761/200200 29531/7207200 267/114400 1069/1372800 9/57200 1/52800 1/800800 1/28828800", "1 1072/104663 8513/941967 14197/3767868 694/941967 547/15071472 -11/1159344 -23/15071472 -1/15071472", "1 343/10128 18773/850752 91/20256 -1/1792 -79/283584 -1/81024 1/283584 1/3403008", "1 1225/38588 4975/231528 6695/1389168 -1187/2778336 -25/86823 -25/1389168 5/1389168 1/2778336", "1 899/30800 3833/184800 823/158400 -83/316800 -47/158400 -1/39600 1/277200 1/2217600", "1 1648/18645 2051/55935 -79/20340 -851/223740 -29/894960 109/894960 1/894960 -1/894960", "1 1667/33330 12151/399960 223/49995 -2521/1599840 -383/799920 -1/399960 7/799920 1/1599840", "1 851/18040 3233/108240 299/59040 -607/432960 -331/649440 -1/81180 1/108240 1/1298880", "1 25/572 2503/85800 119/20592 -1211/1029600 -7/12870 -1/39600 1/102960 1/1029600", "1 112/5525 512/16575 1777/198900 -124/49725 -563/795600 89/795600 7/795600 -1/795600", "1 196/26637 1078/79911 3023/426192 631/852384 -7/26637 -17/426192 1/426192 1/2557152", "1 49/7262 735/58096 913/130716 1861/2091456 -125/522864 -49/1045728 1/522864 1/2091456", "1 35/5819 541/46552 1429/209484 1783/1675872 -173/837936 -1/18216 1/837936 1/1675872", "1 1/195 1693/163800 41/6240 79/62400 -1/6240 -1/15600 0 1/1310400", "1 32/18165 1096/272475 17/5190 41/34600 7/41520 -1/207600 -1/290640 -1/4359600", "1 14/22305 2143/1338300 187/118960 2803/3568800 13/59480 61/1784400 1/356880 1/10706400", "1 1/1760 33/22400 469/316800 967/1267200 7/31680 23/633600 1/316800 1/8870400", "1 80/38357 16/3487 4867/1380852 1613/1380852 71/502128 -43/5523408 -17/5523408 -1/5523408", "1 35/46904 691/375232 1457/844272 10993/13508352 179/844272 19/614016 1/422136 1/13508352", "1 16/6773 240/47411 6353/1706796 1961/1706796 815/6827184 -67/6827184 -19/6827184 -1/6827184", "1 49/5000 2107/120000 3113/360000 709/1440000 -163/360000 -37/720000 1/180000 1/1440000", "1 147/16280 49/2960 1679/195360 829/1172160 -7/16280 -1/15840 1/195360 1/1172160", "1 21/2596 397/25960 1321/155760 899/934560 -37/93456 -1/12980 1/233640 1/934560", "1 7/1010 829/60600 751/90900 919/727200 -5/14544 -17/181800 1/363600 1/727200", "1 16/583 32/795 199/20988 -233/52470 -7/7632 89/419760 1/83952 -1/419760", "1 7/451 1457/54120 389/32472 -161/649440 -59/64944 -1/14760 1/64944 1/649440", "1 7/484 373/14520 1057/87120 59/522720 -47/52272 -1/10890 1/65340 1/522720", "1 15/1144 5/208 839/68640 229/411840 -1/1144 -5/41184 1/68640 1/411840", "1 1/88 23/1056 241/19800 349/316800 -13/15840 -1/6336 1/79200 1/316800", "1 -112/20085 -64/60255 1541/241020 61/60255 -799/964080 49/964080 11/964080 -1/964080", "1 -196/35685 -98/35685 361/63440 361/126880 -19/95160 -19/190320 1/570960 1/1141920", "1 -49/9060 -637/217440 5/906 883/289920 -1/9060 -17/144960 0 1/869760", "1 -7/1353 -503/162360 419/81180 2099/649440 1/64944 -1/7380 -1/324720 1/649440", "1 -7/1503 -191/60120 359/80160 533/160320 1/5344 -1/6680 -1/120240 1/480960", "1 -32/20961 -152/104805 79/69870 401/279480 15/37264 3/186320 -11/1676880 -1/1676880", "1 -14/26577 -341/531540 169/708720 823/1417440 5/17718 43/708720 13/2126160 1/4252320", "1 -35/73524 -529/882288 19/98032 631/1176384 27/98032 37/588192 1/147048 1/3529152", "1 -16/8877 -208/133155 767/532620 829/532620 157/426096 13/2130480 -13/2130480 -1/2130480", "1 -7/11154 -953/1338480 28/83655 319/486720 7/24336 151/2676960 7/1338480 1/5353920", "1 -112/55185 -272/165555 25/14716 121/73580 99/294320 -1/882960 -1/176592 -1/2648880", "1 -49/7170 -539/172080 1249/172080 2249/688320 -37/86040 -47/344160 1/172080 1/688320", "1 -49/7040 -49/14080 1849/253440 1849/506880 -43/126720 -43/253440 1/253440 1/506880", "1 -7/1012 -39/10120 259/36432 493/121440 -7/36432 -19/91080 0 1/364320", "1 -7/1086 -269/65160 209/32580 1139/260640 1/26064 -2/8145 -1/130320 1/260640", "1 -16/2937 -32/44055 373/58740 19/29370 -43/46992 19/234960 1/78320 -1/704880", "1 -7/759 -337/91080 307/30360 43/11040 -1/1104 -1/5060 1/60720 1/364320", "1 -35/3476 -31/6952 1367/125136 1183/250272 -109/125136 -17/62568 1/62568 1/250272", "1 -25/2288 -25/4576 961/82368 961/164736 -31/41184 -31/82368 1/82368 1/164736", "1 -25/2244 -175/26928 13/1122 251/35904 -1/2244 -3/5984 0 1/107712", "1 112/55185 -272/165555 -25/14716 121/73580 -99/294320 -1/882960 1/176592 -1/2648880", "1 196/35685 -98/35685 -361/63440 361/126880 19/95160 -19/190320 -1/570960 1/1141920", "1 49/7170 -539/172080 -1249/172080 2249/688320 37/86040 -47/344160 -1/172080 1/688320", "1 7/759 -337/91080 -307/30360 43/11040 1/1104 -1/5060 -1/60720 1/364320", "1 7/531 -89/21240 -427/28320 253/56640 11/5664 -1/3540 -1/21240 1/169920", "1 32/6381 -8/31905 -127/21270 11/85080 11/11344 7/56720 -7/510480 -1/510480", "1 14/8109 61/162180 -437/216240 -217/432480 1/3604 9/72080 11/648720 1/1297440", "1 7/4488 109/269280 -49/26928 -571/1077120 13/53856 67/538560 1/53856 1/1077120", "1 16/2937 -32/44055 -373/58740 19/29370 43/46992 19/234960 -1/78320 -1/704880", "1 7/3432 113/411840 -109/45760 -217/549120 3/9152 1/8320 1/68640 1/1647360", "1 112/20085 -64/60255 -1541/241020 61/60255 799/964080 49/964080 -11/964080 -1/964080", "1 49/9060 -637/217440 -5/906 883/289920 1/9060 -17/144960 0 1/869760", "1 49/7040 -49/14080 -1849/253440 1849/506880 43/126720 -43/253440 -1/253440 1/506880", "1 35/3476 -31/6952 -1367/125136 1183/250272 109/125136 -17/62568 -1/62568 1/250272", "1 35/2082 -151/24984 -53/2776 217/33312 13/5552 -1/2082 -1/16656 1/99936", "1 16/8877 -208/133155 -767/532620 829/532620 -157/426096 13/2130480 13/2130480 -1/2130480", "1 7/1353 -503/162360 -419/81180 2099/649440 -1/64944 -1/7380 1/324720 1/649440", "1 7/1012 -39/10120 -259/36432 493/121440 7/36432 -19/91080 0 1/364320", "1 25/2288 -25/4576 -961/82368 961/164736 31/41184 -31/82368 -1/82368 1/164736", "1 25/1056 -125/12672 -337/12672 545/50688 19/6336 -23/25344 -1/12672 1/50688", "1 -16/6773 240/47411 -6353/1706796 1961/1706796 -815/6827184 -67/6827184 19/6827184 -1/6827184", "1 -196/26637 1078/79911 -3023/426192 631/852384 7/26637 -17/426192 -1/426192 1/2557152", "1 -49/5000 2107/120000 -3113/360000 709/1440000 163/360000 -37/720000 -1/180000 1/1440000", "1 -7/451 1457/54120 -389/32472 -161/649440 59/64944 -1/14760 -1/64944 1/649440", "1 -5/138 1387/23184 -229/10304 -239/61824 27/10304 -1/15456 -1/15456 1/185472", "1 -160/3831 664/11493 -67/7662 -91/10216 73/61296 29/61296 -1/61296 -1/183888", "1 -10/411 937/34524 143/46032 -509/92064 -17/23016 13/46032 1/15344 1/276192", "1 -1/44 41/1680 113/27720 -1151/221760 -5/5544 29/110880 1/13860 1/221760", "1 -16/583 32/795 -199/20988 -233/52470 7/7632 89/419760 -1/83952 -1/419760", "1 -7/286 1007/34320 7/20592 -2111/411840 -1/2574 53/205920 1/20592 1/411840", "1 -112/5525 512/16575 -1777/198900 -124/49725 563/795600 89/795600 -7/795600 -1/795600", "1 -49/7262 735/58096 -913/130716 1861/2091456 125/522864 -49/1045728 -1/522864 1/2091456", "1 -147/16280 49/2960 -1679/195360 829/1172160 7/16280 -1/15840 -1/195360 1/1172160", "1 -7/484 373/14520 -1057/87120 59/522720 47/52272 -1/10890 -1/65340 1/522720", "1 -5/142 237/3976 -853/35784 -449/143136 199/71568 -5/35784 -5/71568 1/143136", "1 -80/38357 16/3487 -4867/1380852 1613/1380852 -71/502128 -43/5523408 17/5523408 -1/5523408", "1 -35/5819 541/46552 -1429/209484 1783/1675872 173/837936 -1/18216 -1/837936 1/1675872", "1 -21/2596 397/25960 -1321/155760 899/934560 37/93456 -1/12980 -1/233640 1/934560", "1 -15/1144 5/208 -839/68640 229/411840 1/1144 -5/41184 -1/68640 1/411840", "1 -25/748 175/2992 -689/26928 -227/107712 79/26928 -13/53856 -1/13464 1/107712", "1 -1072/104663 8513/941967 -14197/3767868 694/941967 -547/15071472 -11/1159344 23/15071472 -1/15071472", "1 -4900/184977 13381/739908 -4285/986544 -265/1973088 5/27404 -1/75888 -5/2959632 1/5919264", "1 -343/10128 18773/850752 -91/20256 -1/1792 79/283584 -1/81024 -1/283584 1/3403008", "1 -1667/33330 12151/399960 -223/49995 -2521/1599840 383/799920 -1/399960 -7/799920 1/1599840", "1 -1597/15930 431/7965 -209/84960 -887/169920 89/84960 1/14160 -1/31860 1/509760", "1 -3136/21465 1066/21465 103/7155 -419/57240 -43/114480 11/38160 1/343440 -1/343440", "1 -1147/5805 127/5805 3/80 -79/20640 -1/360 1/30960 7/92880 1/185760", "1 -139/660 449/31680 153/3520 -39/14080 -3/880 -1/21120 1/10560 1/126720", "1 -1648/18645 2051/55935 79/20340 -851/223740 29/894960 109/894960 -1/894960 -1/894960", "1 -1217/8580 2881/102960 1073/51480 -1471/411840 -73/51480 1/15840 1/25740 1/411840", "1 -2384/36699 3313/110097 23/48932 -353/146796 23/195728 1/15056 -1/587184 -1/1761552", "1 -833/33652 21223/1211472 -5513/1211472 -139/4845888 223/1211472 -41/2422944 -1/605736 1/4845888", "1 -1225/38588 4975/231528 -6695/1389168 -1187/2778336 25/86823 -25/1389168 -5/1389168 1/2778336", "1 -851/18040 3233/108240 -299/59040 -607/432960 331/649440 -1/81180 -1/108240 1/1298880", "1 -136/1415 1109/20376 -101/25470 -2041/407520 239/203760 1/20376 -7/203760 1/407520", "1 -14/22305 2143/1338300 -187/118960 2803/3568800 -13/59480 61/1784400 -1/356880 1/10706400", "1 5/4503 -463/756504 -287/432288 629/864576 -119/432288 11/216144 -1/216144 1/6052032", "1 -43/174006 -2935/696024 19/11048 17/44192 -25/66288 1/11048 -13/1392048 1/2784096", "1 -201/6268 -1741/225648 799/75216 -529/300864 -41/75216 11/50144 -1/37608 1/902592", "1 -271/1415 332/12735 5191/203760 -3571/407520 1/50940 73/203760 -11/203760 1/407520", "1 -448/2495 -514/22455 763/22455 -427/179640 -623/359280 79/359280 7/359280 -1/359280", "1 -121/890 -613/8010 3601/128160 1679/256320 -221/128160 -1/4005 1/32040 1/256320", "1 -82/645 -1343/15480 1241/46440 57/6880 -157/92880 -2/5805 1/30960 1/185760", "1 -5/44 -1069/10560 769/31680 1369/126720 -5/3168 -31/63360 1/31680 1/126720", "1 -144/2777 -941/24993 217/11108 14/8331 -77/44432 19/133296 1/44432 -1/399888", "1 -51/1138 -4171/40968 239/13656 641/54624 -47/27312 -1/2276 1/27312 1/163872", "1 -59/1448 -1075/8688 839/52128 1591/104256 -85/52128 -17/26064 1/26064 1/104256", "1 -25/836 -797/5016 19/1584 67/3168 -1/792 -31/30096 1/30096 1/60192", "1 0 -1669/7920 0 323/10560 0 -3/1760 0 1/31680", "1 16/5193 -815/67509 161/90012 7/3462 -245/360048 11/360048 11/1080144 -1/1080144", "1 407/19296 -2545/77184 -101/25728 667/102912 -5/12864 -13/51456 1/77184 1/308736", "1 221/6972 -1871/41832 -89/11952 215/23904 -1/5976 -5/11952 1/83664 1/167328", "1 175/2904 -1297/17424 -203/11616 119/7744 7/11616 -5/5808 0 1/69696", "1 20/99 -823/3960 -47/660 233/5280 1/176 -1/330 -1/7920 1/15840", "1 160/50001 -136/150003 -97/42858 263/171432 -107/342864 1/342864 13/2400048 -1/2400048", "1 70/7197 -13/86364 -2519/345456 1913/690912 11/172728 -41/345456 1/345456 1/690912", "1 5/372 11/31248 -17/1674 61/17856 1/3348 -5/26784 0 1/374976", "1 25/1078 25/12936 -7/396 109/22176 1/1008 -1/2772 -1/77616 1/155232", "1 5/66 5/396 -923/15840 359/31680 17/3168 -1/792 -1/7920 1/31680", "1 14/26577 -341/531540 -169/708720 823/1417440 -5/17718 43/708720 -13/2126160 1/4252320", "1 -67/40900 -1189/490800 327/163600 23/654400 -57/163600 103/981600 -1/81800 1/1963200", "1 -1163/38250 281/153000 491/51000 -587/204000 -37/102000 13/51000 -11/306000 1/612000", "1 -1373/6210 233/3105 163/6624 -1007/66240 31/33120 1/1840 -1/9936 1/198720", "1 -1312/5265 149/5265 35/702 -259/28080 -49/18720 29/56160 1/33696 -1/168480", "1 -923/3780 -149/3780 35/576 29/5760 -1/240 -1/2880 1/12096 1/120960", "1 -74/305 -1151/21960 1373/21960 689/87840 -97/21960 -23/43920 1/10980 1/87840", "1 -50/209 -1069/15048 17/264 241/20064 -47/10032 -1/1254 1/10032 1/60192", "1 -536/7875 -239/15750 529/21000 -11/10500 -181/84000 23/84000 1/36000 -1/252000", "1 -713/5850 -133/1800 9/200 121/10400 -31/7800 -3/5200 1/11700 1/93600", "1 -113/800 -1399/14400 499/9600 323/19200 -11/2400 -3/3200 1/9600 1/57600", "1 -15/88 -1097/7920 983/15840 839/31680 -17/3168 -13/7920 1/7920 1/31680", "1 -20/99 -823/3960 47/660 233/5280 -1/176 -1/330 1/7920 1/15840", "1 -48/15725 -389/47175 243/62900 22/15725 -207/251600 49/754800 3/251600 -1/754800", "1 -17/4450 -1459/53400 87/17800 473/71200 -39/35600 -2/6675 1/35600 1/213600", "1 -59/14400 -221/5760 101/19200 373/38400 -23/19200 -1/1920 1/28800 1/115200", "1 -5/1188 -799/11880 43/7920 283/15840 -1/792 -1/880 1/23760 1/47520", "1 0 -541/2640 0 203/3520 0 -23/5280 0 1/10560", "1 -14/8109 61/162180 437/216240 -217/432480 -1/3604 9/72080 -11/648720 1/1297440", "1 -1/60 743/50400 241/40320 -1741/403200 1/40320 29/100800 -1/20160 1/403200", "1 -7/48 953/5760 7/3840 -787/30720 11/3072 1/1280 -1/5120 1/92160", "1 -32/213 416/3195 89/2130 -43/2130 -17/6816 31/34080 1/34080 -1/102240", "1 -14/123 503/7380 89/1640 -157/39360 -3/656 -1/6560 1/9840 1/118080", "1 -7/64 39/640 511/9216 -191/92160 -11/2304 -13/46080 1/9216 1/92160", "1 -25/242 25/484 179/3168 31/69696 -173/34848 -1/2178 1/8712 1/69696", "1 -16/375 148/5625 107/4500 -517/90000 -77/36000 79/180000 1/36000 -1/180000", "1 -1/15 293/12600 463/10080 209/100800 -11/2520 -17/50400 1/10080 1/100800", "1 -1/14 43/1960 893/17640 289/70560 -17/3528 -19/35280 1/8820 1/70560", "1 -5/66 5/264 661/11880 113/15840 -25/4752 -1/1188 1/7920 1/47520", "1 -5/66 5/396 923/15840 359/31680 -17/3168 -1/792 1/7920 1/31680", "1 10/411 937/34524 -143/46032 -509/92064 17/23016 13/46032 -1/15344 1/276192", "1 28/183 727/5490 -473/10980 -1591/87840 11/2196 19/43920 -1/5490 1/87840", "1 64/669 1088/10035 -11/10035 -149/10035 -13/32112 97/160560 1/160560 -1/160560", "1 7/129 1177/15480 547/30960 -1561/247680 -55/24768 1/30960 7/123840 1/247680", "1 7/138 101/1380 83/4320 -367/66240 -47/19872 -1/49680 1/16560 1/198720", "1 25/539 75/1078 233/11088 -101/22176 -1/396 -1/11088 5/77616 1/155232", "1 1147/5805 127/5805 -3/80 -79/20640 1/360 1/30960 -7/92880 1/185760", "1 3136/21465 1066/21465 -103/7155 -419/57240 43/114480 11/38160 -1/343440 -1/343440", "1 1597/15930 431/7965 209/84960 -887/169920 -89/84960 1/14160 1/31860 1/509760", "1 136/1415 1109/20376 101/25470 -2041/407520 -239/203760 1/20376 7/203760 1/407520", "1 1/11 4331/79200 7/1200 -497/105600 -7/5280 1/52800 1/26400 1/316800", "1 160/3831 664/11493 67/7662 -91/10216 -73/61296 29/61296 1/61296 -1/183888", "1 5/138 1387/23184 229/10304 -239/61824 -27/10304 -1/15456 1/15456 1/185472", "1 5/142 237/3976 853/35784 -449/143136 -199/71568 -5/35784 5/71568 1/143136", "1 25/748 175/2992 689/26928 -227/107712 -79/26928 -13/53856 1/13464 1/107712", "1 1/33 1/18 359/13200 -17/26400 -1/330 -1/2640 1/13200 1/79200", "1 -32/6381 -8/31905 127/21270 11/85080 -11/11344 7/56720 7/510480 -1/510480", "1 -7/531 -89/21240 427/28320 253/56640 -11/5664 -1/3540 1/21240 1/169920", "1 -35/2082 -151/24984 53/2776 217/33312 -13/5552 -1/2082 1/16656 1/99936", "1 -25/1056 -125/12672 337/12672 545/50688 -19/6336 -23/25344 1/12672 1/50688", "1 -25/693 -25/1386 7/176 7/352 -1/264 -1/528 1/11088 1/22176", "1 32/20961 -152/104805 -79/69870 401/279480 -15/37264 3/186320 11/1676880 -1/1676880", "1 7/1503 -191/60120 -359/80160 533/160320 -1/5344 -1/6680 1/120240 1/480960", "1 7/1086 -269/65160 -209/32580 1139/260640 -1/26064 -2/8145 1/130320 1/260640", "1 25/2244 -175/26928 -13/1122 251/35904 1/2244 -3/5984 0 1/107712", "1 25/693 -25/1386 -7/176 7/352 1/264 -1/528 -1/11088 1/22176", "1 7/17085 -227/410040 -71/546720 533/1093440 -149/546720 3/45560 -1/136680 1/3280320", "1 -143/94878 -667/379512 11/6024 -1/8032 -11/36144 1/9036 -11/759024 1/1518048", "1 -85/3256 487/117216 25/3168 -1495/468864 -5/29304 61/234432 -5/117216 1/468864", "1 -99/461 376/4149 131/7376 -773/44256 7/3688 13/22128 -1/7376 1/132768", "1 -192/743 358/6687 109/2229 -87/5944 -89/35664 29/35664 1/35664 -1/106992", "1 -69/236 -29/2124 863/11328 -23/22656 -73/11328 -1/5664 1/5664 1/67968", "1 -50/167 -115/4008 985/12024 103/48096 -175/24048 -5/12024 5/24048 1/48096", "1 -17/55 -137/2640 713/7920 229/31680 -67/7920 -13/15840 1/3960 1/31680", "1 -80/1289 -73/11601 1085/46404 -35/11601 -385/185616 73/185616 5/185616 -1/185616", "1 -55/406 -863/14616 115/2088 65/8352 -25/4176 -1/2088 5/29232 1/58464", "1 -79/464 -239/2784 1171/16704 451/33408 -131/16704 -1/1044 1/4176 1/33408", "1 -53/220 -193/1320 797/7920 13/480 -23/1980 -17/7920 1/2640 1/15840", "1 -2/5 -449/1440 61/360 389/5760 -29/1440 -17/2880 1/1440 1/5760", "1 -112/36207 -227/36207 7/1788 7/8046 -161/193104 19/193104 7/579312 -1/579312", "1 -53/9828 -877/39312 1/144 41/7488 -1/624 -1/3744 1/19656 1/157248", "1 -23/3444 -667/20664 17/1968 11/1312 -1/492 -1/1968 1/13776 1/82656", "1 -13/1320 -97/1584 203/15840 49/2880 -49/15840 -1/792 1/7920 1/31680", "1 -4/135 -331/1080 7/180 133/1440 -7/720 -1/120 1/2160 1/4320", "1 -7/5205 59/124920 157/99936 -601/999360 -103/499680 2/15615 -1/49968 1/999360", "1 -14/1055 57/4220 539/151920 -437/101280 23/75960 43/151920 -1/16880 1/303840", "1 -28/185 71/370 -113/6660 -1631/53280 43/6660 23/26640 -1/3330 1/53280", "1 -64/305 64/305 109/2745 -109/2745 -89/43920 89/43920 1/43920 -1/43920", "1 -14/55 41/220 427/3960 -881/31680 -203/15840 1/1980 7/15840 1/31680", "1 -21/80 29/160 463/3840 -581/23040 -19/1280 1/5760 1/1920 1/23040", "1 -3/11 19/110 73/528 -331/15840 -7/396 -1/2640 1/1584 1/15840", "1 -32/815 24/815 289/14670 -169/19560 -227/117360 79/117360 1/39120 -1/117360", "1 -7/65 27/520 1349/18720 -29/4160 -179/18720 -1/9360 1/3120 1/37440", "1 -7/50 37/600 7/72 -121/21600 -143/10800 -1/1800 1/2160 1/21600", "1 -9/44 69/880 131/880 -1/960 -1/48 -3/1760 1/1320 1/10560", "1 -1/3 1/10 557/2160 23/1440 -1/27 -11/2160 1/720 1/4320", "1 7/331 55/2648 -611/95328 -989/190656 115/95328 13/47664 -1/11916 1/190656", "1 14/55 41/220 -427/3960 -881/31680 203/15840 1/1980 -7/15840 1/31680", "1 64/305 64/305 -109/2745 -109/2745 89/43920 89/43920 -1/43920 -1/43920", "1 28/185 71/370 113/6660 -1631/53280 -43/6660 23/26640 1/3330 1/53280", "1 21/145 11/58 161/6960 -1231/41760 -77/10440 1/1392 7/20880 1/41760", "1 3/22 41/220 163/5280 -881/31680 -3/352 1/1980 1/2640 1/31680", "1 69/236 -29/2124 -863/11328 -23/22656 73/11328 -1/5664 -1/5664 1/67968", "1 192/743 358/6687 -109/2229 -87/5944 89/35664 29/35664 -1/35664 -1/106992", "1 99/461 376/4149 -131/7376 -773/44256 -7/3688 13/22128 1/7376 1/132768", "1 38/181 821/8688 -187/13032 -1847/104256 -31/13032 29/52128 1/6516 1/104256", "1 56/275 131/1320 -49/4950 -1421/79200 -119/39600 1/1980 7/39600 1/79200", "1 32/611 40/611 -1/10998 -653/43992 -5/6768 83/87984 1/87984 -1/87984", "1 14/167 85/668 739/24048 -959/48096 -85/12024 11/24048 7/24048 1/48096", "1 21/232 131/928 107/2784 -695/33408 -1/116 5/16704 1/2784 1/33408", "1 15/154 97/616 13/264 -67/3168 -17/1584 0 5/11088 1/22176", "1 1/10 17/100 451/7200 -281/14400 -19/1440 -1/1800 1/1800 1/14400", "1 -32/7935 8/23805 47/9522 -97/190440 -349/380880 67/380880 1/76176 -1/380880", "1 -14/1095 -31/13140 163/10512 269/105120 -37/13140 -11/52560 1/10512 1/105120", "1 -7/388 -19/4656 305/13968 253/55872 -55/13968 -13/27936 1/6984 1/55872", "1 -5/154 -17/1848 31/792 1/96 -1/144 -1/792 1/3696 1/22176", "1 -5/42 -11/252 41/288 29/576 -7/288 -1/144 1/1008 1/4032", "1 -7/7845 101/188280 8/7845 -167/251040 -13/125520 1/7845 -1/41840 1/753120", "1 -7/824 71/6592 19/29664 -887/237312 19/29664 29/118656 -1/14832 1/237312", "1 -14/167 85/668 -739/24048 -959/48096 85/12024 11/24048 -7/24048 1/48096", "1 -32/611 40/611 1/10998 -653/43992 5/6768 83/87984 -1/87984 -1/87984", "1 -7/331 55/2648 611/95328 -989/190656 -115/95328 13/47664 1/11916 1/190656", "1 -21/1090 79/4360 11/1635 -721/156960 -103/78480 1/4360 7/78480 1/156960", "1 -3/176 53/3520 37/5280 -491/126720 -1/704 1/5760 1/10560 1/126720", "1 -16/917 16/917 31/4716 -31/4716 -11/18864 11/18864 1/132048 -1/132048", "1 -1/77 41/4312 1/126 -71/22176 -17/11088 1/5544 1/11088 1/155232", "1 -21/1700 29/3400 163/20400 -341/122400 -11/6800 1/7650 1/10200 1/122400", "1 -1/88 19/2640 25/3168 -211/95040 -1/594 1/15840 1/9504 1/95040", "1 -5/508 11/2032 137/18288 -107/73152 -31/18288 -1/36576 1/9144 1/73152", "1 1/77 41/4312 -1/126 -71/22176 17/11088 1/5544 -1/11088 1/155232", "1 7/65 27/520 -1349/18720 -29/4160 179/18720 -1/9360 -1/3120 1/37440", "1 32/815 24/815 -289/14670 -169/19560 227/117360 79/117360 -1/39120 -1/117360", "1 14/1055 57/4220 -539/151920 -437/101280 -23/75960 43/151920 1/16880 1/303840", "1 63/5260 267/21040 -29/10520 -1031/252480 -13/31560 11/42080 1/15780 1/252480", "1 3/286 67/5720 -4/2145 -71/18720 -1/1872 1/4290 7/102960 1/205920", "1 55/406 -863/14616 -115/2088 65/8352 25/4176 -1/2088 -5/29232 1/58464", "1 80/1289 -73/11601 -1085/46404 -35/11601 385/185616 73/185616 -5/185616 -1/185616", "1 85/3256 487/117216 -25/3168 -1495/468864 5/29304 61/234432 5/117216 1/468864", "1 131/5404 151/32424 -197/27792 -59/18528 1/13896 7/27792 1/21616 1/389088", "1 97/4400 137/26400 -973/158400 -91/28800 -7/158400 19/79200 1/19800 1/316800", "1 16/917 16/917 -31/4716 -31/4716 11/18864 11/18864 -1/132048 -1/132048", "1 7/824 71/6592 -19/29664 -887/237312 -19/29664 29/118656 1/14832 1/237312", "1 1/128 55/5376 -1/4608 -97/27648 -5/6912 1/4608 1/13824 1/193536", "1 15/2156 41/4312 1/3696 -71/22176 -1/1232 1/5544 1/12936 1/155232", "1 1/170 29/3400 1/1224 -341/122400 -11/12240 1/7650 1/12240 1/122400", "1 7/1770 11/42480 -37/7080 -17/56640 19/14160 1/28320 -1/14160 1/169920", "1 14/1095 -31/13140 -163/10512 269/105120 37/13140 -11/52560 -1/10512 1/105120", "1 32/7935 8/23805 -47/9522 -97/190440 349/380880 67/380880 -1/76176 -1/380880", "1 7/5205 59/124920 -157/99936 -601/999360 103/499680 2/15615 1/49968 1/999360", "1 7/5770 11/23080 -73/51930 -167/276960 71/415440 13/103860 1/46160 1/830880", "1 5/4708 9/18832 -103/84744 -37/61632 1/7704 41/338976 1/42372 1/677952", "1 53/9828 -877/39312 -1/144 41/7488 1/624 -1/3744 -1/19656 1/157248", "1 112/36207 -227/36207 -7/1788 7/8046 161/193104 19/193104 -7/579312 -1/579312", "1 143/94878 -667/379512 -11/6024 -1/8032 11/36144 1/9036 11/759024 1/1518048", "1 25/17528 -485/315504 -155/90144 -31/180288 25/90144 5/45072 5/315504 1/1262016", "1 19/14300 -331/257400 -7/4400 -7/31200 7/28600 19/171600 1/57200 1/1029600", "1 -14/3795 -137/45540 67/20240 383/121440 1/2530 -3/20240 -1/60720 1/364320", "1 -32/26835 -104/80505 41/53670 271/214680 187/429360 13/429360 -1/143120 -1/1288080", "1 -7/17085 -227/410040 71/546720 533/1093440 149/546720 3/45560 1/136680 1/3280320", "1 -7/18910 -39/75640 67/680760 1219/2723040 359/1361520 23/340380 11/1361520 1/2723040", "1 -1/3080 -29/61600 1/15840 127/316800 1/3960 1/14400 1/110880 1/2217600", "1 16/6585 16/19755 -27/8780 -9/8780 23/35120 23/105360 -1/105360 -1/316080", "1 7/7845 101/188280 -8/7845 -167/251040 13/125520 1/7845 1/41840 1/753120", "1 7/8660 9/17320 -283/311760 -401/623520 23/311760 19/155880 1/38970 1/623520", "1 1/1408 7/14080 -197/253440 -311/506880 1/25344 29/253440 7/253440 1/506880", "1 1/1680 47/100800 -1/1600 -11/19200 0 1/9600 1/33600 1/403200", "1 -16/6585 16/19755 27/8780 -9/8780 -23/35120 23/105360 1/105360 -1/316080", "1 -7/1770 11/42480 37/7080 -17/56640 -19/14160 1/28320 1/14160 1/169920", "1 -7/1640 1/9840 67/11808 -11/118080 -11/7380 -1/59040 1/11808 1/118080", "1 -1/220 -1/6600 241/39600 19/79200 -13/7920 -1/9900 1/9900 1/79200", "1 -1/222 -7/13320 9/1480 13/17760 -1/592 -1/4440 1/8880 1/53280", "1 32/26835 -104/80505 -41/53670 271/214680 -187/429360 13/429360 1/143120 -1/1288080", "1 14/3795 -137/45540 -67/20240 383/121440 -1/2530 -3/20240 1/60720 1/364320", "1 7/1360 -13/3264 -59/12240 829/195840 -1/2880 -5/19584 1/48960 1/195840", "1 1/110 -43/6600 -89/9900 559/79200 -1/7920 -1/1800 1/39600 1/79200", "1 1/30 -19/900 -17/480 113/4800 1/480 -1/400 0 1/14400", "1 -32/18165 1096/272475 -17/5190 41/34600 -7/41520 -1/207600 1/290640 -1/4359600", "1 -1/195 1693/163800 -41/6240 79/62400 1/6240 -1/15600 0 1/1310400", "1 -7/1010 829/60600 -751/90900 919/727200 5/14544 -17/181800 -1/363600 1/727200", "1 -1/88 23/1056 -241/19800 349/316800 13/15840 -1/6336 -1/79200 1/316800", "1 -1/33 1/18 -359/13200 -17/26400 1/330 -1/2640 -1/13200 1/79200", "1 -784/84425 6451/759825 -343/92100 133/168850 -203/4052400 -37/4052400 7/4052400 -1/12157200", "1 -611/26950 16301/970200 -221/46200 19/184800 17/92400 -1/46200 -1/646800 1/3880800", "1 -899/30800 3833/184800 -823/158400 -83/316800 47/158400 -1/39600 -1/277200 1/2217600", "1 -25/572 2503/85800 -119/20592 -1211/1029600 7/12870 -1/39600 -1/102960 1/1029600", "1 -1/11 4331/79200 -7/1200 -497/105600 7/5280 1/52800 -1/26400 1/316800", "1 -1/1760 33/22400 -469/316800 967/1267200 -7/31680 23/633600 -1/316800 1/8870400", "1 7/6974 -83/139480 -731/1255320 3439/5021280 -137/502128 67/1255320 -13/2510640 1/5021280", "1 -13/32120 -2209/578160 659/385440 233/770880 -139/385440 3/32120 -1/96360 1/2312640", "1 -29/940 -373/62040 341/33840 -1451/744480 -1/2115 83/372240 -1/33840 1/744480", "1 -53/275 841/26400 193/7920 -3011/316800 19/79200 59/158400 -1/15840 1/316800", "1 35/73524 -529/882288 -19/98032 631/1176384 -27/98032 37/588192 -1/147048 1/3529152", "1 -29/18540 -871/407880 47/24720 -17/543840 -1/3090 29/271920 -1/74160 1/1631520", "1 -599/21120 343/126720 445/50688 -1501/506880 -67/253440 1/3960 -1/25344 1/506880", "1 -32/147 283/3528 5/231 -39/2464 5/3696 1/1848 -1/8624 1/155232", "1 -7/4488 109/269280 49/26928 -571/1077120 -13/53856 67/538560 -1/53856 1/1077120", "1 -1/66 389/27720 103/20790 -467/110880 5/33264 23/83160 -1/18480 1/332640", "1 -35/242 247/1452 -149/34848 -1829/69696 157/34848 13/17424 -1/4356 1/69696", "1 1/44 41/1680 -113/27720 -1151/221760 5/5544 29/110880 -1/13860 1/221760", "1 35/209 173/1254 -1627/30096 -1127/60192 97/15048 1/2736 -7/30096 1/60192", "1 139/660 449/31680 -153/3520 -39/14080 3/880 -1/21120 -1/10560 1/126720", "1 7/18910 -39/75640 -67/680760 1219/2723040 -359/1361520 23/340380 -11/1361520 1/2723040", "1 -25/17528 -485/315504 155/90144 -31/180288 -25/90144 5/45072 -5/315504 1/1262016", "1 -131/5404 151/32424 197/27792 -59/18528 -1/13896 7/27792 -1/21616 1/389088", "1 -38/181 821/8688 187/13032 -1847/104256 31/13032 29/52128 -1/6516 1/104256", "1 -7/5770 11/23080 73/51930 -167/276960 -71/415440 13/103860 -1/46160 1/830880", "1 -63/5260 267/21040 29/10520 -1031/252480 13/31560 11/42080 -1/15780 1/252480", "1 -21/145 11/58 -161/6960 -1231/41760 77/10440 1/1392 -7/20880 1/41760", "1 21/1090 79/4360 -11/1635 -721/156960 103/78480 1/4360 -7/78480 1/156960", "1 21/80 29/160 -463/3840 -581/23040 19/1280 1/5760 -1/1920 1/23040", "1 50/167 -115/4008 -985/12024 103/48096 175/24048 -5/12024 -5/24048 1/48096", "1 -7/8660 9/17320 283/311760 -401/623520 -23/311760 19/155880 -1/38970 1/623520", "1 -1/128 55/5376 1/4608 -97/27648 5/6912 1/4608 -1/13824 1/193536", "1 -21/232 131/928 -107/2784 -695/33408 1/116 5/16704 -1/2784 1/33408", "1 21/1700 29/3400 -163/20400 -341/122400 11/6800 1/7650 -1/10200 1/122400", "1 7/50 37/600 -7/72 -121/21600 143/10800 -1/1800 -1/2160 1/21600", "1 79/464 -239/2784 -1171/16704 451/33408 131/16704 -1/1044 -1/4176 1/33408", "1 7/1640 1/9840 -67/11808 -11/118080 11/7380 -1/59040 -1/11808 1/118080", "1 7/388 -19/4656 -305/13968 253/55872 55/13968 -13/27936 -1/6984 1/55872", "1 23/3444 -667/20664 -17/1968 11/1312 1/492 -1/1968 -1/13776 1/82656", "1 -7/1360 -13/3264 59/12240 829/195840 1/2880 -5/19584 -1/48960 1/195840", "1 1/3080 -29/61600 -1/15840 127/316800 -1/3960 1/14400 -1/110880 1/2217600", "1 -19/14300 -331/257400 7/4400 -7/31200 -7/28600 19/171600 -1/57200 1/1029600", "1 -97/4400 137/26400 973/158400 -91/28800 7/158400 19/79200 -1/19800 1/316800", "1 -56/275 131/1320 49/4950 -1421/79200 119/39600 1/1980 -7/39600 1/79200", "1 -5/4708 9/18832 103/84744 -37/61632 -1/7704 41/338976 -1/42372 1/677952", "1 -3/286 67/5720 4/2145 -71/18720 1/1872 1/4290 -7/102960 1/205920", "1 -3/22 41/220 -163/5280 -881/31680 3/352 1/1980 -1/2640 1/31680", "1 3/176 53/3520 -37/5280 -491/126720 1/704 1/5760 -1/10560 1/126720", "1 3/11 19/110 -73/528 -331/15840 7/396 -1/2640 -1/1584 1/15840", "1 17/55 -137/2640 -713/7920 229/31680 67/7920 -13/15840 -1/3960 1/31680", "1 -1/1408 7/14080 197/253440 -311/506880 -1/25344 29/253440 -7/253440 1/506880", "1 -15/2156 41/4312 -1/3696 -71/22176 1/1232 1/5544 -1/12936 1/155232", "1 -15/154 97/616 -13/264 -67/3168 17/1584 0 -5/11088 1/22176", "1 1/88 19/2640 -25/3168 -211/95040 1/594 1/15840 -1/9504 1/95040", "1 9/44 69/880 -131/880 -1/960 1/48 -3/1760 -1/1320 1/10560", "1 53/220 -193/1320 -797/7920 13/480 23/1980 -17/7920 -1/2640 1/15840", "1 1/220 -1/6600 -241/39600 19/79200 13/7920 -1/9900 -1/9900 1/79200", "1 5/154 -17/1848 -31/792 1/96 1/144 -1/792 -1/3696 1/22176", "1 13/1320 -97/1584 -203/15840 49/2880 49/15840 -1/792 -1/7920 1/31680", "1 -1/110 -43/6600 89/9900 559/79200 1/7920 -1/1800 -1/39600 1/79200", "1 -1/1680 47/100800 1/1600 -11/19200 0 1/9600 -1/33600 1/403200", "1 -1/170 29/3400 -1/1224 -341/122400 11/12240 1/7650 -1/12240 1/122400", "1 -1/10 17/100 -451/7200 -281/14400 19/1440 -1/1800 -1/1800 1/14400", "1 5/508 11/2032 -137/18288 -107/73152 31/18288 -1/36576 -1/9144 1/73152", "1 1/3 1/10 -557/2160 23/1440 1/27 -11/2160 -1/720 1/4320", "1 2/5 -449/1440 -61/360 389/5760 29/1440 -17/2880 -1/1440 1/5760", "1 1/222 -7/13320 -9/1480 13/17760 1/592 -1/4440 -1/8880 1/53280", "1 5/42 -11/252 -41/288 29/576 7/288 -1/144 -1/1008 1/4032", "1 4/135 -331/1080 -7/180 133/1440 7/720 -1/120 -1/2160 1/4320", "1 -1/30 -19/900 17/480 113/4800 -1/480 -1/400 0 1/14400", "1 1/280 -1/1120 -7/1440 7/5760 1/720 -1/2880 -1/10080 1/40320", "1 1/5 -1/10 -169/720 169/1440 13/360 -13/720 -1/720 1/1440", "1 0 -205/144 0 91/192 0 -5/96 0 1/576", "1 -1/5 -1/10 169/720 169/1440 -13/360 -13/720 1/720 1/1440", "1 -1/280 -1/1120 7/1440 7/5760 -1/720 -1/2880 1/10080 1/40320" }); VPolygon result = lrs.run(new HPolygon(ine, false)); checkResults(result, ext, null); } @Test public void testH2VDiamond() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] ine = convert(new String[] { "1/2 -1 -1", "1/2 -1 1", "1/2 1 -1", "1/2 1 1" }); Rational[][] ext = convert(new String[] { "1 -1/2 0 ", "1 0 -1/2 ", "1 1/2 0 ", "1 0 1/2" }); VPolygon result = lrs.run(new HPolygon(ine, false)); checkResults(result, ext, null); } // TODO: move to new style and finish @Test public void testH2VIn0() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] matrix = new Rational[][] { { Rational.valueOf("9"), Rational.valueOf("-2"), Rational.valueOf("-3"), Rational.valueOf("-3"), Rational.valueOf("-2"), Rational.valueOf("-2")}, { Rational.valueOf("9"), Rational.valueOf("-2"), Rational.valueOf("0"), Rational.valueOf("0"), Rational.valueOf("2"), Rational.valueOf("0")}, { Rational.valueOf("9"), Rational.valueOf("-2"), Rational.valueOf("-1"), Rational.valueOf("-1"), Rational.valueOf("-1"), Rational.valueOf("-3")} }; VPolygon result = lrs.run(new HPolygon(matrix, true)); assertEquals(9, result.vertices.size()); assertEquals(6, result.vertices.get(0).length); assertEquals(Rational.ONE, result.vertices.get(0)[0]); assertEquals(6, result.vertices.get(1).length); assertEquals(Rational.ONE, result.vertices.get(1)[0]); assertEquals(Rational.valueOf("9/2"), result.vertices.get(1)[1]); assertEquals(6, result.vertices.get(2).length); assertEquals(Rational.ONE, result.vertices.get(2)[0]); assertEquals(Rational.valueOf("3"), result.vertices.get(2)[2]); assertEquals(6, result.vertices.get(3).length); assertEquals(Rational.ONE, result.vertices.get(3)[0]); assertEquals(Rational.valueOf("3"), result.vertices.get(3)[3]); assertEquals(6, result.vertices.get(4).length); assertEquals(Rational.ONE, result.vertices.get(4)[0]); assertEquals(Rational.valueOf("9/2"), result.vertices.get(4)[4]); assertEquals(6, result.vertices.get(5).length); assertEquals(Rational.ONE, result.vertices.get(5)[0]); assertEquals(Rational.valueOf("3"), result.vertices.get(5)[5]); assertEquals(6, result.vertices.get(6).length); assertEquals(Rational.ONE, result.vertices.get(6)[0]); assertEquals(6, result.vertices.get(7).length); assertEquals(Rational.ONE, result.vertices.get(7)[0]); assertEquals(6, result.vertices.get(8).length); assertEquals(Rational.ONE, result.vertices.get(8)[0]); } @Test public void testH2VIn1() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] ine = convert(new String[]{ "1 -299 -534 815 807 ", "1 -887 -399 -867 -543", "1 683 632 958 -181 ", "1 -756 681 -658 470 ", "1 -99 135 -921 -825 ", "1 -795 -874 -286 732 ", "1 43 -567 588 -143 ", "1 -955 414 -159 -378 ", "1 -235 -695 947 166 ", "1 957 853 -194 -258 ", "1 487 -914 -100 -991 ", "1 -515 -786 -169 200 ", "1 954 -758 -178 985 ", "1 505 -970 400 -211 ", "1 714 997 401 661 ", "1 -475 618 459 775 ", "1 -219 704 -111 -876 ", "1 152 -390 -629 984 ", "1 -240 -621 -62 583 ", "1 -76 531 -606 -676 ", "1 490 -519 -240 -109 ", "1 -635 860 -798 825", "1 5 49 781 895 ", "1 495 490 -774 866 ", "1 -78 69 853 861 ", "1 -340 228 -374 498 ", "1 390 -12 -524 -408 ", "1 -382 -42 -376 264 ", "1 -299 -731 -283 -518", "1 892 -581 654 -439" }); Rational[][] ext = convert(new String[] { "1 0 0 0 0 ", "1 1/955 0 0 0 ", "1 271/249421 68/748263 0 0 ", "1 59/57246 0 17/171738 0 ", "1 55/61093 0 0 68/183279 ", "1 0 1/970 0 0 ", "1 12/151565 65/60626 0 0 ", "1 25/24107 92/458033 0 0 ", "1 0 5/4626 7/57825 0 ", "1 0 93/87002 10/43501 0 ", "1 0 581/643644 25/33876 0 ", "1 0 1238213/1283193192 869425/1283193192 32555/641596596 ", "1 1198/73156715 159413/146313430 8884/73156715 0 ", "1 0 195/192104 0 7/96052 ", "1 2902/21603603 24547/22632346 0 17768/237639633 ", "1 296389/740569351 747892/740569351 0 203166/740569351 ", "1 161611/345428747 297774/345428747 0 153348/345428747 ", "1 411425/798221083 747400/798221083 0 248756/798221083 ", "1 49142617/153482777591 150444025/153482777591 34472131/153482777591 36793320/153482777591 ", "1 0 0 1/921 0 ", "1 9/121849 0 394/365547 0 ", "1 0 3/26918 89/80754 0 ", "1 0 0 0 1/991 ", "1 115/643641 0 0 706/643641 ", "1 111/219365 0 0 668/658095 ", "1 51203/127946617 158278/1663306021 0 1859542/1663306021 ", "1 30863/175970379 0 5534/58656793 191060/175970379 ", "1 12843/34016723 0 12338/102050169 2700/2616671 ", "1 5497187/15716902603 15227692/204319733839 3255890/47150707809 677477584/612959201517 ", "1 0 0 166/830211 821/830211 ", "1 0 40081/106097082 1643/2720438 31814/53048541" }); Integer[][] cobasisArr = new Integer[][] { {31, 32, 33, 34}, {8, 32, 33, 34}, {2, 8, 33, 34}, {2, 8, 32, 34}, {2, 8, 32, 33}, {14, 31, 33, 34}, {6, 14, 33, 34}, {2, 6, 33, 34}, {11, 14, 31, 34}, {6, 11, 31, 34}, {2, 6, 31, 34}, {2, 6, 11, 31}, {6, 11, 14, 34}, {11, 14, 31, 33}, {6, 11, 14, 33}, {6, 11, 29, 33}, {2, 11, 29, 33}, {2, 6, 29, 33}, {2, 6, 11, 29}, {5, 31, 32, 34}, {2, 5, 32, 34}, {2, 5, 31, 34}, {11, 31, 32, 33}, {11, 17, 32, 33}, {2, 17, 32, 33}, {2, 11, 17, 33}, {5, 11, 17, 32}, {2, 5, 17, 32}, {2, 5, 11, 17}, {5, 11, 31, 32}, {2, 5, 11, 31} }; VPolygon result = lrs.run(new HPolygon(ine, true)); assertEquals(ext.length, result.vertices.size()); for (int i = 0; i < ext.length; ++i) { assertEquals(ext[i].length, result.vertices.get(i).length); for (int j = 0; j < ext[i].length; ++j) { assertEquals(ext[i][j], result.vertices.get(i)[j]); } } assertEquals(cobasisArr.length, result.cobasis.size()); for (int i = 0; i < cobasisArr.length; ++i) { assertEquals("r" + i, cobasisArr[i].length, result.cobasis.get(i).length); for (int j = 0; j < cobasisArr[i].length; ++j) { assertEquals("r" + i + " c" + j, cobasisArr[i][j], result.cobasis.get(i)[j]); } } } @Test public void testH2VIn2() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] ine = convert(new String[] { "1 -1 0 -1 0 0", "1 -1 0 0 0 -1", "1 0 -1 -1 0 0", "1 0 -1 0 -1 0", "1 0 0 0 -1 -1", "0 -1 1 0 0 1", "0 1 -1 0 1 0", "0 0 0 -1 1 1", "0 0 1 1 -1 0", "0 1 0 1 0 -1", "2 -1 -1 -1 -1 -1" }); Rational[][] ext = convert(new String[] { "1 0 0 0 0 0", "1 1 1 0 0 0", "1 1/2 0 1/2 0 1/2", "1 0 1/2 1/2 1/2 0", "1 1/2 1/2 0 1/2 0", "1 3/4 1/2 0 1/2 1/4", "1 1/2 0 1/2 1/2 1/2", "1 0 1/2 0 1/2 0", "1 0 0 1 1 0", "1 1/2 0 0 0 1/2", "1 1/2 1/2 0 0 1/2", "1 1/2 3/4 0 1/4 1/2", "1 0 1/2 1/2 1/2 1/2", "1 0 0 1 0 1", "1 1/2 1/2 0 1/2 1/2", "1 0 0 1/2 1/2 1/2", "1 1/3 0 1/3 1/3 2/3", "1 0 1/3 1/3 2/3 1/3" }); VPolygon result = lrs.run(new HPolygon(ine, true)); assertEquals(ext.length, result.vertices.size()); for (int i = 0; i < ext.length; ++i) { assertEquals(ext[i].length, result.vertices.get(i).length); for (int j = 0; j < ext[i].length; ++j) { assertEquals(ext[i][j], result.vertices.get(i)[j]); } } } @Test public void testH2VIn3() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] ine = convert(new String[] { "0 1 -1 0 1 0 0", "0 0 -1 1 0 0 1 ", "0 -1 1 0 1 0 0", "0 -1 0 1 0 1 0 ", "0 0 1 -1 0 0 1", "0 1 1 0 -1 0 0 ", "0 0 0 0 -1 1 1 ", "0 1 0 1 0 -1 0 ", "0 0 0 0 1 -1 1 ", "0 0 1 1 0 0 -1 ", "0 0 0 0 1 1 -1 ", "0 1 0 -1 0 1 0 ", "12 -1 -1 -1 -1 -1 -1" }); Rational[][] ext = convert(new String[] { "1 0 0 4 0 4 4", "1 0 4 0 4 0 4 ", "1 3 0 3 3 0 3 ", "1 4 4 4 0 0 0 ", "1 0 3 3 3 3 0 ", "1 4 0 0 4 4 0 ", "1 3 3 0 0 3 3 ", "1 0 0 0 0 0 0" }); Integer[][] cobasisArr = new Integer[][] { {8, 9, 10, 11, 12, 13, 1, 3, 5, 6}, {7, 8, 10, 11, 12, 13, 1, 2, 4, 6}, {5, 7, 10, 11, 12, 13, 3, 4, 6}, {5, 7, 9, 11, 12, 13, 1, 2, 3, 4}, {6, 7, 8, 9, 12, 13, 1, 2, 5}, {6, 7, 8, 9, 10, 13, 2, 3, 4, 5}, {4, 8, 9, 10, 11, 13, 1, 2, 3}, {7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6} }; VPolygon result = lrs.run(new HPolygon(ine, false)); checkResults(result, ext, cobasisArr); } @Test public void testH2VIn4() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] ine = convert(new String[] { "10 -8 -1 -2 -3 -3 -2 -2", "10 8 -2 -2 0 0 2 0", "10 -11 3 -2 -1 -1 -1 -3", "5 23 -4 -2 -3 0 0 1", "27 5 -4 -1 3 9 11 -12" }); Rational[][] ext = convert(new String[] { "1 0 0 0 0 0 0 0 ", "1 10/11 0 0 0 0 0 0 ", "1 8/7 6/7 0 0 0 0 0 ", "1 4/5 0 0 6/5 0 0 0 ", "1 4/5 0 0 0 6/5 0 0 ", "1 5/7 0 0 0 0 15/7 0 ", "1 0 5/4 0 0 0 0 0 ", "1 7/11 54/11 0 0 0 0 0 ", "1 0 5/4 0 0 35/12 0 0 ", "1 0 5/4 0 0 0 35/8 0 ", "1 0 0 5/2 0 0 0 0 ", "1 5/34 0 285/68 0 0 0 0 ", "1 4/23 3/23 195/46 0 0 0 0 ", "1 5/31 0 495/124 15/62 0 0 0 ", "1 10/71 0 585/142 0 15/71 0 0 ", "1 5/37 0 150/37 0 0 15/37 0 ", "1 0 0 5/2 0 5/3 0 0 ", "1 0 0 5/2 0 0 5/2 0 ", "1 0 0 25/8 0 0 0 5/4 ", "1 0 0 25/12 5/6 0 0 5/3 ", "1 0 0 55/18 0 5/9 0 10/9 ", "1 0 0 3 0 0 1 1 ", "1 0 0 0 5/3 0 0 0 ", "1 5/31 0 0 90/31 0 0 0 ", "1 0 0 0 5/3 5/3 0 0 ", "1 0 0 0 5/3 0 5/2 0 ", "1 0 0 0 20/9 0 0 5/3 ", "1 0 0 0 0 10/3 0 0 ", "1 0 0 0 0 0 5 0 ", "1 0 0 0 0 0 0 9/4 ", "1 13/49 0 0 0 0 0 347/147 ", "1 277/473 464/473 0 0 0 0 1025/473 ", "1 3/47 0 0 464/329 0 0 865/329 ", "1 0 87/52 0 0 0 0 22/13 ", "1 257/553 2314/553 0 0 0 0 580/553 ", "1 0 71/191 517/191 0 0 0 363/191 ", "1 79/2846 694/1423 7905/2846 0 0 0 5315/2846 ", "1 0 89/255 598/255 79/255 0 0 514/255 ", "1 0 281/648 1699/648 0 79/648 0 641/324 ", "1 0 230/493 1272/493 0 0 79/493 999/493 ", "1 0 41/57 0 257/171 0 0 136/57 ", "1 0 147/79 0 0 257/237 0 193/79 ", "1 0 394/203 0 0 0 257/203 561/203 ", "1 0 0 13/7 0 0 0 44/21 ", "1 0 0 3/5 44/35 0 0 88/35 ", "1 0 0 0 11/7 0 0 37/14 ", "1 0 0 0 0 1 0 3", "1 0 0 0 0 10/7 0 20/7 ", "1 0 39/229 0 0 277/229 0 710/229", "1 0 0 0 13/14 1/2 0 20/7 ", "1 0 0 0 0 0 13/15 137/45 ", "1 0 0 0 0 0 5/2 5/2 ", "1 0 98/199 0 0 0 277/199 669/199", "1 0 0 0 14/11 0 3/11 31/11 " }); VPolygon result = lrs.run(new HPolygon(ine, true)); checkResults(result, ext, null); } @Test public void testH2VIn5() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] ine = convert(new String[] { "10 2 3 -8 -1 -2 -3 -3 -2 -2", "10 -6 33 8 -2 -2 0 0 2 0 ", "10 93 3 -11 3 -2 -1 -1 -1 -3", "5 -9 21 23 -4 -2 -3 0 0 1 ", "27 31 23 5 -4 -1 3 9 11 -12" }); Rational[][] ext = convert(new String[] { "1 0 0 0 0 0 0 0 0 0", "0 0 1 0 0 0 0 0 0 0", "1 5/9 0 0 0 0 0 0 0 0", "0 7 3 0 0 0 0 0 0 0", "1 95/33 0 10/11 0 0 0 0 0 0", "0 197 22 57 0 0 0 0 0 0", "1 5 0 5/2 0 0 0 0 0 0", "0 72 8 21 0 0 0 0 0 0", "1 145/71 0 90/71 280/71 0 0 0 0 0", "0 1269 142 369 12 0 0 0 0 0", "1 10/9 0 5/9 0 35/9 0 0 0 0", "0 107 12 31 0 1 0 0 0 0", "1 25/7 0 10/7 0 0 40/21 0 0 0", "0 879 98 255 0 0 4 0 0 0", "1 95/33 0 10/11 0 0 0 280/99 0 0", "0 591 66 171 0 0 0 4 0 0", "1 5 0 40/23 0 0 0 0 70/23 0", "0 414 46 120 0 0 0 0 3 0", "1 11/5 0 2/5 0 0 0 0 0 28/5", "0 447 50 129 0 0 0 0 0 6", "1 5/9 0 0 0 0 0 100/27 0 0", "0 21 9 0 0 0 0 23 0 0", "1 5/9 0 0 0 0 0 0 50/9 0", "0 14 6 0 0 0 0 0 23 0", "1 0 0 10/11 0 0 0 0 0 0", "0 0 11 3 0 0 0 0 0 0", "1 15/361 0 455/361 0 0 0 0 0 0", "0 9 722 273 0 0 0 0 0 0", "1 0 0 8/7 6/7 0 0 0 0 0", "0 0 35 12 9 0 0 0 0 0", "1 0 0 4/5 0 0 6/5 0 0 0", "0 0 25 6 0 0 9 0 0 0", "1 0 0 4/5 0 0 0 6/5 0 0", "0 0 25 6 0 0 0 9 0 0", "1 0 0 5/7 0 0 0 0 15/7 0", "0 0 14 3 0 0 0 0 9 0", "1 0 0 0 5/4 0 0 0 0 0", "1 0 35/9 0 65/3 0 0 0 0 0", "0 9 17 0 69 0 0 0 0 0", "0 0 1 0 3 0 0 0 0 0", "1 0 0 7/11 54/11 0 0 0 0 0", "1 0 0 0 5/4 0 0 35/12 0 0", "1 0 0 0 5/4 0 0 0 35/8 0", "1 0 0 0 0 5/2 0 0 0 0", "1 0 5/18 0 0 65/12 0 0 0 0", "0 0 2 0 0 3 0 0 0 0", "0 36 22 0 0 69 0 0 0 0", "1 0 0 5/34 0 285/68 0 0 0 0", "1 15/2788 0 455/2788 0 12135/2788 0 0 0 0", "1 0 0 4/23 3/23 195/46 0 0 0 0", "1 0 0 5/31 0 495/124 15/62 0 0 0", "1 0 0 10/71 0 585/142 0 15/71 0 0", "1 0 0 5/37 0 150/37 0 0 15/37 0", "1 0 0 0 0 5/2 0 5/3 0 0", "1 0 0 0 0 5/2 0 0 5/2 0", "1 0 0 0 0 25/8 0 0 0 5/4", "1 5/262 0 0 0 430/131 0 0 0 455/262", "1 0 0 0 0 25/12 5/6 0 0 5/3", "1 0 0 0 0 55/18 0 5/9 0 10/9", "1 0 0 0 0 3 0 0 1 1", "1 0 0 0 0 0 5/3 0 0 0", "1 0 5/18 0 0 0 65/18 0 0 0", "0 18 11 0 0 0 23 0 0 0", "0 0 1 0 0 0 1 0 0 0", "1 0 0 5/31 0 0 90/31 0 0 0", "1 0 0 0 0 0 5/3 5/3 0 0", "1 0 0 0 0 0 5/3 0 5/2 0", "1 0 0 0 0 0 20/9 0 0 5/3", "1 0 0 0 0 0 0 10/3 0 0", "0 0 1 0 0 0 0 1 0 0", "1 0 0 0 0 0 0 0 5 0", "0 0 2 0 0 0 0 0 3 0", "1 0 0 0 0 0 0 0 0 9/4", "1 87/77 0 0 0 0 0 0 0 398/77", "1 317/187 148/935 0 0 0 0 0 0 6482/935", "0 45 16 0 0 0 0 0 0 69", "1 1157/785 0 74/785 0 0 0 0 0 4786/785", "1 147/125 0 0 0 0 0 148/375 0 698/125", "1 197/165 0 0 0 0 0 0 74/165 316/55", "1 0 13/11 0 0 0 0 0 0 149/33", "0 0 1 0 0 0 0 0 0 1", "1 149/957 5750/957 0 0 0 0 0 0 13559/957", "0 1 60 0 0 0 0 0 0 91", "1 0 277/51 0 149/51 0 0 0 0 596/51", "0 0 3 0 1 0 0 0 0 4", "1 0 0 13/49 0 0 0 0 0 347/147", "1 232/4751 0 2875/4751 0 0 0 0 0 12487/4751", "1 0 0 277/473 464/473 0 0 0 0 1025/473", "1 0 0 3/47 0 0 464/329 0 0 865/329", "1 0 0 0 87/52 0 0 0 0 22/13", "1 0 257/135 0 317/27 0 0 0 0 268/135", "1 0 0 257/553 2314/553 0 0 0 0 580/553", "1 0 0 0 71/191 517/191 0 0 0 363/191", "1 79/7412 0 0 909/3706 21769/7412 0 0 0 14461/7412", "1 0 79/2097 0 1007/2097 2024/699 0 0 0 4028/2097", "1 0 0 79/2846 694/1423 7905/2846 0 0 0 5315/2846", "1 0 0 0 89/255 598/255 79/255 0 0 514/255", "1 0 0 0 281/648 1699/648 0 79/648 0 641/324", "1 0 0 0 230/493 1272/493 0 0 79/493 999/493", "1 0 0 0 41/57 0 257/171 0 0 136/57", "1 0 0 0 147/79 0 0 257/237 0 193/79", "1 0 0 0 394/203 0 0 0 257/203 561/203", "1 0 0 0 0 13/7 0 0 0 44/21", "1 22/971 0 0 0 2875/971 0 0 0 2002/971", "1 11/31 0 0 0 74/31 0 0 0 92/31", "1 0 0 0 0 3/5 44/35 0 0 88/35", "1 0 0 0 0 0 11/7 0 0 37/14", "1 41/55 0 0 0 0 148/165 0 0 22/5", "1 0 3/14 0 0 0 149/98 0 0 149/49", "0 0 7 0 0 0 3 0 0 6", "1 0 0 0 0 0 0 1 0 3", "1 0 0 0 0 0 0 10/7 0 20/7", "0 0 7 0 0 0 0 3 0 6", "1 39/4727 0 0 0 0 0 5750/4727 0 15049/4727", "1 0 0 0 39/229 0 0 277/229 0 710/229", "1 0 0 0 0 0 13/14 1/2 0 20/7", "1 0 0 0 0 0 0 0 13/15 137/45", "1 0 0 0 0 0 0 0 5/2 5/2", "0 0 4 0 0 0 0 0 3 3", "1 49/2032 0 0 0 0 0 0 2875/2032 3667/1016", "1 0 0 0 98/199 0 0 0 277/199 669/199", "1 0 0 0 0 0 14/11 0 3/11 31/11" }); VPolygon result = lrs.run(new HPolygon(ine, true)); checkResults(result, ext, null); } @Test public void testH2VIn6() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] ine = convert(new String[] { "1 1 1 1 1 1 1 1 1 1 0 ", "2 -2 -3 8 1 2 3 3 2 2 -9 ", "3 6 -3 -8 2 2 0 0 -2 0 -9 ", "4 -9 -3 1 -3 2 1 1 1 3 -9 ", "5 9 -2 -2 4 2 3 0 0 -1 -5 ", "6 -3 -2 -5 4 1 -3 -9 -1 2 -7 ", "7 -9 -3 -5 -2 2 4 -2 4 -1 -7 ", "8 -8 -4 5 -2 2 4 -2 4 -1 -7 ", "9 -7 -5 -5 -2 2 4 -2 4 -1 -7 ", "10 -6 -6 5 -2 2 4 -2 4 -1 -7 ", "11 -5 -7 -5 -2 2 4 -2 4 -1 -7", "12 -4 -8 5 -2 2 4 -2 4 -1 -7 ", "13 -3 -9 -5 -2 2 4 -2 4 -1 -7" }); Rational[][] ext = convert(new String[] { "1 0 0 0 0 0 0 0 0 0 0", "0 0 0 0 0 1 0 0 0 0 0", "1 4/9 0 0 0 0 0 0 0 0 0", "0 2 0 0 0 9 0 0 0 0 0", "1 2/7 10/21 0 0 0 0 0 0 0 0", "1 25/168 235/252 23/168 0 0 0 0 0 0 0", "1 25/168 127/84 23/168 0 73/84 0 0 0 0 0", "1 11/30 41/30 1/2 0 29/20 0 0 0 0 0", "0 1 1 0 0 6 0 0 0 0 0", "1 32/69 101/69 68/69 0 224/69 0 0 0 0 0", "0 5 5 2 0 35 0 0 0 0 0", "0 10 10 142 69 484 0 0 0 0 0", "0 10 10 73 0 277 0 0 0 69 0", "1 154/353 507/353 210/353 0 609/353 67/353 0 0 0 0", "0 25 25 2 0 147 4 0 0 0 0", "0 40 40 568 1059 1153 783 0 0 0 0", "1 116/225 341/225 146/225 0 53/25 0 0 67/225 0 0", "0 17 17 2 0 99 0 0 4 0 0", "0 26 26 56 75 197 0 0 87 0 0", "1 313/744 1057/744 439/744 0 2191/744 0 0 0 0 67/248", "0 13 13 1 0 91 0 0 0 0 3", "1 25/168 311/168 23/168 0 143/24 0 0 0 0 57/56", "1 265/648 913/648 55/648 0 4687/648 0 0 0 118/81 1081/648", "1 4/37 45/37 0 0 0 23/37 0 0 0 0", "1 7/36 26/27 0 0 0 0 0 23/36 0 0", "1 35/48 1/4 0 0 0 0 0 53/16 0 0", "1 1/2 0 1/2 0 0 0 0 0 0 0", "0 2 0 0 0 9 0 0 0 0 0", "1 41/102 0 23/34 0 0 0 0 0 0 0", "1 35/66 0 29/22 0 24/11 0 0 0 0 0", "0 5 0 3 0 30 0 0 0 0 0", "0 5 0 69 33 228 0 0 0 0 0", "0 5 0 36 0 129 0 0 0 33 0", "1 85/174 0 43/58 0 0 8/29 0 0 0 0", "0 20 0 15 0 0 129 0 0 261 0", "1 5/9 0 2/3 0 0 1/3 0 0 0 0", "0 25 0 3 0 108 6 0 0 0 0", "1 77/162 2/9 35/54 0 0 8/27 0 0 0 0", "1 175/354 0 97/118 18/59 0 32/59 0 0 0 0", "0 20 0 276 513 531 381 0 0 0 0", "0 55 0 228 747 0 915 0 0 531 0", "1 31/54 0 13/18 0 0 1/9 0 1/3 0 0", "1 7/162 0 11/27 0 0 0 0 0 247/54 0", "0 4 0 3 0 0 81 0 0 273 0", "1 11/30 2/5 1/2 0 0 0 0 0 0 0", "1 40/159 569/477 37/318 0 0 0 0 0 61/106 0", "1 4/17 21/17 3/34 0 0 0 0 0 25/34 0", "1 8/161 169/161 3/161 0 0 0 0 0 533/161 0", "0 8 8 3 0 0 161 0 0 533 0", "1 52/199 251/199 39/398 0 0 14/199 0 0 261/398 0", "1 728/1471 2199/1471 273/1471 0 0 1511/1471 0 0 1827/1471 0", "0 110 110 409 1471 0 1865 0 0 1153 0", "0 40 40 15 0 0 277 0 0 553 0", "1 4/13 17/13 5/78 0 0 0 0 8/39 21/26 0", "1 12/53 65/53 11/106 4/53 0 0 0 0 65/106 0", "1 40/159 199/159 37/318 0 14/159 0 0 0 61/106 0", "1 31/60 0 7/20 0 0 0 3/10 0 0 0", "1 101/270 0 59/90 0 0 0 8/45 0 0 0", "1 215/678 66/113 89/226 0 0 0 24/113 0 0 0", "1 547/4342 2370/2171 261/4342 0 0 0 757/2171 0 0 0", "1 117/920 643/460 59/920 0 217/460 0 38/115 0 0 0", "1 138/419 557/419 176/419 0 497/419 0 67/419 0 0 0", "1 2273/12680 7881/6340 549/12680 0 0 0 1189/3170 0 1953/6340 0", "1 44/191 235/191 33/382 0 0 0 28/191 0 195/382 0", "1 872/4153 5025/4153 327/4153 0 0 0 1511/4153 0 1491/4153 0", "1 558/2459 3017/2459 7/2459 0 0 0 1017/2459 0 1071/2459 0", "1 4907/24592 29499/24592 465/12296 0 0 0 4687/12296 0 10423/24592 809/24592", "1 131/228 0 53/76 0 0 0 3/76 33/76 0 0", "1 17/30 0 7/10 0 0 0 0 2/5 0 0", "1 2/3 0 1/2 0 0 0 0 3/2 0 0", "1 131/210 0 53/70 0 6/35 0 0 18/35 0 0", "0 39 0 81 105 229 0 0 127 0 0", "0 17 0 3 0 72 0 0 6 0 0", "1 199/258 0 61/86 0 0 0 0 42/43 18/43 0", "0 1 0 0 0 0 0 0 3 3 0", "0 290 0 21 129 0 0 0 915 687 0", "1 367/942 0 169/314 0 0 0 0 0 0 18/157", "1 331/726 0 157/242 0 210/121 0 0 0 0 54/121", "0 26 0 3 0 156 0 0 0 0 9", "1 25/168 0 23/168 0 509/105 0 0 0 0 583/420", "1 280/633 0 33/422 0 2779/422 0 0 0 2081/1266 1280/633", "1 188/393 0 86/131 0 0 35/131 0 0 0 9/131", "1 457/1272 0 199/424 0 0 0 35/212 0 0 33/212", "1 1932/7901 0 282/7901 0 0 0 2779/7901 0 5254/7901 3671/7901", "1 385/1317 0 95/878 0 0 0 0 0 2117/2634 569/1317", "1 3/5 0 0 0 0 7/5 0 0 0 0", "0 7 0 0 0 30 3 0 0 0 0", "1 7/52 33/26 0 0 0 53/52 0 0 0 0", "1 5/6 0 0 0 0 0 0 7/2 0 0", "0 1 0 0 0 4 0 0 1 0 0", "1 3/4 0 0 0 0 0 0 15/4 0 0", "0 0 0 0 0 1 0 0 1 0 0", "0 1 0 0 0 0 0 0 3 3 0", "1 17/20 0 0 1/5 0 0 0 17/4 0 0", "0 3 0 0 6 10 0 0 25 0 0", "0 13 0 0 6 0 0 0 45 30 0", "1 25/36 0 0 0 0 0 0 0 3/4 0", "0 2 0 0 0 9 0 0 0 0 0", "1 1/9 0 0 0 0 0 0 0 6 0", "0 0 0 0 0 1 0 0 0 2 0", "0 1 0 0 0 0 18 0 0 63 0", "1 4/3 0 0 0 0 0 0 11/2 17 0", "0 1 0 0 0 0 0 0 3 3 0", "0 2 0 0 0 3 0 0 9 24 0", "0 1 0 0 0 0 6 0 3 27 0", "1 11/28 19/21 0 0 0 0 0 0 3/4 0", "1 275/111 61/37 0 0 0 0 0 239/37 207/37 0", "0 293 42 0 111 0 0 0 927 723 0", "1 45/31 0 0 0 0 65/31 0 0 72/31 0", "0 5 0 0 0 0 21 0 0 39 0", "0 15 0 0 31 0 63 0 0 55 0", "0 25 0 0 0 93 12 0 0 9 0", "1 75/121 0 0 0 0 0 65/121 0 42/121 0", "1 209/911 1113/911 0 0 0 0 379/911 0 399/911 0", "1 230/841 0 0 0 0 0 323/841 0 574/841 371/841", "1 286/1273 0 0 0 0 0 503/1273 0 54/67 615/1273", "1 472/2399 0 0 282/2399 0 0 1027/2399 0 1688/2399 1177/2399", "1 18/65 0 0 0 0 94/585 37/117 0 58/65 101/195", "1 1202/4257 0 0 0 0 0 509/1419 188/1419 3518/4257 2095/4257", "1 85/21 0 0 0 0 0 0 65/7 54/7 0", "0 1 0 0 0 0 0 0 3 3 0", "0 3 0 0 1 0 0 0 9 7 0", "0 3 0 0 0 7 0 0 4 3 0", "1 5/12 0 0 0 0 0 0 0 11/12 1/3", "1 25/106 0 0 0 0 0 0 0 153/106 26/53", "1 2/29 0 0 0 0 0 0 0 108/29 11/29", "0 3 0 0 0 0 58 0 0 191 2", "1 40/447 0 0 95/149 0 0 0 0 526/447 239/447", "1 67/120 0 0 0 323/40 0 0 0 229/120 139/60", "0 3 0 0 0 21 0 0 0 1 2", "1 79/174 0 0 0 503/58 0 0 0 403/174 223/87", "0 1 0 0 0 105 0 0 0 33 24", "1 122/285 0 0 33/95 1027/95 0 0 0 136/57 883/285", "1 17/47 0 0 0 0 19/47 0 0 63/47 27/47", "1 94/175 0 0 0 0 29/25 0 0 344/175 121/175", "0 3 0 0 0 0 21 0 0 43 2", "0 53 0 0 525 0 861 0 0 853 152", "1 7/15 0 0 0 37/7 11/35 0 0 199/105 191/105", "1 565/1362 0 0 0 0 0 0 95/227 1801/1362 352/681", "1 242/105 0 0 0 0 0 0 29/5 566/105 61/105", "0 39 0 0 15 0 0 0 123 97 2", "1 119/222 0 0 0 509/74 0 0 11/37 455/222 239/111", "1 0 2/3 0 0 0 0 0 0 0 0", "1 0 5/6 0 1/2 0 0 0 0 0 0", "1 0 215/213 6/71 25/71 0 0 0 0 0 0", "1 0 314/213 6/71 25/71 99/142 0 0 0 0 0", "1 0 1 16/21 11/7 31/21 0 0 0 0 0", "0 0 0 2 12 17 0 0 0 0 0", "0 0 0 4 3 13 0 0 0 0 0", "0 0 0 16 33 31 21 0 0 0 0", "0 0 0 6 15 16 0 0 7 0 0", "1 0 1 172/17 313/17 1878/17 0 0 0 0 334/17", "0 0 0 27 52 312 0 0 0 0 55", "0 0 0 8 11 66 0 0 0 0 10", "0 0 0 32 61 247 17 0 0 0 40", "0 0 0 126 237 1337 0 0 17 0 234", "1 0 139/111 3/74 20/37 0 0 0 0 33/74 0", "1 0 1 13/50 26/25 0 0 0 0 31/50 0", "0 0 0 13 52 0 50 0 0 31 0", "0 0 0 2 33 0 0 0 25 24 0", "1 0 1 1/27 4/27 0 0 0 0 95/27 0", "0 0 0 1 4 0 27 0 0 95 0", "1 0 19/12 0 1/2 9/8 0 0 0 0 0", "0 0 2 0 12 21 0 0 0 0 0", "1 0 37/21 0 2/7 6/7 3/7 0 0 0 0", "1 0 89/51 0 7/17 18/17 0 0 6/17 0 0", "0 0 6 0 6 13 0 0 10 0 0", "1 0 25/21 0 2/7 0 3/7 0 0 0 0", "1 0 25/21 0 2/7 0 0 3/7 0 0 0", "1 0 53/42 0 11/28 0 0 9/28 0 3/14 0", "1 0 1149/931 0 327/931 0 0 524/931 0 60/931 0", "0 0 34 0 982 0 0 449 931 556 0", "1 0 1 0 109/117 0 0 12/13 0 34/117 0", "0 0 0 0 16 0 13 5 0 10 0", "0 0 0 0 134 0 0 63 117 74 0", "1 0 1 109/575 436/575 0 0 81/115 0 73/575 0", "0 0 0 144 576 0 575 55 0 318 0", "0 0 0 17 643 0 0 290 575 349 0", "1 0 1 0 327/541 0 0 382/541 0 712/1623 218/1623", "0 0 0 0 432 0 541 53 0 522 96", "0 0 0 0 1776 0 0 819 1623 1064 34", "1 0 53/51 0 7/17 0 0 0 6/17 0 0", "1 0 11/6 0 0 7/4 0 0 0 0 0", "0 0 2 0 0 9 0 0 0 0 0", "1 2/7 25/14 0 0 55/28 0 0 0 0 0", "0 1 1 0 0 6 0 0 0 0 0", "1 7/36 145/72 0 0 227/144 0 0 23/36 0 0", "1 46/93 95/31 0 0 349/93 0 0 199/93 0 0", "0 30 198 0 93 419 0 0 305 0 0", "0 7 9 0 0 43 0 0 4 0 0", "1 7/36 295/128 0 0 6841/1152 0 0 23/36 0 335/384", "1 2/7 499/224 0 0 275/32 0 0 0 0 297/224", "0 8 9 0 0 63 0 0 0 0 3", "1 0 23/12 0 0 13/8 0 0 1/4 0 0", "1 0 9 0 0 58/3 0 0 22/3 0 0", "0 0 18 0 3 44 0 0 20 0 0", "0 0 0 0 0 1 0 0 1 0 0", "0 0 6 0 0 17 0 0 5 0 0", "0 0 24 0 0 61 0 0 25 6 0", "1 0 151/64 0 0 529/64 0 0 1/4 0 85/64", "1 0 40/17 0 7/17 173/17 0 0 6/17 0 31/17", "0 0 63 0 48 329 0 0 80 0 45", "1 0 75/32 0 0 301/32 0 0 0 0 49/32", "0 0 7 0 0 49 0 0 0 0 5", "1 0 149/64 0 1/2 787/64 0 0 0 0 143/64", "0 0 27 0 32 381 0 0 0 0 65", "1 0 227/112 0 5/7 1573/112 0 0 0 6/7 47/16", "1 0 139/64 0 0 621/64 0 0 0 1/2 113/64", "0 0 3 0 0 117 0 0 0 32 25", "1 0 1 0 0 0 1/3 0 0 0 0", "1 0 17/9 0 0 4/3 1/3 0 0 0 0", "1 0 12/5 0 0 21/10 11/10 0 0 0 0", "0 0 2 0 0 7 1 0 0 0 0", "0 0 2 0 0 3 5 0 0 8 0", "1 0 12/5 0 21/40 63/40 13/8 0 0 0 0", "0 0 8 32 69 71 57 0 0 0 0", "0 0 8 0 9 19 13 0 0 0 0", "0 0 72 0 57 131 45 0 80 0 0", "1 0 121/56 0 2/7 383/56 3/7 0 0 0 67/56", "1 0 53/24 0 0 49/8 1/3 0 0 0 23/24", "1 4/37 71/37 0 0 39/37 23/37 0 0 0 0", "1 28/221 27/13 0 0 21/17 199/221 0 0 0 0", "0 15 17 0 0 91 4 0 0 0 0", "1 4/37 303/148 0 0 441/148 23/37 0 0 0 57/148", "1 0 1 0 0 0 0 1/3 0 0 0", "1 0 14/9 0 0 5/6 0 1/3 0 0 0", "1 0 81/53 0 0 42/53 0 22/53 0 0 0", "0 0 16 0 0 77 0 5 0 0 0", "1 0 79/48 0 0 35/16 0 1/3 0 0 13/48", "1 0 5/6 0 0 0 0 0 1/4 0 0", "1 0 1 0 0 0 0 0 0 1/2 0", "1 0 1 0 0 0 0 0 0 3 0", "1 7/50 32/25 0 0 0 0 0 0 53/50 0", "1 1/26 14/13 0 0 0 0 0 0 83/26 0", "0 1 2 0 0 0 26 0 0 83 0", "1 7/29 36/29 0 0 0 0 0 0 32/29 0", "1 1/19 20/19 0 0 0 0 0 0 64/19 0", "0 0 0 0 0 1 0 0 0 2 0", "0 1 1 0 0 0 19 0 0 64 0", "1 1/13 14/13 0 0 0 0 0 3/26 46/13 0", "0 4 4 0 0 13 0 0 19 54 0", "0 2 2 0 0 0 26 0 3 92 0", "1 8/39 47/39 0 41/117 0 0 0 0 98/117 0", "1 19/468 487/468 0 53/78 0 0 0 0 469/468 77/468", "1 11/28 39/28 0 0 41/56 0 0 0 3/4 0", "0 1 1 0 0 6 0 0 0 0 0", "1 65/122 187/122 0 0 544/61 0 0 0 211/122 239/122", "0 9 9 0 0 69 0 0 0 2 4", "1 75/178 253/178 0 0 846/89 0 0 0 389/178 401/178", "0 3 3 0 0 324 0 0 0 101 73", "1 115/292 407/292 0 55/146 862/73 0 0 0 661/292 829/292", "1 52/151 203/151 0 0 0 41/151 0 0 144/151 0", "1 91/137 228/137 0 0 0 199/137 0 0 252/137 0", "0 45 45 0 137 0 261 0 0 230 0", "0 25 25 0 0 137 8 0 0 6 0", "0 5 5 0 0 0 29 0 0 56 0", "1 13/14 27/14 0 0 0 29/28 0 39/28 18/7 0", "0 142 142 0 196 0 251 0 409 544 0", "0 10 10 0 0 0 37 0 15 88 0", "1 1/4 3/2 0 0 0 1/2 0 0 3/4 0", "1 7/19 33/19 0 0 0 23/19 0 0 21/19 0", "0 5 10 0 0 0 49 0 0 91 0", "1 39/121 160/121 0 0 0 53/121 0 0 137/121 13/121", "1 91/178 269/178 0 0 0 114/89 0 0 959/534 91/534", "0 159 159 0 1602 0 2640 0 0 2585 409", "0 15 15 0 0 0 108 0 0 217 5", "1 10/23 33/23 0 0 939/161 55/161 0 0 278/161 232/161", "1 39/103 142/103 0 0 0 0 0 41/103 108/103 0", "1 26/57 83/57 0 0 0 0 0 13/19 24/19 0", "0 8 8 0 57 0 0 0 69 66 0", "1 64/31 95/31 0 0 203/93 0 0 491/93 146/31 0", "0 9 9 0 0 41 0 0 8 6 0", "0 198 198 0 93 251 0 0 641 504 0", "0 24 24 0 0 37 0 0 73 78 0", "1 27/74 472/333 0 0 0 0 0 52/111 227/222 0", "1 529/1398 1927/1398 0 0 0 0 0 106/233 1543/1398 35/1398", "1 115/226 341/226 0 0 2576/339 0 0 110/339 1279/678 1211/678", "1 21/110 131/110 0 0 0 0 0 0 139/110 7/110", "1 3/59 62/59 0 0 0 0 0 0 193/59 1/59", "0 3 3 0 0 0 59 0 0 193 1", "1 0 65/51 0 7/17 0 0 0 0 12/17 0", "1 0 17/16 0 3/32 0 0 0 0 13/4 0", "0 0 2 0 3 0 32 0 0 104 0", "1 0 41/33 0 7/11 0 0 0 0 6/11 0", "1 0 1 0 13/9 0 0 0 0 10/9 0", "0 0 0 0 8 9 0 0 0 2 0", "0 0 0 0 13 0 9 0 0 10 0", "0 0 0 0 13 0 0 0 9 10 0", "1 0 1 0 1/6 0 0 0 0 11/3 0", "0 0 0 0 0 1 0 0 0 2 0", "0 0 0 0 1 0 6 0 0 22 0", "1 0 1 0 1/2 0 0 0 1/2 5 0", "0 0 0 0 2 1 0 0 3 10 0", "0 0 0 0 1 0 2 0 1 10 0", "0 0 0 0 1 0 0 0 1 2 0", "1 0 199/147 0 26/49 0 9/49 0 0 24/49 0", "1 0 267/85 0 273/85 0 524/85 0 0 252/85 0", "0 0 22 17 101 0 139 0 0 71 0", "0 0 9 0 22 0 36 0 0 19 0", "0 0 142 0 298 0 449 0 85 262 0", "0 0 2 0 3 0 8 0 0 8 0", "0 0 159 0 621 0 993 0 0 704 85", "1 0 59/45 0 3/5 0 0 0 2/15 8/15 0", "0 0 8 0 99 0 0 0 87 78 0", "1 0 229/210 0 5/7 0 0 0 0 6/7 9/70", "1 0 1 0 39/47 0 0 0 0 148/141 26/141", "0 0 0 0 117 0 141 0 0 148 26", "0 0 0 0 177 0 0 0 141 154 8", "1 0 1 0 9/58 0 0 0 0 100/29 1/29", "0 0 0 0 9 0 58 0 0 200 2", "1 0 1 0 35/3 382/3 0 0 0 172/9 278/9", "0 0 0 0 21 159 9 0 0 32 40", "0 0 0 0 9 91 0 0 1 14 22", "0 0 0 0 3 42 0 0 0 8 10", "0 0 0 0 2 21 0 0 0 3 5", "1 0 19/12 0 0 7/8 0 0 0 1/2 0", "1 0 8/7 0 0 3/14 0 0 0 22/7 0", "0 0 2 0 0 3 14 0 0 44 0", "0 0 4 0 0 13 0 0 7 18 0", "0 0 0 0 0 1 0 0 0 2 0", "1 0 1 1/3 0 4/3 0 0 0 5 0", "0 0 0 1 0 4 0 0 0 3 0", "0 0 0 1 0 4 3 0 0 15 0", "0 0 0 4 0 19 0 0 3 30 0", "0 0 0 0 0 1 0 0 0 2 0", "1 0 1 0 0 9/4 0 0 0 5 1/2", "0 0 0 0 0 9 0 0 0 4 2", "0 0 0 0 0 9 4 0 0 20 2", "0 0 0 0 0 10 0 0 1 10 2", "0 0 0 0 0 1 0 0 0 2 0", "1 0 0 3/8 0 0 0 0 0 0 0", "1 0 5/6 1/16 0 0 0 0 0 0 0", "1 0 163/96 1/16 0 83/64 0 0 0 0 0", "1 0 47/15 44/15 0 224/15 0 0 0 0 0", "0 0 1 1 0 7 0 0 0 0 0", "0 0 2 8 3 32 0 0 0 0 0", "0 0 2 5 0 23 0 0 0 3 0", "1 0 1099/512 1/16 0 4109/512 0 0 0 0 689/512", "1 0 2347/1136 6/71 25/71 10877/1136 0 0 0 0 2017/1136", "1 0 0 10/13 41/26 0 0 0 0 0 0", "0 0 0 4 3 13 0 0 0 0 0", "1 0 0 13/17 27/17 0 0 0 0 0 0", "0 0 0 2 12 17 0 0 0 0 0", "1 0 0 24/31 99/62 0 1/62 0 0 0 0", "0 0 0 16 33 31 21 0 0 0 0", "0 0 0 13 52 0 50 0 0 31 0", "1 0 0 37/48 51/32 0 0 0 1/96 0 0", "0 0 0 6 15 16 0 0 7 0 0", "0 0 0 2 33 0 0 0 25 24 0", "1 0 1/63 16/21 11/7 0 0 0 0 0 0", "1 0 0 90/139 303/278 0 0 110/139 0 0 0", "0 0 0 42 29 139 0 5 0 0 0", "1 0 0 9/101 186/101 0 0 145/101 0 0 0", "1 0 0 99/106 237/106 0 201/212 175/212 0 0 0", "0 0 0 84 177 159 119 10 0 0 0", "0 0 0 144 576 0 575 55 0 318 0", "1 0 0 252/349 786/349 0 0 817/698 603/698 0 0", "0 0 0 126 393 349 0 117 238 0 0", "0 0 0 17 643 0 0 290 575 349 0", "1 0 603/749 216/749 645/749 0 0 76/107 0 0 0", "1 0 0 11/27 7/54 0 0 0 0 127/27 0", "0 0 0 1 4 0 27 0 0 95 0", "1 0 0 9/2 0 33/2 0 0 0 0 0", "0 0 0 1 0 5 0 0 0 0 0", "0 0 0 3 1 11 0 0 0 0 0", "0 0 0 0 0 1 0 0 1 0 0", "0 0 0 2 0 8 0 0 0 1 0", "1 0 0 3/8 0 0 11/8 0 0 0 0", "0 0 0 0 0 0 2 0 0 3 0", "1 0 0 51/44 69/22 0 17/4 0 0 0 0", "0 0 0 6 13 11 11 0 0 0 0", "0 0 0 1 4 0 5 0 0 2 0", "1 0 0 3/8 0 0 0 0 0 17/4 0", "0 0 0 0 0 0 1 0 0 3 0", "1 0 0 2/3 0 7/6 0 0 0 6 0", "0 0 0 0 0 1 0 0 0 2 0", "0 0 0 1 0 4 3 0 0 15 0", "0 0 0 4 0 19 0 0 3 30 0", "0 0 0 1 0 4 0 0 0 3 0", "1 0 0 0 4/3 0 0 0 0 0 0", "0 0 0 0 2 3 0 0 0 0 0", "1 0 0 0 11/4 0 0 0 17/4 0 0", "0 0 0 0 3 2 0 0 5 0 0", "0 0 0 0 3 0 0 0 3 2 0", "1 0 0 0 25/9 0 0 0 0 13/9 0", "0 0 0 0 8 9 0 0 0 2 0", "0 0 0 0 13 0 9 0 0 10 0", "0 0 0 0 13 0 0 0 9 10 0", "1 0 0 0 1/3 0 0 0 0 19/3 0", "0 0 0 0 0 1 0 0 0 2 0", "0 0 0 0 1 0 6 0 0 22 0", "1 0 0 0 4 0 0 0 11/2 21 0", "0 0 0 0 1 0 0 0 1 2 0", "0 0 0 0 2 1 0 0 3 10 0", "0 0 0 0 1 0 2 0 1 10 0", "1 0 0 0 0 0 2 0 0 0 0", "0 0 0 0 0 3 1 0 0 0 0", "0 0 0 0 0 0 2 0 0 3 0", "1 0 1 0 0 0 4/3 0 0 0 0", "0 0 0 0 0 0 2 0 0 3 0", "1 0 51/37 0 21/37 0 68/37 0 0 0 0", "1 0 0 0 18/5 0 34/5 0 0 0 0", "0 0 0 0 7 5 11 0 0 0 0", "0 0 0 0 11 0 18 0 0 5 0", "1 0 0 0 7 0 17/2 0 17/2 0 0", "0 0 0 0 3 1 3 0 4 0 0", "0 0 0 0 11 0 13 0 11 3 0", "1 0 0 0 0 0 3/2 0 3/2 0 0", "0 0 0 0 0 1 0 0 1 0 0", "0 0 0 0 0 0 2 0 0 3 0", "1 0 0 0 0 0 0 2/3 0 0 0", "0 0 0 0 0 9 0 1 0 0 0", "1 1/2 0 0 0 0 0 1/2 0 0 0", "1 38/221 210/221 0 0 0 0 88/221 0 0 0", "1 38/1265 303/253 0 261/1265 0 0 122/253 0 0 0", "1 5/179 237/179 0 531/2506 477/2506 0 1199/2506 0 0 0", "1 31/442 1947/1547 0 549/3094 0 0 1475/3094 0 477/3094 0", "1 128/565 693/565 0 7/1695 0 0 236/565 0 742/1695 0", "1 1129/7484 8613/7484 0 465/3742 0 0 862/1871 0 3551/7484 583/7484", "1 4/37 45/37 0 0 0 29/74 17/74 0 0 0", "1 133/904 249/226 0 0 0 0 77/226 261/904 0 0", "1 11/3 0 0 0 14 0 1 0 0 0", "0 16 0 0 0 75 0 3 0 0 0", "0 26 0 0 0 114 3 3 0 0 0", "0 2 0 0 0 9 0 0 0 0 0", "0 22 0 0 0 96 0 3 3 0 0", "0 53 0 0 0 276 0 6 0 0 9", "1 0 1 0 0 0 0 4/9 0 0 0", "1 1/31 33/31 0 0 0 0 13/31 0 0 0", "1 26/1037 1551/1037 0 0 693/1037 0 415/1037 0 0 0", "1 16/89 133/89 0 0 77/89 0 33/89 0 0 0", "1 6 7 0 0 35 0 1 0 0 0", "0 8 8 0 0 49 0 1 0 0 0", "0 13 13 0 0 77 1 1 0 0 0", "0 1 1 0 0 6 0 0 0 0 0", "0 11 11 0 0 65 0 1 1 0 0", "0 53 53 0 0 343 0 4 0 0 6", "1 4/37 705/407 0 0 315/407 177/407 76/407 0 0 0", "1 166/1093 1815/1093 0 0 939/1093 0 335/1093 354/1093 0 0", "1 79/601 759/601 0 0 0 0 257/601 0 231/601 0", "1 79/348 427/348 0 0 0 0 5/12 0 77/174 0", "1 132/575 707/575 0 0 7/575 0 239/575 0 252/575 0", "1 47/205 252/205 0 0 0 7/1230 509/1230 0 91/205 0", "1 47/251 345/251 0 0 0 61/251 78/251 0 105/251 0", "1 47/202 249/202 0 0 0 155/909 313/909 0 133/202 47/606", "1 31/135 166/135 0 0 0 0 56/135 1/135 4/9 0", "1 109/278 387/278 0 0 0 0 203/556 327/556 255/278 0", "0 34 34 0 556 0 0 251 607 406 0", "1 1369/6361 8367/6361 0 0 0 0 2429/6361 1098/6361 2817/6361 0", "1 3151/13226 16377/13226 0 0 0 0 2576/6613 930/6613 457/778 637/13226", "1 237/1322 1559/1322 0 0 0 0 282/661 0 763/1322 79/1322", "1 0 153/127 0 39/127 0 0 68/127 0 0 0", "1 0 9/7 0 15/49 6/49 0 26/49 0 0 0", "0 0 126 0 156 278 0 45 245 0 0", "1 0 1 0 18/7 17/7 0 13/7 0 0 0", "0 0 0 0 8 13 0 5 0 0 0", "0 0 0 0 39 45 7 20 0 0 0", "0 0 0 0 3 4 0 1 0 0 0", "0 0 0 0 33 37 0 18 7 0 0", "0 0 0 0 53 129 0 27 0 0 14", "1 0 4/3 0 2/7 3/14 0 3/7 0 0 0", "1 0 1 5/17 207/238 73/238 0 167/238 0 0 0", "0 0 0 42 29 139 0 5 0 0 0", "0 0 0 84 177 159 119 10 0 0 0", "0 0 0 126 393 349 0 117 238 0 0", "1 0 23/16 0 2/7 199/112 0 3/7 0 0 5/16", "1 0 1 0 0 0 0 12/13 0 28/13 0", "0 0 0 0 0 13 0 5 0 16 0", "1 0 1 0 0 0 0 1/2 0 3 0", "1 0 43/54 0 0 0 0 131/108 11/36 92/27 0", "0 8 8 3 0 0 513 176 0 1589 0", "0 0 0 1 4 0 107 40 0 335 0", "0 0 0 3 0 12 49 20 0 165 0", "0 0 0 4 0 23 0 8 7 38 0", "1 0 1 0 0 0 11/3 7/3 0 14 0", "0 1 1 0 0 0 63 22 0 196 0", "0 0 0 0 1 0 26 10 0 82 0", "0 0 0 0 0 3 10 5 0 36 0", "0 1 2 0 0 0 80 27 0 245 0", "0 0 2 0 3 0 112 40 0 344 0", "0 0 2 0 0 3 44 15 0 134 0", "0 0 0 0 0 0 3 1 0 9 0", "0 0 0 0 13 0 0 7 13 12 0", "1 0 1 0 0 11/28 0 9/7 11/28 53/14 0", "0 14 14 0 0 66 0 41 87 230 0", "0 0 14 0 0 54 0 17 33 80 0", "0 0 0 0 7 10 0 13 17 48 0", "0 0 0 0 0 19 0 10 5 38 0", "0 0 0 0 0 155 0 30 29 170 28", "0 2 2 0 0 0 88 31 3 278 0", "0 0 0 0 3 0 40 17 3 132 0", "0 0 0 13 0 52 0 5 0 29 0", "0 0 0 0 0 117 0 3 0 46 26", "0 9 9 0 0 0 551 187 0 1701 3", "0 0 0 0 27 0 670 248 0 2088 6", "0 0 0 0 0 27 58 23 0 198 6", "1 0 0 3/8 0 0 0 11/24 0 0 0", "1 0 0 3/8 0 0 0 115/104 0 303/104 0", "0 0 0 13 0 52 0 5 0 29 0", "1 0 0 3/8 0 0 0 7/16 0 17/4 0", "1 0 0 43/161 0 0 0 471/322 139/322 719/161 0", "0 0 0 4 0 23 0 8 7 38 0", "1 0 0 0 42/23 0 0 34/23 0 0 0", "1 0 0 0 33/14 9/14 0 25/14 0 0 0", "0 0 0 0 8 13 0 5 0 0 0", "0 0 0 0 39 45 7 20 0 0 0", "0 0 0 0 3 4 0 1 0 0 0", "0 0 0 0 33 37 0 18 7 0 0", "0 0 0 0 53 129 0 27 0 0 14", "1 0 0 0 18/5 0 0 17/10 51/10 0 0", "0 0 0 0 9 5 0 3 14 0 0", "0 0 0 0 29 0 0 13 29 15 0", "1 0 0 0 25/13 0 0 20/13 0 1/13 0", "0 0 0 0 16 0 13 5 0 10 0", "0 0 0 0 134 0 0 63 117 74 0", "1 0 0 0 0 0 0 1/2 3/2 0 0", "1 0 0 0 0 0 0 20/13 0 51/13 0", "0 0 0 0 0 13 0 5 0 16 0", "1 0 0 0 0 0 0 1 0 5 0", "1 0 0 0 0 0 14/3 10/3 0 19 0", "0 1 0 0 0 0 64 23 0 201 0", "0 0 0 0 1 0 26 10 0 82 0", "0 0 0 0 0 3 10 5 0 36 0", "0 0 0 0 0 0 3 1 0 9 0", "1 0 0 3/8 0 0 139/24 10/3 0 173/8 0", "0 4 0 3 0 0 265 92 0 825 0", "0 0 0 1 4 0 107 40 0 335 0", "0 0 0 3 0 12 49 20 0 165 0", "0 0 0 0 0 0 3 1 0 9 0", "1 0 0 0 0 0 0 33/19 7/19 5 0", "0 0 0 0 0 19 0 10 5 38 0", "1 0 0 0 0 0 0 29/18 3/2 5 0", "0 0 0 0 0 9 0 4 9 18 0", "0 0 0 0 0 0 3 1 0 9 0", "1 43/78 0 0 0 0 0 61/26 41/13 259/26 0", "0 14 0 0 0 39 0 36 81 204 0", "0 1 0 0 0 0 26 10 3 87 0", "1 0 0 0 43/40 0 0 117/40 103/40 93/10 0", "0 0 0 0 7 10 0 13 17 48 0", "0 0 0 0 3 0 40 17 3 132 0", "0 0 0 0 13 0 0 7 13 12 0", "1 0 0 0 0 0 0 11/27 0 0 1/3", "1 2/95 0 0 0 0 0 37/95 0 0 33/95", "1 31/172 0 0 0 0 0 127/344 0 0 105/344", "1 853/6628 0 459/6628 0 0 0 509/1657 0 0 1185/3314", "1 64/3805 0 0 918/3805 0 0 349/761 0 0 303/761", "1 4/37 0 0 0 0 17/37 6/37 0 0 15/37", "1 211/1378 0 0 0 0 0 205/689 459/1378 0 249/689", "1 0 0 0 114/383 0 0 187/383 0 0 153/383", "1 0 0 0 2/7 32/35 0 3/7 0 0 3/5", "1 0 0 0 390/541 0 0 401/541 0 336/541 267/541", "0 0 0 0 432 0 541 53 0 522 96", "0 0 0 0 1776 0 0 819 1623 1064 34", "1 0 0 0 0 6/5 0 1/3 0 0 3/5", "1 0 0 0 0 0 0 1 0 8/3 1/3", "0 0 0 0 0 117 0 3 0 46 26", "1 0 0 0 0 0 0 2/3 0 10/3 1/3", "1 0 0 0 0 0 26/9 19/9 0 12 1/3", "0 9 0 0 0 0 544 185 0 1683 6", "0 0 0 0 27 0 670 248 0 2088 6", "0 0 0 0 0 27 58 23 0 198 6", "1 0 0 0 0 0 0 38/31 39/155 112/31 43/155", "0 0 0 0 0 155 0 30 29 170 28", "1 0 0 0 0 0 0 0 3/2 0 0", "0 0 0 0 0 1 0 0 1 0 0", "1 0 0 0 0 0 0 0 0 5 0", "0 0 0 0 0 1 0 0 0 2 0", "0 0 0 0 0 0 1 0 0 3 0", "1 0 0 0 0 0 0 0 3/2 5 0", "0 0 0 0 0 1 0 0 1 2 0", "0 0 0 0 0 0 1 0 0 3 0", "1 0 0 0 0 0 0 0 0 0 2/9", "1 2/7 0 0 0 0 0 0 0 0 10/63", "1 25/168 0 23/168 0 0 0 0 0 0 235/756", "1 2/7 0 0 0 254/35 0 0 0 0 62/35", "0 5 0 0 0 36 0 0 0 0 3", "1 4/37 0 0 0 0 23/37 0 0 0 15/37", "1 10/79 0 0 0 0 71/79 0 0 0 33/79", "1 4/37 0 0 0 324/185 23/37 0 0 0 147/185", "1 7/36 0 0 0 0 0 0 23/36 0 26/81", "1 47/66 0 0 0 0 0 0 71/22 0 1/11", "1 7/36 0 0 0 41/9 0 0 23/36 0 4/3", "1 0 0 1/16 0 0 0 0 0 0 5/18", "1 0 0 6/71 25/71 0 0 0 0 0 215/639", "1 0 0 178/233 367/233 0 0 0 0 0 1/233", "1 0 0 182/17 331/17 1969/17 0 0 0 0 355/17", "0 0 0 27 52 312 0 0 0 0 55", "0 0 0 8 11 66 0 0 0 0 10", "0 0 0 32 61 247 17 0 0 0 40", "0 0 0 126 237 1337 0 0 17 0 234", "1 0 0 1008/2669 2742/2669 0 0 1969/2669 0 0 603/2669", "1 0 0 1/16 0 539/80 0 0 0 0 71/40", "1 0 0 6/71 25/71 2959/355 0 0 0 0 777/355", "1 0 0 0 1/2 0 0 0 0 0 5/18", "1 0 0 0 2/7 0 3/7 0 0 0 25/63", "1 0 0 0 2/7 0 0 3/7 0 0 25/63", "1 0 0 0 7/17 0 0 0 6/17 0 53/153", "1 0 0 0 5/7 0 0 0 0 6/7 31/63", "1 0 0 0 45/47 0 0 0 0 178/141 77/141", "0 0 0 0 117 0 141 0 0 148 26", "0 0 0 0 177 0 0 0 141 154 8", "1 0 0 0 6/29 0 0 0 0 114/29 11/29", "0 0 0 0 9 0 58 0 0 200 2", "1 0 0 0 37/3 401/3 0 0 0 182/9 295/9", "0 0 0 0 3 42 0 0 0 8 10", "0 0 0 0 21 159 9 0 0 32 40", "0 0 0 0 9 91 0 0 1 14 22", "0 0 0 0 2 21 0 0 0 3 5", "1 0 0 0 0 8 0 0 0 0 2", "0 0 0 0 0 7 0 0 0 0 1", "1 0 0 0 1/2 109/10 0 0 0 0 27/10", "0 0 0 0 5 57 0 0 0 0 11", "1 0 0 0 5/7 449/35 0 0 0 6/7 117/35", "1 0 0 0 0 42/5 0 0 0 1/2 11/5", "0 0 0 0 0 18 0 0 0 5 4", "1 0 0 0 0 0 1/3 0 0 0 1/3", "1 0 0 0 0 0 11/9 0 0 0 1/3", "1 0 0 0 60/113 0 187/113 0 0 0 51/113", "0 0 0 0 99 0 156 0 0 113 22", "1 0 0 0 2/7 194/35 3/7 0 0 0 57/35", "1 0 0 0 0 24/5 1/3 0 0 0 7/5", "1 0 0 0 0 0 0 1/3 0 0 1/3", "1 0 0 0 0 0 0 0 1/4 0 5/18", "1 0 0 0 0 137/20 0 0 1/4 0 9/5", "0 0 0 0 0 1 0 0 1 0 0", "1 0 0 0 7/17 149/17 0 0 6/17 0 39/17", "0 0 0 0 15 91 0 0 25 0 18", "1 0 0 0 0 0 0 0 0 1/2 1/3", "1 0 0 0 0 0 0 0 0 10/3 1/3", "1 0 0 0 0 3 0 0 0 6 1", "0 0 0 0 0 9 4 0 0 20 2", "0 0 0 0 0 10 0 0 1 10 2", "0 0 0 0 0 1 0 0 0 2 0", "0 0 0 0 0 9 0 0 0 4 2" }); VPolygon result = lrs.run(new HPolygon(ine, true)); checkResults(result, ext, null); } // NOTE: Equivalent to kq20_11 and kq20_11a @Test public void testH2VIn7() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] ine = convert(new String[] { "10000 -915 -828 -303 -632 -786 -231 -12 -568 -351 -308 ", "10000 -930 -217 -480 -704 -700 -91 -441 -927 -33 -330 ", "10000 -765 -616 -962 -274 -276 -39 -924 -541 -444 -838 ", "10000 -747 -470 -506 -329 -481 -425 -679 -140 -764 -960 ", "10000 -243 -664 -760 -333 -456 -686 -717 -137 -721 -833 ", "10000 -682 -107 -380 -720 -382 -920 -164 -220 -640 -262 ", "10000 -145 -942 -873 -570 -973 -365 -685 -932 -424 -928 ", "10000 -183 -612 -402 -869 -681 -539 -941 -513 -290 -622 ", "10000 -669 -694 -353 -941 -209 -572 -580 -822 -964 -725", "10000 -188 -646 -87 -552 -330 -19 -976 -609 -965 -158" }); Rational[][] ext = convert(new String[] { "1 0 0 0 0 0 0 0 0 0 0", "1 1000/93 0 0 0 0 0 0 0 0 0", "1 1222000/114297 10000/38099 0 0 0 0 0 0 0 0", "1 10750/1131 0 0 0 625/377 0 0 0 0 0", "1 40000/3759 0 0 0 0 10000/8771 0 0 0 0", "1 212000/19749 0 0 0 0 0 0 0 10000/19749 0", "1 0 5000/471 0 0 0 0 0 0 0 0", "1 38000/24729 770000/74187 0 0 0 0 0 0 0 0", "1 284150000/136212981 1148030000/136212981 0 0 0 656120000/136212981 0 0 0 0", "1 36770000/31139511 246530000/31139511 0 0 0 15560000/2395347 0 0 0 0", "1 97013950000/24194935353 125491510000/24194935353 26897040000/8064978451 0 0 107468440000/24194935353 0 0 0 0", "1 208615270000/46659144489 70254040000/15553048163 58585220000/15553048163 0 0 69182500000/15553048163 0 0 0 0", "1 27462496884000/6487691411383 30680805172000/6487691411383 24595554212000/6487691411383 861478502000/6487691411383 0 27481019234000/6487691411383 0 0 0 0", "1 212182553080000/49693244344291 234584779970000/49693244344291 186491660150000/49693244344291 0 0 214699729820000/49693244344291 0 4307392510000/49693244344291 0 0", "1 28639550000/11501746449 65629700000/11501746449 0 0 6724260000/3833915483 80584760000/11501746449 0 0 0 0", "1 1167626651875/340404055806 661366442500/170202027903 0 0 917688070625/340404055806 2225854199375/340404055806 413683270625/340404055806 0 0 0", "1 34045461255625/8042321813043 3130248815000/1148903116149 0 0 25950219261875/8042321813043 6496048506875/1148903116149 18976347861875/8042321813043 0 0 0", "1 60589293784938125/12536753666548116 3270686326303750/3134188416637029 0 0 47123131821229375/12536753666548116 60896117610870625/12536753666548116 34675336619689375/12536753666548116 1111198785286250/1044729472212343 0 0", "1 3475391896500625/776762656550967 2150880122345000/776762656550967 322469407600000/258920885516989 0 1956233139156875/776762656550967 4151169050133125/776762656550967 1422520786956875/776762656550967 0 0 0", "1 5610365488914108750/1139512526541805979 19928668877028000000/7976587685792641853 23581119410381460000/7976587685792641853 0 1880773065318786250/1139512526541805979 37978145293561516250/7976587685792641853 9459619574598743750/7976587685792641853 1674275504955860000/7976587685792641853 0 0", "1 29180386464408422500/5573680991689576821 643231276150130000/506698271971779711 13058327433469180000/5573680991689576821 0 13273299698719457500/5573680991689576821 24199695688731302500/5573680991689576821 9686272257169497500/5573680991689576821 1808893246519400000/1857893663896525607 0 0", "1 1535350000/248797737 900410000/248797737 0 0 0 1461440000/248797737 0 0 0 0", "1 94130000/47492491 249550000/47492491 0 0 0 417420000/47492491 0 0 0 0", "1 68843757200/13710710551 45375122800/13710710551 55899187200/13710710551 0 0 69629167200/13710710551 0 0 0 0", "1 430530734830000/85165272022669 852787057150000/255495816068007 1006029045940000/255495816068007 0 88066866220000/255495816068007 1268382045380000/255495816068007 0 0 0 0", "1 713839090000/256200835887 1289137430000/256200835887 0 0 171489080000/85400278629 1892071640000/256200835887 0 0 0 0", "1 1078570250000/190224662121 595081330000/190224662121 701785900000/190224662121 0 0 303010640000/63408220707 0 0 0 0", "1 1484589650000/169214543643 71462250000/56404847881 0 0 0 660919840000/169214543643 296766220000/169214543643 0 0 0", "1 499317601870000/65514459219747 39799732290000/21838153073249 41461418380000/21838153073249 0 0 263259445520000/65514459219747 75424187960000/65514459219747 0 0 0", "1 0 222500/92109 815000/92109 0 0 0 0 0 0 0", "1 13064400/3888733 84386000/11666199 36068000/11666199 0 0 0 0 0 0 0", "1 0 71732500/33202613 228155000/33202613 0 0 0 0 0 153950000/33202613 0", "1 0 802500/100963 0 0 0 695000/100963 0 0 0 0", "1 0 1000/1463 0 0 0 0 0 0 0 14750/1463", "1 66140000/20855893 92525000/20855893 0 0 0 0 0 0 0 120485000/20855893", "1 95930000/24599971 157550000/24599971 0 0 0 0 0 0 0 90170000/24599971", "1 2755420625/679943354 2042583125/339971677 0 0 0 444349375/679943354 0 0 0 2574874375/679943354", "1 39506180000/10106580551 163374160000/30319741653 0 0 0 25494590000/30319741653 0 0 0 132336470000/30319741653", "1 1122700000/524315477 5652722000/1572946431 0 0 0 6296686000/1572946431 0 0 0 8208982000/1572946431", "1 967351671500/253021099829 2708710250500/759063299487 636523347000/253021099829 0 0 2752820433500/759063299487 0 0 0 2097409329500/759063299487", "1 45989038135000/10807998664183 52096158620000/10807998664183 38704876500000/10807998664183 0 0 45339746255000/10807998664183 0 0 0 2153696255000/10807998664183", "1 21944969107150000/4672507559008581 15289750597952500/4672507559008581 14506018587580000/4672507559008581 0 4159686265705000/4672507559008581 19985319226220000/4672507559008581 0 0 0 614743717100000/519167506556509", "1 198433450980000/55799828418007 152750244270000/55799828418007 0 0 146516233560000/55799828418007 344955176990000/55799828418007 0 0 0 125932940550000/55799828418007", "1 7778627474000/2412770120917 9406651458000/2412770120917 0 0 5951240376000/2412770120917 16140356124000/2412770120917 0 0 0 2647572932000/2412770120917", "1 562808678980000/148940777152183 424772679150000/148940777152183 0 0 410096839520000/148940777152183 895560579190000/148940777152183 0 0 0 303621565790000/148940777152183", "1 2310617707028800/563944069966633 1616708231262800/563944069966633 652828925022400/563944069966633 0 1237057447792000/563944069966633 3186361326745200/563944069966633 0 0 0 910413303652400/563944069966633", "1 84571184200/34847505301 377585487500/104542515903 0 0 0 301215941800/104542515903 127304669400/34847505301 0 0 303228718000/104542515903", "1 1365059725000/589774998663 23920391755000/5307974987967 0 0 0 16238925125000/5307974987967 2797414430000/589774998663 0 0 6025937795000/5307974987967", "1 6128645510000/2067614448681 4849940080000/2067614448681 0 0 0 8116013900000/2067614448681 3654542620000/689204816227 0 0 3046838780000/2067614448681", "1 447885254493750/154209875436167 1555299613700000/462629626308501 0 0 119934424191250/154209875436167 1525406639076250/462629626308501 678559409871250/154209875436167 0 0 716672787190000/462629626308501", "1 10258658750/2091109083 3488613750/697036361 0 0 0 656848750/697036361 0 0 0 2601196250/697036361", "1 745275940000/94243168483 144237190000/94243168483 0 0 0 412873630000/94243168483 0 0 0 148383110000/94243168483", "1 37396130000/12447849161 1018750000/1131622651 0 0 0 90626120000/12447849161 0 0 0 54958900000/12447849161", "1 322623155930000/64459233416229 146138697410000/64459233416229 78754850560000/21486411138743 0 0 323840633320000/64459233416229 0 0 0 80964079780000/64459233416229", "1 117673570724080000/23103134979394831 193045899272050000/69309404938184493 243286102473340000/69309404938184493 0 57057023002660000/69309404938184493 330960241487930000/69309404938184493 0 0 0 16475939646930000/23103134979394831", "1 329676283490000/49828538651027 111284527190000/49828538651027 142998363940000/49828538651027 0 0 214476923740000/49828538651027 0 0 0 37712093980000/49828538651027", "1 1404336126875/333525239611 14494168275625/2668201916888 0 0 400945778125/1334100958444 280283726875/333525239611 0 0 0 1320152718125/333525239611", "1 31944710000/7353820927 33891068750/7353820927 0 0 8580187500/7353820927 0 0 0 0 30853790000/7353820927", "1 0 15125/15131 0 0 0 559750/166441 0 0 0 1404500/166441", "1 0 9047930000/16878251463 0 0 0 27963550000/16878251463 29049740000/5626083821 0 0 97365790000/16878251463", "1 0 8885000/18680181 0 0 0 0 66140000/18680181 0 0 11035000/1436937", "1 0 11053120000/4766716757 0 0 0 0 20828930000/4766716757 0 13981775000/4766716757 18382585000/4766716757", "1 0 0 5000/481 0 0 0 0 0 0 0", "1 241000/26373 0 27500/8791 0 0 0 0 0 0 0", "1 730250000/78598209 24290000/26199403 63220000/26199403 0 0 0 0 0 0 0", "1 21526000/2225049 0 1470000/741683 0 0 0 0 0 3470000/2225049 0", "1 0 0 1480000/154569 445000/154569 0 0 0 0 0 0", "1 0 0 16634400/2241791 5738600/2241791 0 0 0 0 10908200/2241791 0", "1 0 0 3260000/317083 0 0 890000/317083 0 0 0 0", "1 0 0 1605000/160739 0 0 565000/160739 0 0 0 0", "1 82690000/231589499 0 2309680000/231589499 0 0 787820000/231589499 0 0 0 0", "1 593076170000/140128271463 679207090000/140128271463 526077100000/140128271463 0 0 592351460000/140128271463 0 0 0 0", "1 0 0 871510000/92644163 0 0 298550000/92644163 82690000/92644163 0 0 0", "1 0 0 106336500/19419739 0 0 155739500/19419739 0 47769000/19419739 0 0", "1 119969615000/41951135159 0 294417491000/41951135159 0 0 229737848000/41951135159 0 65702761000/41951135159 0 0", "1 0 0 344140000/34703089 0 0 286930000/104109267 0 0 82690000/104109267 0", "1 0 0 1385000/178081 0 0 0 0 0 1010000/178081 0", "1 0 0 0 10000/941 0 0 0 0 0 0", "1 395000/67359 0 0 145000/22453 0 0 0 0 0 0", "1 597170000/92896731 24830000/30965577 0 169240000/30965577 0 0 0 0 0 0", "1 1096746490000/214976865393 127490530000/71658955131 95710380000/23886318377 299871800000/71658955131 0 0 0 0 0 0", "1 37265000/14463003 0 31528125/4821001 30574375/4821001 0 0 0 0 0 0", "1 1742410000/301384977 0 0 343760000/100461659 0 0 504450000/100461659 0 0 0", "1 8843426000/1195467939 6246795500/2789425191 0 848791000/398489313 0 0 2392759500/929808397 0 0 0", "1 14630018959250/1676871703881 790493912000/558957234627 0 226169844250/558957234627 0 452558288750/186319078209 453482469250/186319078209 0 0 0", "1 8477974250/1072329041 0 0 1060493750/1072329041 0 2878447750/1072329041 4150222250/1072329041 0 0 0", "1 474660000/60588941 0 0 230110000/60588941 0 0 0 0 74490000/60588941 0", "1 0 1855000/245421 0 1240000/245421 0 0 0 0 0 0", "1 134590000/158599117 1265910000/158599117 0 656120000/158599117 0 0 0 0 0 0", "1 141867270000/42640647439 517733390000/127921942317 523452380000/127921942317 159548760000/42640647439 0 0 0 0 0 0", "1 0 1345200/184057 0 176496/184057 0 1295312/184057 0 0 0 0", "1 0 0 3710000/620283 5200000/620283 0 0 0 0 0 0", "1 1209010000/564094417 0 3851240000/564094417 3690360000/564094417 0 0 0 0 0 0", "1 62384303750/27114776277 0 181192219375/27114776277 174854417500/27114776277 4372264375/27114776277 0 0 0 0 0", "1 1396426381130000/386182442237881 723524651350000/386182442237881 1819037257580000/386182442237881 1813966897640000/386182442237881 365674941440000/386182442237881 0 0 0 0 0", "1 1144638394230000/288144185543041 0 1268976764830000/288144185543041 843946135640000/288144185543041 842578440990000/288144185543041 0 0 0 723524651350000/288144185543041 0", "1 0 0 87427500/14863547 93274500/14863547 0 52451500/14863547 0 0 0 0", "1 0 0 29947500/4335923 15923000/4335923 0 22298500/4335923 0 0 0 0", "1 279515745000/124965304289 0 963053730000/124965304289 328513805000/124965304289 0 496231465000/124965304289 0 0 0 0", "1 369273935000/145215982207 0 1004570790000/145215982207 692331085000/145215982207 0 347934475000/145215982207 0 0 0 0", "1 432271462810000/132677815012593 0 272995244185000/44225938337531 205013525930000/44225938337531 107477962255000/132677815012593 257465909270000/132677815012593 0 0 0 0", "1 395799552150910000/91751374617586689 457957796510000/418956048482131 148899540947300000/30583791539195563 93814336252260000/30583791539195563 134316768820720000/91751374617586689 231688780314140000/91751374617586689 0 0 0 0", "1 84160824583731250/19638834580603293 0 2717797856431250/595116199412221 15842454391741250/6546278193534431 53996337279133750/19638834580603293 28253167618396250/19638834580603293 0 0 171734173691250/89675043747047 0", "1 0 20197910000/8173583693 31489120000/8173583693 29528446000/8173583693 0 50378602000/8173583693 0 0 0 0", "1 217093734360000/63038044178189 129723154310000/63038044178189 352676981440000/63038044178189 127084482310000/63038044178189 0 264047888290000/63038044178189 0 0 0 0", "1 429498130402740000/94746273670747021 277149666255910000/94746273670747021 407198047849100000/94746273670747021 68720009346170000/94746273670747021 76155322682580000/94746273670747021 425635868811710000/94746273670747021 0 0 0 0", "1 0 0 18773572500/2986979909 12665551500/2986979909 0 11288020500/2986979909 0 0 5049477500/2986979909 0", "1 56570604245000/28326058478709 0 199967472970000/28326058478709 30719265605000/9442019492903 0 243469259795000/84978175436127 0 0 129723154310000/84978175436127 0", "1 0 0 58900620000/13946459863 58473945000/13946459863 0 72873200000/13946459863 0 0 0 30296865000/13946459863", "1 1720960428125/616742217941 0 24110067480000/4317195525587 12176334866250/4317195525587 0 16199007363125/4317195525587 0 0 0 8107697144375/4317195525587", "1 0 0 2381670000/331198303 934200000/331198303 0 0 0 0 1651630000/331198303 0", "1 31521970000/241935924633 0 1748541880000/241935924633 672264520000/241935924633 0 0 0 0 1191322460000/241935924633 0", "1 0 0 107091332500/15541744021 43609737500/15541744021 0 0 7880492500/15541744021 0 74695800000/15541744021 0", "1 0 0 0 2950/287 450/287 0 0 0 0 0", "1 0 0 0 2920000/457367 2990000/457367 0 0 0 0 0", "1 126030000/117104029 0 0 725780000/117104029 759580000/117104029 0 0 0 0 0", "1 7330925000/6077216829 0 5588635000/18231650487 38356235000/6077216829 37224910000/6077216829 0 0 0 0 0", "1 172946390000/131906194679 0 0 779220220000/131906194679 849804630000/131906194679 0 33531810000/131906194679 0 0 0", "1 31139950000/20180845471 0 0 124422890000/20180845471 113888340000/20180845471 0 0 0 0 16765905000/20180845471", "1 0 0 0 19742000/7277993 46615000/7277993 44303000/7277993 0 0 0 0", "1 67148015000/34827054239 0 0 128559100000/34827054239 221529780000/34827054239 136183335000/34827054239 0 0 0 0", "1 112975719685000/47929534452397 0 83561257665000/47929534452397 19365451295000/3686887265569 208645761150000/47929534452397 119053609680000/47929534452397 0 0 0 0", "1 7499620069750/1812613155349 0 0 1495227716000/1812613155349 10787405771250/1812613155349 7748734122750/1812613155349 4178062883250/1812613155349 0 0 0", "1 113926667695000/53037600680791 0 0 226589691125000/53037600680791 242554844610000/53037600680791 194015233155000/53037600680791 0 83561257665000/53037600680791 0 0", "1 0 109181595000/24076382359 0 46925955000/24076382359 41008087500/24076382359 195249582500/24076382359 0 0 0 0", "1 0 0 0 1775837200/691274643 1541175800/691274643 4654999000/691274643 0 0 0 2911509200/691274643", "1 0 0 0 1129270000/157152881 546510000/157152881 0 0 424990000/157152881 0 0", "1 186878990000/168206389193 0 0 1051421590000/168206389193 1052830920000/168206389193 0 0 33531810000/168206389193 0 0", "1 31880000/17485743 0 0 50252500/5828581 18607500/5828581 0 0 0 0 0", "1 1335625/1007633 0 0 13443125/2015266 249375/42878 0 0 0 0 0", "1 48981730000/24748731251 13064010000/24748731251 0 200062360000/24748731251 83222160000/24748731251 0 0 0 0 0", "1 19654685000/8044506539 0 0 56947232500/8044506539 29837902500/8044506539 13064010000/8044506539 0 0 0 0", "1 33429490000/18182570181 0 0 46519815000/6060856727 24788245000/6060856727 0 0 0 4354670000/6060856727 0", "1 0 600520000/131271871 0 898520000/131271871 241390000/131271871 0 0 0 0 0", "1 19296990000/30423904637 122507510000/30423904637 0 203219320000/30423904637 72152000000/30423904637 0 0 0 0 0", "1 0 95182875000/20796657313 0 40875870000/20796657313 34533210000/20796657313 168230810000/20796657313 0 0 0 0", "1 2324086110000/94512269085289 430559371290000/94512269085289 0 185057673120000/94512269085289 158887473720000/94512269085289 764707904120000/94512269085289 0 0 0 0", "1 9027538922800/4755510117697 13962675747600/4755510117697 0 15131692966400/4755510117697 15775846977600/4755510117697 24981653092800/4755510117697 0 0 0 0", "1 29992278630958750/7052210052205717 2504790517980000/1007458578886531 0 212708321540000/1007458578886531 23611353347756250/7052210052205717 5475806360966250/1007458578886531 17289625083836250/7052210052205717 0 0 0", "1 112988373481411322500/23825084052120071491 24346153627005090000/23825084052120071491 0 7556656528718300000/23825084052120071491 91361399474195257500/23825084052120071491 111692480829584242500/23825084052120071491 67257159020862217500/23825084052120071491 20271034665136260000/23825084052120071491 0 0", "1 252992482790000/100359895797841 495581358810000/100359895797841 0 26475729320000/100359895797841 223841707480000/100359895797841 732022632560000/100359895797841 0 0 0 0", "1 0 45323370000/260651531911 0 1894405040000/260651531911 795538770000/260651531911 0 0 761749580000/260651531911 0 0", "1 62751269762000/51966429416723 64009864266000/51966429416723 0 350852051080000/51966429416723 181208624640000/51966429416723 0 0 79363097664000/51966429416723 0 0", "1 0 0 48041600/9686161 83201600/9686161 7704400/9686161 0 0 0 0 0", "1 122932945000/95768904127 0 359853150000/95768904127 750113480000/95768904127 15665055000/7366838779 0 0 0 0 0", "1 10652916030000/5787929705837 68021760530000/63667226764207 132271829440000/63667226764207 451813571240000/63667226764207 187664260480000/63667226764207 0 0 0 0 0", "1 277884066140000/168486353474207 0 234402176580000/168486353474207 1134649522000000/168486353474207 726272700990000/168486353474207 0 0 0 204065281590000/168486353474207 0", "1 0 0 143391427500/28904746351 188891542500/28904746351 20813580000/28904746351 98484807500/28904746351 0 0 0 0", "1 15927077226875/7286433303503 0 21225946387500/7286433303503 44205459913750/7286433303503 21981156519375/7286433303503 14903775881250/7286433303503 0 0 0 0", "1 112196787496990000/45346069385631229 17076179726610000/45346069385631229 101337118145220000/45346069385631229 255169158261020000/45346069385631229 154041888540720000/45346069385631229 102218949224940000/45346069385631229 0 0 0 0", "1 27071449169856250/11796625041110233 0 22459702255796250/11796625041110233 67029085549838750/11796625041110233 46495998218508750/11796625041110233 22661020837301250/11796625041110233 0 0 6403567397478750/11796625041110233 0", "1 35843104648182500/13147666937051927 0 17773459850587500/13147666937051927 67118104555277500/13147666937051927 50326416834795000/13147666937051927 4560956743830000/1878238133864561 0 0 0 12807134794957500/13147666937051927", "1 0 49604358000/10982928091 464817222000/7105954474877 14229874926000/7105954474877 11705411154000/7105954474877 57317257714000/7105954474877 0 0 0 0", "1 0 0 1825928557500/3287682744283 9868925172500/3287682744283 815403137500/469668963469 21079742755000/3287682744283 0 0 0 20668482500/5081426189", "1 0 0 0 849825000/109619819 161745000/109619819 459280000/109619819 0 0 0 0", "1 65176708000/25650908917 0 0 169913687000/25650908917 97030467000/25650908917 57233784000/25650908917 0 0 0 0", "1 63527674600000/24958323285403 0 15729569190000/24958323285403 161416328255000/24958323285403 92115884565000/24958323285403 53121845910000/24958323285403 0 0 0 0", "1 7109851938125/2442103361066 0 0 7386970801250/1221051680533 9221536636875/2442103361066 5707632125625/2442103361066 983098074375/2442103361066 0 0 0", "1 9725445267500/4141572844049 0 0 22438178350000/4141572844049 16871146627500/4141572844049 12301719607500/4141572844049 0 3932392297500/4141572844049 0 0", "1 0 848769330000/186336883819 0 367021710000/186336883819 309091740000/186336883819 10871300000/1340553121 0 0 0 0", "1 0 0 0 89775565000/32281118687 59636330000/32281118687 215574755000/32281118687 0 0 0 141461555000/32281118687", "1 0 0 0 33546500/4486369 13465500/4486369 0 0 12752000/4486369 0 0", "1 0 0 9064674000/18013884191 133610596000/18013884191 51632004000/18013884191 0 0 49173178000/18013884191 0 0", "1 0 0 0 244315632500/34476410749 106629832500/34476410749 11330842500/34476410749 0 104739927500/34476410749 0 0", "1 0 0 0 341380065000/94365667943 279933315000/94365667943 573735085000/94365667943 0 286782855000/94365667943 0 0", "1 9465709692500/4581287890331 0 0 19760955760000/4581287890331 19520255137500/4581287890331 17179082610000/4581287890331 0 8490378555000/4581287890331 0 0", "1 191869988564440000/88562369138662597 10580137082550000/88562369138662597 0 381123990903950000/88562369138662597 379897844120820000/88562369138662597 326809549592310000/88562369138662597 0 152005677217830000/88562369138662597 0 0", "1 117042481944055000/55227845469495829 0 0 242560077103925000/55227845469495829 244941754633740000/55227845469495829 193161576637245000/55227845469495829 0 89838809023185000/55227845469495829 10580137082550000/55227845469495829 0", "1 2328935285653000/1000069439406607 0 0 4304084838599000/1000069439406607 4323841303590000/1000069439406607 3519586236405000/1000069439406607 0 1421876788047000/1000069439406607 0 423205483302000/1000069439406607", "1 0 89818668900000/19752034209551 0 38571353355000/19752034209551 32948165805000/19752034209551 22898595385000/2821719172793 0 387347685000/19752034209551 0 0", "1 0 0 0 54477624045000/20811707630459 40122000195000/20811707630459 140468133805000/20811707630459 0 3651857115000/20811707630459 0 89818668900000/20811707630459", "1 0 0 0 196776840000/27212152991 87954110000/27212152991 0 0 77515180000/27212152991 5035930000/27212152991 0", "1 98491208700000/80260150931977 0 0 520019521480000/80260150931977 384228752870000/80260150931977 0 0 78134058860000/80260150931977 106683107110000/80260150931977 0", "1 0 0 0 1300280000/202314159 1055870000/202314159 0 0 0 600520000/202314159 0", "1 4016707250/3853975823 0 0 24040717000/3853975823 20923317750/3853975823 0 0 0 9188063250/3853975823 0", "1 38500721140000/13813219519717 0 0 56373832780000/13813219519717 2470563090000/476317914473 0 78134058860000/41439658559151 0 91018989130000/41439658559151 0", "1 0 0 0 73388195000/16099800591 1692545000/328567359 16625825000/5366600197 0 0 47797142500/16099800591 0", "1 0 0 0 2414097000/6432306631 37547145000/6432306631 22685499000/6432306631 0 0 42767575000/6432306631 0", "1 4226298959500/2757746701009 0 0 13243132514000/2757746701009 15109878640500/2757746701009 6157306380000/2757746701009 0 0 5817781561500/2757746701009 0", "1 0 360765886830000/79606963389983 0 156642201000000/79606963389983 134853635010000/79606963389983 643134560440000/79606963389983 0 0 2324086110000/79606963389983 0", "1 0 0 0 14865227634000/9076012875491 40748663442000/9076012875491 42876381134500/9076012875491 18038294341500/9076012875491 0 34510350793500/9076012875491 0", "1 2358247475361750/1207125862709311 0 0 884252733708000/1207125862709311 5591473221449250/1207125862709311 5188541450354750/1207125862709311 3398179213493250/1207125862709311 0 3686827476084000/1207125862709311 0", "1 35938727188868750/9655030728657419 0 0 2590343890420000/1379290104093917 50264950364306250/9655030728657419 3887533696496250/1379290104093917 1131698514408750/508159512034601 0 2504790517980000/1379290104093917 0", "1 3066492064714375/720987366782806 0 0 306383818075000/360493683391403 4073559505730625/720987366782806 2755286859909375/720987366782806 1836092149858125/720987366782806 0 222852052173750/360493683391403 0", "1 11867565737027461250/2997913363500981689 0 1319571813684855000/2997913363500981689 5999462008537705000/2997913363500981689 14519259609019443750/2997913363500981689 8281741994839706250/2997913363500981689 6859716225815088750/2997913363500981689 0 4334141562621975000/2997913363500981689 0", "1 68479254800052406250/17060401584246198617 0 0 26607018771786520000/17060401584246198617 85047624143326458750/17060401584246198617 53010561672748151250/17060401584246198617 41118535817896428750/17060401584246198617 5278287254739420000/17060401584246198617 24346153627005090000/17060401584246198617 0", "1 21273654851624543750/5907779498712812407 0 1030130982668380000/347516441100753671 9442161625760040000/5907779498712812407 13031234573972571250/5907779498712812407 22889306399664428750/5907779498712812407 18952679708777791250/5907779498712812407 0 3080979519604480000/5907779498712812407 0", "1 915334208019318750/220827202774209071 0 12491720820487105000/4637371258258390491 9130954842359395000/4637371258258390491 12301140017086801250/4637371258258390491 15452312744085698750/4637371258258390491 13640072285189286250/4637371258258390491 0 1235968111234865000/4637371258258390491 0", "1 0 0 0 19583083525000/7178858839569 15404607192500/7178858839569 46477056707500/7178858839569 0 0 608642852500/2392952946523 30063823902500/7178858839569", "1 0 0 0 1745080000/262328689 75470000/37475527 0 0 0 0 1201040000/262328689", "1 104767395000/45984207827 0 0 282430730000/45984207827 177133315000/45984207827 0 0 0 0 119951050000/45984207827", "1 81144305114000/35100665633879 11174377794000/35100665633879 0 215792331688000/35100665633879 135728555520000/35100665633879 0 0 0 0 79363097664000/35100665633879", "1 151322280940000/58281131471809 0 0 320103788480000/58281131471809 761110380000/186201697993 55871888970000/58281131471809 0 0 0 136014849090000/58281131471809", "1 86296548240000/39636890008123 0 0 242931064140000/39636890008123 169558301230000/39636890008123 0 0 0 18623962990000/39636890008123 78134058860000/39636890008123", "1 0 0 0 115479960000/41563375229 77820180000/41563375229 266936230000/41563375229 0 0 0 190365750000/41563375229", "1 152160713125/681538843266 0 0 2735997233125/1022308264899 2096297090000/1022308264899 13307935780625/2044616529798 0 0 0 8969986901875/2044616529798", "1 3426144663125/1176251666786 0 0 346236970625/84017976199 2526164430000/588125833393 3663825976875/1176251666786 0 0 0 2424075650625/1176251666786", "1 769811919375/428044869871 0 0 6364593511250/3852403828839 9300793240000/3852403828839 22828749085625/3852403828839 0 0 0 17790355811875/3852403828839", "1 1738148035625/457228364057 0 0 1179924108750/457228364057 1833988270000/457228364057 1604378894375/457228364057 0 0 0 1376752748125/457228364057", "1 23364268689558125/5360800588396718 0 10845932382421875/5360800588396718 13959825528188125/5360800588396718 8159356057318125/2680400294198359 7645083678701250/2680400294198359 0 0 0 12215053265158125/5360800588396718", "1 439954623215625/124409869951753 0 546430261770000/124409869951753 2181414919628750/1119688829565777 824844368350000/1119688829565777 4324137181919375/1119688829565777 0 0 0 2915037499613125/1119688829565777", "1 6723191447119000/1486519761274547 0 11199540154943625/2973039522549094 7367187887458125/2973039522549094 5824252457410375/2973039522549094 3964468034758125/1486519761274547 0 0 0 5649908133917875/2973039522549094", "1 877504476656605630000/183215253971619319897 98225047728976210000/183215253971619319897 660501186699798380000/183215253971619319897 391583480337327800000/183215253971619319897 375881224371435880000/183215253971619319897 514735882729242700000/183215253971619319897 0 0 0 279046602747314940000/183215253971619319897", "1 18818204435377414375/4173885040156409544 0 5650886349339823125/1391295013385469848 8960407891534020625/4173885040156409544 3782644630457604375/1391295013385469848 7596916071341036875/4173885040156409544 0 0 6139065483061013125/4173885040156409544 723526159530141875/1043471260039102386", "1 5720142764387148125/1196051799255440661 2880076677330160000/1196051799255440661 4346499688370030000/1196051799255440661 1592628377602341250/3588155397766321983 4349773595811230000/3588155397766321983 15943974447066375625/3588155397766321983 0 0 0 3136890025907091875/3588155397766321983", "1 888191397378750/431737334730991 0 0 695365202870000/431737334730991 1143309741591250/431737334730991 2487904489873750/431737334730991 505297256831250/431737334730991 0 0 1536178115035000/431737334730991", "1 3112337673598750/769645206406783 0 0 276961638730000/109949315200969 3258680917611250/769645206406783 371297554876250/109949315200969 970507703531250/769645206406783 0 0 208732543165000/109949315200969", "1 14594752311373750/3591364706739193 0 0 9026462044910000/3591364706739193 15180000075761250/3591364706739193 12111753780558750/3591364706739193 4625751796331250/3591364706739193 0 0 6720521057430000/3591364706739193", "1 4163751536333750/1019980212572099 0 0 2391397713280000/1019980212572099 4451662961471250/1019980212572099 3522292086438750/1019980212572099 1403508245231250/1019980212572099 0 0 1782816417390000/1019980212572099", "1 3743600507643488750/923596044349449443 0 22444356496980000/923596044349449443 136832346837980000/54329179079379379 557444015147313750/131942292049921349 3110310944408313750/923596044349449443 1177797045082676250/923596044349449443 0 0 1733656625048790000/923596044349449443", "1 17549826504600036250/4326548174421800513 0 0 10788346007256160000/4326548174421800513 18315526609852998750/4326548174421800513 14651596162072571250/4326548174421800513 5550008316643318750/4326548174421800513 74814521656600000/4326548174421800513 0 8115384542335030000/4326548174421800513", "1 194997013259883750/53799914140963271 0 160072896654140000/53799914140963271 282241108896040000/161399742422889813 300866063197493750/161399742422889813 664699730564106250/161399742422889813 157838874860011250/53799914140963271 0 0 96280609987640000/161399742422889813", "1 6862788481112295250/1647429247690111277 0 4439581385647788000/1647429247690111277 3378449984852220000/1647429247690111277 585551186070814250/235347035384301611 5676982412452754250/1647429247690111277 4611150415094295750/1647429247690111277 0 0 494387244493946000/1647429247690111277", "1 0 0 0 174797430000/24090689473 73487710000/24090689473 0 0 69844930000/24090689473 0 5035930000/24090689473", "1 0 0 0 87000/11347 0 55250/11347 0 0 0 0", "1 943885000/124438117 0 0 485405000/124438117 0 273000000/124438117 0 0 0 0", "1 304683446000/39541707431 4354974000/39541707431 0 146344372000/39541707431 0 88901124000/39541707431 0 0 0 0", "1 40540291222800/6138677328283 5836907201200/6138677328283 23217214474400/6138677328283 14018580135200/6138677328283 0 15432420000800/6138677328283 0 0 0 0", "1 17657246486000/1943503318469 1529110194000/1943503318469 0 672159352000/1943503318469 0 6684826104000/1943503318469 3629155740000/1943503318469 0 0 0", "1 163187720000/34837146249 0 189330587500/34837146249 141272072500/34837146249 0 68930350000/34837146249 0 0 0 0", "1 12320650000/2234031589 0 0 260945000/51954223 3629145000/2234031589 4861350000/2234031589 0 0 0 0", "1 13397834000/1567368713 0 0 1108040000/1567368713 0 5454494500/1567368713 4392930500/1567368713 0 0 0", "1 7241334473000/923828685123 0 1131930790000/923828685123 855591295000/923828685123 0 3101536309000/923828685123 813259967000/307942895041 0 0 0", "1 386523584809380000/46107527325002803 44236117549530000/46107527325002803 5935439795660000/4191593393182073 23973238918850000/46107527325002803 0 151639072999530000/46107527325002803 68012843324590000/46107527325002803 0 0 0", "1 38262085000/4846326391 0 0 16909409000/4846326391 0 10322773500/4846326391 0 0 1088743500/4846326391 0", "1 124598410000/15335289199 0 0 43304465000/15335289199 0 37331580000/15335289199 0 0 0 10887435000/15335289199", "1 138082170625/15774596023 0 0 18029648750/15774596023 0 46405599375/15774596023 0 0 0 30150463125/15774596023", "1 116390766672500/13651066378529 0 9856425817500/13651066378529 17405332997500/13651066378529 0 37625424300000/13651066378529 0 0 0 23814843472500/13651066378529", "1 513550016290000/69084932592567 0 176000503865000/69084932592567 107946708350000/69084932592567 0 181784117720000/69084932592567 0 0 0 36596698515000/23028310864189", "1 277747706788930000/35768427631296359 47186216101690000/107305282893889077 254043054686140000/107305282893889077 133872189398800000/107305282893889077 0 98249648070980000/35768427631296359 0 0 0 136025686649180000/107305282893889077", "1 95457985267000/10720316480767 0 0 11810422037000/10720316480767 0 31025910735000/10720316480767 3942570327000/10720316480767 0 0 16820212134000/10720316480767", "1 0 186390000/38285261 0 56478000/38285261 0 50038000/5469323 0 0 0 0", "1 0 0 0 45183000/19741997 0 152686000/19741997 0 0 0 93195000/19741997", "1 17622508125/7316511521 0 0 382031250/665137411 0 52390991875/7316511521 0 0 0 37867040625/7316511521", "1 42014314221875/11293920819459 0 49513251160000/11293920819459 18267337176250/11293920819459 0 47932378298125/11293920819459 0 0 0 3486064314375/1254880091051", "1 0 0 0 3610000/381461 0 0 720000/381461 0 0 0", "1 2160190000/526471071 0 0 672800000/175490357 0 0 1103580000/175490357 0 0 0", "1 151586855000/33117678507 0 0 40553657500/11039226169 10409557500/11039226169 0 62503110000/11039226169 0 0 0", "1 54863746783750/12272272571433 11098653697500/4090757523811 0 10391864850625/4090757523811 10471393050625/4090757523811 0 15522807012500/4090757523811 0 0 0", "1 64528670000/14121386611 0 0 8675560000/14121386611 0 61583560000/14121386611 94232220000/14121386611 0 0 0", "1 14972201286875/2833334840907 0 0 560912035000/314814982323 1745880986875/944444946969 7338101875/3116980023 4974990201875/944444946969 0 0 0", "1 12923359493391250/2572895517242127 1868860756190000/857631839080709 0 1150701719115000/857631839080709 2506061946696250/857631839080709 216748964031250/122518834154387 301407483143750/77966530825519 0 0 0", "1 0 315927500/52012643 0 245345000/52012643 0 0 120695000/52012643 0 0 0", "1 36692095000/16857148017 95821141250/16857148017 0 34305887500/16857148017 0 0 78004752500/16857148017 0 0 0", "1 16446033000/4846564889 36466393750/4846564889 0 4851770500/4846564889 0 0 13086309500/4846564889 0 0 0", "1 57771276175000/13950782401031 47451352746250/13950782401031 0 32854971797500/13950782401031 33040930360000/13950782401031 0 51906066442500/13950782401031 0 0 0", "1 211601338773410000/48681333381446129 107766677552610000/48681333381446129 0 103175655437760000/48681333381446129 158619372256980000/48681333381446129 0 556834228161560000/146044000144338387 0 14478781538380000/20863428592048341 0", "1 0 47807527500/8008849973 0 10413765000/8008849973 0 47370790000/8008849973 17266605000/8008849973 0 0 0", "1 0 0 631855000/113791709 912875000/113791709 0 0 96305000/113791709 0 0 0", "1 190959010000/143681924349 0 766569130000/143681924349 898769710000/143681924349 0 0 332287010000/143681924349 0 0 0", "1 510673494670000/220219013820043 0 972246568530000/220219013820043 178212209170000/31459859117149 224003469080000/220219013820043 0 511458594370000/220219013820043 0 0 0", "1 743620340423230000/177822248278608143 469718137115390000/177822248278608143 14478781538380000/25403178325515449 502755271218460000/177822248278608143 449300291576140000/177822248278608143 0 606866461288860000/177822248278608143 0 0 0", "1 0 0 76041232500/13858145281 78176377500/13858145281 0 56187042500/13858145281 10406790000/13858145281 0 0 0", "1 0 0 50818523750/9424521579 41085113750/9424521579 0 46861422500/9424521579 13660891250/9424521579 0 0 0", "1 10449436200/10178951113 0 54088243500/10178951113 41555778300/10178951113 0 44628180200/10178951113 19093761900/10178951113 0 0 0", "1 66704366860000/37367531371123 0 194385848885000/37367531371123 131718365925000/37367531371123 0 135141782830000/37367531371123 102041043985000/37367531371123 0 0 0", "1 1977647976000/917391292819 0 5348921681875/917391292819 3214931373125/917391292819 0 3491177950500/917391292819 1621539428875/917391292819 0 0 0", "1 6081636679386250/2095342280878641 0 8787946480580000/2095342280878641 5443343627480000/2095342280878641 2301739756658750/2095342280878641 8381080513861250/2095342280878641 5836956458798750/2095342280878641 0 0 0", "1 62482257460111250/15839367982232537 0 50178035993570000/15839367982232537 38948298710110000/15839367982232537 35822053087013750/15839367982232537 52102381239006250/15839367982232537 43000832113223750/15839367982232537 0 0 0", "1 15261116480184738125/3525952979022475413 1235968111234865000/3525952979022475413 9002389391766815000/3525952979022475413 2131693406078275000/1175317659674158471 9048299223078269375/3525952979022475413 12570491215457350625/3525952979022475413 10198364728045774375/3525952979022475413 0 0 0", "1 6291017834035808125/1363602551497214839 1444713854207325000/1363602551497214839 1689252888761355000/1363602551497214839 2065040497951655000/1363602551497214839 4626388708492209375/1363602551497214839 5148952753228415625/1363602551497214839 3401857889578479375/1363602551497214839 0 0 0", "1 30897593130740197500/6321049564384792211 7622568243681930000/6321049564384792211 17054792632431980000/6321049564384792211 9044466232597000000/6321049564384792211 15896591404780882500/6321049564384792211 22120183771828477500/6321049564384792211 11626941781138122500/6321049564384792211 0 0 0", "1 34752739168082206250/8099974729343054073 0 6113713501303670000/2699991576447684691 8840849706799450000/8099974729343054073 20298329329372678750/8099974729343054073 11132497796950833750/2699991576447684691 26805038653203308750/8099974729343054073 4943872444939460000/8099974729343054073 0 0", "1 9137587488713046250/2297906348371417057 1540489759802240000/2297906348371417057 6165273098719940000/2297906348371417057 3029655818778520000/2297906348371417057 4736403584296358750/2297906348371417057 9869440472216081250/2297906348371417057 7128347813651938750/2297906348371417057 0 0 0", "1 24998245322699441250/5155159139582113381 12713208406416720000/5155159139582113381 15609881848411720000/5155159139582113381 1674275504955860000/5155159139582113381 8719515763492263750/5155159139582113381 23527702576236176250/5155159139582113381 6273780051814183750/5155159139582113381 0 0 0", "1 2788104439158356250/704796558555433561 0 1514242413905220000/704796558555433561 64433158495800000/704796558555433561 1424280351682688750/704796558555433561 3662544001615671250/704796558555433561 2692712909999548750/704796558555433561 770244879901120000/704796558555433561 0 0", "1 0 11668537090000/9662887736351 42124666935000/9662887736351 39827131675000/9662887736351 0 53367061010000/9662887736351 9754509295000/9662887736351 0 0 0", "1 0 0 6384142794375/2034380099911 3261216868125/2034380099911 0 15003653686250/2034380099911 4900822505625/2034380099911 4375701408750/2034380099911 0 0", "1 0 0 33957219535000/6496927907627 29303704985000/6496927907627 0 29951170207500/6496927907627 9419667917500/6496927907627 0 2917134272500/6496927907627 0", "1 0 0 1551849007500/341439076673 1505087947500/341439076673 0 1728399130000/341439076673 349458487500/341439076673 0 0 357200115000/341439076673", "1 0 0 18698401250/4169933257 19196543750/4169933257 0 0 6919701250/1787114253 0 23869876250/12509799771 0", "1 0 0 52843375333000/12260701785817 39889702253000/12260701785817 0 18157014886000/12260701785817 52258758913000/12260701785817 0 26681746744000/12260701785817 0", "1 0 0 0 279750000/46706899 0 274332500/46706899 80872500/46706899 0 0 0", "1 0 0 0 72187500/100784413 0 957740000/100784413 455782500/100784413 0 0 0", "1 0 170312750000/54859863057 0 104174750000/54859863057 0 476600360000/54859863057 103030580000/54859863057 0 0 0", "1 0 0 0 129261000000/76076419631 0 580333067500/76076419631 317315452500/76076419631 0 127734562500/76076419631 0", "1 0 0 0 215140125000/88632995371 0 690385955000/88632995371 178908990000/88632995371 0 0 255469125000/88632995371", "1 0 0 0 721550000/242859037 0 0 1225590000/242859037 1263710000/242859037 0 0", "1 0 0 0 3590550625/529822144 1449130625/529822144 0 314745625/529822144 1744638125/529822144 0 0", "1 0 0 0 120140000/28770859 0 0 75470000/28770859 0 0 180530000/28770859", "1 20675900000/22225938263 0 0 67664380000/22225938263 0 0 80030490000/22225938263 0 0 135637710000/22225938263", "1 1274090000/1325316021 0 0 30857400000/10160756161 0 0 36875620000/10160756161 0 0 61583560000/10160756161", "1 171516314000/23517802797 0 0 17956458000/7839267599 0 0 11297438000/7839267599 0 0 23027582000/7839267599", "1 162150345875/20572436683 78163065125/82289746732 0 149352074875/82289746732 0 0 51974642125/82289746732 0 0 226279144375/82289746732", "1 57790921910000/14386658748729 0 0 14888157480000/4795552916243 11404989030000/4795552916243 0 17374887110000/4795552916243 0 0 117409630000/47480721943", "1 39763144430000/42001629435559 1158821080000/42001629435559 0 127132492300000/42001629435559 0 0 151906347120000/42001629435559 0 0 254997479060000/42001629435559", "1 206150913900590000/51025485355142221 48107334768000000/51025485355142221 0 141440194369560000/51025485355142221 142143964112410000/51025485355142221 0 162948465634170000/51025485355142221 0 0 16086695636230000/7289355050734603", "1 9305268594696500/2141138263070751 1764757624070750/713712754356917 0 5362721867029000/2141138263070751 5909345424082750/2141138263070751 0 7434586884813250/2141138263070751 0 0 180984769229750/305876894724393", "1 11887862685510625/2609157258763811 9409310171695625/5218314517527622 0 6119679174145625/2609157258763811 14602513538266875/5218314517527622 0 12898547288010625/5218314517527622 0 0 1516611759728125/745473502503946", "1 11254581686400621250/2402148054063551087 5023125675101620000/2402148054063551087 0 4138837501633080000/2402148054063551087 7264718356720613750/2402148054063551087 393216411886073750/343164007723364441 8336888783856693750/2402148054063551087 0 0 233164520294170000/343164007723364441", "1 59649344530000/63319467316857 0 1158821080000/63319467316857 192664780060000/63319467316857 0 0 228411779960000/63319467316857 0 0 128323589620000/21106489105619", "1 303903675694130000/83237349785854147 0 48107334768000000/83237349785854147 274170111634920000/83237349785854147 213758594788870000/83237349785854147 0 243896566865190000/83237349785854147 0 0 231655751041270000/83237349785854147", "1 7722023190000/2127958037861 0 0 7215293960000/2127958037861 6278431810000/2127958037861 0 5519186970000/2127958037861 0 0 6635358010000/2127958037861", "1 9495627079610000/2345449137203831 0 0 5935124849920000/2345449137203831 9919704389910000/2345449137203831 7827286390980000/2345449137203831 2986005170850000/2345449137203831 0 0 4461593572110000/2345449137203831", "1 33369423114000/35432218158829 0 0 107265599780000/35432218158829 0 0 128228178928000/35432218158829 463528432000/35432218158829 0 215596888252000/35432218158829", "1 282232906161870000/76962649205630653 0 0 215933058717080000/76962649205630653 199413908267130000/76962649205630653 0 253677798670810000/76962649205630653 32071556512000000/76962649205630653 0 224063751822730000/76962649205630653", "1 0 0 0 70407360000/30769979123 0 7755370000/2366921471 77820180000/30769979123 0 0 191230110000/30769979123", "1 1974953520000/8002183895473 0 0 16994387040000/8002183895473 0 24334826630000/8002183895473 22367897820000/8002183895473 0 0 49401345210000/8002183895473", "1 330331445409375/181281696085022 677450897046250/271922544127533 0 59967212095625/90640848042511 0 1434985068251875/543845088255066 30247964382500/6972372926347 0 0 1803268385265625/543845088255066", "1 1164293820251875/836760612902422 0 677450897046250/418380306451211 28560437233125/13496138917781 0 2162809686728125/836760612902422 1461444647686250/418380306451211 0 0 3464465198319375/836760612902422", "1 0 0 0 157060540000/65414763839 0 0 287914070000/65414763839 0 82703600000/65414763839 358120330000/65414763839", "1 0 0 0 7984051250/3980326249 0 0 20515791250/3980326249 0 318522500/173057663 18384593750/3980326249", "1 0 1031901851250/3270181971931 0 6770227490000/3270181971931 0 0 15517549352500/3270181971931 0 4970393053750/3270181971931 16307942397500/3270181971931", "1 0 17435166689420000/16748441162022849 0 6736822989640000/5582813720674283 0 11743190730370000/16748441162022849 29110049315080000/5582813720674283 0 10570606253100000/5582813720674283 66796648893850000/16748441162022849", "1 0 0 515950925625/2591800964224 5946832649375/2591800964224 0 0 289684878125/63214657664 0 3728084033125/2591800964224 3330113804375/647950241056", "1 0 0 0 31217211840000/15300606568859 0 37468559890000/15300606568859 50171218740000/15300606568859 0 7899814080000/15300606568859 90322655790000/15300606568859", "1 0 0 17435166689420000/22222787799406783 41091416465180000/22222787799406783 0 19933400323550000/22222787799406783 104544533639100000/22222787799406783 0 37257402248060000/22222787799406783 95796373787710000/22222787799406783", "1 0 0 0 24460243429640000/41769208589364103 0 62196094850070000/41769208589364103 230282732779000000/41769208589364103 34870333378840000/41769208589364103 75550773525180000/41769208589364103 171090325302910000/41769208589364103", "1 0 0 0 8258646616000/3877894017851 0 0 18250874150000/3877894017851 550347654000/3877894017851 5561570519000/3877894017851 20149388902000/3877894017851", "1 0 0 0 350000/97873 0 0 0 790000/97873 0 0", "1 0 21475000/46100141 0 130850000/46100141 0 0 0 392905000/46100141 0 0", "1 0 0 128850000/105354341 406300000/105354341 0 0 0 761230000/105354341 0 0", "1 406438080000/180152932313 0 1191912090000/180152932313 1117293580000/180152932313 0 0 0 69956230000/180152932313 0 0", "1 0 0 0 311750000/143066119 0 128850000/143066119 0 1293920000/143066119 0 0", "1 0 0 0 263150000/95080903 0 0 128850000/95080903 764540000/95080903 0 0", "1 173016195000/101593680077 0 0 92816245000/101593680077 0 0 595956045000/101593680077 568362985000/101593680077 0 0", "1 0 0 0 8162500/4181327 0 0 0 271776250/29269289 16106250/29269289 0", "1 0 0 0 323825000/115146361 0 0 0 88480000/10467851 0 64425000/115146361", "1 0 0 0 5000/1133 0 0 0 0 0 265000/32857", "1 370510000/409040503 0 0 1389740000/409040503 0 0 0 0 0 3496260000/409040503", "1 99145000/12936527 0 0 30715000/12936527 0 0 0 0 0 47082000/12936527", "1 44761906000/5675584339 3156306000/5675584339 0 11738732000/5675584339 0 0 0 0 0 18722076000/5675584339", "1 39779884000/4620556031 0 0 6876748000/4620556031 0 9468918000/4620556031 0 0 0 10628382000/4620556031", "1 198855830000/57314563243 248155120000/57314563243 0 50989180000/57314563243 0 0 0 0 0 43332140000/8187794749", "1 66952370000/17082421113 33733212500/5694140371 0 8886987500/17082421113 0 0 0 0 0 65431547500/17082421113", "1 2563885625/406041858 1509858125/541389144 0 328424375/270694572 0 0 0 0 0 83963750/22557881", "1 48544128430000/6363226466883 1495214870000/2121075488961 1187991820000/2121075488961 1455087760000/707025162987 0 0 0 0 0 6649187960000/2121075488961", "1 1064303916500/252407392939 344799911375/77663813212 0 224226981500/252407392939 375442831375/504814785878 0 0 0 0 1081554543000/252407392939", "1 538082050000/242739091393 0 496310240000/242739091393 16966380000/5164661519 0 0 0 0 0 1574957820000/242739091393", "1 628032370000/88213640643 0 28243595000/29404546881 73427290000/29404546881 0 0 0 0 0 103350595000/29404546881", "1 72581463230000/8630263892943 0 3802338370000/2876754630981 594058760000/410964947283 0 0 0 0 1495214870000/958918210327 591611450000/410964947283", "1 125737812272000/30361119821959 0 66318836517000/30361119821959 104603702625000/30361119821959 60762603019000/30361119821959 0 0 0 0 117173219749000/30361119821959", "1 1028977493419190000/227927540237034951 185081948114330000/227927540237034951 412753513216340000/227927540237034951 685505049317600000/227927540237034951 162964191304880000/75975846745678317 0 0 0 0 785519721048520000/227927540237034951", "1 419871384840830000/98136180181693201 0 314668642639450000/98136180181693201 257780357217030000/98136180181693201 290318387319310000/98136180181693201 0 0 0 185081948114330000/98136180181693201 148583389563470000/98136180181693201", "1 320809915000/81913315787 0 0 300870330000/81913315787 268947995000/81913315787 0 0 0 0 365768570000/81913315787", "1 257798595746000/64055391196499 13670632146000/64055391196499 0 227252330212000/64055391196499 209042667000000/64055391196499 0 0 0 0 277330858716000/64055391196499", "1 393569818060000/99062268306121 0 0 343295649920000/99062268306121 347976558060000/99062268306121 68353160730000/99062268306121 0 0 0 403390565010000/99062268306121", "1 121148105240000/30891072487643 0 0 768442516480000/216237507413501 766403683410000/216237507413501 0 0 0 68353160730000/216237507413501 890845893120000/216237507413501", "1 629754550000/217842558379 0 0 161337660000/217842558379 0 0 0 496310240000/217842558379 0 1651495220000/217842558379", "1 1051716920000/147369690783 0 0 62131970000/49123230261 0 0 0 56487190000/49123230261 0 69793460000/16374410087", "1 325598752430000/42167771349093 3846372890000/4685307927677 0 1461540020000/1081224906387 0 0 0 8315942740000/14055923783031 0 16196709740000/4685307927677", "1 252313198972000/54980492330219 0 0 40073290128000/54980492330219 94819824914000/54980492330219 0 0 132637673034000/54980492330219 0 295797126260000/54980492330219", "1 1135587966250970000/226506606431365623 263199656640590000/226506606431365623 0 173729671630580000/226506606431365623 150840014733040000/75502202143788541 0 0 412753513216340000/226506606431365623 0 333497680495340000/75502202143788541", "1 0 0 0 227490/106201 0 416780/106201 0 0 0 840750/106201", "1 182143125/5009909587 0 0 10598853750/5009909587 0 19537596875/5009909587 0 0 0 39763055625/5009909587", "1 8866849796875/3237105266319 0 12972263560000/3237105266319 6771775626250/3237105266319 0 10686266123125/3237105266319 0 0 0 4310407368125/1079035088773", "1 0 0 0 53937500/18920529 0 0 0 0 23156875/18920529 160175000/18920529", "1 0 0 337955530000/106027081107 152858770000/106027081107 0 0 0 0 422539690000/106027081107 537660890000/106027081107", "1 55106840050000/88930727722897 0 355044551280000/88930727722897 129834419220000/88930727722897 0 0 0 0 341960515940000/88930727722897 379704756940000/88930727722897", "1 0 0 13151425652500/5650117731541 8885541897500/5650117731541 0 0 13776710012500/5650117731541 0 18434786520000/5650117731541 24463176720000/5650117731541", "1 0 0 0 37018824000/17588782369 0 67591106000/17588782369 0 0 1165716000/17588782369 139678962000/17588782369", "1 0 0 0 0 10000/973 0 0 0 0 0", "1 6800/2823 0 0 0 28000/2823 0 0 0 0 0", "1 27373000/6939929 0 63415000/20819787 0 48280000/6939929 0 0 0 0 0", "1 276202000/78939489 0 0 0 226950000/26313163 0 126830000/78939489 0 0 0", "1 0 0 3485000/347539 0 445000/347539 0 0 0 0 0", "1 18638625/4238719 0 47235625/8477438 0 39190625/8477438 0 0 0 0 0", "1 95733511600/20163677643 17758306000/20163677643 96516628000/20163677643 0 89175824000/20163677643 0 0 0 0 0", "1 283440538000/60217567503 0 92130630000/20072522501 0 96656070000/20072522501 0 0 0 88791530000/60217567503 0", "1 0 0 983345000/126257251 0 143465000/126257251 0 0 0 623870000/126257251 0", "1 0 0 0 0 185000/25191 197000/25191 0 0 0 0", "1 3765000/1320589 0 0 0 832180000/106967709 591085000/106967709 0 0 0 0", "1 497648875000/100492784301 0 149744905000/33497594767 0 419104480000/100492784301 363830660000/100492784301 0 0 0 0", "1 198335656250/44056299867 0 0 0 269106758750/44056299867 200087691250/44056299867 37436226250/14685433289 0 0 0", "1 16857831750/3738661877 0 0 0 22580161250/3738661877 17004672750/3738661877 9875957250/3738661877 0 0 0", "1 76986972346250/16986220645497 835525420000/16986220645497 0 0 102265265128750/16986220645497 77128933041250/16986220645497 44169148888750/16986220645497 0 0 0", "1 513727345000/143663815311 0 0 0 671624560000/143663815311 794439005000/143663815311 0 149744905000/47887938437 0 0", "1 0 486120000/149929399 0 0 568725000/149929399 1336985000/149929399 0 0 0 0", "1 136370098000/52575060207 84244882000/17525020069 0 0 130188056000/52575060207 128975272000/17525020069 0 0 0 0", "1 0 0 243060000/61622699 0 238845000/61622699 470245000/61622699 0 0 0 0", "1 596284990000/160508394099 0 356902675000/53502798033 0 328513805000/160508394099 241324730000/53502798033 0 0 0 0", "1 1529584970000/302273105247 0 525555275000/100757701749 0 1067441165000/302273105247 1057237570000/302273105247 0 0 0 0", "1 2345402076190000/453459886349421 302678470000/1103308725911 751223589740000/151153295449807 0 1570984760920000/453459886349421 1592622484220000/453459886349421 0 0 0 0", "1 21542149402250/4326542902307 0 16939372480000/4326542902307 0 15661253108750/4326542902307 16493069849250/4326542902307 5978650240750/4326542902307 0 0 0", "1 52465428968615000/10028178368866989 5575861442570000/10028178368866989 38406953814020000/10028178368866989 0 34657695797555000/10028178368866989 37521254966585000/10028178368866989 9453092344315000/10028178368866989 0 0 0", "1 46394955133750/9079662324897 0 1638919296250/336283789811 0 33792678601250/9079662324897 28384557186250/9079662324897 0 0 37834808750/66274907481 0", "1 234172875958000/49062782882793 41281167326000/16354260960931 71573641628000/16354260960931 0 71702786744000/49062782882793 75610962580000/16354260960931 0 0 0 0", "1 13874636628250/3258147926521 0 12173445980000/3258147926521 0 9602991968750/3258147926521 14757474327250/3258147926521 7608831092750/3258147926521 0 0 0", "1 27259960426015000/5534033168720961 12873495970690000/5534033168720961 18165737918020000/5534033168720961 0 10505370062315000/5534033168720961 25582043852105000/5534033168720961 5610137141555000/5534033168720961 0 0 0", "1 0 0 0 0 159165000/26241763 106425000/26241763 0 0 162040000/26241763 0", "1 0 0 0 0 53687000/11737361 96059000/11737361 0 0 0 32408000/11737361", "1 49033520000/22082776667 0 0 0 83232605000/22082776667 144584025000/22082776667 0 0 0 86163160000/22082776667", "1 18939620000/4677153707 0 0 0 26633680000/4677153707 22727810000/4677153707 0 0 0 10576585000/4677153707", "1 337977759710000/65201001734927 0 267602978340000/65201001734927 0 245400349160000/65201001734927 231595381020000/65201001734927 0 0 0 49654082215000/65201001734927", "1 1757994938750/388579522151 0 0 0 40040009586250/6605851876567 29922453723750/6605851876567 16725186146250/6605851876567 0 0 417762710000/6605851876567", "1 53553589800625/12612310051559 0 61876064876250/12612310051559 0 27324559243750/12612310051559 55070523501875/12612310051559 0 0 0 19022077731875/12612310051559", "1 181573869524000/34823090026591 0 156968237904000/34823090026591 0 121492976338000/34823090026591 121819183080000/34823090026591 0 0 0 23914600963000/34823090026591", "1 632445747268390000/120209723772267841 17650128883930000/120209723772267841 533171362968740000/120209723772267841 0 415517466787640000/120209723772267841 421450220109100000/120209723772267841 0 0 0 75624738754520000/120209723772267841", "1 227924737072450000/43957882425467691 0 22276794967700000/4884209158385299 0 160026521910590000/43957882425467691 142279232532970000/43957882425467691 0 0 17650128883930000/43957882425467691 1961156486785000/4884209158385299", "1 64038350635198000/13080700905187129 29305478007322000/13080700905187129 50118689524052000/13080700905187129 0 20690538923992000/13080700905187129 59452728689172000/13080700905187129 0 0 0 8976219426488000/13080700905187129", "1 0 0 0 0 10000/15241 0 0 0 0 153750/15241", "1 55540000/12130903 0 0 0 2450000/418307 0 0 0 0 47547500/12130903", "1 71528486000/14372304113 0 23694468000/14372304113 0 72779360000/14372304113 0 0 0 0 45098947000/14372304113", "1 20408770000/4897617749 0 0 39490780000/14692853247 59604280000/14692853247 0 0 0 0 62010785000/14692853247", "1 45836230000/9691038391 0 0 0 57949210000/9691038391 0 8462310000/9691038391 0 0 30261710000/9691038391", "1 11338760000/2348868761 0 0 0 198718630000/39930768937 0 0 29618085000/39930768937 0 162069357500/39930768937", "1 0 0 0 0 1815000/1777429 79105000/19551719 0 0 0 240000/29579", "1 0 0 0 0 17770000/41382171 0 166460000/41382171 0 0 11275000/1532673", "1 5987200000/1423292201 0 0 0 139880330000/27042551819 0 125705340000/27042551819 0 0 34180025000/27042551819", "1 265650078650000/52863403717213 88712390060000/52863403717213 0 0 242146622390000/52863403717213 0 162299080810000/52863403717213 0 0 64401045680000/52863403717213", "1 0 0 0 0 0 250/23 0 0 0 0", "1 3445000/342129 0 0 0 0 1165000/342129 0 0 0 0", "1 663665000/68998263 0 111425000/68998263 0 0 70660000/22999421 0 0 0 0", "1 123243125/14093678 0 93550625/28187356 0 0 21255625/7046839 0 0 0 0", "1 3003357850000/341107443519 133641670000/341107443519 1029736060000/341107443519 0 0 1040418500000/341107443519 0 0 0 0", "1 144591935000/15870723537 0 14087511000/5290241179 0 0 12856053000/5290241179 0 0 13364167000/15870723537 0", "1 19352500/2341513 0 0 13928125/4683026 0 5655000/2341513 0 0 0 0", "1 1584305000/156905991 0 0 0 0 170395000/52301997 111425000/156905991 0 0 0", "1 144910000/15494527 0 0 0 0 54857500/15494527 34437500/15494527 0 0 0", "1 4450000/900177 0 0 0 0 5622500/900177 4842500/900177 0 0 0", "1 20750000/4994711 0 0 0 0 31780000/4994711 30840000/4994711 0 0 0", "1 279750000/71416699 0 0 0 0 493707500/71416699 421747500/71416699 0 0 0", "1 22027875000/5635480447 0 1135875000/5635480447 0 0 38569310000/5635480447 33026805000/5635480447 0 0 0", "1 14287250000/3558921409 0 1322000000/3558921409 0 0 23219320000/3558921409 161660000/27167339 0 0 0", "1 3777182470000/956825310119 0 25667227840000/18179680892261 8742531960000/18179680892261 0 98348392280000/18179680892261 103866393380000/18179680892261 0 0 0", "1 65821975850000/16728791756161 0 18680708120000/16728791756161 0 0 94475658760000/16728791756161 99703002460000/16728791756161 5828354640000/16728791756161 0 0", "1 8755225000/2127823133 0 1182625000/2127823133 0 0 13999640000/2127823133 12061595000/2127823133 0 0 0", "1 39827086000/8841676223 0 20709677500/8841676223 0 0 51075323000/8841676223 38998262000/8841676223 0 0 0", "1 45201528686000/9453126003361 10511395290000/9453126003361 22333526120000/9453126003361 0 0 53022950668000/9453126003361 32385631912000/9453126003361 0 0 0", "1 5007881368549375/985992906327049 8129398282465000/2957978718981147 8928954210850000/2957978718981147 0 3916318497529375/2957978718981147 14204505307840625/2957978718981147 1029746227933125/985992906327049 0 0 0", "1 1282858151000/297654120729 0 625614103750/297654120729 145991601250/297654120729 0 237592984000/42522017247 154936191750/33072680081 0 0 0", "1 807870173200/183934168049 0 364412613625/183934168049 0 0 2162362528825/367868336098 1716554846425/367868336098 131392441125/367868336098 0 0", "1 4739003468750/1175670997747 0 365217500000/1175670997747 0 190526906250/1175670997747 7824476653750/1175670997747 6796507086250/1175670997747 0 0 0", "1 495274965881350/124606570939511 0 290561964930400/124606570939511 137078463067200/124606570939511 139339492110450/124606570939511 607986928095950/124606570939511 528063919192850/124606570939511 0 0 0", "1 14529352883697500/3278283746358487 0 7804829036630000/3278283746358487 6155161007325000/3278283746358487 7725984390967500/3278283746358487 11707183059347500/3278283746358487 10697154791222500/3278283746358487 0 0 0", "1 8071031250/1948202291 0 0 0 562593750/1948202291 1848958750/278314613 11313258750/1948202291 0 0 0", "1 8519182386250/1657142879833 0 0 2707607195000/1657142879833 4861196823750/1657142879833 6446876778750/1657142879833 891781713750/236734697119 0 0 0", "1 1469287225167050/293626767753101 268820842297200/293626767753101 0 417267667924600/293626767753101 1054030771851750/293626767753101 1155441313530450/293626767753101 849826070976750/293626767753101 0 0 0", "1 4069262327350000/981658004187523 0 0 1903544958509000/981658004187523 4754232104175000/981658004187523 2825289648156000/981658004187523 2409639811260000/981658004187523 0 1344104211486000/981658004187523 0", "1 40096447252500/8407663068097 0 0 0 26811751787500/8407663068097 42227241750000/8407663068097 32054925185000/8407663068097 10830428780000/8407663068097 0 0", "1 922241710000/97549243277 185345750000/292647729831 0 0 0 1019302960000/292647729831 166626100000/97549243277 0 0 0", "1 28071840500/3204981133 0 5064713750/3204981133 0 0 10917004000/3204981133 5710861000/3204981133 0 0 0", "1 1070947231310000/120767880896601 89564430010000/120767880896601 194119227220000/120767880896601 0 0 402970803860000/120767880896601 141530227480000/120767880896601 0 0 0", "1 993155000/106260941 0 0 0 0 392135000/106260941 0 111425000/106260941 0 0", "1 1145380000/119454061 0 0 0 0 399110000/119454061 0 0 0 176375000/119454061", "1 433401730000/46516307821 0 69628900000/46516307821 0 0 141970660000/46516307821 0 0 0 47752325000/46516307821", "1 289475785000/32582616643 0 79631372500/32582616643 0 0 98546230000/32582616643 0 0 0 28554305000/32582616643", "1 805694229370000/90475603142131 21074448870000/90475603142131 213489644020000/90475603142131 0 0 275381604820000/90475603142131 0 0 0 70765113740000/90475603142131", "1 1026277990000/104647437563 0 0 0 0 337884080000/104647437563 69628900000/104647437563 0 0 92672875000/104647437563", "1 0 1170000/268739 0 0 0 2785000/268739 0 0 0 0", "1 0 0 58500/10963 0 0 5000/577 0 0 0 0", "1 496480000/138465871 0 1015452500/138465871 0 0 717595000/138465871 0 0 0 0", "1 0 0 0 0 0 345625/34196 73125/17098 0 0 0", "1 0 0 0 0 0 1427500/146657 0 0 0 585000/146657", "1 298282500/114586109 0 0 0 0 858842500/114586109 0 0 0 581287500/114586109", "1 185461705000/42284832427 0 198530597500/42284832427 0 0 212367340000/42284832427 0 0 0 97495655000/42284832427", "1 1068232500/291849899 0 0 0 0 2039642500/291849899 122250000/26531809 0 0 354787500/291849899", "1 4031000000/1073572099 0 0 0 0 7119770000/1073572099 6219060000/1073572099 0 0 495750000/1073572099", "1 107570062500/28515990863 0 0 0 0 199433552500/28515990863 164506470000/28515990863 0 0 5111437500/28515990863", "1 780165609375/202577079449 0 0 0 53733421875/202577079449 1381079441875/202577079449 1125837106875/202577079449 0 0 68478281250/202577079449", "1 0 0 0 0 0 0 625/61 0 0 0", "1 8125/8952 0 0 0 0 0 360625/35808 0 0 0", "1 46000/4971 0 0 0 0 0 110000/34797 0 0 0", "1 11102000/1172373 4335000/2735537 0 0 0 0 15805000/8206611 0 0 0", "1 49628000/5557401 0 0 0 0 4678000/1852467 43084000/12967269 0 0 0", "1 825656680000/90475964583 39088940000/30158654861 0 0 0 71698070000/30158654861 69447060000/30158654861 0 0 0", "1 0 1455000/238441 0 0 0 0 1480000/238441 0 0 0", "1 17230000/19991519 850715000/139940633 0 0 0 0 847510000/139940633 0 0 0", "1 123322000/36285573 100215000/12095191 0 0 0 0 90170000/36285573 0 0 0", "1 11884693750/3248893797 8284010625/1082964599 0 0 0 12129426250/9746681391 25748743750/9746681391 0 0 0", "1 246058190000/97882563929 545626070000/97882563929 0 0 0 274447100000/97882563929 480283580000/97882563929 0 0 0", "1 62482590000/30742238213 173457090000/30742238213 0 0 0 117759280000/30742238213 134282760000/30742238213 0 0 0", "1 312524250000/84281394911 20445750000/84281394911 0 0 0 596499280000/84281394911 479910840000/84281394911 0 0 0", "1 65088064490000/26025582822767 131718365925000/26025582822767 12051875590000/26025582822767 0 0 86105827520000/26025582822767 123780209840000/26025582822767 0 0 0", "1 32245616170000/8237973085961 8742531960000/8237973085961 6093677560000/8237973085961 0 0 42780423080000/8237973085961 48480390140000/8237973085961 0 0 0", "1 19827488285000/4686157205183 69196600412500/14058471615549 50059955980000/14058471615549 0 0 59175171665000/14058471615549 2153696255000/14058471615549 0 0 0", "1 6802805659611250/1748360881633621 5366679638040000/1748360881633621 1433345574380000/1748360881633621 0 2873427980373750/1748360881633621 6999036759666250/1748360881633621 7065671894953750/1748360881633621 0 0 0", "1 2208894238962500/459463181729031 1404753854352500/459463181729031 1162760322380000/459463181729031 0 730422954642500/459463181729031 2059002324782500/459463181729031 76842964637500/51051464636559 0 0 0", "1 18610508340000/4693534265477 12874845570000/4693534265477 0 0 14486054610000/4693534265477 27646579870000/4693534265477 11566104570000/4693534265477 0 0 0", "1 16504864908750/4003385298997 1511613660000/571912185571 0 0 12721798466250/4003385298997 3281201266250/571912185571 10089471476250/4003385298997 0 0 0", "1 56892291797467500/12120518359216763 9420569453370000/12120518359216763 0 0 45061866653472500/12120518359216763 59817676897477500/12120518359216763 37168728183602500/12120518359216763 13886692842580000/12120518359216763 0 0", "1 14380526432463750/3523758087849731 9161386753560000/3523758087849731 411141791700000/3523758087849731 0 10863573051011250/3523758087849731 20284625311828750/3523758087849731 9035484120191250/3523758087849731 0 0 0", "1 3492143237452500/889832562050497 2210631834270000/889832562050497 0 0 2885785866847500/889832562050497 5078853701982500/889832562050497 2278447231657500/889832562050497 0 205570895850000/889832562050497 0", "1 6461515203221250/1610151588949927 4172191217220000/1610151588949927 0 0 5011013076753750/1610151588949927 9372390675676250/1610151588949927 4010195542713750/1610151588949927 0 0 205570895850000/1610151588949927", "1 182464730000/43466678061 17351120000/14488892687 0 0 0 67806400000/14488892687 92021300000/14488892687 0 0 0", "1 253531115425/60267502664 27451908850/7533437833 0 0 119779187675/60267502664 191275278325/60267502664 252080005275/60267502664 0 0 0", "1 1206607257113750/255559701178453 8274016192060000/2811156712962983 0 2374831046740000/2811156712962983 7747444861513750/2811156712962983 864596612703750/401593816137569 10645172860233750/2811156712962983 0 0 0", "1 10666882513978905625/2228110406990109516 1089526663521340000/557027601747527379 58291130073542500/79575371678218197 262965538138857500/185675867249175793 6614140662667211875/2228110406990109516 701359232779556875/318301486712872788 7559102581476381875/2228110406990109516 0 0 0", "1 40057451329138630000/8175303615278461753 18034462932857470000/8175303615278461753 0 6745512220468900000/8175303615278461753 24928213968186860000/8175303615278461753 2524943490372920000/1167900516468351679 31186257214443140000/8175303615278461753 466329040588340000/1167900516468351679 0 0", "1 21860502589230625/4591211628356204 1662496419927500/1147802907089051 0 0 13286697847926875/4591211628356204 14374253344523125/4591211628356204 19453840299166875/4591211628356204 1335197643810000/1147802907089051 0 0", "1 8817728750/1067813373 765563125/355937791 0 0 0 2930903750/1067813373 2601196250/1067813373 0 0 0", "1 7108065250/1519164919 66836762250/16710814109 0 0 109612059250/50132442327 420864320750/150397326981 528061087250/150397326981 0 0 0", "1 46263254350456875/9051728189418631 19591281465690000/9051728189418631 0 0 26474067741085625/9051728189418631 25199130438914375/9051728189418631 32530593652495625/9051728189418631 8705703539110000/9051728189418631 0 0", "1 0 534382500/103995283 8615000/14856469 0 0 0 706450000/103995283 0 0 0", "1 0 8479947500/2336509849 45046405000/16355568943 0 0 0 58637850000/16355568943 0 66383200000/16355568943 0", "1 0 394600000/81192699 0 0 0 0 560950000/81192699 0 0 8615000/11598957", "1 0 22633284375/7811508152 0 0 0 0 18657221875/3905754076 0 12184671875/3905754076 5630800625/1952877038", "1 0 9617822472500/5552916700981 0 0 3800955065000/5552916700981 0 28957589510000/5552916700981 0 17802511795000/5552916700981 16580425805000/5552916700981", "1 0 0 130000/214631 0 0 0 2187500/214631 0 0 0", "1 0 0 0 43750/41089 0 0 396250/41089 0 0 0", "1 963750/710963 0 0 12784375/12086371 0 0 113449375/12086371 0 0 0", "1 0 458085000/81271067 0 101270000/81271067 0 0 472220000/81271067 0 0 0", "1 2461150000/1771076133 9922415000/1771076133 0 2192230000/1771076133 0 0 9864830000/1771076133 0 0 0", "1 0 213345952500/45473971223 33225525000/45473971223 23898680000/45473971223 0 0 308233130000/45473971223 0 0 0", "1 0 0 7710000/10774417 71225000/183165089 0 0 1824725000/183165089 0 0 0", "1 0 0 184046250/35370067 169191250/35370067 0 0 141006250/35370067 0 0 0", "1 0 0 391845355000/77442860739 168682435000/77442860739 0 225533410000/77442860739 370626175000/77442860739 0 0 0", "1 0 0 225531420000/218549396783 207588830000/218549396783 0 0 1569234590000/218549396783 853383810000/218549396783 0 0", "1 0 0 0 392410000/179075929 0 0 1041190000/179075929 916170000/179075929 0 0", "1 64519540000/96858920291 0 0 211597990000/96858920291 0 0 551994990000/96858920291 494105630000/96858920291 0 0", "1 257042740000/131521161131 0 0 251704150000/131521161131 0 0 835486590000/131521161131 513155950000/131521161131 0 0", "1 597432580000/321649233761 0 0 14214864897500/9327827779069 4568082472500/9327827779069 0 56314467765000/9327827779069 42207031505000/9327827779069 0 0", "1 318742540000/192584833893 0 0 188076490000/192584833893 0 0 1142970370000/192584833893 1061687090000/192584833893 0 0", "1 45461281340000/25443547383543 0 0 33793218820000/25443547383543 8778062170000/25443547383543 0 152453950280000/25443547383543 124044466610000/25443547383543 0 0", "1 13121577580000/7455606532761 20974847240000/7455606532761 0 12687996850000/7455606532761 0 0 41063678570000/7455606532761 6271227630000/2485202177587 0 0", "1 193422170866240000/104496924628092423 1225971091150000/34832308209364141 0 157292781937670000/104496924628092423 53278961025320000/104496924628092423 0 628415782721830000/104496924628092423 473708488471210000/104496924628092423 0 0", "1 277991329559866000/64973242739254619 183663398849178000/64973242739254619 0 152338890916140000/64973242739254619 168686509213340000/64973242739254619 0 243147018178660000/64973242739254619 2895756307676000/9281891819893517 0 0", "1 74725683380000/55350610324109 0 20974847240000/55350610324109 95304649530000/55350610324109 0 0 336653987170000/55350610324109 256897216810000/55350610324109 0 0", "1 303531185174590000/166512660445813983 0 1225971091150000/55504220148604661 252352960835870000/166512660445813983 80962757714120000/166512660445813983 0 1003031219420530000/166512660445813983 759881360605960000/166512660445813983 0 0", "1 3524035297500/1948001313773 0 0 2975607770000/1948001313773 969255602500/1948001313773 0 11704502840000/1948001313773 8918735455000/1948001313773 0 0", "1 3863909994190000/2101720463345493 0 0 3097741910232500/2101720463345493 1046297550282500/2101720463345493 23576367137500/700573487781831 12685204248430000/2101720463345493 9611583955847500/2101720463345493 0 0", "1 8983244682630000/4351377200276881 0 0 6431563197740000/4351377200276881 4083154219440000/4351377200276881 0 25535974098860000/4351377200276881 17768613138620000/4351377200276881 1225971091150000/4351377200276881 0", "1 131254424380000/89289322004089 0 0 62278140210000/89289322004089 0 83899388960000/89289322004089 576159807210000/89289322004089 443208201370000/89289322004089 0 0", "1 87272140140000/65960896912157 0 0 98303956250000/65960896912157 0 0 1222658169110000/197882690736471 919940217190000/197882690736471 0 83899388960000/197882690736471", "1 44343776086160000/24217260864352417 0 0 36380478467030000/24217260864352417 12006227611630000/24217260864352417 0 14123615030560000/2343605890098621 331457961812870000/72651782593057251 0 1225971091150000/72651782593057251", "1 0 0 0 0 175000/177063 0 585000/59021 0 0 0", "1 0 0 0 0 640000/112277 0 730000/112277 0 0 0", "1 705680000/187464983 0 0 0 1051160000/187464983 0 1094230000/187464983 0 0 0", "1 91569375/20800454 0 0 0 362549375/62401362 237780625/62401362 211139375/62401362 0 0 0", "1 128057890000/33046091029 0 0 0 180208380000/33046091029 0 577220620000/99138273087 0 33615950000/99138273087 0", "1 0 0 392500/169517 0 84595625/29326441 0 221421875/29326441 0 0 0", "1 1660915610000/437555407121 0 67231900000/437555407121 0 38875070000/7173039461 0 2582008510000/437555407121 0 0 0", "1 5087793288125/1203912286874 0 474205550000/601956143437 0 5707245889375/1203912286874 2156391270625/1203912286874 6033864069375/1203912286874 0 0 0", "1 0 0 37037759200/9983301827 0 13494594800/9983301827 28366989200/9983301827 64255274000/9983301827 0 0 0", "1 295557977500/84183839029 0 197674935200/84183839029 0 252174591300/84183839029 348565632700/84183839029 370540046500/84183839029 0 0 0", "1 0 0 0 0 581835000/94442803 758570000/94442803 148065000/94442803 0 0 0", "1 241637010/55538441 0 0 0 325588950/55538441 37314550/7934063 157971270/55538441 0 0 0", "1 14927436406250/3357041297711 0 0 582189205000/3357041297711 19710707313750/3357041297711 15124965228750/3357041297711 9306505586250/3357041297711 0 0 0", "1 18061253539656875/4011236971969706 445704104347500/2005618485984853 0 620984848085000/2005618485984853 22674855433730625/4011236971969706 17798583312894375/4011236971969706 10783564161770625/4011236971969706 0 0 0", "1 3087978873750/692329614649 0 0 0 41891500643750/7615625761139 35670662186250/7615625761139 22307019163750/7615625761139 2328756820000/7615625761139 0 0", "1 0 21027858000/13277825213 0 0 60317958000/13277825213 113487466000/13277825213 18770382000/13277825213 0 0 0", "1 0 0 3391590000/3250561369 0 15903915000/3250561369 26150045000/3250561369 6606540000/3250561369 0 0 0", "1 29217795468750/7962884617747 0 13937046420000/7962884617747 0 30115832426250/7962884617747 41772567053750/7962884617747 27263550926250/7962884617747 0 0 0", "1 29204207230513750/7596054728002047 0 22267589908540000/7596054728002047 8737173067240000/7596054728002047 18519179140081250/7596054728002047 32673912837718750/7596054728002047 25344530078901250/7596054728002047 0 0 0", "1 23038758067120000/5449421070402559 0 14724328519895000/5449421070402559 9165750066435000/5449421070402559 14923155743935000/5449421070402559 19750218667530000/5449421070402559 16563086271620000/5449421070402559 0 0 0", "1 0 0 0 0 48353002500/8868824249 63860271250/8868824249 18626846250/8868824249 0 13142411250/8868824249 0", "1 7800701103750/3262247868881 0 0 0 16230276821250/3262247868881 16323670768750/3262247868881 9907334321250/3262247868881 0 6968523210000/3262247868881 0", "1 0 0 0 0 213803760000/43137604069 353269955000/43137604069 66593895000/43137604069 0 0 52569645000/43137604069", "1 449524931250/165620632289 0 0 0 690085503750/165620632289 1025436786250/165620632289 55082966250/23660090327 0 0 302979270000/165620632289", "1 0 0 0 0 62617500/34707433 0 233752500/34707433 0 0 785000/200621", "1 32703490000/8495912879 0 0 0 871322570000/161422344701 0 941799810000/161422344701 0 0 33615950000/161422344701", "1 0 0 0 0 15786220000/32488633449 55729130000/32488633449 187329580000/32488633449 0 0 19260590000/3609848161", "1 0 0 0 0 1416480000/2845982809 5150630000/2845982809 16243740000/2845982809 0 0 15166650000/2845982809", "1 0 0 0 0 65646743200/169879685147 307643294000/169879685147 973382103200/169879685147 11930926400/169879685147 0 910287073200/169879685147", "1 3519756928750/856188700019 0 0 0 4356713136250/856188700019 616700773750/856188700019 4594572016250/856188700019 0 0 474205550000/856188700019", "1 0 745682900000/12884165347929 0 0 1867963540000/4294721782643 22607563330000/12884165347929 24683281060000/4294721782643 0 0 68653805410000/12884165347929", "1 0 0 29827316000/889282942721 0 414050634000/889282942721 1567025486000/889282942721 5114612790000/889282942721 0 0 4728927640000/889282942721", "1 33570000/34656613 0 0 0 102275000/103969839 0 337095000/34656613 0 0 0", "1 2028230000/521730603 0 0 0 927670000/173910201 0 1045310000/173910201 0 0 0", "1 318182050000/113904373941 0 0 0 514543850000/113904373941 0 705754310000/113904373941 0 228611230000/113904373941 0", "1 0 199090000/45217121 0 0 50635000/45217121 0 314395000/45217121 0 0 0", "1 25055530000/26548296953 116425820000/26548296953 0 0 29595105000/26548296953 0 180117895000/26548296953 0 0 0", "1 552052570000/141668782757 33615950000/141668782757 0 0 758936340000/141668782757 0 827049520000/141668782757 0 0 0", "1 300639314000/61604995353 45499140000/20534998451 0 0 95440890000/20534998451 0 241291570000/61604995353 0 0 0", "1 586135930290000/133823540688733 353861073920000/133823540688733 0 277277161940000/133823540688733 416589447730000/133823540688733 0 520465767030000/133823540688733 0 0 0", "1 2303921198125/513048864158 237102775000/256524432079 0 0 2411236369375/513048864158 644688100625/513048864158 2581422329375/513048864158 0 0 0", "1 3668983380000/729410383763 1474736500000/729410383763 0 0 28334436740000/6564693453867 8050130710000/6564693453867 26056044560000/6564693453867 0 0 0", "1 70709514788125/14591412907022 15775017717500/7295706453511 0 6763740785000/7295706453511 155034435903125/43774238721066 1385596001875/893351810634 173812356243125/43774238721066 0 0 0", "1 0 86665172500/20585307311 12527765000/20585307311 0 11949340000/20585307311 0 148395670000/20585307311 0 0 0", "1 0 76810925000/16650948259 0 0 2534065000/16650948259 0 116879095000/16650948259 0 0 12527765000/16650948259", "1 0 0 16785000/26900747 0 35612500/80702241 0 270112500/26900747 0 0 0", "1 0 0 0 0 39241000/23234643 0 58367000/7744881 79636000/23234643 0 0", "1 665580560/546305381 0 0 0 917491720/546305381 0 3996618040/546305381 1862813120/546305381 0 0", "1 439560290000/121922811559 0 0 0 605444830000/121922811559 0 735377990000/121922811559 67231900000/121922811559 0 0", "1 222040214960000/120587162026257 0 0 178120841830000/120587162026257 64654342030000/120587162026257 0 728616164720000/120587162026257 547356396590000/120587162026257 0 0", "1 0 0 83197570000/107132146071 0 103794415000/107132146071 0 279615695000/35710715357 346660690000/107132146071 0 0", "1 0 0 0 0 534560000/1171760931 0 80777420000/10545848379 38405462500/10545848379 0 10399696250/10545848379", "1 0 0 0 0 221862500/46711903 0 305167500/46711903 0 99545000/46711903 0", "1 30856822000/11400993411 0 0 0 53511950000/11400993411 0 69028874000/11400993411 0 24018370000/11400993411 0", "1 45169250000/14270448933 0 0 0 70029970000/14270448933 0 85140910000/14270448933 0 22863830000/14270448933 0", "1 626254850000/155452827177 0 0 0 94495310000/17272536353 0 844170170000/155452827177 0 136720100000/155452827177 0", "1 418345160000/97519642497 0 0 0 24256590000/3611838611 0 9437440000/3362746293 0 211831970000/97519642497 0", "1 737439574270000/151940243243151 28325162660000/16882249249239 0 0 82186033570000/16882249249239 0 581047857550000/151940243243151 0 128802091360000/151940243243151 0", "1 814845882190000/172290299607711 0 56650325320000/19143366623079 0 32406153850000/6381122207693 0 216399294370000/172290299607711 0 377531020480000/172290299607711 0", "1 68793040450000/17532999566941 0 0 6687230065000/17532999566941 91515801747500/17532999566941 0 95285879502500/17532999566941 0 17046181857500/17532999566941 0", "1 3049336341875/756504912678 0 0 0 12124104551875/2269514738034 835903758125/2269514738034 12647646731875/2269514738034 0 237102775000/378252456339 0", "1 25763734170000/9241523541409 1980552040000/9241523541409 0 0 41727925610000/9241523541409 0 56010189190000/9241523541409 0 18503685670000/9241523541409 0", "1 53912266454000/19105260486159 0 0 0 87504956038000/19105260486159 0 115981577866000/19105260486159 792220816000/6368420162053 38751353210000/19105260486159 0", "1 0 0 39856115000/23203639519 0 64469984375/23203639519 0 169547000625/23203639519 0 43332586250/23203639519 0", "1 0 0 333906245000/108897196681 0 33919790000/15556742383 0 527643495000/108897196681 0 3245035000/730853669 0", "1 31254294618000/28833248687537 0 11165528368000/4119035526791 0 79880723170000/28833248687537 0 110509176654000/28833248687537 0 146569199638000/28833248687537 0", "1 17403002238000/6498541649483 0 792220816000/6498541649483 0 29596396390000/6498541649483 0 39736019274000/6498541649483 0 1043887066000/499887819191 0", "1 0 0 573657219820000/281383490053259 0 601940376550000/281383490053259 312631052490000/281383490053259 1907790688890000/281383490053259 0 722634917920000/281383490053259 0", "1 176166579047000/122202939145233 0 51798501698000/40734313048411 0 355872215210000/122202939145233 174653397665000/122202939145233 731669223326000/122202939145233 0 352875915137000/122202939145233 0", "1 0 0 0 0 120988775000/29341572569 4433687500/1725974857 146131727500/29341572569 0 113401847500/29341572569 0", "1 34648556530000/31934260737297 0 0 0 132312491650000/31934260737297 76496648680000/31934260737297 156266735710000/31934260737297 0 119373871630000/31934260737297 0", "1 0 0 0 0 4501151250/2213572487 0 103682251250/15495007409 0 38405462500/15495007409 39856115000/15495007409", "1 0 0 0 0 143542970000/73494597031 0 477081060000/73494597031 0 197393500000/73494597031 199119925000/73494597031", "1 0 0 38471289890000/37443999555733 0 69727097435000/37443999555733 0 206835252165000/37443999555733 0 138721656680000/37443999555733 78135736545000/37443999555733", "1 7163221930000/4794971986641 0 0 0 16351808570000/4794971986641 0 30425229110000/4794971986641 0 10956613510000/4794971986641 1980552040000/1598323995547", "1 0 0 0 286528877200/972179731079 1738586964600/972179731079 0 6227902232600/972179731079 0 2574358458800/972179731079 2703868231000/972179731079", "1 0 0 0 0 3183975346400/1664542261617 286528877200/1664542261617 10972458764000/1664542261617 0 1445277324800/554847420539 1468500198800/554847420539", "1 0 0 0 0 456691720000/202722748577 13943487610000/16015097137583 98331803100000/16015097137583 0 48221533900000/16015097137583 34648556530000/16015097137583", "1 0 0 0 0 28010023295700000/25942071043818991 24995018165670000/25942071043818991 163583413182740000/25942071043818991 16690063216040000/25942071043818991 71271997395200000/25942071043818991 70274431355510000/25942071043818991", "1 0 0 8345031608020000/27156852312231353 0 49021843456570000/27156852312231353 14014351406430000/27156852312231353 176609192435910000/27156852312231353 0 74619790177600000/27156852312231353 63419968456920000/27156852312231353", "1 0 0 0 0 0 70000/101637 1040000/101637 0 0 0", "1 0 0 0 0 0 320000/37009 30000/5287 0 0 0", "1 144375000/43958561 0 0 0 0 325780000/43958561 252465000/43958561 0 0 0", "1 0 0 0 0 144375000/58550969 539245000/58550969 208860000/58550969 0 0 0", "1 0 0 0 0 0 56630000/5779531 25046250/5779531 7218750/5779531 0 0", "1 17560000/19885147 0 0 0 0 40910000/59655441 600280000/59655441 0 0 0", "1 645310000/151783911 0 0 0 0 238160000/50594637 359420000/50594637 0 0 0", "1 7852214375/1736584182 0 0 0 2619239375/578861394 813520625/578861394 1093673125/192953798 0 0 0", "1 39003295000/15867368451 0 0 0 0 51454385000/15867368451 13486340000/1763040939 0 33056395000/15867368451 0", "1 0 139210000/25202207 0 0 0 20254000/25202207 165684000/25202207 0 0 0", "1 0 383040000/66856943 0 0 0 303040000/66856943 287790000/66856943 0 0 0", "1 12386788000/14789406713 81395930000/14789406713 0 0 0 11838042000/14789406713 95039608000/14789406713 0 0 0", "1 0 241977550000/48206704563 0 0 0 13437625000/5356300507 264920905000/48206704563 0 67242395000/48206704563 0", "1 0 0 17560000/29366229 0 0 28490000/88098687 897400000/88098687 0 0 0", "1 0 0 286247500/89065631 0 0 298385000/89065631 653300000/89065631 0 0 0", "1 58470250000/15253864193 0 16297180000/15253864193 0 0 83041280000/15253864193 96203900000/15253864193 0 0 0", "1 0 131174612500/27122356673 15483485000/27122356673 0 0 11949340000/27122356673 189457650000/27122356673 0 0 0", "1 0 84341217500/31100531209 77440135000/31100531209 0 0 80732600000/31100531209 17847810000/2827321019 0 0 0", "1 0 150485094137500/42642893452541 53649728855000/42642893452541 0 0 69379189360000/42642893452541 275180831910000/42642893452541 0 56635586280000/42642893452541 0", "1 0 0 191426120000/254205918351 0 0 207588830000/254205918351 1928666200000/254205918351 1049396900000/254205918351 0 0", "1 0 0 928458490000/257223240631 0 0 1005140860000/257223240631 1577208280000/257223240631 337364870000/257223240631 0 0", "1 0 0 6216850000/3772112231 0 0 191280330000/86758581313 696486060000/86758581313 0 177970130000/86758581313 0", "1 1641511851875/742660267484 0 94911340625/371330133742 0 0 2449621049375/742660267484 1393178003750/185665066871 0 1674584608125/742660267484 0", "1 0 0 0 0 0 78482000/56374449 402352000/56374449 278420000/56374449 0 0", "1 38285224000/33128067853 0 0 0 0 45874586000/33128067853 229581144000/33128067853 162791860000/33128067853 0 0", "1 0 0 0 0 0 166285000/42618241 323345000/42618241 0 111335000/42618241 0", "1 0 0 0 0 0 0 3230000/492467 2910000/492467 0 0", "1 365840000/289539151 0 0 0 0 0 166770000/26321741 1701430000/289539151 0 0", "1 96599000/53798397 0 0 0 0 0 303835000/53798397 112965000/17932799 0 0", "1 0 0 365840000/461365633 0 0 0 3360730000/461365633 2137530000/461365633 0 0", "1 0 0 0 0 0 0 42500000/5740263 24662500/5740263 0 5716250/5740263", "1 0 0 0 0 0 0 2320000/229197 0 0 175000/229197", "1 0 0 0 0 0 0 216000/21383 0 0 17000/21383", "1 0 0 0 83490000/40944571 0 0 195810000/40944571 0 0 245395000/40944571", "1 13443310000/14692073807 0 0 132429860000/44076221421 0 0 160601840000/44076221421 0 0 268768420000/44076221421", "1 144701315170000/37578912174923 0 0 59203274280000/37578912174923 150505767830000/37578912174923 0 162546022710000/37578912174923 0 0 68184727430000/37578912174923", "1 0 0 0 31572440000/32662697013 0 13443310000/10887565671 166966880000/32662697013 0 0 193467610000/32662697013", "1 0 0 0 14164800000/11140621069 0 25716830000/11140621069 46210860000/11140621069 0 0 67124130000/11140621069", "1 0 0 7573243540000/30850227298123 20702531700000/30850227298123 0 53187985150000/30850227298123 160572576060000/30850227298123 0 0 173151464570000/30850227298123", "1 0 0 0 16411685800000/61127340930467 0 117313233990000/61127340930467 333553122080000/61127340930467 15146487080000/61127340930467 0 341054960570000/61127340930467", "1 0 0 0 13293640000/6174729647 0 0 28738310000/6174729647 0 6721655000/6174729647 34088575000/6174729647", "1 0 0 0 0 0 447970000/224518093 1372520000/224518093 0 0 1144990000/224518093", "1 1971850000/3539083171 0 0 0 0 8603740000/3539083171 1266220000/208181363 0 0 16297180000/3539083171", "1 0 0 0 11831100000/41448520187 0 76094630000/41448520187 235723780000/41448520187 0 0 227287610000/41448520187", "1 0 0 0 0 1183110000/3010082321 5377550000/3010082321 17449450000/3010082321 0 0 16039700000/3010082321", "1 1640000/133957241 0 0 0 0 0 123240000/12177931 0 0 102275000/133957241", "1 0 820000/2326133 0 0 0 0 23000000/2326133 0 0 1795000/2326133", "1 0 200214390000/42226484273 0 5068130000/42226484273 0 0 291884330000/42226484273 0 0 33225525000/42226484273", "1 0 40014404000/8374319629 0 0 0 1013626000/8374319629 58295160000/8374319629 0 0 6193394000/8374319629", "1 0 39472480000/33648523317 0 0 0 60600050000/33648523317 21647080000/3738724813 0 0 154880270000/33648523317", "1 0 7573243540000/25317226577973 0 3735927080000/8439075525991 0 43002422690000/25317226577973 45317976560000/8439075525991 0 0 7419777050000/1332485609367", "1 0 182107650960000/58779169091569 0 0 0 64592626170000/58779169091569 368941129720000/58779169091569 0 5600916280000/3457598181857 107299457710000/58779169091569", "1 0 1669006321604000/3315931736744993 0 0 4848602171612000/3315931736744993 1731905702882000/3315931736744993 21306045380700000/3315931736744993 0 8592233303912000/3315931736744993 8620183094106000/3315931736744993", "1 0 0 1640000/94738023 0 0 0 959000000/94738023 0 0 71225000/94738023", "1 0 0 0 0 0 0 10540000/1047843 102500/1047843 0 816250/1047843", "1 0 0 0 534560000/1403145317 0 0 31051100000/4209435951 16684532500/4209435951 0 4698571250/4209435951", "1 0 0 0 0 0 267280000/683941539 1601660000/212257719 25009002500/6155473851 0 5982066250/6155473851", "1 0 0 0 0 0 4275690000/2007460577 34006040000/6022381731 2722240000/6022381731 0 32015810000/6022381731", "1 8205842900000/17742478028203 0 0 0 0 45564811810000/17742478028203 95029478720000/17742478028203 12573800520000/17742478028203 0 89213148430000/17742478028203", "1 0 0 0 0 0 0 1086280000/107511523 0 1640000/107511523 84325000/107511523", "1 0 0 0 0 0 449654610000/310284352621 2346541720000/310284352621 0 716181560000/310284352621 31084250000/13490624027", "1 1327117769375/919220961053 0 0 0 0 2372091276875/919220961053 6873002117500/919220961053 0 2113608031875/919220961053 949113406250/919220961053", "1 0 0 0 42467768620000/51527108774799 0 45850748270000/51527108774799 339853587700000/51527108774799 0 140530785040000/51527108774799 149673456290000/51527108774799", "1 0 0 0 0 21233884310000/19271872902463 15294784530000/19271872902463 132264016930000/19271872902463 0 50216438300000/19271872902463 49825334260000/19271872902463", "1 0 0 0 0 0 0 0 2500/233 0 0", "1 10000/146469 0 0 0 0 0 0 1570000/146469 0 0", "1 5234000/1752551 5582000/1752551 0 0 0 0 0 12348000/1752551 0 0", "1 38866000/11672891 53018000/11672891 0 0 0 0 0 65612000/11672891 0 0", "1 2231000/543291 639750/181097 0 0 0 0 0 1057750/181097 0 0", "1 15408056000/3948484801 14296138000/3948484801 4128150000/3948484801 0 0 0 0 21652192000/3948484801 0 0", "1 42068065862000/10269213571887 32262443546000/10269213571887 9473128060000/3423071190629 12824591960000/10269213571887 0 0 0 36567494144000/10269213571887 0 0", "1 63394374262000/14284706668411 44430803066000/14284706668411 34948116020000/14284706668411 0 0 12824591960000/14284706668411 0 60740755984000/14284706668411 0 0", "1 165281914000/46899788759 170758622000/46899788759 0 0 16512600000/46899788759 0 0 287672348000/46899788759 0 0", "1 66894526000/24276394753 37126498000/24276394753 0 0 0 0 102081600000/24276394753 137516292000/24276394753 0 0", "1 13496616400/3496825267 21882997200/3496825267 0 0 0 0 7536496000/3496825267 7762832800/3496825267 0 0", "1 3588885200/617804811 4856976400/1441544559 0 0 0 0 882356000/480514853 679032800/205934937 0 0", "1 1638977740430000/187265389069413 87988533250000/62421796356471 0 0 0 56907141040000/20807265452157 48928909420000/20807265452157 18093587540000/62421796356471 0 0", "1 12388199924500/2867263581481 10362544088500/2867263581481 343656167500/220558737037 0 0 0 1603073995000/2867263581481 13000612406500/2867263581481 0 0", "1 302716769714000/67651473241339 247241104302000/67651473241339 0 0 5498498680000/5203959480103 0 154363388720000/67651473241339 240804988708000/67651473241339 0 0", "1 196874000/69531023 0 0 0 563780000/69531023 0 0 126830000/69531023 0 0", "1 311750000/320339997 0 0 0 0 279100000/106779999 0 3060710000/320339997 0 0", "1 158138750/21232929 0 0 0 0 33018125/7077643 0 60675625/21232929 0 0", "1 2667211190000/332591387501 164592290000/332591387501 0 0 0 35214360000/8111985061 0 731721860000/332591387501 0 0", "1 868524210000/123957296491 928230290000/867701075437 2720963480000/867701075437 0 0 3381265400000/867701075437 0 1302842020000/867701075437 0 0", "1 2689031171930000/295814391442103 241219510550000/295814391442103 0 0 0 1079969487360000/295814391442103 540097456380000/295814391442103 73937528720000/295814391442103 0 0", "1 110567267332260000/13094220078066331 12940133737930000/13094220078066331 17127478665610000/13094220078066331 0 0 47267577949140000/13094220078066331 18910329460570000/13094220078066331 4794647783770000/13094220078066331 0 0", "1 9207782500/1840156189 0 8409925000/1840156189 0 0 8402938750/1840156189 0 5433541250/1840156189 0 0", "1 106612990000/12517657711 0 0 0 0 49220297500/12517657711 34885557500/12517657711 6648240000/12517657711 0 0", "1 57608110000/7219282173 0 0 0 0 8246050000/2406427391 8803730000/2406427391 1696790000/2406427391 0 0", "1 91306519805000/11529176312767 0 11734190375000/11529176312767 0 0 45500047120000/11529176312767 30534208315000/11529176312767 7700321655000/11529176312767 0 0", "1 209088332500/23578220981 0 0 0 0 84390957500/23578220981 0 21652232500/23578220981 0 41148072500/23578220981", "1 30757626250/3461750629 0 0 0 0 37004581250/10385251887 0 9014824375/10385251887 0 18682975000/10385251887", "1 1956751882250/220669666947 0 119360634500/1986027002523 0 0 2352591839750/662009000841 0 1740533299750/1986027002523 0 3543126439750/1986027002523", "1 48244190790000/6373966393459 0 42129437405000/19121899180377 0 0 23098758510000/6373966393459 0 21589341670000/19121899180377 0 30534208315000/19121899180377", "1 82991840224310000/10455951436031309 5565831116330000/10455951436031309 4992790404820000/2412911869853379 0 0 2832408935980000/804303956617793 0 26774437879760000/31367854308093927 0 37820658921140000/31367854308093927", "1 303735026807500/34131773636697 0 0 0 0 40463437167500/11377257878899 1193606345000/34131773636697 29526055092500/34131773636697 0 60304877637500/34131773636697", "1 15928904000/4007630807 0 19637114000/4007630807 0 0 17189132000/4007630807 0 22742000/5919691 0 0", "1 400231600/194739469 0 0 0 0 7425299600/9152755043 51056496400/9152755043 54845534000/9152755043 0 0", "1 7190050000/4516982317 0 0 0 0 422005700000/221332133533 1446944460000/221332133533 1091252140000/221332133533 0 0", "1 23151130000/5265328029 0 0 0 0 405256000000/82490139121 555039180000/82490139121 34702240000/82490139121 0 0", "1 70611038770625/14509399281579 0 0 0 10860617265625/4836466427193 6043374828125/1612155475731 24905631205625/4836466427193 2243648140000/1612155475731 0 0", "1 25504193569375/8168086693157 0 0 0 12348437343125/8168086693157 19802528506875/8168086693157 45391212563125/8168086693157 29663976200000/8168086693157 0 0", "1 43474200713834375/9937395569365391 0 13299971359420000/9937395569365391 0 25273063781698125/9937395569365391 44468721663711875/9937395569365391 39939106587558125/9937395569365391 14248132096620000/9937395569365391 0 0", "1 23534103188000/15581214166259 0 0 0 0 53632799890000/15581214166259 75218531776000/15581214166259 23949391264000/15581214166259 0 63554092474000/15581214166259", "1 62094420000000/47763278950111 0 0 0 0 187806031370000/47763278950111 216814173540000/47763278950111 67977548160000/47763278950111 0 202809389430000/47763278950111", "1 299218755070000/172771373554203 1967463091227500/1554942361987827 0 0 0 5311814547925000/1554942361987827 2442902405630000/518314120662609 479737696765000/518314120662609 0 5393609438425000/1554942361987827", "1 7861851888606250/4981048106376919 0 1967463091227500/4981048106376919 0 0 19027317438688750/4981048106376919 23451170852912500/4981048106376919 228483497865000/160678971173449 0 18688091747411250/4981048106376919", "1 26643525507771250/6346515077625821 0 0 0 2352657686446250/906645011089403 20243724254726250/6346515077625821 28023403338243750/6346515077625821 11611277601720000/6346515077625821 0 6649985679710000/6346515077625821", "1 647650000/230617569 0 0 0 0 0 0 1539970000/230617569 0 279100000/76872523", "1 694730000/210264737 0 0 0 0 0 0 787000000/210264737 0 1366840000/210264737", "1 43100000/7922247 0 0 0 0 0 0 9770000/2640749 0 12090000/2640749", "1 188217346000/28823992587 797782000/417739023 0 0 0 0 0 26985484000/9607997529 0 8823560000/3202665843", "1 15310450000/3710144203 59896670000/11130432609 0 0 0 0 0 14219180000/11130432609 0 37682480000/11130432609", "1 332708520000/90546852457 0 275942270000/271640557371 0 0 0 0 1388338330000/271640557371 0 1117293580000/271640557371", "1 26495730658000/6011693042313 19560252814000/6011693042313 29974194940000/18035079126939 0 0 0 0 80986245128000/18035079126939 0 12824591960000/18035079126939", "1 1141858180000/263668280717 0 0 0 275942270000/263668280717 0 0 1004630310000/263668280717 0 1364553980000/263668280717", "1 210192349662000/42264689192269 76815861266000/42264689192269 0 0 59948389880000/42264689192269 0 0 126855635004000/42264689192269 0 154363388720000/42264689192269", "1 75073820000/23991999569 0 0 0 0 16133766000/23991999569 0 65349664000/23991999569 0 174827134000/23991999569", "1 114210780000/119898293861 0 0 0 0 10452310000/1965545801 0 169581660000/119898293861 0 44898570000/6310436519", "1 10913811018750/3224438243273 0 35015867102500/9673314729819 0 0 15357096408750/3224438243273 0 13543551252500/9673314729819 0 34459242661250/9673314729819", "1 1211668960000/166383198207 0 0 0 0 62131970000/55461066069 0 108639160000/55461066069 0 220093250000/55461066069", "1 516207470000/58148112579 0 0 0 0 68078340000/19382704193 0 17191870000/19382704193 0 35365860000/19382704193", "1 140726233347500/17786536883037 5150422367500/5928845627679 0 0 0 182692502500/152021682761 0 8459928860000/5928845627679 0 6116113677500/1976281875893", "1 360415604620000/75648032853113 0 0 0 125902694090000/75648032853113 50091612660000/75648032853113 0 30761199630000/10806861836159 0 390891421880000/75648032853113", "1 411307151020000/85526155499777 0 0 0 285558237580000/85526155499777 347893712650000/85526155499777 0 171647824960000/85526155499777 0 248725080770000/85526155499777", "1 648303067673180000/124567083992162401 146936565113420000/124567083992162401 0 0 241469382152500000/124567083992162401 86864835815290000/124567083992162401 0 282814401623340000/124567083992162401 0 520489498439930000/124567083992162401", "1 38385105000/14207087243 0 0 0 0 0 137971135000/42621261729 245570165000/42621261729 0 92816245000/42621261729", "1 0 0 3910000/424291 0 0 0 0 890000/424291 0 0", "1 308216000/115959783 0 607670000/115959783 0 0 0 0 627050000/115959783 0 0", "1 42641078000/9905243179 33729178000/9905243179 22383340000/9905243179 0 0 0 0 44587912000/9905243179 0 0", "1 0 0 0 25000/63869 0 0 0 670000/63869 0 0", "1 0 0 0 0 0 550000/116537 0 1035000/116537 0 0", "1 0 0 0 0 0 7525/788 0 2175/394 0 0", "1 0 212190000/47987603 0 0 0 480043750/47987603 0 70597500/47987603 0 0", "1 0 0 0 0 0 238856875/25997054 0 28239375/12998527 0 53047500/12998527", "1 194792572500/76052522447 0 0 0 0 564317552500/76052522447 0 3056250000/6913865677 0 22700587500/4473677791", "1 4169669818875/1043311249274 0 6198005217125/1564966873911 0 0 776669740125/149044464182 0 1826733717625/1564966873911 0 8582774232125/3129933747822", "1 0 646275000/101560847 0 0 0 832900000/101560847 0 110310000/101560847 0 0", "1 0 0 8633400/3645769 0 0 31601000/3645769 0 18654900/3645769 0 0", "1 841380965000/214802337533 0 1130721995000/214802337533 0 0 1078493870000/214802337533 0 692331085000/214802337533 0 0", "1 275933256490000/64551408775339 0 315958448455000/64551408775339 0 27619554105000/64551408775339 306097555480000/64551408775339 0 205013525930000/64551408775339 0 0", "1 2183897872344770000/430057648454609787 176869121225050000/143352549484869929 560599322464480000/143352549484869929 0 564161325020840000/430057648454609787 1863084682768240000/430057648454609787 0 281443008756780000/143352549484869929 0 0", "1 76739865031391875/15758688294184632 0 9983708142418125/2626448049030772 0 43490110013093125/15758688294184632 21424953208935625/7879344147092316 0 7921227195870625/5252896098061544 11054320076565625/5252896098061544 0", "1 0 566229870000/183788418769 311841690000/183788418769 0 0 1697123780000/183788418769 0 442926690000/183788418769 0 0", "1 441641857640000/109410382792847 249522931170000/109410382792847 531238357070000/109410382792847 0 0 583017353900000/109410382792847 0 127084482310000/109410382792847 0 0", "1 712454833514760000/151216445876325881 449067044151950000/151216445876325881 615800804503970000/151216445876325881 0 115570324283920000/151216445876325881 744510344497620000/151216445876325881 0 68720009346170000/151216445876325881 0 0", "1 0 0 14929336875/6700166189 0 0 116445246875/13400332378 35389366875/13400332378 44197929375/13400332378 0 0", "1 1103176505500/366248246419 0 3283228390625/732496492838 0 0 8615656371625/1464992985676 3119036639625/1464992985676 3214931373125/1464992985676 0 0", "1 444995054898750/111994624416803 0 238018893960000/111994624416803 0 225180137316250/111994624416803 588411231053750/111994624416803 427975557706250/111994624416803 129396820610000/111994624416803 0 0", "1 22174491121161250/4896726070177997 0 9693010537640000/4896726070177997 0 11777054970383750/4896726070177997 23418747692726250/4896726070177997 16115791500513750/4896726070177997 6699277594390000/4896726070177997 0 0", "1 0 0 1250728200/285711917 0 0 1949379000/285711917 0 844370100/285711917 629144300/285711917 0", "1 42087428365000/15298905652213 0 92646276475000/15298905652213 0 0 70193210870000/15298905652213 0 30719265605000/15298905652213 27724770130000/15298905652213 0", "1 0 0 0 0 107917500/67498901 598697500/67498901 0 377103750/67498901 0 0", "1 390780222500/119912512023 0 0 0 386778567500/119912512023 724380490000/119912512023 0 179444765000/39970837341 0 0", "1 1734155446970000/467523081047391 85929986450000/155841027015797 0 0 1575174644360000/467523081047391 2684087199280000/467523081047391 0 596782321980000/155841027015797 0 0", "1 245035386042500/67465745827239 0 0 0 269884613802500/67465745827239 336719884045000/67465745827239 0 80937448032500/22488581942413 21482496612500/22488581942413 0", "1 147088866117500/32986974207039 0 0 0 116296410140000/32986974207039 163389901232500/32986974207039 0 27160538232500/10995658069013 0 21482496612500/10995658069013", "1 0 1307271450000/315335956093 0 0 311841690000/315335956093 3012937580000/315335956093 0 556615530000/315335956093 0 0", "1 813685029970000/309658686081367 1521991219430000/309658686081367 0 0 96762248680000/44236955154481 2291748952200000/309658686081367 0 52951458640000/309658686081367 0 0", "1 0 0 0 0 11725576875/2086216436 8154219375/2086216436 0 1508810625/4172432872 27234821875/4172432872 0", "1 0 0 0 0 0 180387500/34763491 168982500/34763491 178155000/34763491 0 0", "1 0 0 0 0 0 432332500/45463499 159247500/45463499 139875000/45463499 0 0", "1 0 98846250000/72534871067 0 0 0 700302160000/72534871067 220222605000/72534871067 156262125000/72534871067 0 0", "1 0 0 12355781250/8185615319 0 0 73268432500/8185615319 26232313125/8185615319 24781359375/8185615319 0 0", "1 0 0 0 0 0 425230015000/45161375543 145047982500/45161375543 107570062500/45161375543 0 49423125000/45161375543", "1 0 52214265000/12869953829 0 0 0 92995060000/12869953829 38188680000/12869953829 20827530000/12869953829 0 0", "1 0 0 313285590000/157843924733 0 0 1316793700000/157843924733 512489760000/157843924733 507785130000/157843924733 0 0", "1 238725630940000/118167433520167 0 325626389390000/118167433520167 0 0 638255860420000/118167433520167 561023149840000/118167433520167 263436731850000/118167433520167 0 0", "1 12240967251181250/3096352432904813 0 6465247308460000/3096352432904813 0 6229363915803750/3096352432904813 16236004411276250/3096352432904813 12003815370383750/3096352432904813 3577786425360000/3096352432904813 0 0", "1 0 0 0 0 38257060000/25200936543 223740032500/25200936543 56896677500/25200936543 101014925000/25200936543 0 0", "1 32301303832500/7933997875051 0 0 0 27925264997500/7933997875051 42426785430000/7933997875051 24701194700000/7933997875051 16179089915000/7933997875051 0 0", "1 0 35259361710000/14957845439747 0 0 17808104410000/14957845439747 138594669110000/14957845439747 25714235570000/14957845439747 33085348160000/14957845439747 0 0", "1 0 0 17629680855000/9902593475749 0 8696578315000/29707780427247 259317133255000/29707780427247 86482709735000/29707780427247 95013400865000/29707780427247 0 0", "1 1613451478856250/407771560280969 0 10979011158540000/5301030283652597 0 10803023251733750/5301030283652597 27952664955986250/5301030283652597 20405738328553750/5301030283652597 6107591169040000/5301030283652597 0 0", "1 38306427266793750/8666504852264851 0 9420569453370000/8666504852264851 0 25505718491451250/8666504852264851 2525420429163750/509794403074403 31074476327236250/8666504852264851 11923975640420000/8666504852264851 0 0", "1 0 0 0 0 34891402660000/12374210730579 89781676007500/12374210730579 33166905342500/12374210730579 24775379390000/12374210730579 8814840427500/4124736910193 0", "1 5652408555288750/2335367847502483 0 0 0 9667711284186250/2335367847502483 11663701841463750/2335367847502483 7546066234876250/2335367847502483 1473754556180000/2335367847502483 5489505579270000/2335367847502483 0", "1 72877107773471250/16817850603398221 0 0 0 67098323098573750/16817850603398221 78957460451936250/16817850603398221 55148779257323750/16817850603398221 23319687475820000/16817850603398221 9420569453370000/16817850603398221 0", "1 0 0 0 0 0 194528270000/30740484181 9803940000/2794589471 70407360000/30740484181 0 104428530000/30740484181", "1 0 0 0 0 1131710526500/917231992511 8100944490000/917231992511 1815920801500/917231992511 2397404197000/917231992511 0 1762968085500/917231992511", "1 1442977184801250/511644086883637 0 0 0 1323785009285750/511644086883637 3264639698676250/511644086883637 1299644295205750/511644086883637 556292162296000/511644086883637 0 1097901115854000/511644086883637", "1 25596292881391250/5816590279144429 0 0 0 20949979201663750/5816590279144429 29367183796586250/5816590279144429 18057469111743750/5816590279144429 8656251053880000/5816590279144429 0 3140189817790000/5816590279144429", "1 0 0 0 0 0 1509350000/217444051 0 454980000/217444051 0 1292550000/217444051", "1 0 0 19283045000/11154463313 0 0 96552685000/11154463313 0 32485525000/11154463313 0 31457215000/11154463313", "1 2830810870625/796597672127 0 3586463331250/796597672127 0 0 4261816075625/796597672127 0 1352926096250/796597672127 0 1732798133125/796597672127", "1 0 0 0 0 43386851250/42780689839 375606533750/42780689839 0 6112826250/2516511167 0 163408931250/42780689839", "1 7588394562000/3320833665001 0 0 0 6842362569750/3320833665001 22521096127250/3320833665001 0 3818756106750/3320833665001 0 14731810215750/3320833665001", "1 135762178745000/29040137051987 0 0 0 102453324355000/29040137051987 137925472235000/29040137051987 0 53096584893750/29040137051987 0 76724089997500/29040137051987", "1 24713954083551250/5074059068539117 0 10669030738907500/15222177205617351 0 16193700914990000/5074059068539117 22964599265696250/5074059068539117 0 27919651056376250/15222177205617351 0 36336610176106250/15222177205617351", "1 55499541561081250/11671144643124693 0 0 0 14055821970111250/3890381547708231 6083156240106250/1296793849236077 5334515369453750/11671144643124693 21154701728360000/11671144643124693 0 26165490610430000/11671144643124693", "1 2131476420528750/545394750579281 0 6390747485822500/1636184251737843 0 279332146413750/545394750579281 2772114432270000/545394750579281 0 2181414919628750/1636184251737843 0 4279755577062500/1636184251737843", "1 4824041831997500/954044871860687 0 8890399114265000/2862134615582061 0 1658433823176250/954044871860687 3979881544046250/954044871860687 0 4911458591638750/2862134615582061 0 5371930500171250/2862134615582061", "1 97774783847839730000/18439549909421935559 12581219649503790000/18439549909421935559 166824626168264420000/55318649728265806677 0 34938062252628040000/18439549909421935559 75411681504045420000/18439549909421935559 0 78316696067465560000/55318649728265806677 0 77490178057355980000/55318649728265806677", "1 20757781512570478750/4195685618710674061 0 2661125679530817500/740415109184236599 0 677235291530691250/246805036394745533 11900140496012557500/4195685618710674061 0 17920815783068041250/12587056856132022183 7863262280939868750/4195685618710674061 4316591322736025000/12587056856132022183", "1 18251748964389751250/3735950620606490747 9166918293151150000/3735950620606490747 142262239773047500/40461559067940333 0 4383881000425265000/3735950620606490747 17614214371472296250/3735950620606490747 0 3185256755204682500/11207851861819472241 0 9459619574598743750/11207851861819472241", "1 0 0 0 0 0 0 0 100/239 0 2475/239", "1 26185000/9949597 0 0 0 0 0 0 23131250/9949597 0 79893125/9949597", "1 7520687500/1576000079 0 0 0 3417065000/1576000079 0 0 3928291875/1576000079 0 16559329375/3152000158", "1 43165950280000/8338827312477 9032653624000/8338827312477 0 0 20384347790000/8338827312477 0 0 16229908081000/8338827312477 0 36271773587500/8338827312477", "1 0 0 0 0 0 1678000/405493 0 24200/36863 0 3442200/405493", "1 0 0 0 0 0 105873730000/53454123379 288273060000/53454123379 18095860000/53454123379 0 303410490000/53454123379", "1 0 0 0 0 0 0 26185000/7558079 2221250/7558079 0 59885625/7558079", "1 0 0 0 0 0 0 0 0 2000/193 0", "1 10000/464353 0 0 0 0 0 0 0 4810000/464353 0", "1 6130000/647241 0 0 0 0 0 0 0 820000/215747 0", "1 148270000/15709533 0 660000/5236511 0 0 0 0 0 19780000/5236511 0", "1 17600000/2809639 0 8900000/2809639 0 0 0 0 0 13672500/2809639 0", "1 18092000/1956909 0 1103000/652303 0 0 0 0 0 1911000/652303 0", "1 435058130000/53318219997 2569510000/2538962857 30377100000/17772739999 0 0 0 0 0 59651080000/17772739999 0", "1 1621025810000/185602036641 0 115824540000/61867345547 5139020000/8838192221 0 0 0 0 189261320000/61867345547 0", "1 477091630000/59092823923 0 146650810000/59092823923 14738930000/8441831989 0 0 0 0 127490530000/59092823923 0", "1 774801750000/87104604713 0 137640660000/87104604713 0 0 0 0 5139020000/12443514959 284799380000/87104604713 0", "1 291604960000/34163762673 0 18296290000/11387920891 0 0 0 0 14738930000/11387920891 31408000000/11387920891 0", "1 28520000/3097269 0 0 0 110000/442467 0 0 0 12170000/3097269 0", "1 348574000/36717639 0 0 0 0 0 132000/1748459 0 45772000/12239213 0", "1 32440250/3213081 0 0 0 0 0 3935750/3213081 0 6839750/3213081 0", "1 121550000/12334779 0 0 0 0 0 21620000/12334779 0 23390000/12334779 0", "1 759389110000/76778245107 2846830000/8530916123 0 0 0 0 116232760000/76778245107 0 143396140000/76778245107 0", "1 63750730000/6433835427 0 406690000/714870603 0 0 0 6440140000/6433835427 0 13732510000/6433835427 0", "1 178165476000/18633141857 0 0 12416230000/18633141857 0 0 23740368000/18633141857 0 43242354000/18633141857 0", "1 702616286000/73126636053 0 0 0 0 0 28026576000/24375545351 12416230000/24375545351 62873928000/24375545351 0", "1 122360000/85840773 0 0 0 480610000/85840773 0 0 0 701350000/85840773 0", "1 792990000/184482539 0 0 0 0 0 961220000/184482539 0 785070000/184482539 0", "1 480950000/111833919 0 0 0 0 0 1752620000/335501757 0 1423010000/335501757 0", "1 8169834800/1899905731 28993600/1899905731 0 0 0 0 9906628000/1899905731 0 8057543600/1899905731 0", "1 510612310000/59424813699 30823040000/19808271233 0 0 0 0 30377100000/19808271233 0 46894460000/19808271233 0", "1 213418190000/49910572939 0 1449680000/49910572939 0 0 0 259663860000/49910572939 0 212875710000/49910572939 0", "1 160157230000/37231314811 0 0 289936000/37231314811 0 0 194420708000/37231314811 0 157812366000/37231314811 0", "1 312225530000/34574193417 0 0 9720592000/11524731139 0 0 24612676000/11524731139 0 23027582000/11524731139 0", "1 312848430178000/33724444107141 5497077202000/11241481369047 0 7264191308000/11241481369047 0 0 6355322428000/3747160456349 0 7240932620000/3747160456349 0", "1 71311470470000/7763649316997 0 6871346502500/7763649316997 855910232500/1109092759571 0 0 1035320037500/1109092759571 0 18321840307500/7763649316997 0", "1 244156378000/56746207633 0 0 0 0 0 296111532000/56746207633 289936000/56746207633 240807514000/56746207633 0", "1 2358223190000/252329945127 0 0 0 0 0 131956220000/84109981709 48602960000/84109981709 206151250000/84109981709 0", "1 2055859306690000/217681831766403 20292699470000/72560610588801 0 0 0 0 33698315460000/24186870196267 36320956540000/72560610588801 56907141040000/24186870196267 0", "1 3065696340425/325676254911 0 50731748675/108558751637 0 0 0 14881222325/15508393091 8559102325/15508393091 284607974850/108558751637 0", "1 0 5000/23483 0 0 0 0 0 0 240000/23483 0", "1 0 675000/76729 0 0 0 0 0 0 310000/76729 0", "1 19916000/12372681 113513000/12372681 0 0 0 0 0 0 32806000/12372681 0", "1 0 116775000/25520747 95580000/25520747 0 0 0 0 0 20810000/3645821 0", "1 26648630000/21409052573 84033065000/21409052573 98078910000/21409052573 0 0 0 0 0 107180280000/21409052573 0", "1 12308985000/3994337311 80255071250/11983011933 30001497500/11983011933 0 0 0 0 0 9971797500/3994337311 0", "1 71921206590000/17177204892739 83898501820000/17177204892739 63462378880000/17177204892739 0 0 211157853800000/51531614678217 0 0 8614785020000/51531614678217 0", "1 0 4245156250/9533038797 60045222500/9533038797 0 0 0 0 13324315000/9533038797 62485165000/9533038797 0", "1 0 37287000/4754557 0 0 0 25488000/4754557 0 0 7354000/4754557 0", "1 0 82630000/14440143 0 0 32090000/14440143 0 0 0 83350000/14440143 0", "1 4408440000/3163489507 9457450000/9490468521 0 0 55743470000/9490468521 0 0 0 70376650000/9490468521 0", "1 5066360000/2305652967 436000000/256183663 0 0 12681110000/2305652967 0 0 0 14827310000/2305652967 0", "1 59116699770000/17843496271243 61583004527500/17843496271243 0 0 47404253915000/17843496271243 0 64658191780000/17843496271243 0 50558138095000/17843496271243 0", "1 55699312630000/13874785245369 6028657746250/1541642805041 0 0 38878593422500/13874785245369 0 4453512180000/1541642805041 0 33669145660000/13874785245369 0", "1 0 600832000/1580561181 0 0 8395514000/1580561181 0 0 0 12816934000/1580561181 587792000/526853727", "1 0 1069725000/131449331 0 0 0 0 128360000/131449331 0 516240000/131449331 0", "1 307727510000/138317695703 958545080000/138317695703 0 0 0 0 489369520000/138317695703 0 236766230000/138317695703 0", "1 228191210000/69317536037 555258480000/69317536037 0 0 0 0 480023960000/207952608111 0 194070820000/207952608111 0", "1 0 124643762500/27874948327 69976375000/27874948327 0 0 0 61767620000/27874948327 0 136638830000/27874948327 0", "1 16910731420000/29784954423319 123421481572500/29784954423319 75169420655000/29784954423319 0 0 0 85666775860000/29784954423319 0 129315582170000/29784954423319 0", "1 0 42255111502500/15791879918021 49321937615000/15791879918021 16910731420000/15791879918021 0 0 54697567400000/15791879918021 0 65918589690000/15791879918021 0", "1 0 67414637612500/26433438939603 87649107995000/26433438939603 0 0 0 25268520820000/8811146313201 16910731420000/26433438939603 133548390370000/26433438939603 0", "1 0 59282025000/10257237989 0 0 0 69976375000/30771713967 39693215000/10257237989 0 78007555000/30771713967 0", "1 1393786250000/1077116665987 103315677800000/20465216653753 0 0 0 47103811125000/20465216653753 110404571055000/20465216653753 0 25162487495000/20465216653753 0", "1 15091840990000/9274673628643 47382517600000/9274673628643 0 0 0 19188573520000/9274673628643 50846389280000/9274673628643 0 507755930000/488140717297 0", "1 502599690505000/197970076303331 3775925044625000/1385790534123317 0 0 2796725753525000/1385790534123317 2460032495005000/1385790534123317 7304892191295000/1385790534123317 0 2754405880755000/1385790534123317 0", "1 49167440912530000/32993498869822519 159920269907512500/32993498869822519 5728009132505000/32993498869822519 0 0 70888871644090000/32993498869822519 181847154757330000/32993498869822519 0 39435199012950000/32993498869822519 0", "1 8213558263496500000/3709834405063081499 8839981488582960000/3709834405063081499 1237381846757860000/3709834405063081499 0 6981228952028390000/3709834405063081499 7226936745474670000/3709834405063081499 19817449768719130000/3709834405063081499 0 8241416070671180000/3709834405063081499 0", "1 18119847418280000/9073825167636249 6347403430490000/3024608389212083 0 0 22103825804630000/9073825167636249 20185865258480000/9073825167636249 45692705357360000/9073825167636249 0 23581946247890000/9073825167636249 0", "1 0 155118100000/49640333411 0 0 0 0 218768910000/49640333411 0 166389690000/49640333411 139952750000/49640333411", "1 7550684810000/53253382557551 161953737745000/53253382557551 0 0 0 0 243628387830000/53253382557551 0 170940247460000/53253382557551 150338841310000/53253382557551", "1 40896220906220000/29931872344558391 139096680605260000/29931872344558391 0 0 0 59698618749090000/29931872344558391 166208797906200000/29931872344558391 0 37937478596540000/29931872344558391 11456018265010000/29931872344558391", "1 27194419208260000/13937194289920701 7538080705180000/13937194289920701 0 0 0 40655802336950000/13937194289920701 33553507988120000/4645731429973567 0 10109584513100000/4645731429973567 6996285781430000/13937194289920701", "1 15534835476686620000/8384252223025412499 7080457926617980000/2794750741008470833 0 0 12592054307663080000/8384252223025412499 14430642065394010000/8384252223025412499 45675729840225040000/8384252223025412499 0 17939061928472140000/8384252223025412499 1856072770136790000/2794750741008470833", "1 0 889731624400/332668906861 0 75506848100/332668906861 0 0 1591800425000/332668906861 0 1037086136200/332668906861 986438752300/332668906861", "1 0 5127519715675000/2862313627772691 0 1388111073670000/2862313627772691 1058765887955000/2862313627772691 0 1599974075405000/318034847530299 0 3016506261260000/954104542590897 8912472031675000/2862313627772691", "1 0 1564453930000/741160733493 0 0 2246229010000/2223482200479 0 8684033560000/2223482200479 0 9339065510000/2223482200479 6163542680000/2223482200479", "1 4164333221010000/13348419536630639 34021379317705000/13348419536630639 0 0 5213947614340000/13348419536630639 0 61167966416890000/13348419536630639 0 44951307941780000/13348419536630639 37499617608130000/13348419536630639", "1 0 10312343494000/3892678079821 0 0 0 0 54664468586000/11678034239463 1510136962000/11678034239463 12774923084000/3892678079821 35059643198000/11678034239463", "1 0 32972101999040000/17038894871821669 0 0 4934908862270000/17038894871821669 0 7405641004060000/1548990442892879 4164333221010000/17038894871821669 58998443760820000/17038894871821669 53695645075400000/17038894871821669", "1 0 0 10000/256777 0 0 0 0 0 2660000/256777 0", "1 0 0 2430000/478127 0 0 0 0 0 4070000/478127 0", "1 127306000/83354997 0 163232000/27784999 0 0 0 0 0 2236000/312191 0", "1 7510330000/3724943017 0 216320860000/40974373187 0 57581740000/40974373187 0 0 0 276015940000/40974373187 0", "1 0 0 43560000/17826209 0 77850000/17826209 0 0 0 152090000/17826209 0", "1 7734360000/13105734511 0 38369600000/13105734511 0 53376710000/13105734511 0 0 0 104961470000/13105734511 0", "1 87742638000/43360238483 0 229043476000/43360238483 0 114694732000/43360238483 0 0 0 257846164000/43360238483 0", "1 1583708510000/356708774979 0 162324580000/39634308331 0 70768180000/15509077173 0 0 0 1128171440000/356708774979 0", "1 917260710000/421904985619 517194997500/421904985619 1930516460000/421904985619 0 891338315000/421904985619 0 0 0 2467538480000/421904985619 0", "1 3699518690000/1003805769969 301357722500/111533974441 342577860000/111533974441 0 2536874285000/1003805769969 0 0 0 4213924040000/1003805769969 0", "1 27469665531850000/6256376225306613 2233055772122500/893768032186659 492526625860000/127681147455237 0 10796040121915000/6256376225306613 20796735418160000/6256376225306613 0 0 1229487434200000/695152913922957 0", "1 325923056370000/162312565698509 0 845044088740000/162312565698509 107576559480000/162312565698509 379704756940000/162312565698509 0 0 0 960782917300000/162312565698509 0", "1 1202083489930000/299342799200817 0 45076527580000/11086770340771 62682406280000/33260311022313 1015372685260000/299342799200817 0 0 0 1054501621240000/299342799200817 0", "1 84724404550000/44704812703969 0 226567028020000/44704812703969 0 102400312800000/44704812703969 0 0 17929426580000/44704812703969 284491374980000/44704812703969 0", "1 291076017850000/67686837671919 0 72278637060000/22562279223973 0 242128796800000/67686837671919 0 0 31341203140000/22562279223973 288073774540000/67686837671919 0", "1 0 0 2879170000/445854739 0 0 0 0 636530000/445854739 3027980000/445854739 0", "1 0 0 82630000/38726201 0 178900000/38726201 0 0 0 332680000/38726201 0", "1 2616405000/5982982019 0 9457450000/5982982019 0 4396765000/854711717 0 0 0 50112550000/5982982019 0", "1 0 0 266427100000/114412851059 0 498575050000/114412851059 0 24180240000/114412851059 0 966652510000/114412851059 0", "1 14560898340000/41399819660917 0 97090072040000/41399819660917 0 172215037790000/41399819660917 0 29451989520000/41399819660917 0 328743841670000/41399819660917 0", "1 45052879356390000/30523244747987623 44375602814295000/30523244747987623 74999235216260000/30523244747987623 0 64417118170250000/30523244747987623 0 90399469176120000/30523244747987623 0 157599380691140000/30523244747987623 0", "1 42916542518850000/36755895625753009 0 106556855222250000/36755895625753009 29583735209530000/36755895625753009 87676828160620000/36755895625753009 0 125497646949830000/36755895625753009 0 189089037624820000/36755895625753009 0", "1 213557718230880000/186567093359372947 0 567061914392720000/186567093359372947 0 433111707595130000/186567093359372947 0 552979840077780000/186567093359372947 88751205628590000/186567093359372947 1077205206594860000/186567093359372947 0", "1 0 0 963650000/261770721 0 0 0 642310000/261770721 0 1976140000/261770721 0", "1 0 0 122251000/32939963 0 0 0 137133000/32939963 0 191629000/32939963 0", "1 43955062000/57515810011 0 206121632000/57515810011 0 0 0 17354210000/5228710001 0 375800174000/57515810011 0", "1 51965575500000/42225779998349 0 132286577725000/42225779998349 0 53240488945000/42225779998349 0 135052647465000/42225779998349 0 260723931865000/42225779998349 0", "1 72928823060000/33446149200059 0 12308070010000/33446149200059 0 0 106480977890000/33446149200059 245342556380000/33446149200059 0 81038961210000/33446149200059 0", "1 0 0 263751940/68466013 87910124/68466013 0 0 262588912/68466013 0 33622284/6224183 0", "1 0 0 1168432510000/289179275869 0 0 0 81673830000/26289025079 219775310000/289179275869 1843985210000/289179275869 0", "1 0 0 0 10000/375937 0 0 0 0 3890000/375937 0", "1 0 0 0 661040000/349405963 2104310000/349405963 0 0 0 2523050000/349405963 0", "1 168397080000/139788494989 0 0 75659600000/139788494989 903860930000/139788494989 0 0 0 1063407350000/139788494989 0", "1 125095480000/59226281631 0 0 6976000000/6580697959 386612230000/59226281631 0 0 0 382460830000/59226281631 0", "1 0 0 0 2672650000/511493993 0 0 2622580000/511493993 0 1119170000/511493993 0", "1 1462458430000/472539029547 0 0 490437200000/157513009849 0 0 247721360000/36349156119 0 513155950000/472539029547 0", "1 22005052618750/6108775765019 0 0 11807597361875/6108775765019 17818273166875/6108775765019 0 32850076435000/6108775765019 0 12944361936250/6108775765019 0", "1 96179023400000/22619866623177 0 0 16941924685000/7539955541059 24131596965000/7539955541059 0 37128115660000/7539955541059 0 117409630000/74653025159 0", "1 224325682440000/89535530697283 0 0 803193050000/8139593699753 0 285092370670000/89535530697283 678804748230000/89535530697283 0 186916996020000/89535530697283 0", "1 0 82533378125/15171587993 0 48665656250/15171587993 0 0 57769798750/15171587993 0 15702126250/15171587993 0", "1 108759564370000/56599385187477 312787344380000/56599385187477 0 9594286760000/5145398653407 0 0 273642127160000/56599385187477 0 6271227630000/18866461729159 0", "1 207714181127730000/61965067252023721 93420846622210000/61965067252023721 0 88561169820180000/61965067252023721 205684047155480000/61965067252023721 0 287449114888300000/61965067252023721 0 127397618774350000/61965067252023721 0", "1 91649021442500000/21571291809665507 32189636129887500/21571291809665507 0 40261897092530000/21571291809665507 79932967768945000/21571291809665507 0 86774869502380000/21571291809665507 0 4021673909057500/3081613115666501 0", "1 1181736284374330000/267429259935315289 473522412372110000/267429259935315289 0 466742977350620000/267429259935315289 985564748697640000/267429259935315289 0 1004150378977740000/267429259935315289 0 48531576311300000/38204179990759327 0", "1 1964541706818709125/431504470817787794 422587914344102000/215752235408893897 0 347362481241872000/215752235408893897 1494629049593094375/431504470817787794 42897585026915375/61643495831112542 1658034229495874375/431504470817787794 0 23316452029417000/30821747915556271 0", "1 0 18118409012500/10241873283933 27189891092500/10241873283933 10113285237500/3413957761311 0 0 1224499707500/249801787413 0 23421284397500/10241873283933 0", "1 0 106448228387500/21576910047837 0 696893125000/1135626844623 0 55931749187500/21576910047837 103919073407500/21576910047837 0 12852093597500/7192303349279 0", "1 0 23616388713326250/12767934426772399 1358583281052500/555127583772713 24583720456265000/12767934426772399 0 13474512240985000/12767934426772399 66737409058660000/12767934426772399 0 31857711241285000/12767934426772399 0", "1 0 86406539962500/40148254940417 0 55797795085000/40148254940417 0 0 220793847665000/40148254940417 0 85165528715000/40148254940417 108759564370000/40148254940417", "1 0 1724399408462000/2210218891015419 0 2705422713110000/2210218891015419 1541288849389000/2210218891015419 0 4097959180195000/736739630338473 0 2035724490778000/736739630338473 6923806037591000/2210218891015419", "1 0 4591836657830000/2104044803490809 0 1778096561140000/2104044803490809 0 1323277304890000/2104044803490809 11920167340540000/2104044803490809 0 4740686036700000/2104044803490809 5434333124210000/2104044803490809", "1 0 3393612227315084000/3239004547819478343 0 3106967095337324000/3239004547819478343 1845199442163526000/3239004547819478343 367941524682846000/1079668182606492781 6090063532531754000/1079668182606492781 0 2933555366437460000/1079668182606492781 9673980068434988000/3239004547819478343", "1 0 0 91403651875/30251461068 102748515625/30251461068 0 0 162121316875/30251461068 0 82502494375/30251461068 0", "1 0 0 0 1182329900000/298589545791 1320534050000/298589545791 0 754896260000/298589545791 0 1202792090000/298589545791 0", "1 2945690697000/1048256450869 0 0 18992267042000/9434308057821 42692357171000/9434308057821 0 37740266702000/9434308057821 0 28966074968000/9434308057821 0", "1 4336493337500/1214434296793 0 0 25978240855000/10929908671137 1824350217500/376893402453 0 38103807805000/10929908671137 0 26541432040000/10929908671137 0", "1 1239078540280000/337490227042231 0 0 781999262720000/337490227042231 61460308590000/11637594035939 0 890845893120000/337490227042231 0 955286174670000/337490227042231 0", "1 8957303033329375/2346682560483718 0 0 2485198702540000/1173341280241859 416100156035625/80920088292542 150317810154375/80920088292542 6001404884953125/2346682560483718 0 2230796786055000/1173341280241859 0", "1 162385433803042000/46050310843615899 0 0 3543238423876000/2708841814330347 177017933440400000/46050310843615899 0 222163674526084000/46050310843615899 37368338648884000/46050310843615899 34100143316606000/15350103614538633 0", "1 386955662053650000/105935344520059619 0 0 145133024300260000/105935344520059619 412919766770640000/105935344520059619 0 501814760364260000/105935344520059619 85839029679700000/105935344520059619 224063751822730000/105935344520059619 0", "1 0 0 133238229413750/42060855389767 128766172706250/42060855389767 36236818025000/42060855389767 0 204585530223750/42060855389767 0 130885257158750/42060855389767 0", "1 0 0 6954696150000/1933365588619 3829265005000/1933365588619 2166928795000/1933365588619 0 7749232355000/1933365588619 0 8638866070000/1933365588619 0", "1 1089722360654400/427677236451133 0 467104233111050/427677236451133 806146748551350/427677236451133 1406143368675800/427677236451133 0 53961080363250/11558844228409 0 1216169576670050/427677236451133 0", "1 216236668562050000/59669666768646673 0 64379272259775000/59669666768646673 143169331435645000/59669666768646673 223609860277280000/59669666768646673 0 234816516603395000/59669666768646673 0 115827875520635000/59669666768646673 0", "1 156412849575270000/37423648063050983 0 118380603093027500/37423648063050983 81368399174372500/37423648063050983 135449228271810000/37423648063050983 0 37145847390867500/37423648063050983 0 105173016135082500/37423648063050983 0", "1 0 0 215884265806800000/70923967667017121 167854913593940000/70923967667017121 62977036568870000/70923967667017121 50368745148670000/70923967667017121 360409172572150000/70923967667017121 0 232438396461300000/70923967667017121 0", "1 35389268624394940000/23350535291243436589 0 1380599454364060000/805190872111842641 26519944465748880000/23350535291243436589 54905131076724090000/23350535291243436589 29262040305892210000/23350535291243436589 119825938443401590000/23350535291243436589 0 2612296612496100000/805190872111842641 0", "1 0 0 0 24752089220000/21344482624937 85158582710000/21344482624937 58154235910000/21344482624937 79260276190000/21344482624937 0 96597285660000/21344482624937 0", "1 60032532867400000/56882882098582443 0 0 12694806860980000/18960960699527481 231258701380570000/56882882098582443 141644039516470000/56882882098582443 236875776682870000/56882882098582443 0 8087287418120000/1961478693054567 0", "1 0 0 0 7240070000/7701757333 0 30752721000/7701757333 49995311000/7701757333 0 24498787000/7701757333 0", "1 0 0 49297968350000/17616806828249 660868695500000/299485716080233 0 369716750530000/299485716080233 1726161423160000/299485716080233 0 896774899930000/299485716080233 0", "1 0 0 0 690599450000/260286930991 0 0 1388516210000/260286930991 1320534050000/260286930991 64519540000/260286930991 0", "1 0 0 96900121440000/38915707591319 107953460650000/38915707591319 0 0 209927998210000/38915707591319 72473636050000/38915707591319 74725683380000/38915707591319 0", "1 0 0 0 7334469990000/5725949830993 0 0 103860821930000/17177849492979 38402906650000/17177849492979 9696904460000/5725949830993 43066720640000/17177849492979", "1 0 0 0 146168044236850000/126279885434898419 16117785765945000/18039983633556917 0 717287988607235000/126279885434898419 51731982253860000/126279885434898419 361825811798390000/126279885434898419 405963584507605000/126279885434898419", "1 0 0 0 11016685347333740000/40326267366919772561 28538778824326190000/40326267366919772561 42250077851576230000/40326267366919772561 243788061912319910000/40326267366919772561 33936122273150840000/40326267366919772561 114176069245222980000/40326267366919772561 115042792112966080000/40326267366919772561", "1 0 0 0 95589061250/57519331201 0 0 355262001250/57519331201 0 6614502500/2500840487 182807303750/57519331201", "1 0 0 0 9941430546250/6772086679049 117353940000/294438551263 0 40399952866250/6772086679049 0 830607272500/294438551263 22005052618750/6772086679049", "1 0 0 0 1740096085000/1108056085191 12504508487500/7756392596337 0 39713221172500/7756392596337 0 25350217150000/7756392596337 2454742247500/861821399593", "1 0 0 1077749630288750/1686134128337423 2562185122111250/1686134128337423 1765402396625000/1686134128337423 0 9189287539318750/1686134128337423 0 5268935642253750/1686134128337423 4540509836060000/1686134128337423", "1 0 0 293001126610000/260984280779791 342344138780000/260984280779791 292406938485000/260984280779791 0 1319205269815000/260984280779791 0 947637662940000/260984280779791 613093464555000/260984280779791", "1 0 0 16968061136575420000/21374746913553960263 30014666202480180000/21374746913553960263 22262568468781900000/21374746913553960263 5139695247270150000/21374746913553960263 117091651536358200000/21374746913553960263 0 67969058761684060000/21374746913553960263 53083902936592410000/21374746913553960263", "1 0 0 0 15996651512140000/14526362564574193 32100426211370000/14526362564574193 15903704061570000/14526362564574193 70957340102670000/14526362564574193 0 53410599945480000/14526362564574193 30016266433700000/14526362564574193", "1 0 0 0 439845088125/381073362863 0 9779495000/16568407081 2416386938125/381073362863 0 45986506250/16568407081 1168362929375/381073362863", "1 0 0 0 76716852700000/77079661863309 0 71307669170000/77079661863309 493031708860000/77079661863309 0 31196600200000/11011380266187 222544860950000/77079661863309", "1 0 0 332594833805000/2448873091999557 7763264644060000/7346619275998671 0 5835387268550000/7346619275998671 46733093092750000/7346619275998671 0 20749909282645000/7346619275998671 21190061711795000/7346619275998671", "1 0 0 0 66697100134660000/81422670080255403 0 76620065280230000/81422670080255403 523336558767340000/81422670080255403 5321517340880000/27140890026751801 225520317521920000/81422670080255403 239418483167930000/81422670080255403", "1 0 2660758670440000/9269352756330653 0 27194419208260000/27808058268991959 0 20940644167790000/27808058268991959 175082752590220000/27808058268991959 0 10891801331440000/3972579752713137 82657950775490000/27808058268991959", "1 0 0 0 0 216400/31961 0 0 0 257200/31961 0", "1 237760000/232356343 0 0 0 1555310000/232356343 0 0 0 1829650000/232356343 0", "1 497480000/212407281 0 0 0 1528730000/212407281 0 0 0 1331330000/212407281 0", "1 0 0 0 0 348890000/60632077 0 0 0 499270000/60632077 59440000/60632077", "1 0 0 0 0 0 625/33354 0 0 345625/33354 0", "1 0 0 0 0 0 1350/217 0 0 1450/217 0", "1 134920000/14352479 0 0 0 0 89668750/43057437 0 0 112551250/43057437 0", "1 93326035000/10076553417 0 16481105000/30229660251 0 0 8622595000/4318522893 0 0 25812085000/10076553417 0", "1 11310885000/2187116287 0 9961805000/2187116287 0 0 5941185000/2187116287 0 0 7665255000/2187116287 0", "1 50779447225000/6759874858551 8880715880000/6759874858551 19023808505000/6759874858551 0 0 20384724685000/6759874858551 0 0 9428023495000/6759874858551 0", "1 33449725000/3711814839 0 1024069000/412423871 0 0 8063321000/3711814839 0 0 5288851000/3711814839 0", "1 131441897455000/14285088891617 0 31374340285000/14285088891617 0 0 33685705375000/14285088891617 13552635320000/42855266674851 0 44782215005000/42855266674851 0", "1 145805809355000/16026453788633 0 38216550305000/16026453788633 0 0 41068986875000/16026453788633 0 0 10537224435000/16026453788633 6776317660000/16026453788633", "1 442994909455000/52326058524541 0 131886122455000/52326058524541 35522863520000/52326058524541 0 88678535795000/52326058524541 0 0 99782212185000/52326058524541 0", "1 79568669095000/9760700641849 0 27347201077000/9760700641849 12112512770000/9760700641849 0 16183888011000/9760700641849 0 0 14592268003000/9760700641849 0", "1 63682913923605000/7379613370359619 0 16007174565767500/7379613370359619 5672024505147500/7379613370359619 0 13743968800245000/7379613370359619 2899831249082500/7379613370359619 0 11059029387382500/7379613370359619 0", "1 171754868889005000/20699829736066497 0 16624549775505000/6899943245355499 21335668037660000/20699829736066497 0 40662170375645000/20699829736066497 0 0 23593108050845000/20699829736066497 11599324996330000/20699829736066497", "1 611663450545000/71164017411779 0 165580419465000/71164017411779 0 0 150213163245000/71164017411779 0 35522863520000/71164017411779 133678127015000/71164017411779 0", "1 26547533165000/3138602412019 0 7553089261800/3138602412019 0 0 7262390745400/3138602412019 0 2422502554000/3138602412019 4993878960200/3138602412019 0", "1 90186215619065000/10328251491995519 0 21080306387550000/10328251491995519 0 0 23544107865492500/10328251491995519 3076023309477500/10328251491995519 5672024505147500/10328251491995519 16175167172412500/10328251491995519 0", "1 17821976123981000/2090827319446273 0 803863476757000/368969526961107 0 0 5123694428577000/2090827319446273 0 4267133607532000/6272481958338819 2782915558165000/2090827319446273 2460818647582000/6272481958338819", "1 60564557500/7370041707 0 0 0 8240552500/7370041707 1719555000/818893523 0 0 23452472500/7370041707 0", "1 223818800000/23557663731 0 0 0 0 51390092500/23557663731 8240552500/23557663731 0 17865562500/7852554577 0", "1 360980515000/36467803693 0 0 0 0 99673130000/36467803693 128411575000/109403411079 0 92672875000/109403411079 0", "1 143204675425000/14996451733567 0 0 6938352221000/14996451733567 0 36471527139000/14996451733567 18198624165000/14996451733567 0 16820212134000/14996451733567 0", "1 490804436285000/51238082795051 0 0 0 0 136725405657500/51238082795051 57643986522500/51238082795051 17345880552500/51238082795051 60304877637500/51238082795051 0", "1 211866505000/24457991981 0 0 0 0 84368918750/24457991981 0 42273522500/24457991981 20574036250/24457991981 0", "1 287085407500/30610060757 0 0 0 0 67384167500/30610060757 0 0 72118595000/30610060757 8240552500/30610060757", "1 0 5670000/1946779 0 0 0 110767500/13627453 0 0 47065000/13627453 0", "1 0 0 16200/7553 0 0 22950/4067 0 0 329900/52871 0", "1 26150795000/6894314529 0 37543435000/6894314529 0 0 63769685000/20682943587 0 0 81027005000/20682943587 0", "1 20321619085000/5317370589527 0 28130185405000/5317370589527 0 2227822000000/5317370589527 15547046385000/5317370589527 0 0 21047782105000/5317370589527 0", "1 12528581327572000/2626735283572057 2665154185798000/1125743692959453 4429862969074000/1125743692959453 0 11298341622328000/7880205850716171 31245888917282000/7880205850716171 0 0 3295187929386000/2626735283572057 0", "1 7906004065000/1946082038723 0 8209357345000/1946082038723 0 0 7689364565000/1946082038723 3118950800000/1946082038723 0 5255697645000/1946082038723 0", "1 0 0 0 0 101250/20309 1130625/284326 0 0 985625/142163 0", "1 0 0 0 0 0 30307500/4219019 1417500/602717 0 19812500/4219019 0", "1 0 0 0 0 0 30729375/4291952 0 0 9413125/2145976 354375/153284", "1 23802722500/9957095027 0 0 0 0 69874902500/9957095027 0 0 1018750000/905190457 45345737500/9957095027", "1 80464874285000/20606836122767 0 106984330005000/20606836122767 0 0 67097799585000/20606836122767 0 0 73069348705000/20606836122767 7797377000000/20606836122767", "1 0 0 0 0 332030000/53711479 661040000/483403311 0 0 3974450000/483403311 0", "1 0 0 0 0 372870000/62175811 174240000/62175811 0 0 460750000/62175811 0", "1 6897420/13462579 0 0 0 81068580/13462579 44215920/13462579 0 0 91054540/13462579 0", "1 1420303750/1386898149 0 0 0 8521903750/1386898149 1388637500/462299383 0 0 9081761875/1386898149 0", "1 5823490000/2249742411 0 0 0 45666445000/6749227233 19375855000/6749227233 0 0 10576585000/2249742411 0", "1 32505885698750/7201503498231 0 0 0 43788142596250/7201503498231 32405703893750/7201503498231 2058492376250/800167055359 0 417762710000/7201503498231 0", "1 170891425640000/67437251737191 1311362290000/1070432567257 0 0 368038206770000/67437251737191 25854622560000/7493027970799 0 0 303621565790000/67437251737191 0", "1 3083014516875/1316820580327 0 0 163920286250/188117225761 8319363674375/1316820580327 2886767328750/1316820580327 0 0 6883763740625/1316820580327 0", "1 41927695030000/15369151662459 0 0 0 92773086977500/15369151662459 4623448867500/1707683518051 0 163920286250/243954788293 76724089997500/15369151662459 0", "1 72705153170761250/16462202498266469 0 0 0 77521913015763750/16462202498266469 63144988047586250/16462202498266469 33865991132753750/16462202498266469 3266502732440000/2351743214038067 26165490610430000/16462202498266469 0", "1 1469466427500/572241340363 350323840000/81748762909 0 0 1627481682500/572241340363 11358055490000/1716724021089 0 0 1654733082500/1716724021089 0", "1 23828263125/21435279937 0 15302853750/21435279937 0 119491903125/21435279937 64936317500/21435279937 0 0 135780500625/21435279937 0", "1 50355899207000/12955855685787 0 1089157678000/205648502949 0 36212521348000/12955855685787 38945226125000/12955855685787 0 0 30435324371000/12955855685787 0", "1 56664387155000/11327611190679 0 846976330000/179803352233 0 42302762540000/11327611190679 10889806135000/3775870396893 0 0 12716978600000/11327611190679 0", "1 75235191192538750/14727997524421413 0 7331010386760000/1636444169380157 0 56012245601806250/14727997524421413 45260947954543750/14727997524421413 490289121696250/1636444169380157 0 11151722885140000/14727997524421413 0", "1 340987875473810000/73605710671927371 2309490523730000/1168344613840117 4860907008980000/1168344613840117 0 145509404402680000/73605710671927371 281013684151460000/73605710671927371 0 0 89762194264880000/73605710671927371 0", "1 42992815814960000/10739920668854307 3258662472650000/1534274381264901 4517997531280000/1534274381264901 0 27946543242850000/10739920668854307 41714459022080000/10739920668854307 0 0 22760332591310000/10739920668854307 0", "1 23416836946954375/7023525248666857 0 5182360444820625/1003360749809551 1112852115041875/1003360749809551 15739216939705625/7023525248666857 15145373235679375/7023525248666857 0 0 23320299996905000/7023525248666857 0", "1 44613995099239375/10338346752181308 0 718597312578125/164100742098116 299006754076875/164100742098116 31120797841650625/10338346752181308 1681850575331875/1148705194686812 0 0 25588577026290625/10338346752181308 0", "1 12894483373336653750/2904038689649800189 0 11530255993626182500/2904038689649800189 5687905175090817500/2904038689649800189 8915708085715811250/2904038689649800189 4856098267611318750/2904038689649800189 1447052319060283750/2904038689649800189 0 5716926182761447500/2904038689649800189 0", "1 311930427698236650000/69240482219075152307 20202906031614410000/9891497459867878901 40422212946092200000/9891497459867878901 177957262604420000/581852791756934053 2893386650135580000/1610243772536631449 249995165587629020000/69240482219075152307 0 0 100380480829026940000/69240482219075152307 0", "1 72909812021796250/20568366202581589 0 14370777664577500/2938338028940227 0 43551439770048750/20568366202581589 58526054373442500/20568366202581589 0 2225704230083750/2938338028940227 68476089233000000/20568366202581589 0", "1 138452939071446250/28793851582414779 0 1737658295022500/457045263212933 0 83445657089098750/28793851582414779 8200939678457500/3199316842490531 0 598013508153750/457045263212933 68508723477981250/28793851582414779 0", "1 20472739904872246250/4184836840922764829 0 14931990397690005000/4184836840922764829 0 12239283280265598750/4184836840922764829 11356133279399798750/4184836840922764829 1079147830684006250/4184836840922764829 5687905175090817500/4184836840922764829 804039095187662500/380439712811160439 0", "1 490315750733013090000/106976513248930583419 31834636617353050000/15282359035561511917 61029119161892740000/15282359035561511917 0 187823172156785180000/106976513248930583419 408602514510426080000/106976513248930583419 0 177957262604420000/898962296209500701 151353913193579900000/106976513248930583419 0", "1 500939154750/506331208747 0 0 0 2947145936250/506331208747 1716465881750/506331208747 3060570750/5564079217 0 3079745730000/506331208747 0", "1 17033651875/19885244351 0 0 0 228681939375/39770488702 136706516875/39770488702 0 0 244792058125/39770488702 2550475625/5681498386", "1 39626720000/78812088361 0 0 0 498041570000/78812088361 75659600000/78812088361 0 0 637181150000/78812088361 0", "1 0 0 0 0 37940496/6878777 42628336/20636331 8124272/6878777 0 149434624/20636331 0", "1 8690427100000/23325155860551 0 0 0 123965650210000/23325155860551 48545036020000/23325155860551 40074539980000/23325155860551 0 156138846670000/23325155860551 0", "1 0 0 0 0 0 9636500/2495469 4475500/831823 0 12090500/2495469 0", "1 36200350000/18036095281 0 0 0 0 64801685000/18036095281 134356095000/18036095281 0 42686535000/18036095281 0", "1 39698210000/16839741809 0 0 0 0 56752990000/16839741809 127379850000/16839741809 0 36821880000/16839741809 0", "1 10023098570000/4085899186919 73017550000/371445380629 0 0 0 13244111060000/4085899186919 30745361440000/4085899186919 0 8493964510000/4085899186919 0", "1 658594103110000/266556020010467 0 0 0 0 870787956580000/266556020010467 2024077729120000/266556020010467 1606386100000/24232365455497 558485485430000/266556020010467 0", "1 129261000000/35179407001 0 0 0 0 246272292500/35179407001 206074627500/35179407001 0 5111437500/35179407001 0", "1 2326364343750/637647534523 0 0 0 561714031250/637647534523 4103319508750/637647534523 3454432651250/637647534523 0 365217500000/637647534523 0", "1 6817758580000/3085720259623 0 646091330000/3085720259623 0 0 10325317150000/3085720259623 23116403680000/3085720259623 0 7006697430000/3085720259623 0", "1 65589438875380000/29464965093728677 2202890924700000/29464965093728677 6996285781430000/29464965093728677 0 0 97056710080870000/29464965093728677 220004044025740000/29464965093728677 0 66030121831830000/29464965093728677 0", "1 169520493694360000/76760223357245779 0 20858545106810000/76760223357245779 2202890924700000/76760223357245779 0 252149414486590000/76760223357245779 573760784202880000/76760223357245779 0 174010701850710000/76760223357245779 0", "1 49593583142260000/22407796398305199 0 5756522689810000/22407796398305199 0 0 74094590909890000/22407796398305199 167711348338180000/22407796398305199 489531316600000/22407796398305199 50633528602210000/22407796398305199 0", "1 13055061300000/6315279196043 0 0 0 3230456650000/6315279196043 21587417390000/6315279196043 44976160870000/6315279196043 0 15881342800000/6315279196043 0", "1 0 0 0 0 0 0 0 5000/103077 355000/34359 0", "1 0 0 0 0 0 0 0 33750/3437 6875/3437 0", "1 32650000/44868297 0 0 0 0 0 0 3143920000/314078079 139550000/104692693 0", "1 3008390000/346813953 0 0 0 0 0 0 230110000/115604651 307080000/115604651 0", "1 276219550000/92645788251 0 1079198720000/277937364753 0 0 0 0 1588209680000/277937364753 558646790000/277937364753 0", "1 31441491593200/7336064343709 23838625963600/7336064343709 15845019616000/7336064343709 0 0 0 0 33718255338400/7336064343709 2564918392000/7336064343709 0", "1 832137751490000/187944174722413 0 572893142550000/187944174722413 0 595965649090000/187944174722413 0 0 421973067820000/187944174722413 673331566130000/187944174722413 0", "1 778809880000/234449131451 0 0 0 998964830000/234449131451 0 0 963050240000/234449131451 853793110000/234449131451 0", "1 0 0 104470000/16362399 0 0 0 0 790000/442227 106555000/16362399 0", "1 0 0 306994830000/44438212811 67922500000/44438212811 0 0 0 31521970000/44438212811 255380520000/44438212811 0", "1 0 0 153126598750/23903705771 0 4245156250/23903705771 0 0 35507107500/23903705771 160694282500/23903705771 0", "1 0 0 585413770000/90159324059 0 0 67922500000/270477972177 0 144270430000/90159324059 1753323640000/270477972177 0", "1 0 0 0 0 0 0 0 53937500/32017059 102685000/32017059 243925000/32017059", "1 54652150000/20059943707 0 0 0 0 0 0 53291100000/20059943707 13444805000/20059943707 147960100000/20059943707", "1 392318870000/47730545337 0 0 0 0 0 0 72117580000/47730545337 62131970000/47730545337 131956220000/47730545337", "1 1084893166790000/127617297456519 14920064650000/42539099152173 0 0 0 0 0 54578340320000/42539099152173 1461540020000/1090746132107 33698315460000/14179699717391", "1 80639859070000/9157040414627 0 14920064650000/27471121243881 0 0 0 0 4158411320000/3924445891983 18486809270000/9157040414627 5952488930000/3924445891983", "1 239106605380000/50765553475223 0 0 0 102203152610000/50765553475223 0 0 142457723130000/50765553475223 33394408440000/50765553475223 244193515460000/50765553475223", "1 753023807080000/163419359517173 0 0 0 575495818370000/163419359517173 0 0 384221258240000/163419359517173 347893712650000/163419359517173 495093281280000/163419359517173", "1 20687630157280000/4082385050383319 122076858048330000/126553936561882889 0 0 285072957555470000/126553936561882889 0 0 295294047921530000/126553936561882889 86864835815290000/126553936561882889 504451871799900000/126553936561882889", "1 33903696027755000/7194558178036131 0 40692286016110000/21583674534108393 0 22882598728585000/7194558178036131 0 0 42963392869505000/21583674534108393 19956821523355000/7194558178036131 35929964500130000/21583674534108393", "1 0 0 17777871250/5592300963 0 0 0 0 9553673125/11184601926 18579436875/3728200642 26006890625/5592300963", "1 0 0 361934810000/62598626877 0 0 0 0 86787790000/62598626877 130580880000/20866208959 67922500000/62598626877", "1 7355554150000/16738449423649 0 62764821620000/16738449423649 0 0 0 0 14426046580000/16738449423649 81904514180000/16738449423649 68266875200000/16738449423649", "1 0 0 101073454660000/39143902190937 0 0 0 22066662450000/13047967396979 35542167590000/39143902190937 59306431980000/13047967396979 160874809250000/39143902190937", "1 0 0 0 0 0 142222970000/37153432321 0 46273530000/37153432321 57105390000/37153432321 271857030000/37153432321", "1 0 0 0 0 0 50536727330000/32693637431319 175565326700000/32693637431319 38677776820000/32693637431319 71935683260000/32693637431319 131120476670000/32693637431319", "1 0 0 0 0 0 0 54652150000/13652141059 59096650000/40956423177 121204355000/40956423177 205587650000/40956423177", "1 0 0 0 0 574550000/124029083 0 0 330520000/124029083 880210000/124029083 0", "1 122589520000/86845977181 0 0 0 548418570000/86845977181 0 0 37829800000/86845977181 664659550000/86845977181 0", "1 92540120000/36448543539 0 0 0 227081870000/36448543539 0 0 3488000000/4049838171 237875270000/36448543539 0", "1 541228781080000/147102327903031 0 0 0 567125989530000/147102327903031 0 615481003380000/147102327903031 246332018110000/147102327903031 447041485300000/147102327903031 0", "1 762229980880000/189086211148937 0 0 0 756034395230000/189086211148937 0 732580546380000/189086211148937 336401224010000/189086211148937 540975666640000/189086211148937 0", "1 15004890424000/3562603613663 0 0 0 17580806534000/3562603613663 0 7616819712000/3562603613663 6015378944000/3562603613663 13019687710000/3562603613663 0", "1 777694779610460000/167402473108050253 209429323548510000/167402473108050253 0 0 647455194993190000/167402473108050253 0 504451871799900000/167402473108050253 233371488675310000/167402473108050253 403186087022630000/167402473108050253 0", "1 45455758792601500/10046244884358107 0 20942932354851000/10046244884358107 0 38715273042186500/10046244884358107 0 10778989350039000/10046244884358107 16273679834874500/10046244884358107 36244212009296500/10046244884358107 0", "1 0 0 0 0 23950636400/4373787331 0 0 720998400/4373787331 35875968400/4373787331 4903580800/4373787331", "1 0 0 0 0 0 0 114910000/30606229 213945000/30606229 65925000/30606229 0", "1 548705050000/310859603353 0 0 0 0 0 1697169840000/310859603353 1917090160000/310859603353 188076490000/310859603353 0", "1 259896850000/135366506461 0 0 0 0 0 2158397440000/406099519383 855053520000/135366506461 185632490000/406099519383 0", "1 0 0 109741010000/36267790407 0 0 0 135633820000/36267790407 115847570000/36267790407 155648350000/36267790407 0", "1 0 0 1023714299440000/262472719753751 0 269658550450000/262472719753751 0 761925295620000/262472719753751 22975590030000/20190209211827 1576310774140000/262472719753751 0", "1 0 0 0 0 0 172649862500/63821250103 398155667500/63821250103 292324200000/63821250103 70784232500/63821250103 0", "1 0 0 0 0 0 19039593125/4349470177 1525811875/228919483 4525043750/4349470177 12520769375/4349470177 0", "1 0 0 0 0 0 476802500/52320813 42580157500/10516483413 21543500000/10516483413 8237187500/10516483413 0", "1 0 0 636618727150000/328697102914951 0 0 929176630410000/328697102914951 2078608993020000/328697102914951 660868695500000/328697102914951 811128944210000/328697102914951 0", "1 296030912770000/216426548719789 0 0 0 0 373136755760000/216426548719789 1441181046240000/216426548719789 1042415387200000/216426548719789 62278140210000/216426548719789 0", "1 0 143213234725000/35533452529691 0 0 0 111008145375000/35533452529691 186458392585000/35533452529691 1393786250000/1870181712089 64869149265000/35533452529691 0", "1 0 2089488369542500/24598453026610581 47369669150735000/24598453026610581 0 0 69104417062570000/24598453026610581 51622745202570000/8199484342203527 49167440912530000/24598453026610581 60213685150490000/24598453026610581 0", "1 0 0 296030912770000/154209728578167 0 0 431813842600000/154209728578167 974065370180000/154209728578167 321911376250000/154209728578167 4623633390000/1903823809607 0", "1 0 0 77051766598000/39165396881013 0 0 111801304780000/39165396881013 246332888056000/39165396881013 79779404506000/39165396881013 95490252376000/39165396881013 0", "1 0 0 485488079786920000/249776111241685361 0 8357953478170000/249776111241685361 702230538717090000/249776111241685361 1573491455181630000/249776111241685361 503564740781820000/249776111241685361 618678297615100000/249776111241685361 0", "1 112688669437063700000/64981562772139500683 0 1707701950449860000/1584916165174134163 0 144029374533146310000/64981562772139500683 141803000262051470000/64981562772139500683 365972204602767290000/64981562772139500683 53039888931497760000/64981562772139500683 189455616950748300000/64981562772139500683 0", "1 0 0 0 0 286426469450000/102188315507541 362713277750000/102188315507541 484591358410000/102188315507541 123760446100000/102188315507541 128545627080000/34062771835847 0", "1 29656102714820000/22358556687912003 0 0 0 78894426474730000/22358556687912003 62975538497020000/22358556687912003 11831041855580000/2484284076434667 12694806860980000/22358556687912003 81993279339770000/22358556687912003 0", "1 36518296182388750/12379139688413529 0 0 0 38279168152206250/12379139688413529 1107262007461250/728184687553737 68014957084258750/12379139688413529 1887962522312500/1375459965379281 28192399361841250/12379139688413529 0", "1 23762170000971875/5874436701361618 0 0 0 19346046853860625/5874436701361618 13606221028149375/5874436701361618 28668129210320625/5874436701361618 4856016986120000/2937218350680809 3324992839855000/2937218350680809 0", "1 0 0 0 0 0 0 1089124870000/200963060799 566719130000/200963060799 177829840000/66987686933 548705050000/200963060799", "1 0 0 0 0 128215650890000/162160263040519 0 834965342460000/162160263040519 187178390310000/162160263040519 585346636540000/162160263040519 541228781080000/162160263040519", "1 0 0 32972101999040000/23469340837384963 0 24819730798610000/23469340837384963 0 100397328299340000/23469340837384963 17973067285950000/23469340837384963 110119589708780000/23469340837384963 53389429557720000/23469340837384963", "1 0 0 0 0 6822446981930000/10051368939569079 32972101999040000/30154106818707237 179528525406260000/30154106818707237 30494857394770000/30154106818707237 89879941710260000/30154106818707237 86297614156040000/30154106818707237", "1 0 0 0 0 0 66010229910000/44758439069783 866507890840000/134275317209349 310064077880000/134275317209349 89007592360000/44758439069783 296030912770000/134275317209349", "1 0 0 0 0 0 144257452430000/84085205269293 1662653807080000/252255615807879 275917999100000/252255615807879 23909558520000/9342800585477 636618727150000/252255615807879", "1 66697100134660000/46667260999748207 0 0 0 0 123567795228610000/46667260999748207 47940218498920000/6666751571392601 15076161410360000/46667260999748207 110767913693660000/46667260999748207 51808704208290000/46667260999748207", "1 0 0 0 0 0 73617838770000/38071417043929 679658434160000/114214251131787 154069040080000/114214251131787 74569503220000/38071417043929 385258832990000/114214251131787", "1 12230121714820000/16165375752806383 0 0 0 0 44441958965570000/16165375752806383 86039815783640000/16165375752806383 21301807549240000/16165375752806383 15739704729820000/16165375752806383 62710001728290000/16165375752806383", "1 0 17337001654130000/13680561635808563 0 0 0 21186055644130000/13680561635808563 252474075716200000/41041684907425689 40896220906220000/41041684907425689 30853479383180000/13680561635808563 94739338301470000/41041684907425689", "1 0 0 0 0 3467400330826000/6043285437556363 8361193550558000/6043285437556363 112277334550954000/18129856312669089 20523293539436000/18129856312669089 16454981975444000/6043285437556363 48548807978692000/18129856312669089", "1 2203337069466748000/8410145820407012913 0 0 0 7293088217133184000/8410145820407012913 11644903229277694000/8410145820407012913 51295718570082472000/8410145820407012913 2832183170647192000/2803381940135670971 23317606854220708000/8410145820407012913 170770195044986000/68375169271601731", "1 0 0 0 0 0 0 0 0 5670000/547313 10000/547313", "1 0 0 0 0 0 0 0 0 117500/18577 100000/18577", "1 2274550000/240256149 0 0 0 0 0 0 0 301120000/80085383 660000/11440769", "1 85011356000/9907423003 0 0 16856354000/9907423003 0 0 0 0 9468918000/9907423003 23740368000/9907423003", "1 1991549090000/223873931859 0 0 0 0 0 0 84281770000/74624643953 136156680000/74624643953 140132880000/74624643953", "1 0 107875000/35445641 0 0 0 0 0 0 11790000/3222331 213200000/35445641", "1 51761450000/15304373003 79936650000/15304373003 0 0 0 0 0 0 12747295000/15304373003 69863300000/15304373003", "1 520968370000/136375277713 862638500000/136375277713 0 0 0 0 0 0 71095900000/136375277713 480023960000/136375277713", "1 165002630000/29353966167 41637370000/9784655389 0 0 0 0 0 0 10509580000/9784655389 30377100000/9784655389", "1 43246558550000/10781356796577 6366518528750/1197928532953 0 0 6751130067500/10781356796577 0 0 0 8969079260000/10781356796577 4453512180000/1197928532953", "1 0 76429385000/32386141867 46901280000/32386141867 0 0 0 0 0 141417510000/32386141867 162671440000/32386141867", "1 32553844990000/26842790751523 64917209610000/26842790751523 80003333940000/26842790751523 0 0 0 0 0 110112817340000/26842790751523 92699184760000/26842790751523", "1 0 1542451000/560054133 0 0 0 781688000/560054133 0 0 561350000/186684711 3392456000/560054133", "1 0 18012415000/6759105029 0 0 0 0 23450640000/6759105029 0 22898970000/6759105029 26778560000/6759105029", "1 2219435330000/9593258270711 26262720255000/9593258270711 0 0 0 0 40001666970000/9593258270711 0 30121594180000/9593258270711 33080371010000/9593258270711", "1 0 13151425652500/6086737042873 0 2219435330000/6086737042873 0 0 27532507955000/6086737042873 0 18224366560000/6086737042873 22227101245000/6086737042873", "1 0 25268363665000/11427471979149 0 0 0 0 50421555580000/11427471979149 2219435330000/11427471979149 37278302380000/11427471979149 13670489120000/3809157326383", "1 0 0 177525000/60433067 0 0 0 0 0 395605000/60433067 221105000/60433067", "1 24205670000/16615505867 0 80127930000/16615505867 0 0 0 0 0 104567350000/16615505867 28790870000/16615505867", "1 0 0 82552720000/37984436609 0 152858770000/37984436609 0 0 0 307392250000/37984436609 30937440000/37984436609", "1 0 0 0 0 0 118350000/34622203 0 0 142220000/34622203 195070000/34622203", "1 0 0 0 0 87050000/16728997 0 0 0 1826590000/217476961 244720000/217476961", "1 0 0 24033280000/22940270809 0 116623730000/22940270809 0 0 0 193389870000/22940270809 13954160000/22940270809", "1 0 0 97778370625/51444753856 0 1274474441875/308668523136 0 215596339375/308668523136 0 1233513739375/154334261568 151676024375/308668523136", "1 0 0 0 24033280000/106644400767 66238670000/11849377863 0 0 0 869130530000/106644400767 112264720000/106644400767", "1 0 0 0 0 173193410000/29760706177 18024960000/29760706177 0 0 245575390000/29760706177 19813360000/29760706177", "1 0 0 0 0 46273530000/9028947119 20638180000/9028947119 0 0 62164890000/9028947119 12256980000/9028947119", "1 0 0 0 0 21327399155000/4220711543823 2346680895000/1406903847941 6350679590000/4220711543823 0 29527230835000/4220711543823 2172606775000/4220711543823", "1 0 0 0 0 0 0 87050000/20534579 0 1491930000/266949527 792990000/266949527", "1 0 0 0 0 0 0 1405810000/225929091 0 801280000/225929091 240475000/75309697", "1 0 18163808750/9802922697 0 0 0 0 49442732500/9802922697 0 34358547500/9802922697 30906970000/9802922697", "1 0 0 18163808750/14541493041 0 0 0 73599132500/14541493041 0 22959388750/4847164347 35028451250/14541493041", "1 0 0 0 0 0 145310470000/163870424759 1109182640000/163870424759 0 497814920000/163870424759 461960090000/163870424759", "1 0 60930010000/31046688773 0 0 0 0 145740210000/31046688773 0 117682410000/31046688773 96836270000/31046688773", "1 4870263230000/33597024737413 74191204215000/33597024737413 0 0 0 0 160726698930000/33597024737413 0 118273558100000/33597024737413 102049862290000/33597024737413", "1 0 3894797732500/2099940081163 0 487026323000/2099940081163 0 0 10485603044000/2099940081163 0 7177600783000/2099940081163 6672086200000/2099940081163", "1 0 14224581284000/7390108536497 0 0 0 0 35937553862000/7390108536497 974052646000/7390108536497 26237140968000/7390108536497 23575406270000/7390108536497", "1 0 0 15232502500/10489381481 0 0 0 43048145000/10489381481 0 60016197500/10489381481 23025107500/10489381481", "1 1130357412500/2216702984821 0 9273900526875/4433405969642 0 0 0 9220652360625/2216702984821 0 24924355335625/4433405969642 6655061118125/4433405969642", "1 0 0 1947398866250/1555206615449 904285930000/1555206615449 0 0 7675006707500/1555206615449 0 7032280638750/1555206615449 3838729473750/1555206615449", "1 0 0 17780726605000/12903371302447 0 0 0 59131262040000/12903371302447 4521429650000/12903371302447 64315495895000/12903371302447 31371353565000/12903371302447", "1 0 0 0 7422703250/6024183529 0 0 5129866750/860597647 0 808026500/261921023 20019653750/6024183529", "1 0 0 0 0 0 30465005000/25167571451 11993865000/2287961041 0 116512175000/25167571451 62636050000/25167571451", "1 76716852700000/38025385117441 0 0 0 0 126244402130000/38025385117441 283132069740000/38025385117441 0 88667671200000/38025385117441 9691369950000/38025385117441", "1 0 0 0 0 0 71122906420000/65859580550247 403715557990000/65859580550247 48723039710000/65859580550247 210144443440000/65859580550247 194660547970000/65859580550247", "1 0 0 0 0 0 0 1904192490000/354897093523 296908130000/354897093523 1364537280000/354897093523 1220781890000/354897093523", "1 0 0 0 0 0 0 0 0 0 125/12", "1 70000/7181 0 0 0 0 0 0 0 0 61000/21543", "1 488120000/50216439 5615000/16738813 0 0 0 0 0 0 0 45007500/16738813", "1 42930000/4996691 7300000/4996691 0 0 0 0 0 0 0 15070000/4996691", "1 3290800/410783 0 0 0 898400/410783 0 0 0 0 1268200/410783", "1 119435000/12110907 0 0 0 0 5615000/4036969 0 0 0 8587500/4036969", "1 97885000/10961157 0 0 0 0 0 0 2288750/3653719 0 12336875/3653719", "1 72276950000/7726685967 1265998000/2575561989 0 0 0 0 0 99566000/367937427 0 223045000/78047333", "1 1082110000/108651369 0 0 0 0 0 0 0 22460000/36217123 78715000/36217123", "1 0 0 2500/2879 0 0 0 0 0 0 229375/23032", "1 0 0 450000/80581 0 0 0 0 0 0 445000/80581", "1 150910000/164936677 0 370100000/164936677 0 0 0 0 0 0 1405590000/164936677", "1 18153250/1894287 0 228875/631429 0 0 0 0 0 0 1748250/631429", "1 144046070000/14965537887 1939870000/4988512629 995660000/4988512629 0 0 0 0 0 0 13127200000/4988512629", "1 57130130000/5862933573 0 1471110000/1954311191 0 0 0 0 0 1939870000/1954311191 460010000/279187313", "1 197080852000/39043551419 0 100564272000/39043551419 0 173505554000/39043551419 0 0 0 0 113410859000/39043551419", "1 691894542470000/134449938866463 41648250890000/134449938866463 324598161620000/134449938866463 0 588930074320000/134449938866463 0 0 0 0 125193559720000/44816646288821", "1 16724576590625/3334697876122 0 4935776519375/1667348938061 0 15338942618125/3334697876122 0 0 0 2603015680625/3334697876122 13524955898125/6669395752244", "1 0 0 4840000/3970369 0 0 128270000/43674059 0 0 0 370090000/43674059", "1 105578640000/62486818661 0 232157480000/62486818661 0 0 160563170000/62486818661 0 0 0 375301990000/62486818661", "1 0 0 36191720000/48652640729 0 0 81193850000/48652640729 211157280000/48652640729 0 0 302427310000/48652640729", "1 0 0 35540000/53891033 0 0 0 150910000/53891033 0 0 435895000/53891033", "1 0 0 14930000/4225291 0 0 0 0 0 96202500/29577037 176447500/29577037", "1 0 0 124150000/28100347 0 0 0 0 0 93125000/28100347 143465000/28100347", "1 9309670000/50053763077 0 189023100000/50053763077 0 0 0 0 0 160563170000/50053763077 286736830000/50053763077", "1 0 0 44212480000/13407534191 0 0 0 9309670000/13407534191 0 40596925000/13407534191 77465115000/13407534191", "1 0 0 0 10000/7559 0 0 0 0 0 150625/15118", "1 0 0 0 14520000/7165793 0 304790000/78823723 0 0 0 631410000/78823723", "1 0 0 0 7108000/8049753 0 0 31162000/8049753 0 0 59375000/8049753", "1 0 0 0 0 0 254000/60907 0 0 0 522000/60907", "1 0 0 0 0 0 264790000/141628711 115520000/20232673 0 0 786130000/141628711", "1 0 0 0 0 0 0 610000/159019 0 0 175000/22717", "1 65495000/6842967 0 0 0 0 0 9155000/15966923 0 0 5847500/2280989", "1 826744970000/85834539483 14240670000/28611513161 0 0 0 0 995660000/4087359023 0 0 71698070000/28611513161" }); VPolygon result = lrs.run(new HPolygon(ine, true)); checkResults(result, ext, null); } //FIXME: digits 120 in in ine? //@Test public void testH2Vkkd38_6() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] ine = convert(new String[] { "2919394390774395218459334 -4379091595292464054287507 -36492430237104184038520181 -253987324572060483286422939 -1691789494531258045567157717 -11149182918946980113429731347 -73511950112254277868261780941", "7 -21 -133 -777 -4669 -29001 -184813", "7 -14 -112 -728 -4564 -28784 -184372", "7 -7 -77 -595 -4109 -27307 -179717", "7 0 -28 -336 -2884 -21840 -156148", "7 7 35 91 -301 -7133 -75445", "7 14 112 728 4396 25424 141772", "7 21 203 1617 12131 88641 638723", "7 28 308 2800 23996 200368 1650188", "7 35 427 4319 41251 384335 3535267", "7 42 560 6216 65324 670992 6815180", "7 49 707 8533 97811 1098349 12216107", "7 56 868 11312 140476 1712816 20717068", "7 63 1043 14595 195251 2570043 33602843", "7 70 1232 18424 264236 3735760 52521932", "7 77 1435 22841 349699 5286617 79549555", "7 84 1652 27888 454076 7311024 117255692", "7 91 1883 33607 579971 9909991 168778163", "7 98 2128 40040 730156 13197968 237900748", "7 105 2387 47229 907571 17303685 329136347", "7 112 2660 55216 1115324 22370992 447815180", "7 119 2947 64043 1356691 28559699 600178027", "7 126 3248 73752 1635116 36046416 793474508", "7 133 3563 84385 1954211 45025393 1036066403", "7 140 3892 95984 2317756 55709360 1337536012", "7 147 4235 108591 2729699 68330367 1708799555", "7 154 4592 122248 3194156 83140624 2162225612", "7 161 4963 136997 3715411 100413341 2711758603", "7 168 5348 152880 4297916 120443568 3373047308", "7 175 5747 169939 4946291 143549035 4163578427", "7 182 6160 188216 5665324 170070992 5102815180", "7 189 6587 207753 6459971 200375049 6212340947", "7 196 7028 228592 7335356 234852016 7516007948", "7 203 7483 250775 8296771 273918743 9040090963", "7 210 7952 274344 9349676 318018960 10813446092", "7 217 8435 299341 10499699 367624117 12867674555", "7 224 8932 325808 11752636 423234224 15237291532", "-2919394390774395218459333 4379091595292464054287507 36492430237104184038520181 253987324572060483286422939 1691789494531258045567157717 11149182918946980113429731347 73511950112254277868261780941" }); Rational[][] ext = convert(new String[] { "1 -3457633353342845560651/3199159354695268062175 30570854219539234855717/38389912256343216746100 -7764123497488641249359/30711929805074573396880 2057030598772364151641/61423859610149146793760 -12219592103442797191/9032920530904286293200 22201652255742569/1329520770782449064800", "1 2428964145333498547289415583/850782720982436471670298800 -171130729204367921249774491597/71465748562524663620305099200 8950930056566450255163838027/9528766475003288482707346560 -5108964992248647594266131669/28586299425009865448122039680 1409366112577447356559709/96640633620723006924009600 -5838797292998456959465043/20418785303578475320087171200", "1 -124086856442797621547529599/7376787226036641674591050 2058776287702527816343070767/132782170068659550142638900 -2647233171486473482856701/376687007286977447213160 89017439392114517471565829/53112868027463820057055560 -17833352250987498100572197/88521446712439700095092600 364531999874246323211423/37937762876759871469325400", "1 -35453387555085034727865841/2107653493153326192740300 147055449121609129738791707/9484440719189967867331350 -252117444903473665033973/35874953074950233067920 25433554112032719277590371/15175105150703948587730160 -1698414500094047438149741/8430613972613304770961200 729063999748492646422849/75875525753519742938650800", "1 607241036333374636822345213/212695680245609117917574700 -3055905878649427165174503803/1276174081473654707505448200 26639672787400149568939673/28359424032747882389009960 -45615758859362924948804263/255234816294730941501089640 12583626005155779969283/862862800185026847535800 -182462415406201779983281/638087040736827353752724100", "1 21878150181071375731004782/7663424244448022845170621 -2202020321470389608801841223/919610909333762741420474520 115176305346179997356220221/122614787911168365522729936 -32869982421669134626790555/183922181866752548284094904 596042719707503194038625/40871595970389455174243312 -18782862618278123197013/65686493523840195815748180", "1 -62715571314612999019793701/3649601039837493409024370 1038465750335815497394983509/65692818717074881362438660 -62635167234631398156788617/8759042495609984181658488 89449684367439274605242101/52554254973659905089950928 -8942958334744387438949083/43795212478049920908292440 7/720", "1 -3583746932263599943988209/208548630847856766229964 74176125023986821242498791/4692344194076777240174190 -17895762067037542330511029/2502583570174281194759568 12778526338205610657891727/7507750710522843584278704 -511026190556822139368519/2502583570174281194759568 7/720", "1 265663252198723848162202096/93055865825440277405643255 -10695527275713320957037546817/4466681559621133315470876240 186475922941434281433880763/198519180427605925132038944 -319308400667643022088823055/1786672623848453326188350496 2554468798746442260165539/175163982730240522175328480 -2554469316085824754793771/8933363119242266630941752480", "1 1505461401534052999538774323/527311828118463903403581385 -3788060859095590333805932024/1581935484355391710210744155 4755184648694642115706618241/5062193549937253472674381296 -129244620028016004252929119/723170507133893353239197328 21713041873042532198226883/1488880455863898080198347440 -11884523134189460802539/41561523398499618002252720", "1 -41421950938379136177993889/2441171298025343773001420 1375502110991793623514470779/87882166728912375828051120 -83141588410975866027351839/11717622230521650110406816 59465065078842413988310681/35152866691564950331220448 -11905265066051393405358149/58588111152608250552034080 243159938374181986073891/25109190493974964522300320", "1 -1613842244352433877064703/95110570052935471675380 6698873917167826088544521/427997565238209622539210 -1619641332681348039493871/228265368127045132020912 1158410358678748324447613/684796104381135396062736 -231920748039962209195289/1141326840635225660104560 33158173414661179919167/3423980521905676980313680", "1 3450255312912268142563988/1208506863525891298862295 -138905211028715306358046409/58008329449242782345390160 2421789991695768839168107/2578147975521901437572896 -4146886204107465377099303/23203331779697112938156064 563975113585520316837059/38672219632828521563593440 -1143964793665295692223/4000574444775364299682080", "1 177106241909841120016118096/62038094734744539988959025 -235298572759429284472769864989/98268342059835351342511095600 2461458635258394806244707305/2620489121595609369133629216 -7024742863831622264986172083/39307336823934140537004438240 56198154167224498566317287/3853660472934719660490631200 -8028318084962578259181401/28076669159952957526431741600", "1 -23002739723706386012481823/1317937825460937987166700 95109728532948916911715571/5930720214574220942250150 -50397742537344568896627793/6958711718433752572240176 179619453426111758387912443/104380675776506288583602640 -35857270161809025248235419/173967792960843814306004400 730608952573630240299191/74557625554647348988287600", "1 -9858317024445594005349293/564830496626116280214300 1509678230681728839868493/94138416104352713369050 -654516136848630764891267/90372879460178604834288 259191130485009752363509/150621465766964341390480 -465678833270247081145913/2259321986504465120857200 7379888409834648891911/753107328834821706952400", "1 10843239300602517552007448/3798250698045584080956675 -436546517178904052825183729/182316033506188035885920400 1522237869671239830701759/1620586964499449207874848 -13032918114715440194779703/72926413402475214354368160 104263736859414654111907/7149648372791687681800800 -104263871233280237132227/364632067012376071771840800", "1 -6298365902227954797489/5826445123545769187080 9827363844158616795551/12338354379273393572640 -1010269863706964652139/3995276656145670299712 255516336751543638095/7627346343550825117632 -189281143779438023959/139834682965098460489920 58923733802465839/3525244108363826735040", "1 -242142814617406334376972130801/220868247536030346134173809798 5359957680016391873983552780679/6626047426080910384025214293940 -227508768005763666474903945799/883472990144121384536695239192 90987669877922278921385478071/2650418970432364153610085717576 -1251179448477770364417457573/883472990144121384536695239192 33937959748766664245198161/1893156407451688681150061226840", "1 -1781244633704197864657872932283/1600331911173005039666395151330 2632543051083719779380519035287/3200663822346010079332790302660 -1008594155669249323090504781875/3840796586815212095199348363192 135343486050796144120003189123/3840796586815212095199348363192 -28520658210441934274846202469/19203982934076060475996741815960 52914022859713852001798209/2743426133439437210856677402280", "1 -783021567162745006159585910611/692200295463500384401682649920 20863636306835357456438178023533/24919210636686013838460575397120 -4454407823650206828445385342623/16612807091124009225640383598080 361123373583430580717730346513/9967684254674405535384230158848 -25927870557698030659201998209/16612807091124009225640383598080 148159261833248071859908079/7119774467624575382417307256320", "1 -685461137778494023330520262547/595539289473113047281241165640 18295022304178804272942634159021/21439414421032069702124681963040 -3918683998598434556804201091883/14292942947354713134749787975360 319996389999048639285863423563/8575765768412827880849872785216 -4699202865169874465690458345/2858588589470942626949957595072 137941378506152868789531161/6125546977437734200607051989440", "1 -1194594616303858172131790382199/1018730994514410517505532977050 5323523081701757064731679861289/6112385967086463105033197862300 -686511028703566952371987079387/2444954386834585242013279144920 31381659158776579865804926231/814984795611528414004426381640 -21219980587032783347545548197/12224771934172926210066395724600 42696139532618648931421291/1746395990596132315723770817800", "1 -621489173497024388255400780521/519470559589016209633580337510 2774867470681291420745008775987/3116823357534097257801482025060 -119715171060790204412859943607/415576447671212967706864270008 49646111323286948217354092681/1246729343013638903120592810024 -1272977360892339185428682187/692627412785354946178107116680 23720076421671461174821243/890520959295456359371852007160", "1 -1340073000624874675724282639197/1096089196146938069748347510520 11990923283344307038334946351133/13153070353763256836980170126240 -519323318699997194855149419323/1753742713835100911597356016832 31025849859714777020200146667/751604020215043247827438292928 -5704981625681036565018270243/2922904523058501519328926694720 109477269037656946029058187/3758020101075216239137191464640", "1 -383067515022486974244734403191/306052817673082771490551411920 3435153373217004062699898674471/3672633812076993257886616943040 -746943156046253477062494477961/2448422541384662171924411295360 63029975601249785683385696261/1469053524830797303154646777216 -5091908350047891051122582383/2448422541384662171924411295360 33573026461918289086373263/1049323946307712359396176269440", "1 -178079245012856971239334925467/138690855075186613866641941890 8803617377529009896366891644771/9153596434962316515198368164740 -37699655919622632625479533573/119654855358984529610436185160 163767437857162350029121554443/3661438573984926606079347265896 -2714378400964720444263501449/1220479524661642202026449088632 92325813152651069564291021/2615313267132090432913819475640", "1 -1658322098341373287975361126737/1256040885506885179876262792550 7471601002650983659756781685247/7536245313041311079257576755300 -327888454807017192126472026899/1004832708405508143901010234040 141029560775168084416439170129/3014498125216524431703030702120 -11998336813219720963852556197/5024163542027540719505051170200 7663406394395050267688353/195746631507566521539157837800", "1 -46455343429273108075606851147/34128008870818833805607055080 27982903871821613902943397053/27302407096655067044485644064 -55539113663012668599393439847/163814442579930402266913864384 8046566991208535844821101607/163814442579930402266913864384 -2109990109493770689184271837/819072212899652011334569321920 1021787345904510898666165/23402063225704343180987694912", "1 -193653005494440048670131898119/137563399320982298698199434640 5264553289668824104748887513933/4952282375555362753135179647040 -233452047867890085186694137071/660304316740715033751357286272 102602610159839498379022046419/1980912950222145101254071858816 -26575286108668079920669687/9514471422776873685178058880 1136648442067694474269877/23195701993233549195012551040", "1 -320084911297596781493499461767/219076016785301161434832036090 4364615995261288545954848852443/3943368302135420905826976649620 -973362729929933697832797182743/2628912201423613937217984433080 86576347387535566240886008903/1577347320854168362330790659848 -8008249082073455888454087989/2628912201423613937217984433080 62401982408218689536072249/1126676657752977401664850471320", "1 -13788729333579674888289682981/9054981264190464815164533070 62889353605103939675280626503/54329887585142788890987198420 -42340039670192412653436555877/108659775170285577781974396840 60534935674089517196575209/1034855001621767407447375208 -4275365960806547355303371/1278350296121006797434992904 979532162615899951171783/15522825024326511111710628120", "1 -318220717379556947599911569201/199516335439122830102050725600 2913672868381646414340825168877/2394196025269473961224608707200 -131666385784389773758277597611/319226136702596528163281160960 60101254166992977857719550629/957678410107789584489843482880 -1968638728577334022834471699/532043561170994213605468601600 49629607548792185972620643/684056007219849703207031059200", "1 -1642738485896935537558802699/977557496312239524657784200 468195932485522904152096805873/363651388628153103172695722400 -21314242058023500137977948819/48486851817087080423026096320 9870403752079915326331776491/145460555451261241269078288960 -333782708753237614831197731/80811419695145134038376827200 8758161049455271160711857/103900396750900886620770206400", "1 -134016796397404795720443853603/75155625078818658829683638130 618858165531078483426256272161/450933750472911952978101828780 -3155667370813253113005882297/6680500007006103007082990056 13357201791027097532898719873/180373500189164781191240731512 -1400693478513028168552353983/300622500315274635318734552520 12772308788186268903202519/128838214420831986565171951080", "1 -312643861094293722690539556881/163791236458414970029742247270 1450954760313161925697125776623/982747418750489820178453483620 -111964403758071333484895866901/218388315277886626706322996360 32125138309450281073470862873/393098967500195928071381393448 -3486826670590386983019168229/655164945833659880118968989080 33207970900639538690765459/280784976785854234336700995320", "1 -119477559024148450452533390561/57843123081542902570602120720 1115154273492292823089650878221/694117476978514830847225448640 -260676729402964830668338728703/462744984652343220564816965760 25383872587354508492684314753/277646990791405932338890179456 -571174081717859143900549997/92548996930468644112963393152 28463938855518551747032991/198319279136718523099207271040", "1 -2712691709690226685105043937/1197063184698689201267330600 93415920722863685755898867973/52670780126742324855762546400 -39730831307917440579380624623/63204936152090789826915055680 6575064646025917471699893193/63204936152090789826915055680 -2304102721672634780056272397/316024680760453949134575278400 8028276743065281959470051/45146382965779135590653611200", "1 -8738178621648073651730885963/3452613438558230366817179090 123965696039798830891367597951/62147041894048146602709223620 -5928647102482774580739300223/8286272252539752880361229816 429503394466845757758341813/3551259536802751234440527064 -365282936395445645925640129/41431361262698764401806149080 364920818575844019725399/1614208880364886924745694120", "1 -31123044143923564823263012143/10752486855323860809077442730 445052965887593106942940546783/193544763395829494563393969140 -21571131026568453657824938067/25805968452777265941785862552 11195794350295455614898014269/77417905358331797825357587656 -1417697361639900133166999909/129029842263886329708929312760 16421383232945277366493367/55298503827379855589541134040", "1 -10727278026666875820641156231/3136165765040695712290668920 103198761785817839475364113151/37633989180488348547488027040 -76167629698779572342823584263/75267978360976697094976054080 901166493504058402235169077/5017865224065113139665070272 -1072841832797474555621135369/75267978360976697094976054080 4379014954339138241066473/10752568337282385299282293440", "1 -21310331790016236250689749501/5028889143878985420979396320 207174410864705031343637946421/60346669726547825051752755840 -51849319491197640191519186843/40231113151031883367835170560 5678639665089833584208017183/24138667890619130020701102336 -52449277839118370795938147/2682074210068792224522344704 10217629911887833155015101/17241905636156521443357930240", "1 -26832216833806195303434938057/4753713494310145517032497750 132039745135723441405571668387/28522280965860873102194986500 -1348004821034221629003903607/760594159089623282725199640 3808257319418212676244873979/11408912386344349240877994600 -184760146048209072356425199/6338284659080194022709997000 7663138379556532661940413/8149223133103106600627139000", "1 -210908628461152442251562419/24835056599044070254809906 5265408091142046506302501873/745051697971322107644297180 -16173809100356900557953709/5843542729186840059955272 160901427761353812490753807/298020679188528843057718872 -1646029851590460382045381/33113408798725427006413208 364904684401567549598357/212871913706092030755513480", "1 -4262997383479678837167933037/263140886935245326664462120 43323803225794902165829270333/3157690643222943919973545440 -258167317936458717692836235/46780602121821391407015488 1414732681430572530753373369/1263076257289177567989418176 -229859075113278733560342769/2105127095481962613315696960 3648925571288774901119927/902197326635126834278155840", "1 -2015510543416651067153169533/35177257312587904906109760 20929484848830310647390361933/422127087751054858873317120 -5793818007499508003181914923/281418058500703239248878080 105474650459896463096995909/24121547871488849078475264 -127678585797726724818136909/281418058500703239248878080 2189204295352317633374129/120607739357444245392376320", "1 -512069507146253867016552519/1486033303756154558529530 910698982621925759979332419/2972066607512309117059060 -2358579857561535734074294583/17832399645073854702354360 105617727997497659152613821/3566479929014770940470872 -11741264159604324936411665/3566479929014770940470872 364802146071380480245987/2547485663581979243193480", "1 -146305573470358247719015081/424580943930329873865580 292724672985618994279071283/955307123843242216197555 -224626653101098641340409119/1698323775721319495462320 90529481140712279273669033/3056982796298375091832176 -1118215634248030946324921/339664755144263899092464 2188812876428282881475923/15284913981491875459160880", "1 -95976692543650050816817707/1675107491075614519338560 2989926406975758663912912161/60303869678722122696188160 -275896095595214666818186717/13400859928604916154708480 105474650459896463096996015/24121547871488849078475264 -6079932657034605943720811/13400859928604916154708480 2189204295352317633374131/120607739357444245392376320", "1 -86999946601626098717713117/5370222182351945442131880 884159249506018411547538043/64442666188223345305582560 -15806162322640329654663475/2864118497254370902470336 28872095539399439403130123/25777066475289338122233024 -4691001532924055786945779/42961777458815563537055040 521275081612682128731419/128885332376446690611165120", "1 -903894121976367609649556183/106435956853046015377756740 2256603467632305645558222077/319307870559138046133270220 -4621088314387685873701073/1669583636910525731415792 137915509509731839277789341/255446296447310436906616176 -21163240949020204912012093/425743827412184061511026960 2189428106409405297590147/1277231482236552184533080880", "1 -7666347666801770086695727963/1358203855517184433437856500 18862820733674777343653168279/4074611566551553300313569500 -128381411527068726571800801/72437538960916503116685680 1088073519833775050355681811/3259689253241242640250855600 -158365839469893490591222073/5432815422068737733751426000 15326276759113065323880869/16298446266206213201254278000", "1 -1522166556429731160763560781/359206367419927530069956880 14798172204621787953117062441/4310476409039130360839482560 -1234507606933277147417128581/957883646453140080186551680 405617118934988113157717027/1724190563615652144335793024 -11239130965525365170558213/574730187871884048111931008 5108814955943916577507567/8620952818078260721678965120", "1 -574675608571439776105779277/168008880270037270301285835 22114020382675251316149563063/8064426252961788974461720080 -1813514992828085055781522201/1792094722880397549880382240 579321317252608972865468225/3225770501184715589784688032 -76631559485533896830081389/5376284168641192649641146720 6568522431508707361599733/16128852505923577948923440160", "1 -26676894980505912705654164171/9216417304563309264923522340 15894748781699753819390819744/6912312978422481948692641755 -2054393431101757491221432831/2457711281216882470646272624 3198798385798701604256589727/22119401530951942235816453616 -405056389039971466619144491/36865669218253237059694089360 32842766465890554732986861/110597007654759711179082268080", "1 -226965678484365549395608823/89678271131382606930316340 804972052206485914879015013/403552220091221731186423530 -51330277943573805893847025/71742616905106085544253072 78091526266699228683335243/645683552145954769898277648 -3162622825934594337018543/358713084525530427721265360 729841637151688039450801/3228417760729773849491388240", "1 -55361055299800544593980847/24429860912218146964639400 1559820568656350968094795747/879474992839853290727018400 -24570705818130761026209551/39087777459549035143423040 36595907120737945111502369/351789997135941316290807360 -1424924379513070364908029/195438887297745175717115200 312790002976569426992341/1758949985679706581454036800", "1 -5689407572578497640596866569/2754434432454423931933434320 159307753356041831869951132307/99159639568359261549603635520 -12413177590617372888968582227/22035475459635391455467474560 3626267512479215498954920679/39663855827343704619841454208 -27198765796088530661931081/4407095091927078291093494912 28463938855518551747033119/198319279136718523099207271040", "1 -89326817455512492197297641819/46797496130975705722783499220 207279251473308846528162181891/140392488392927117168350497660 -31989829645163238138541866349/62396661507967607630377998960 9178610945557223163848866445/112313990714341693734680398128 -996236191597253423719767221/187189984523902822891133996880 66415941801279077381531227/561569953571708468673401990640", "1 -114871539769204110617524132291/64419107210415993282585975540 265224928084747921468397333401/193257321631247979847757926620 -8114573239234079433443746937/17178428589444264875356260144 11449030106594655028198964807/154605857304998383878206341296 -1200594410154024144473452301/257676428841663973130343902160 76633852729117613419215481/773029286524991919391031706480", "1 -23467692655670507679411641/13965107090174850352254060 83606416515271947170017865/64937747969313054137981379 -50748195376246428899947815/115444885278778762911966896 70502883943427966616655937/1039003967509008866207702064 -7152486616140806032097131/1731673279181681443679503440 87581610494552711607119/1039003967509008866207702064", "1 -668530918864615436134273069/419151965208241239710190600 6121161488196736164581608763/5029823582498894876522287200 -92203351389628693108038123/223547714777728661178768320 126263139006287768608655231/2011929432999557950608914880 -12407386944815130396015643/3353215721665929917681524800 729847169835179205479719/10059647164997789753044574400", "1 -13209370958219184346765008499/8674519866535403268308880420 15061735947440859502063115773/13011779799803104902463320630 -4506782934082105548545096927/11566026488713871024411840560 1217820470619918522425225899/20818847679684967843941313008 -23209129501521257071646995/6939615893228322614647104336 6568627443424270260799049/104094238398424839219706565040", "1 -39194070771134299774714528157/26825634708404223849163106460 22268448955414737479361637052/20119226031303167886872329845 -13243030339182771399085763617/35767512944538965132217475280 3533728464797370050648429095/64381523300170137237991455504 -326867309472385954630780873/107302538833616895396652425840 17829137830919625581735021/321907616500850686189957277520", "1 -27664715070634292667161920803/19651914188711756956885633520 752079041381260586392703816701/707468910793623250447882806720 -11116764184185242151747414509/31443062701938811131017013632 14657515737119928339860378731/282987564317449300179153122688 -1265489814698479996222373/453070067751279699294193280 1136648442067694474269883/23195701993233549195012551040", "1 -6636477632753301153658175373/4875429838688404829372436440 179890096318853232233208910469/175515474192782573857407711840 -2644719698238698504733038933/7800687741901447726995898304 3448528710517943933494778381/70206189677113029542963084736 -100475719499703366151632551/39003438709507238634979491520 15326810188567663479992557/351030948385565147714815423680", "1 -14357767085206695133985928451/10874812861531473418842102100 97033779255207579996842062159/97873315753783260769578918900 -2838861080580235429666444007/8699850289225178735073681680 3663105474679690504323117371/78298652603026608615663135120 -103881704010560354665390681/43499251446125893675368408400 15326812788790100535376789/391493263015133043078315675600", "1 -4625434935398882369852893603/3602359872082769191341349140 114332693214662466186583891937/118877875778731383314264521620 -979211842068120327934540147/3107918321012585184686654160 4253699684601619481275910353/95102300622985106651411617296 -70503335089992738812039399/31700766874328368883803872432 16786511482300194466234823/475511503114925533257058086480", "1 -82085896076247208766729489213/65582746644232022462261016840 736104294260786584864269748223/786992959730784269547132202080 -53353082574732391218749979991/174887324384618726566029378240 13506423343124954075011303265/314797183892313707818852880832 -1091123217867405225240559619/524661973153856179698088134720 50359539692877433629560173/1573985919461568539094264404160", "1 -23929875011158476352219535483/19573021359766751245506205545 856494520238879074166788630813/939505025268804059784297866160 -12364840921428504639408407031/41755778900835735990413238496 15512924929857388510100168923/375802010107521623913719146464 -1222496062645936406789636399/626336683512536039856198577440 54738634518828473014529399/1879010050537608119568595732320", "1 -25366905040694872990016575081/21202879983225151413615523980 14157487095312711330331789931/15902159987418863560211642985 -1628777837561771488610350989/5654101328860040376964139728 2026371890746406049687934717/50886911959740363392677257552 -155874778884776226787186481/84811519932900605654462095920 6777164691906131764234679/254434559798701816963386287760", "1 -1023938242546164147541543430723/873197995298066157861885408900 1140754946078947942442511963557/1309796992947099236792828113350 -65382002733673043083046858351/232852798746150975429836109040 80695694979711205369213170821/2095675188715358778868524981360 -6062851596295080956441620723/3492791981192264631447541635600 256176837195711893588529199/10478375943576793894342624906800", "1 -293769059047926009998796946817/255231124059905591691960499560 2613574614882686324706111677507/3062773488718867100303525994720 -186603999933258788419249020947/680616330826414911178561332160 45713769999864091326552204329/1225109395487546840121410397888 -671314695024267780812926579/408369798495848946707136799296 137941378506152868789531949/6125546977437734200607051989440", "1 -111860223880392143737084678657/98885756494785769200240378560 2980519472405051065205478208111/3559887233812287691208653628160 -212114658269057468021210369767/791086051958286153601923028480 51589053369061511531104660315/1423954893524915076483461451264 -1234660502747525269485816761/791086051958286153601923028480 148159261833248071859908931/7119774467624575382417307256320", "1 -508927038201199389902253883417/457237688906572868476112900380 3384698208536211144917837846551/4115139200159155816285016103420 -96056586254214221246715444305/365790151125258294780890320304 116008702329253837817146324997/3292111360127324653028012882736 -2716253162899231835699654527/1828950755626291473904451601520 317484137158283112010791091/16460556800636623265140064413680", "1 -115306102198764921131892510621/105175355969538260063892290380 765708240002341696283370976297/946578203725844340575030613420 -21667501714834634902371963821/84140284775630608051113832304 25996477107977793977538873251/757262562980675472460024490736 -595799737370366840198792891/420701423878153040255569161520 67875919497533328490396717/3786312814903377362300122453680", "1 -3651670016896101998213561229313/3330835568330277674551638597690 4041581099193545566340967196588/4996253352495416511827457896535 -686195810870387487183990815797/2664668454664222139641310878152 12474116118048477592843895965/363363880181484837223815119748 -6289531123773893303110722791/4441114091107036899402184796920 25590316491506109889088927/1427500957855833289093559399010", "1 -54051572855459799756341960019/48561788578533049094337209686 798840759586826254778665973297/971235771570660981886744193720 -191285114088553310076285213101/728426828677995736415058145290 37336135512146831035986904801/1059529932622539252967357302240 -4327272380338519989026861809/2913707314711982945660232581160 6422667705336610010777711/332995121681369479504026580704", "1 -59787393461190280325118270379/52852711674994631859961114760 318607365090279288102469321889/380539524059961349391720026272 -340114953933691653853885080547/1268465080199871164639066754240 137867311467101696852823425111/3805395240599613493917200262720 -1979714373370733200100931701/1268465080199871164639066754240 11312653468146910459047497/543627891514230499131028608960", "1 -1264840342866213817638854849089/1098910961535237739395248957880 11252898378560054540830154841349/13186931538422852872742987494560 -482060530183775748478095569687/1758257538456380383032398332608 196823215091453500993172693683/5274772615369141149097194997824 -4817305097480538974252175511/2930429230760633971720663887680 84844902461402840088498641/3767694725263672249355139284160", "1 -148048317261714192806813505667/126252825357841729649478615190 329876813707238555967660962633/378758476073525188948435845570 -12154355154711478849215900617/43286682979831450165535525208 277798664406517540314103591/7214447163305241694255920868 -2629827192413182800255801011/1515033904294100755793743382280 1322850662145530323500361/54108353724789312706919406510", "1 -970481979466892367550829474389/811171634950580587418863879170 4333070170278386281559627963341/4867029809703483524513183275020 -62313349771558716909569267673/216312435986821489978363701112 155048708135843474557872029393/3893623847762786819610546620016 -5963411260061668457849614109/3244686539802322349675455516680 74079639547162221636949033/2781159891259133442578961871440", "1 -14070825028149931788462488215/11508902410396437616178255913 3777151015359928199560831199273/4143204867742717541824172128680 -618243054515001429054233841/2087782750185294805655919440 171030135595059235946450789117/4143204867742717541824172128680 -199674453535156773061880279/102301354759079445477140052560 1724267547917351169232019/59188640967753107740345316124", "1 -121791206190352993525004814881/97304424662489600339759347715 436863571400934798310802678975/467061238379950081630844869032 -1424878577386081338523250896481/4670612383799500816308448690320 200394449454929853640982496001/4670612383799500816308448690320 -9713375398675880569530264643/4670612383799500816308448690320 7116025204147477200779649/222410113514261943633735651920", "1 -1258178818082971991128589295793/979875307517608384428533127210 1413631818978385664741786662721/1469812961276412576642799690815 -14528570429146102376924378353/46111779177299218090754500104 1223101943879926371323347105/27345357419096047937540459364 -8717132767740161467589755993/3919501230070433537714132508840 14825053577265491437539319/419946560364689307612228483090", "1 -26921108640230202384781559809/20390112535670877283474786050 485172368505935140286550463921/489362700856101054803394865200 -10645775673339191999127717251/32624180057073403653559657680 18315568359230356600655141489/391490160684880843842715892160 -8115768877474883873796196/3398352089278479547245797675 10947732866379611919740413/279635829060629174173368494400", "1 -38160301337604393778965117057/28033425630005927429646744760 114930876757195576077427846317/112133702520023709718586979040 -45621681383475748265510515201/134560443024028451662304374848 127109614950653667141448519/2587700827385162531967391824 -1733209246716910450654595047/672802215120142258311521874240 2098315704409815681360467/48057301080010161307965848160", "1 -25786917240232613798809759137/18317398200221357200295202332 3505127900486862780764893929221/3297131676039844296053136419760 -111022223585550990924329161433/314012540575223266290774897120 4435844969643903806548958339/85639783793242708988393153760 -6139674885500001398236191121/2198087784026562864035424279840 9232590406174903202400941/188407524345133959774464938272", "1 -648609104971294483439571000077/443909151461965192253422563930 294807791188372922443179829429/266345490877179115352053538358 -16035447978958898944085974571/43308209898728311439358298920 13290299349229343793167806919/242132264433799195774594125780 -1803032447519182461674040001/591878868615953589671230085240 10537197426753719644190639/190246779197985082394323955970", "1 -89899960641445716446472114493/59033541471379052004557796610 410022506292868557837283384699/354201248828274312027346779660 -7886973017156818205877143735/20240071361615674972991244552 5525335093653112569024471153/94453666354206483207292474576 -2369274941162429921150252939/708402497656548624054693559320 12772363311418888015641587/202400713616156749729912445520", "1 -11114778167422291013920738016/6968190385356264936811275735 203534094358154000737795019243/167236569248550358483470617640 -3065813097377676953643414923/7432736411046682599265360784 2099143816178623321860680491/33447313849710071696694123528 -412547802908651884939568779/111491046165700238988980411760 866696317814996810562283/11945469232039311320247901260", "1 -30238224231522785938769139434/17992465707925038990854542845 1668005519997605645933663644417/1295457530970602807341527084840 -25311212304790921410166653715/57575890265360124770734537104 35163731621800623065243233519/518183012388241122936610833936 -396369700791900498403556087/95959817108933541284557561840 31201078042044503703462233/370130723134457944954722024240", "1 -19529454517313315620841186863/10950697687503615982798221574 112725573567746523727643486458/82130232656277119870986661805 -310391118214859072344056601601/657041861250216958967893294440 24329566792940947781203899473/328520930625108479483946647220 -180090778866540990019635053/38649521250012762292229017320 155093144014391988276875/1564385383929087997542603082", "1 -58410933428150938631123763583/30596375768716531662130109070 108429137300180752741477142093/73431301844919675989112261768 -31375775319325133163866498177/61192751537433063324260218140 120030428487915837453821542033/1468626036898393519782245235360 -651392838545843990706350047/122385503074866126648520436280 24814916354238034981617121/209803719556913359968892176480", "1 -2872367642390184969426235282/1390342483700222490476651865 26808548647031954975850766247/16684109804402669885719822380 -358089222340664953246305067/635585135405815995646469424 348688882422256708338558479/3813510812434895973878816544 -45767857745171290883982431/7415159913067853282542143280 2736941167123366872350137/19067554062174479869394082720", "1 -4747871961378115744276797699/2094629669990019530274530960 2972605445467253986734483269/1675703735992015624219624768 -6321200836150975068196542371/10054222415952093745317748608 1046069988817395194173168397/10054222415952093745317748608 -366569243554062981695080889/50271112079760468726588743040 255448064944496771751859/1436317487993156249331106944", "1 -36150814060937095385273425391/14279184537117023767238236430 256415197525662319613408572411/128512660834053213905144127870 -3503573670135064511051316373/4895720412725836720195966776 6218331422413747089528901141/51405064333621285562057651148 -1510984016474234880282482503/171350214445404285206858837160 4151035738947250922345527/18358951547721887700734875410", "1 -8093906282702104961899518293/2795100656611549783064259426 192887653904723982955804150373/83853019698346493491927782780 -46742466892735003176774911123/55902013132230995661285188520 48518208608026241612648187173/335412078793385973967711131120 -204786015360760326196121651/18634004377410331887095062840 2846428718368434480555829/9583202251239599256220318032", "1 -2459107036173819755329676113/718512750202815204767375245 9461947677066987957370207739/3448861200973512982883401176 -34915236709280208085100885623/34488612009735129828834011760 2537290848250023240517799/14123100741087276752184280 -491743984562938109241242849/34488612009735129828834011760 501775282458198500899189/1231736143204826065315500420", "1 -10469343201253803102392867297/2468617233751217283033063765 203535454533176750908550443889/59246813610029214792793530360 -3395578251818339098455627031/2633191716001298435235268016 39006468497367378946294297/165725352755326474944877008 -772745171642757743524088923/39497875740019476528529020240 10035532517252778545786281/16927661031436918512226722960", "1 -127847784626030482257286481/22624321468661796544797962 7076514880688798866447295831/1527141699134671266773862435 -481568015808125619847809751/271491857623941558537575544 408100678267493514907172935/1221713359307737013419089948 -2639703217776829385003905/90497285874647186179191848 410546040330510798769819/436326199752763219078246410", "1 -395788466324061412160400581/46526106909272105921811530 15805850310215595739843851167/2233253131645061084246953440 -10401853726167071636827427/3753366607806825351675552 137952819812345593271476145/255228929330864123913937536 -55562206310192862764024231/1116626565822530542123476720 729863516341008478934537/425381548884773539856562560", "1 -298791576138023922868757461/18392706139065694382986704 15177558687468845074359486899/1103562368343941662979202240 -4068837987678181965818522179/735708245562627775319468160 19350433767853471664564384/17243162005374088484050035 -80470993843151673576843409/735708245562627775319468160 7/1728", "1 -3534535821859751947854338171/61347272847394756839475740 7336857784065362912874369377/147233454833747416414741776 -1450108208438076147394962593/70111168968451150673686560 6465249406959732766886017463/1472334548337474164147417760 -74512574319186022511919011/163592727593052684905268640 3831860981291065696652801/210333506905353452021059680", "1 -1285268899889449346052284751/3676290686209558968052670 1141893454450715472329538293/3676290686209558968052670 -1182010864041934103296263007/8823097646902941523326408 132231411836535302223919403/4411548823451470761663204 -146904417520977101121683083/44115488234514707616632040 228091622921182895656693/1575553151232668129165430", "1 -367219685682699813157795699/1050368767488445419443620 734074363575459946497560452/2363329726849002193748145 -337717389726266886656075203/2520885041972269006664688 226682420291203375241004731/7562655125916807019994064 -41972690720279171749052317/12604425209861345033323440 5474198950108389495760633/37813275629584035099970320", "1 -48088922746391182964004599/834656773433942269924840 299463583023076037260178351/6009528768724384343458848 -414316630982307470684275057/20031762562414614478196160 263887730896315623138204821/60095287687243843434588480 -9123988692145227246357431/20031762562414614478196160 1094817423226018770472229/60095287687243843434588480", "1 -21342255438430280204911235/1313764724218978170213336 1084111334819203219597105849/78825883453138690212800160 -290631284834155854701322959/52550588968759126808533440 176918251591803169504588637/157651766906277380425600320 -5747928131653690969774529/52550588968759126808533440 7/1728", "1 -339247256849195496137485807/39879520207947519361552740 423370990452203457317245697/59819280311921279042329110 -1733642287694511939471237/625561101301137558612592 25866153714814798738401769/47855424249537023233863288 -7937458044313266109146317/159518080831790077446210960 410548227941817269400677/239277121247685116169316440", "1 -78274153852671723830991581/13851625388976610129468140 577674684137861131954880623/124664628500789491165213260 -19655837379923494687665689/11081300311181288103574512 33314341083060695094463079/99731702800631592932170608 -1616144827210303705104431/55406501555906440517872560 67027924951920130411399/71236930571879709237264720", "1 -20917768633873732472313371/4932302165337097468597530 406664244821531969847253007/118375251968090339246340720 -20353116394515519071662079/15783366929078711899512096 11144705284962108270369791/47350100787236135698536288 -514648798962875620062663/26305611548464519832520160 140357098143395504136871/236750503936180678492681440", "1 -14739902314728190341636377/4306769731485405822781470 56714971091310617127094045/20672494711129947949351056 -69760712705854561608593089/68908315703766493164503520 1003763412494514688556491/5587160732737823770094880 -327501821220738001492669/22969438567922164388167840 84214033419557790360703/206724947111299479493510560", "1 -770848217400200472561856247/266200062534433312672786612 6888844782311570819850133024/2994750703512374767568849385 -13354990540781429479078526107/15972003752065998760367196720 6931172658289463087521162201/47916011256197996281101590160 -175530870309223136739532697/15972003752065998760367196720 2846428718368434480555827/9583202251239599256220318032", "1 -210791918722665279214421491/83260551236833957826462020 747566173544205013450168903/374672480565752810219079090 -143003006944288347389849407/199825322968401498783508848 72516984517944572472640159/599475968905204496350526544 -8810402428421194637215633/999126614842007493917544240 677720120644449130178861/2997379844526022481752632720", "1 -1356534846108033069793364987/598465619997148437221294560 38219212870293265543728965641/21544762319897343739966604160 -1806057381757421448056151611/2872634975986312498662213888 896631418986338737862714575/8617904927958937495986641664 -104734069586875137627165857/14363174879931562493311069440 7663441948334903152555763/43089524639794687479933208320", "1 -2188470584678236167181883423/1059308559009693326077449040 61276682621787325659087283309/38135108124348959738788165440 -2864713778725319625970434779/5084681083246527965171755392 1394755529689026833354231905/15254043249739583895515266176 -156918369412015854459368153/25423405416232639825858776960 10947764668493467489400537/76270216248697919477576330880", "1 -140242337162427223604137993/73460686119367422958295580 65083515786423020853227369/44076411671620453774977348 -150663987127611683860102909/293842744477469691833182320 72047075923118749972281727/881528233432409075499546960 -1563968399869973567122087/293842744477469691833182320 104264354429571575553013/881528233432409075499546960", "1 -984678379024200787605432817/552136017857325175603271676 11367284729520657854888380451/8282040267859877634049075140 -1738885816329742702207596059/3680906785715501170688477840 2453401693405809860289464861/33128161071439510536196300560 -51454508247583140005609947/11042720357146503512065433520 656865080531542538584411/6625632214287902107239260112", "1 -4319746318788969419824138883/2570352243989291284407791835 476573005713601613123902208593/370130723134457944954722024240 -7231774944225977545761883823/16450254361531464220209867744 10046780463371606590069478149/148052289253783177981888809696 -339745457821628998631619029/82251271807657321101049338720 62402156084089007406924389/740261446268915889909444048480", "1 -1587825452488898716274381963/995455769336609276687325105 11630519677608800042159672321/9556375385631449056198321008 -2627839797752294531694349117/6370916923754299370798880672 1199510752102070469634672435/19112750771262898112396642016 -39290266943681131899006493/10618194872923832284664801120 1386714108503994896899651/19112750771262898112396642016", "1 -11008158445891312217935294753/7228596914862741061782587340 12551709376312302790937198191/10842895372294111592673881010 -2253420862044805201679178115/5782877531890192849426069872 1014857466181183941249390793/17348632595670578548278209616 -32235033213094284641499991/9638129219816988082376783120 5473869990608094863846387/86743162978352892741391048080", "1 -5615663246504714142333913081/3843369276726971361501494060 1914336306418005989890770497/1729516174527137112675672327 -416505142310620751794439789/1124888568798137959463851920 7594456770988196453238732397/138361293962170969014053786160 -140496034871624607403171727/46120431320723656338017928720 7663416310366341559411363/138361293962170969014053786160", "1 -669790058187860098670379051/475776576629126161046628632 91042283129528903396490378119/85639783793242708988393153760 -20185858833736543804423428589/57093189195495139325595435840 8871689939287807613097899377/171279567586485417976786307520 -159472074948051984369770939/57093189195495139325595435840 1678652801122709673163805/34255913517297083595357261504", "1 -59906281534700775163210149/44008517472536777754547480 1623827144136201231863180941/1584306629011323999163709280 -71619594008596151123250215/211240883868176533221827904 31128885294037632769334269/633722651604529599665483712 -2720893636918226767118669/1056204419340882666109139520 138350486005042792177613/3168613258022647998327418560", "1 -197224239122565585236493607/149378113814438661417397700 1332891122269052583204803213/1344403024329947952756579300 -116986545860870241748655897/358507473154652787401754480 50317495492391089562239297/1075522419463958362205263440 -4280845122184554131233151/1792537365773263937008772400 210533324353454075379623/5377612097319791811026317200", "1 -359479662309420568893880162757/279964373576459538408152322060 807789610844791808423874527753/839893120729378615224456966180 -4151020122613172107692667337/13174794050656919454501285744 698915396502815069327625463/15625918525197741678594548208 -2490609362211474705025640207/1119857494305838153632609288240 118600428618123931500314363/3359572482917514460897827864720", "1 -104392462448873994450003387607/83403792567848228862650869470 374454489772229827123543466989/400338204325671498540724173456 -135702721655817270335547298223/444820227028523887267471303840 171766670961368445977984632957/4003382043256714985407241734560 -2775250113907394448437213507/1334460681085571661802413911520 128088453674654589614033473/4003382043256714985407241734560", "1 -574319388904078848508668841/469751118791691331272581874 154169429198364416308604647781/169110402765008879258129474640 -3709458327090008574325391749/12526696501111768833935516640 13961643722045651913995952763/338220805530017758516258949280 -24449933085937564048393459/12526696501111768833935516640 1970591483334115621979447/67644161106003551703251789856", "1 -277280565561969247871663525861/231763324271594453548246822620 154752506081370938627128847983/173822493203695840161185116965 -53411442661336043065344921323/185410659417275562838597458096 22149815447977639222553098745/556231978251826688515792374288 -567943929529682710271390767/309017765695459271397662430160 74079639547162221636948907/2781159891259133442578961871440", "1 -590225849548362230459052755/503333523021295932157389828 3287808774490749727252419259/3775001422659719491180423710 -565318844405185062754226161/2013334092085183728629559312 232575626014758870960644353/6040002276255551185888677936 -1164928988887345647953841/671111364028394576209853104 738335253290528552651363/30200011381277755929443389680", "1 -17208712147839643777399255141/14951169544697112100615632080 459301974635104266972657172363/538242103609096035622162754880 -19675940007501050958289552489/71765613814546138082955033984 8033600615977693918088663413/215296841443638414248865101952 -589874093569045588683938731/358828069072730690414775169920 24241400703257954310999569/1076484207218192071244325509760", "1 -34164224834965874471495891617/30201549528568361062834922720 182061351480159593201410153643/217451156605692199652411443584 -194351402247823802202219419981/724837188685640665508038145280 78781320838343826773041779143/2174511566056921996524114435840 -1131265356211847542914815923/724837188685640665508038145280 45250613872587641836189907/2174511566056921996524114435840", "1 -1403936957284670123541338665/1261345157883975301151615836 46685498936892443461090638143/56760532104778888551822712620 -19873778087122421826107489851/75680709473038518069096950160 8000600466888606650568604193/227042128419115554207290850480 -112396685203597921792905281/75680709473038518069096950160 875818323454992274196959/45408425683823110841458170096", "1 -1859775918969239622212137717/1696376658176866653705952940 12350133229010070485381045117/15267389923591799883353576460 -1048427518518544671022136831/4071303979624479968894287056 419298020774738742616600579/12213911938873439906682861168 -28829019665884919647566281/20356519898122399844471435280 1094772898032346947126797/61069559694367199533414305840", "1 -1145621862337289310151827999617/1044968060307371551563730933800 1449082217615891642622058333603/1791373817669779802680681600800 -1291662663273933201765129280781/5015846689475383447505908482240 8199605627676714644493211643/238849842355970640357424213440 -35517351943229101559396900087/25079233447376917237529542411200 64226676334061755634829109/3582747635339559605361363201600", "1 -1015513928093051776612877300865/912373168423962876020770855552 3001703806781274220789880780215/3649492673695851504083083422208 -1916715182062224968371722116631/7298985347391703008166166844416 257204470382566398591830832831/7298985347391703008166166844416 -10840035389963799259139959049/7298985347391703008166166844416 20111383118567033790840429/1042712192484529001166595263488", "1 -128409199460707551291564383/113515327888040782668011740 488781191921917776022699643/583793114852781168006917520 -13281584519709531472952639/49533961260235977891496032 59221342641677735049259007/1634620721587787270419369056 -4251963384401005607318503/2724367869312978784032281760 2208812206454662152479/106144202700505666910348640", "1 -98602919392914099313564519261/85667868884986209776192231840 877240826128190486950359393977/1028014426619834517314306782080 -112739873424293726406790876549/411205770647933806925722712832 5114579862569107299455477697/137068590215977935641907570944 -307262060887405170198577901/186911713930879003148055778560 6614252151953927089913993/293718407605667004946944794880", "1 -230296487225733886031846005067/196393590955272690496169097060 2052561858408340600320051727579/2356723091463272285954029164720 -264694487852618565006192869357/942689236585308914381611665888 4033222484696344287384906619/104743248509478768264623518432 -8181681502921123497035826647/4713446182926544571908058329440 16462137351307462109470141/673349454703792081701151189920", "1 -200788156386908718227608846379/167829023806173002780324828780 1792987747685906338645784950267/2013948285674076033363897945360 -232063017451563039326907077561/805579314269630413345559178144 10693003572132245625918041695/268526438089876804448519726048 -7402850941079548989403536899/4027896571348152066727795890720 15326815832587965742659223/575413795906878866675399412960", "1 -130656490847471555763840782765/106868764451722463542244740463 584555806979947287269256171725/641212586710334781253468442778 -1519018409162241259733889459809/5129700693682678250027747542224 70583758979112375519521162203/1709900231227559416675915847408 -10012238698042180837292279671/5129700693682678250027747542224 21348061773577974709006841/732814384811811178575392506032", "1 -112768203857800928770408824093/90097149519517084356481894055 24077386067278999649105879831/25742042719862024101851969730 -87955073754427379908805191679/288310878462454669940742060976 1767142986007571324724896487/41187268351779238562963151568 -2997951553644565312671606277/1441554392312273349703710304880 6588906700349757149753077/205936341758896192814815757840", "1 -129041727207240798571212213571/100500737752477516538864841600 1159890300532060591294697688727/1206008853029730198466378099200 -8940603316388605378377337451/28376678894817181140385367040 21576707357265224893522379849/482403541211892079386551239680 -5364379898384871612782052481/2412017706059460396932756198400 4054710829176853074388001/114857986002831447472988390400", "1 -330224503569007942986866869961/250121079348600945297121339800 425097119040628451676637411651/428778993169030191937922296800 -391761258846826721008439833157/1200581180873284537426182431040 18722503441999055281904574023/400193726957761512475394143680 -14335659610512907827334430471/6002905904366422687130912155200 33572995328635353730934323/857557986338060383875844593600", "1 -34979188518893493502541473779/25697628416679042759377111285 52675618903098437614715934247/51395256833358085518754222570 -27879605180982854592584239965/82232410933372936830006756112 4039238609143749693624095121/82232410933372936830006756112 -1059180013542429009066230711/411162054666864684150033780560 233145710607799780930647/5339766943725515378571867280", "1 -1089982442207184791743256055/774298810981601484301654547 22223972699861143144929649805/20906067896503240076144672769 -39420356219578877093402527763/111499028781350613739438254768 17325382383314559332157089339/334497086344051841218314764304 -311431456825283693014652317/111499028781350613739438254768 2341592739781194143768771/47785298049150263031187823472", "1 -196537899084951261261519429497/134520767802721224609786358180 1786654506612053343496524764113/1614249213632654695317436298160 -239069387502634142303390635307/645699685453061878126974519264 11813484605278676481246944319/215233228484353959375658173088 -9834667554682979612332886897/3228498427265309390634872596320 25544632560069629658073867/461214061037901341519267513760", "1 -54221721848466439041594753971/35608499047366053612838232660 494609183285001772871864034907/427301988568392643354058791920 -6054496555246041853246212655/15538254129759732485602137888 3332699490965614659313773819/56973598475785685780541172256 -2858152194664775122003763591/854603977136785286708117583840 700357359039862753981553/11098752949828380346858669920", "1 -11113822904855943838280667683/6968431840414749925693384835 3634338605839180688838733207/2986470788749178539582879215 -27591442064465013155014361533/66896945667981599286656494416 199915158031856931998013105/3185568841332457108888404496 -112511979215320113263075861/30407702576355272403025679280 3466765623685308899196233/47783532619986856633326067440", "1 -27052295063566111150451746913/16099232126104593070887417905 62180077299730006374908207446/48297696378313779212662253715 -67937855998026342930803451511/154552628410604093480519211888 3495734706912521099253501899/51517542803534697826839737296 -3191780390950131603094173421/772763142053020467402596059440 9305517620729388599716157/110394734579002923914656579920", "1 -86785520234597742372143595825/48672497251723276279914748952 2245189952479578728518365905/1636050327789017690081168032 -183925877685589425223280037731/389379978013786210239317991616 28834241524860021961368396681/389379978013786210239317991616 -1814219379876203274762540869/389379978013786210239317991616 324374849928553770473647/3272100655578035380162336064", "1 -22902206190337400691308781499/11999434718811023354832025680 212582056725306958445559255031/143993216625732280257984308160 -29528164283726480957466107395/57597286650292912103193723264 4706906000783968007004199835/57597286650292912103193723264 -1532657931987681531820381969/287986433251464560515968616320 1621871117422694297705383/13713639678641169548379457920", "1 -6700685538221339936776230211/3244427503291184456967652470 62544222566186387153082006617/38933130039494213483611829640 -4386215155753531759067161649/7786626007898842696722365928 237291023666069147232050825/2595542002632947565574121976 -240274927841902799094326783/38933130039494213483611829640 99782838850021846523513/695234464990968097921639815", "1 -5142051468957262937944349457/2269446330929322265433134730 16098621617662791459342777353/9077785323717289061732538920 -1141200884761485686731699803/1815557064743457812346507784 188862156461167236415024527/1815557064743457812346507784 -682307642336273122902101/93585415708425660430232360 57652121324749402714269/324206618704188895061876390", "1 -3441664499109008450669779433/1360126309334536176538876540 564500312530760747272829639/283032064370192499164159280 -1556918328639641565948596317/2176202094935257882462202464 2368696627127015663254435627/19585818854417320942159822176 -2230957366297717903040757/253046755225029986332814240 3162617273817171859246133/13989870610298086387257015840", "1 -22818055380568272189202408145/7885154178561029224445227252 31078412889824341510707811495/13517407163247478670477532432 -158175184784300019972834364543/189243700285464701386685454048 1303157278193963145892189983/9011604775498319113651688288 -2079241298699210526903950177/189243700285464701386685454048 729830632191062465891447/2457710393317723394632278624", "1 -1365315545147520002013082031/399276129319030271180667025 6568095203197458916018818377/2395656775914181627084002150 -3878490188001138157492442443/3833050841462690603334403440 229450636228796573924171961/1277683613820896867778134480 -273169144427874175075564657/19165254207313453016672017200 1115010448717066660390367/2737893458187636145238859600", "1 -950967447538286730456404399/224496716899697079441872345 660466253217830741798928557/192425757342597496664462010 -2777252492239545152448697243/2155168482237091962641974512 168994554197049541714951063/718389494079030654213991504 -210725550073771886979823993/10775842411185459813209872560 912271506008942348391209/1539406058740779973315696080", "1 -7662244532030248701253222841/1358096008688934648500203760 75426314029874444867364125317/16297152104267215782002445120 -1050200105265255148149471595/592623712882444210254634368 725311714642773324857088289/2172953613902295437600326016 -950147694892246606980930011/32594304208534431564004890240 398075998668677228074643/423302652058888721610453120", "1 -4917697962398951203083404217/579375424970335717780133000 16374108190139864306320747207/2317501699881342871120532000 -150919169103037563894576191/54529451761913949908718400 500519174887962198847801071/927000679952537148448212800 -20948155893423277926050239/421363945432971431112824000 1135227846735928739254553/662143342823240820320152000", "1 -124219202833489530252950285/7671228556049774605354773 315721393795671695792358395/23013685668149323816064319 -2032440580539617047246036439/368218970690389181057029104 412566353053376793861366739/368218970690389181057029104 -40222395315139440117953281/368218970690389181057029104 23649737968617261270139/5844745566514113985032208", "1 -209688715725594351103117609/3657975219812593437367995 1089299736889507771106407483/21947851318875560624207970 -723972165981196912163548169/35116562110200896998732752 51264500305727906908709753/11705520703400298999577584 -417771711197957071136893/919281730633531335045360 456075116641020876763783/25083258650143497856237680", "1 -852306283283996073461416713/2458964395606720812353620 433402238225479200136682221/1405122511775269035630640 -524051597690174820690397329/3934343032970753299765792 16765668933656628823648113/562049004710107614252256 -65235589923514400053136771/19671715164853766498828960 405356612689348029134673/2810245023550538071261280", "1 -11068912769922026928070351/31934602540347023537060 88650457818848018209775939/287411422863123211833540 -30626392072802424585802451/229929138290498569466832 762075860620755855620369/25547682032277618829648 -3812469540984607795313189/1149645691452492847334160 165827705191096921009639/1149645691452492847334160", "1 -21785840594866945569155099/380049373487022694791480 226347997275741874515617341/4560592481844272337497760 -37608943687334904527976557/1824236992737708934999104 2663090924972878280971937/608078997579236311666368 -21702426555738029669449/47754895097845783638720 165845496960371227914103/9121184963688544674995520", "1 -4301963734493143904864091/265670253023368817501464 43736296976023784698508621/3188043036280425810017568 -105581328859200885571222867/19128258217682554860105408 21432018340435158122668435/19128258217682554860105408 -2089475081305944941192381/19128258217682554860105408 77399142442747400520455/19128258217682554860105408", "1 -95799310955823724735391437/11286534252668877619093500 59808025045153725144840616/8464900689501658214320125 -4409975720543305438477889/1593393070965018016813200 1625062256129747398856501/3009742467378367365091600 -6733335822886053619087591/135438411032026531429122000 232205695923258151211159/135438411032026531429122000", "1 -37316125967679782635973729/6614103938420136275163330 244890629967124820997936737/52912831507361090201306640 -12502382205538751763684237/7055044200981478693507552 7064724493273766151205429/21165132602944436080522656 -3084895113286514957730301/105825663014722180402613280 33172999889056435672887/35275221004907393467537760", "1 -74101359548437927048551593/17493250667508863333132910 1441017279747994345743126137/419838016020212719995189840 -24045476123286105216006159/18659467378676120888675104 39505220461647944816482229/167935206408085087998075936 -5473390911007061999475967/279892010680141813330126560 497602639641241280940661/839676032040425439990379680", "1 -319164672891628052418645611/93337276983669414042233850 6141595514678143401991668923/2240094647608065937013612400 -906660043948318010842394533/896037859043226374805444960 17879270355490642123961537/99559762115914041645049440 -63857722074048508459223167/4480189295216131874027224800 1824562552446109080638789/4480189295216131874027224800", "1 -889015144697465150228674937/307213799164715424329034828 58860630473152161952098633/25601149930392952027419569 -1027111589508441688135294963/1228855196658861697316139312 177703265208267701712572315/1228855196658861697316139312 -4500522291556732742216363/409618398886287232438713104 364915316095531232945725/1228855196658861697316139312", "1 -134090824640610718857265751/52991934129916993891125060 5498379667507409876034107/2756805821787589277572980 -90988733491927104503490065/127180641911800785338700144 46143440788188616816645121/381541925735402356016100432 -130380625303113383943941/14788446733930323876593040 431265991884159798988111/1907709628677011780080502160", "1 -534239113657897448098121229/235786631784864650954091920 15053256577554817987957037159/8488318744255127434347309120 -2134193862411090115446312691/3395327497702050973738923648 39244084459463321852472877/377258610855783441526547072 -1276003902550952333739001/175016881324847988337057920 3018874716641423269401737/16976637488510254868694618240", "1 -232058373618055062745500407/112361125655105955219658960 6498101045837546717203396597/4045000523583814387907722560 -911421331065668936949028313/1618000209433525755163089024 16435741898948512362393241/179777801048169528351454336 -49927257733382399811808451/8090001047167628775815445120 1161109397527526941364521/8090001047167628775815445120", "1 -74357812306290261984769877/38959203632503322580623460 345100741437186620853184609/233755221795019935483740760 -11983832907356526362608105/23375522179501993548374076 955135146262980520901833/11687761089750996774187038 -155505066151347558017491/29219402724377491935467595 9215176803538035782417/77918407265006645161246920", "1 -99448648091594051610555713/55774442992807421252767092 459243399370822921742398609/334646657956844527516602552 -19759034797200926602004581/41830832244605565939575319 1376730401301567129553505/18591480997602473750922364 -779601528785610650919737/167323328978422263758301276 33174700560874817434805/334646657956844527516602552", "1 -61999148350418894920822433/36896635888704185800353135 760031502517708252099727977/590346174219266972805650160 -34600385025732794973671561/78712823229235596374086688 16023230130997040943866441/236138469687706789122260064 -4876669810466205657897929/1180692348438533945611300320 33174750876040601068507/393564116146177981870433440", "1 -433006087202179630062890491/271497344431743503598443565 15858932098207333914932862233/13031872532723688172725291120 -238886944281082364978481715/579194334787719474343346272 327133894961220434178569471/5212749013089475269090116448 -32146279775805746646593323/8687915021815792115150194080 1890963067464713945016139/26063745065447376345450582240", "1 -6337603852418155212654043243/4162032356185642630072001220 7226432872670480447803306237/6243048534278463945108001830 -3892176356943884048515462595/9988877654845542312172802928 64922717356473012843775339/1109875294982838034685866992 -167034868519369974662558789/49944388274227711560864014640 3151608115679382392917009/49944388274227711560864014640", "1 -7657320743569529659539856097/5241068875430697062718949020 1933608773389668120667261543/1747022958476899020906316340 -1552398620146974950022033557/4192855100344557650175159216 230132816985948243141176143/4192855100344557650175159216 -21287159209270518641413329/6988091833907596083625265360 1161119661821346802639729/20964275501722788250875796080", "1 -113244929060486731609691037/80446629712374180187184888 27707810119307399245626972349/26064708026809234380647903712 -6143432138116188637932928067/17376472017872822920431935808 2700059592204866389427101655/52129416053618468761295807424 -48534772492252004106179941/17376472017872822920431935808 2554464807034029975020495/52129416053618468761295807424", "1 -3634201404560362961303079143/2669883471862757689285933640 98510248338262013201548122047/96115804987059276814293611040 -13034620604095880069260308391/38446321994823710725717444416 209830577098376607460993759/4271813554980412302857493824 -495201045292564212030968749/192231609974118553628587222080 8393245581880792113503351/192231609974118553628587222080", "1 -2144314958240311318096579637/1624162852912993151280008700 2415324540003570748162748593/2436244279369489726920013050 -1271952139113073769507935877/3897990846991183563072020880 60787348837659270395794603/1299330282330394521024006960 -46544349384782168270566691/19489954234955917815360104400 763022621105348948430331/19489954234955917815360104400", "1 -418966646776755839516931043/326301096598952975775535200 3765877599130066854852971791/3915613159187435709306422400 -29027932845417549929796883/92132074333822016689562880 23351414888815178456193259/522081754558324761240856320 -17416817851898933807734073/7831226318374871418612844800 276457556534785436890093/7831226318374871418612844800", "1 -8787132768140332111980084961/7020557105416915664141446290 157597436076735270430513648523/168493370530005975939394710960 -20560926332203803095565089389/67397348212002390375757884384 321298724728649331768165887/7488594245778043375084209376 -700819843709119164001160287/336986741060011951878789421920 10781847327845057154141479/336986741060011951878789421920", "1 -10181025260841939410169619601/8327436191043308847447642114 60733070855059458417586009769/66619489528346470779581136912 -13151674538201223027999198217/44412993018897647186387424608 5500033167203561728793906855/133238979056692941559162273824 -260058148001095606163437933/133238979056692941559162273824 1293821925671392406606485/44412993018897647186387424608", "1 -7822915183905534476400506863/6538793135305441666765902420 4366041593391005694754415954/4904094851479081250074426815 -502300903574811773434869811/1743678169414784444470907312 624915793176559809306904291/15693103524733060000238165808 -48070460656360707723399983/26155172541221766667063609680 2090020340807449873999001/78465517623665300001190829040", "1 -26917771234176687977748800227/22955095046720184603448336020 59977456901542420139223257801/68865285140160553810345008060 -15469158380997188863998471749/55092228112128443048276006448 235707807547188951860159071/6121358679125382560919556272 -478150217703182542034565251/275461140560642215241380032240 6734510734625779953874201/275461140560642215241380032240", "1 -30733377473116082902929855203/26701673418697000449722254080 30380634671106164050229392559/35602231224929333932963005440 -11713233602524023522783610969/42722677469915200719555606528 1594154762359202275154969039/42722677469915200719555606528 -117052213671392445789935417/71204462449858667865926010880 4810365201421037883573851/213613387349576003597778032640", "1 -3882293718760093239048939283/3431995887316349896767939360 103443874072202234780078504341/123551851943388596283645816960 -4417075537411969895576303659/16473580259118479504486108928 1790484229478256716813977561/49420740777355438513458326784 -128552866998513520179708553/82367901295592397522430544640 5142114816626453490971153/247103703886777192567291633920", "1 -1648561571579629507488473093/1481125273415524149384368272 43856062112064071407645093399/53320509842958869377837257792 -28003955582077962200236548991/106641019685917738755674515584 417539724647023374337391695/11849002187324193195074946176 -158377140437782781383539713/106641019685917738755674515584 2056846000762537546790515/106641019685917738755674515584", "1 -7439103002190190325661384529/6785506885112802282881369700 32933686763997537332320062151/40713041310676813697288218200 -2096854972847294158709651833/8142608262135362739457643640 93177336678144484596514663/2714202754045120913152547880 -57658038868878411622398061/40713041310676813697288218200 91231074338155902890383/5089130163834601712161027275", "1 -403571383908423202485343970778/368113721936626262704662227365 2382203532204139883439136861101/2944909775493010101637297818920 -21667502399919750536483919567/84140279299800288618208509112 80877929955939959779781711577/2355927820394408081309838255136 -189572645326899607201163373/133859535249682277347149900860 30167075504545462532315693/1682805585996005772364170182240", "1 -3808179465391934243881538432863/3421398136665460627628654903740 8442295428706380461569257422711/10264194409996381882885964711220 -2156305106712878571821849995205/8211355527997105506308771768976 96451687445402755328796215879/2737118509332368502102923922992 -60975203296474406917514003219/41056777639985527531543858844880 113126535493156614457840093/5865253948569361075934836977840", "1 -559301598524852441859297795487/494428371970079709748360691840 1354782475548541077247722379451/1618129217356624504630998627840 -636344246439178435521699723047/2373256185456382606792131320832 257945320431885714058660190125/7119768556369147820376393962496 -18519909895732773919575798557/11866280927281913033960656604160 105828053539954343354354099/5085548968835105585983138544640", "1 -315530258846239689403713762327/274136688407142488267248558760 6550078206666852229309058138487/7675827275399989671482959645280 -4208960415429189260378683208787/15351654550799979342965919290560 1487878649424352866642095445/39874427404675271020690699456 -25236466187611920873298171941/15351654550799979342965919290560 9877285615857503681880479/438618701451427981227597694016", "1 -1286490185793016855340057299367/1097091881655468180139622264300 716629692731178012428962260214/822818911241601135104716698225 -11374163535211111065012415355/40508007938048055882078360528 33795657025994488688456455653/877673505324374544111697811440 -22852296704267201184633753541/13165102579865618161675467171600 45980471674509347425596083/1880728939980802594525066738800", "1 -745790348389706775904822143229/623361966918736381798151525220 1248694695758253669650725056086/1402564425567156859045840931745 -15962058821881943424336763611/55409952614998789493169024464 178726203127906895798652193663/4488206161814901948946690981584 -1527573882781979226477316463/831149289224981842397535366960 85392315111285317451516227/3205861544153501392104779272560", "1 -1451755383960497398165306409901/1187422324676037773225645418830 787286893538337368917271577687/863579872491663835073196668240 -160743471275671683264476612229/542821634137617267760295048608 156853174370148268007788311447/3799751438963320874322065340256 -37082418702944387471603115369/18998757194816604371610326701280 7187906495034082238161543/246737106426189667163770476640", "1 -9463219709642304714437512997/7560524031484958956652085590 169722261029594846901369516119/181452576755639014959650054160 -34795655469919139673849129149/114055905389258809403208605472 11418501875539642508671138105/266130445908270555274153412768 -8302036765002670731890219729/3991956688624058329112301191520 18246228087821864088993601/570279526946294047016043027360", "1 -3597607494960946122928482467/2801799919613635812848163460 400168487049594548360034996709/416067288062624918207952273810 -20563585551482583613521986581/65265456950999987169874866480 14888000167685063654762017175/332853830450099934566361819048 -2467621829524646747575624531/1109512768166999781887872730160 152604858702324937863883/4322777018832466682680023624", "1 -3632579248797843220900720976757/2751280401895596266141810741300 247978620615074692087930914087/250116400172326933285619158300 -718238346937363128589316690529/2201024321516477012913448593040 102974451860560578365304994473/2201024321516477012913448593040 -26282145433783057089789620967/11005121607582385064567242965200 61550647878581453532179321/1572160229654626437795320423600", "1 -73002969691951382766204116453/53628501415629598496817596840 4617263614202295095425251844393/4504794118912886273732678134560 -610937631183209140421965513793/1801917647565154509493071253824 383172304025629680717795703/7800509296818850690446195904 -23209979546456006772353917931/9009588237825772547465356269120 56198442499962898972186807/1287084033975110363923622324160", "1 -71348046940380646078672714529/50679727192225164635856820720 1939618933020507847587875702321/1824470178920105926890845545920 -86010020781388459841014898911/243262690522680790252112739456 37801283898285653722242745691/729788071568042370756338218368 -308859793034818871314349159/110573950237582177387323972480 25544760846583654490065489/521277193977173121968813013120", "1 -1066992576625242330195195240483/730224742555561264001577354460 404143780604146146978562331367/365112371277780632000788677230 -216307340819241265306624544169/584179794044449011201261883568 32065675544165461165471148985/584179794044449011201261883568 -8898113931646304390557829943/2920898970222245056006309417840 23111942729097341778005917/417271281460320722286615631120", "1 -585645866119786454990312123887/384550841980667584908424414060 60705823429862193766492205681/52438751179181943396603329190 -256893592110621596650085889157/659230014824001574128727566960 202212890688478341121856985/3456636781848697392435275632 -15434206163423132083606423337/4614610103768011018901092968720 8320306759009004539965875/131846002964800314825745513392", "1 -19890124601625495128761261121/12468953783517060337685972025 2185368949168315570909033674829/1795529344826456688626779971600 -4702535972923029958071323761/11400186316358455165884317280 241052496590806062403005169/3840704480912206820592042720 -1476495920963672322485110453/399006521072545930805951104800 37222466703718326411583601/513008384236130482464794277600", "1 -9018724088202132676313120097/5365930614166038724670905735 221107396128890121890009900631/171709779653313239189468983520 -30196545756054091876909245795/68683911861325295675787593408 582642817258431873191531457/8585488982665661959473449176 -83446921228130887687801701/20201150547448616375231645120 2067917761513412168204657/24529968521901891312781283360", "1 -38294733769745084446746578741/21470703404937590615970176480 176831913060873029974985990819/128824220429625543695821058880 -24345146668159407571560282793/51529688171850217478328423552 2544313615920394109400212641/34353125447900144985552282368 -1200617775808102130159774293/257648440859251087391642117760 7298546559133456884725527/73613840245500310683326319360", "1 -3817926423781611831601123569/1999612708959648168509789380 50738337003197895640418078713/34356981999397591258940926620 -3975369385838184111724448251/7752344656274328284068721904 3530389221978131621187930715/43191634513528400439811450608 -2682242698324511779241380777/503902402657831338464466923760 2322270260061456814042399/19632561142512909290823386640", "1 -25348360927623357179161771233/12267524672283471461181421040 78860654624135867711671829019/49070098689133885844725684160 -608305773770682223659188546049/1079542171160945488583965051520 19744149405603761188858172565/215908434232189097716793010304 -6663921000535391103025534527/1079542171160945488583965051520 4427808811328237387593471/30844062033169871102399001472", "1 -3206669853771317663873213081/1414375685980546443964447400 331264006253244388278745097147/186697590549432130603307056800 -46960691399265119046799958371/74679036219772852241322822720 2590375123296569972872188343/24893012073257617413774274240 -2723151485566909912664515081/373395181098864261206614113600 862563628383150613154773/4849288066219016379306676800", "1 -17481792848868904968074690617/6903069711070780715643296660 2818095688507018474523674253/1411991531809932419108856135 -1694188720243689973214761051/2366766758081410531077701712 6013664265322347050492164739/49702101919709621152631735952 -730609342458709498796881411/82836836532849368587719559920 8028520082020202304389671/35501501371221157966165525680", "1 -228329693497459556088526676949/78818668156047335376272031620 45344290451431207455466482489/19704667039011833844068007905 -7534499130580902791956085541/9007847789262552614431089328 829433630297909690217913557/5732266774985260754637965936 -3465762299374138093528968669/315274672624189341505088126480 13380965075474460296090363/45039238946312763072155446640", "1 -13416529477099129080553988293/3917982193667424768085933810 258110741092664528579141692861/94031572648018194434062411440 -38095667330291146602327455675/37612629059207277773624964576 2253349761186801909499301205/12537543019735759257874988192 -243854886634808965065339091/17096649572366944442556802080 10948174558731480551338069/26866163613719484124017831840", "1 -761662384488883874907327589/179461028440197085192257570 44421504863557305915248924551/12921194047694190133842545040 -3705125107587163970659591309/2871376455043153363076121120 1217182024546391432763710965/5168477619077676053537018016 -56204512876721501319367547/2871376455043153363076121120 437933430690573268726123/738353945582525150505288288", "1 -2558192101939605202021643199/452216976799505325937288100 333720821248039624794139242/71943609945375847308204925 -4496130314561244018974203569/2532415070077229825248813360 15118103011829404582933737/45221697679950532593728810 -369605119773699969252783243/12662075350386149126244066800 425777952544650922852721/452216976799505325937288100", "1 -14786800550596649021889320407/1735424352391763708300224060 36904542450444871058326190729/5206273057175291124900672180 -679925207515524804225001417/245001085043543111760031632 68302002765363462009559601/126212680173946451512743568 -1037359847564811592407093071/20825092228701164499602688720 5109510439440328724701297/2975013175528737785657526960", "1 -474814412062312405261459591/29152393924085487593140680 43408946401768484665872153097/3148458543801232660059193440 -2326865021752080006567624115/419794472506831021341225792 1416084207117740226261732937/1259383417520493064023677376 -229987538985148227277257073/2098972362534155106706128960 3649858209989207251695743/899559583943209331445483840", "1 -3372775043801873590836642129/58253784669714385546921280 11665908807281445856185142293/233015138678857542187685120 -276576149160356271272459439/13315150781649002410724864 410859831074601003574625775/93206055471543016875074048 -213005417625067316715913323/466030277357715084375370240 1216745276180525173313437/66575753908245012053624320", "1 -1032037329190465555974900101/2920814933111716018989380 124975535473937694238231123/398292945424324911680370 -677128410608734185556665791/5007111313905798889696080 70644979512530472408775855/2336651946489372815191504 -117643275216158467676959291/35049779197340592227872560 7/48", "1 -40209246591836320362658441/113797984406949974765820 8926823962424121017016508/28449496101737493691455 -61557128237157653232424159/455191937627799899063280 2752401799189498925017241/91038387525559979812656 -1527834743066993086713757/455191937627799899063280 7/48", "1 -131406819888384685357271629/2269627974144716320009920 454515927556419968422797313/9078511896578865280039680 -75429858861915346710670693/3631404758631546112015872 16007525886023415723686707/3631404758631546112015872 -8298912375002622729191423/18157023793157730560079360 331839620776506865449119/18157023793157730560079360", "1 -6166420935874187081317637/378602518494616721988840 563752550672317982673662699/40889071997418605974794720 -30219026256520519565813225/5451876266322480796639296 18390703988542080860541947/16355628798967442389917888 -2986851155651275678925411/27259381331612403983196480 331805291817200659245067/81778143994837211949589440", "1 -576109112360908403450230127/67613935807471313310398340 159759924027899874711368021/22537978602490437770132780 -8830197500201620834090891/3181832273292767685195216 29272286899441483718382583/54091148645977050648318672 -4490735270843340226870519/90151914409961751080531120 464500949040029884063753/270455743229885253241593360", "1 -697688755074437782369533883/123331902763501452528351300 572092836425210785361377813/123331902763501452528351300 -175173908359528987752240719/98665522210801162022681040 32984952025809609999127997/98665522210801162022681040 -14400199471702596204653833/493327611054005810113405200 464485039139619188566603/493327611054005810113405200", "1 -9891719279076413959835333/2330662707015546560938410 576902660565679297600630747/167807714905119352387565520 -48118507890742389229345013/37290603312248744975014560 15807558760342745880048103/67123085962047740955026208 -243309579552906932118473/12430201104082914991671520 39812130062779388066011/67123085962047740955026208", "1 -522721927679186847294305693/152648656896133432522828590 3352087546657980890638172567/1221189255169067460182628720 -164916308789139162780637035/162825234022542328024350496 87792847838446827642829333/488475702067626984073051488 -34836412376401280723619667/2442378510338134920365257440 331762865416105471252667/814126170112711640121752480", "1 -8895962084316606081371063629/3070857200884961118556053180 1766660666938878212550623764/767714300221240279639013295 -2054863399249337125078914347/2456685760707968894844842544 355471555841961295807674611/2456685760707968894844842544 -135029699975615769877751149/12283428803539844474224212720 3649354111493034626206441/12283428803539844474224212720", "1 -681108812293593700054849237/268950767963796651258829740 268390065572096997573680209/134475383981898325629414870 -154017156385789997564976803/215160614371037321007063792 26033178637759078140658513/215160614371037321007063792 -9488433018944279205154237/1075803071855186605035318960 243288487333945524375443/1075803071855186605035318960", "1 -1374287080187707570231357871/606161008277377047413334600 4302129951340836211412221469/2424644033109508189653338400 -609879109081365182425967237/969857613243803275861335360 100923706102463765176837643/969857613243803275861335360 -35365603708661167696941487/4849288066219016379306676800 862563628383150613154767/4849288066219016379306676800", "1 -10863583254695724505354884083/5257510573835773483363466160 33797423410343943305001775169/21030042295343093933453864640 -23700224952104502220487608729/42060084590686187866907729280 769252574244302383981480301/8412016918137237573381545856 -259633285735145107910083687/42060084590686187866907729280 1207584221271337469343665/8412016918137237573381545856", "1 -1041252661031348681345744783/545348920625358591411760740 7248333857599699377202484221/4908140285628227322705846660 -51628173842054339113303937/100679800730835432260632752 320944474725284692835263403/3926512228502581858164677328 -34834320757461191938199459/6544187047504303096941128880 2322270260061456814042381/19632561142512909290823386640", "1 -373000653601413160195577509/209130227970171337168540680 191376529286659123349549229/139420151980114224779027120 -79042683987530544063506479/167304182376137069734832544 24782275479744098468183647/334608364752274139469665088 -1299369887238205768571173/278840303960228449558054240 165876058162124020107397/1673041823761370697348325440", "1 -20669344739959051206217651/12297778336514985618038745 63342454964349729342056911/49191113346059942472154980 -17301305818976752412285453/39352890676847953977723984 5341263412605945361572427/78705781353695907955447968 -812794687286989165790269/196764453384239769888619920 33175151254225863661037/393528906768479539777239840", "1 -5064966794404251369687017/3175185582764721247182575 1669494995544931681366692599/1371680171754359578782872400 -25147251192101764481664517/60963563189082647945905440 34436070941543723200428953/548672068701743831513148960 -375985719624057123118181/101605938648471079909842400 199050624084055221452317/2743360343508719157565744800", "1 -22817371407264407337284480567/14982500336909126684743808340 8672260489980313395213037427/7491250168454563342371904170 -7784654306382472625760078131/19976667115878835579658411120 7878424312538117186565773/134674160331767430874101648 -200444235888612104981899699/59930001347636506738975233360 252130507848757713332297/3995333423175767115931682224", "1 -41571139349035415462149703183/28450314645021867428632883940 7872930790989860006075764211/7112578661255466857158220985 -8427558733217192154803442589/22760251716017493942906307152 1249312034188264720732628647/22760251716017493942906307152 -346679763570635235995756243/113801258580087469714531535760 6303257107935638666728829/113801258580087469714531535760", "1 -2779794036638206990078105709/1974534825671110310487928080 8396618757664536136743914069/7898139302684441241951712320 -1117013256901148829104074577/3159255721073776496780684928 163641921637600232563819607/3159255721073776496780684928 -44122827576402695902049443/15796278605368882483903424640 774083662017686499698947/15796278605368882483903424640", "1 -19909900825077649845328015531/14625954931535345044586617320 59964462522107728512015263371/58503819726141380178346469280 -7934254950431287537947495475/23401527890456552071338587712 1149516912076889042153374243/23401527890456552071338587712 -301428305798129958082515377/117007639452282760356692938560 5108949318178445361107843/117007639452282760356692938560", "1 -141529061641474411203921445117/107192742930997257122408210700 106276551692174868037682884417/107192742930997257122408210700 -27983312218338823191791170169/85754194344797805697926568560 4011991630930931624622226973/85754194344797805697926568560 -1023979692225313912589195527/428770971723989028489632842800 16786540330522214599685107/428770971723989028489632842800", "1 -1541831783554691195540747767/1200771394120129634077784340 10393986676612845411948782821/10806942547081166706700059060 -267059552616656930045736317/847603337025973859349024240 386701303056754900123684313/8645554037664933365360047248 -32047036747073334384098687/14409256729441555608933412080 305209717404649875727763/8645554037664933365360047248", "1 -4055665589846702020473138617/3240224584922125267136608110 8082012429980706995303169791/8640598893125667379030954960 -3163241406356285424895330151/10368718671750800854837145952 444876696449596461376792417/10368718671750800854837145952 -35939553095249656848009231/17281197786251334758061909920 1658748007983805826272129/51843593358754004274185729760", "1 -56561898076383015512932867621/46263207454910562593206964370 337408668659287443821681876357/370105659639284500745655714960 -43839128529728640890311169003/148042263855713800298262285984 6111162637797984467835836471/148042263855713800298262285984 -1444769559854976135257248849/740211319278569001491311429920 21563719485102246714484411/740211319278569001491311429920", "1 -9685588940126062024737750823/8095609959983589374001967860 16216814230626671034424711667/18215122409963076091504427685 -621898395657738055493631043/2158829322662290499733858096 2321119521141647997385065913/58288391711881843492814168592 -19838621854311418525679221/10794146613311452498669290480 7762937737389574313774123/291441958559409217464070842960", "1 -50122994251675981376884307227/42743839545018240784660607700 18613758252757870452699982981/21371919772509120392330303850 -49238803182732082532520551/175359341723151757065274288 1316713910103681377472313703/34195071636014592627728486160 -296783074081392223177058507/170975358180072963138642430800 1393347626500283255321079/56991786060024321046214143600", "1 -86053706958065369837374672549/74764551383766133163795061480 255197852207799437505543073267/299058205535064532655180245920 -163985470731007373780985211727/598116411070129065310360491840 4463635948273058599926232573/119623282214025813062072098368 -983238942374490423634982921/598116411070129065310360491840 2693805167961137367785557/119623282214025813062072098368", "1 -21790971371098147085426724487/19263443063769339340845221760 21504483738865731384884086963/25684590751692452454460295680 -8264210992716603058723248709/30821508902030942945352354816 372215469598680684067326207/10273836300676980981784118272 -240518310334191869085397319/154107544510154714726761774080 1068970237777316599538919/51369181503384904908920591360", "1 -148370628521763671839537281623/133301226103849115362155385860 109640200372810135864533777737/133301226103849115362155385860 -28003962424842578854828796095/106640980883079292289724308688 3757857952418289168654352147/106640980883079292289724308688 -791885757097070219707965233/533204904415396461448621543440 10284230499377874041621717/533204904415396461448621543440", "1 -62894241648065953634078221757/57368372249863833148778528940 46406562315665062664397902483/57368372249863833148778528940 -11818637672683500292627411957/45894697799891066519022823152 1575544090050778437268455553/45894697799891066519022823152 -324981677703256469487704987/229473488999455332595114115760 4113692114256199436224823/229473488999455332595114115760", "1 -1031054114737742249/953799812869000740 911629299087070207/1144559775442800888 -32157813334191643/127173308382533432 38342787627782659/1144559775442800888 -2582139361827977/1907599625738001480 9565541201699/572279887721400444", "1 -255622367727852748/236513419849818975 9040396526145809839/11352644152791310800 -127555689683311421/504561962346280480 152075994882010213/4541057661116524320 -10238451699575029/7568429435194207200 379155351616097/22705288305582621600" }); VPolygon result = lrs.run(new HPolygon(ine, false)); checkResults(result, ext, null); } @Test public void testH2VMetric40_11() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] ine = convert(new String[] { "0 0 0 1 1 0 0 0 0 0 -1 ", "0 0 1 0 1 0 0 0 0 -1 0 ", "0 0 1 1 0 0 0 0 -1 0 0 ", "0 1 0 0 1 0 0 -1 0 0 0 ", "0 1 0 1 0 0 -1 0 0 0 0 ", "0 1 1 0 0 -1 0 0 0 0 0 ", "0 -1 0 0 1 0 0 1 0 0 0 ", "0 0 0 -1 1 0 0 0 0 0 1 ", "0 0 0 0 0 0 -1 1 0 0 1 ", "0 0 -1 0 1 0 0 0 0 1 0 ", "0 0 0 0 0 0 0 0 -1 1 1 ", "0 0 0 0 0 -1 0 1 0 1 0 ", "2 0 0 0 0 -1 -1 0 -1 0 0 ", "0 -1 0 1 0 0 1 0 0 0 0 ", "0 0 0 0 0 0 1 -1 0 0 1 ", "0 0 0 1 -1 0 0 0 0 0 1 ", "0 0 -1 1 0 0 0 0 1 0 0 ", "0 0 0 0 0 0 0 0 1 -1 1 ", "0 0 0 0 0 -1 1 0 1 0 0 ", "2 -1 -1 0 0 -1 0 0 0 0 0 ", "2 0 0 0 0 -1 0 -1 0 -1 0 ", "0 -1 1 0 0 1 0 0 0 0 0 ", "0 0 0 0 0 1 0 -1 0 1 0 ", "0 0 1 0 -1 0 0 0 0 1 0 ", "2 -1 0 0 -1 0 0 -1 0 0 0", "0 0 0 0 0 1 -1 0 1 0 0 ", "0 0 0 0 0 0 0 0 1 1 -1 ", "0 0 1 -1 0 0 0 0 1 0 0 ", "2 -1 0 -1 0 0 -1 0 0 0 0 ", "2 0 0 0 0 0 -1 -1 0 0 -1 ", "0 0 0 0 0 1 1 0 -1 0 0 ", "0 0 0 0 0 1 0 1 0 -1 0 ", "0 1 -1 0 0 1 0 0 0 0 0 ", "0 1 0 0 -1 0 0 1 0 0 0 ", "2 0 -1 0 -1 0 0 0 0 -1 0 ", "0 0 0 0 0 0 1 1 0 0 -1 ", "0 1 0 -1 0 0 1 0 0 0 0 ", "2 0 0 -1 -1 0 0 0 0 0 -1 ", "2 0 -1 -1 0 0 0 0 -1 0 0 ", "2 0 0 0 0 0 0 0 -1 -1 -1" }); Rational[][] ext = convert(new String[] { "1 1/3 2/3 2/3 2/3 1/3 1/3 1/3 2/3 2/3 2/3", "1 0 1 1 0 1 1 0 0 1 1", "1 1 0 0 1 1 1 0 0 1 1", "1 0 1 1 1 1 1 1 0 0 0", "1 0 1 0 1 1 0 1 1 0 1", "1 1 0 1 1 1 0 0 1 1 0", "1 1/3 1/3 2/3 1/3 2/3 1/3 2/3 1/3 2/3 1/3", "1 2/3 1/3 1/3 1/3 1/3 1/3 1/3 2/3 2/3 2/3", "1 1/3 1/3 1/3 2/3 2/3 2/3 1/3 2/3 1/3 1/3", "1 1 1 1 0 0 0 1 0 1 1", "1 2/3 2/3 2/3 2/3 2/3 2/3 2/3 2/3 2/3 2/3", "1 1 0 1 0 1 0 1 1 0 1", "1 1 1 0 0 0 1 1 1 1 0", "1 2/3 1/3 2/3 2/3 1/3 2/3 2/3 1/3 1/3 2/3", "1 1 0 0 0 1 1 1 0 0 0", "1 2/3 2/3 1/3 2/3 2/3 1/3 2/3 1/3 2/3 1/3", "1 0 0 1 0 0 1 0 1 0 1", "1 0 0 1 1 0 1 1 1 1 0", "1 1/3 1/3 1/3 1/3 2/3 2/3 2/3 2/3 2/3 2/3", "1 1 1 0 1 0 1 0 1 0 1", "1 2/3 2/3 2/3 1/3 2/3 2/3 1/3 2/3 1/3 1/3", "1 1/3 2/3 1/3 1/3 1/3 2/3 2/3 1/3 1/3 2/3", "1 0 1 0 0 1 0 0 1 1 0", "1 0 0 0 1 0 0 1 0 1 1", "1 1 1 1 1 0 0 0 0 0 0", "1 1/3 2/3 2/3 1/3 1/3 1/3 2/3 2/3 1/3 1/3", "1 1/3 1/3 2/3 2/3 2/3 1/3 1/3 1/3 1/3 2/3", "1 2/3 2/3 1/3 1/3 2/3 1/3 1/3 1/3 1/3 2/3", "1 2/3 1/3 1/3 2/3 1/3 1/3 2/3 2/3 1/3 1/3", "1 2/3 1/3 2/3 1/3 1/3 2/3 1/3 1/3 2/3 1/3", "1 1/3 2/3 1/3 2/3 1/3 2/3 1/3 1/3 2/3 1/3", "1 0 0 0 0 0 0 0 0 0 0" }); VPolygon result = lrs.run(new HPolygon(ine, false)); checkResults(result, ext, null); } //@Test //commenting just because it takes forever... should pass though public void testH2VMetric80_16() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] ine = convert(new String[] { "0 1 1 0 0 0 -1 0 0 0 0 0 0 0 0 0", "0 -1 0 1 0 0 0 1 0 0 0 0 0 0 0 0", "0 1 0 1 0 0 0 -1 0 0 0 0 0 0 0 0", "0 -1 0 0 1 0 0 0 1 0 0 0 0 0 0 0", "0 1 0 0 1 0 0 0 -1 0 0 0 0 0 0 0", "0 -1 0 0 0 1 0 0 0 1 0 0 0 0 0 0", "0 1 0 0 0 1 0 0 0 -1 0 0 0 0 0 0", "0 0 -1 1 0 0 0 0 0 0 1 0 0 0 0 0", "0 0 1 -1 0 0 0 0 0 0 1 0 0 0 0 0", "0 0 1 1 0 0 0 0 0 0 -1 0 0 0 0 0", "0 0 -1 0 1 0 0 0 0 0 0 1 0 0 0 0", "0 0 1 0 -1 0 0 0 0 0 0 1 0 0 0 0", "0 0 1 0 1 0 0 0 0 0 0 -1 0 0 0 0", "0 0 -1 0 0 1 0 0 0 0 0 0 1 0 0 0", "0 0 1 0 0 -1 0 0 0 0 0 0 1 0 0 0", "0 0 1 0 0 1 0 0 0 0 0 0 -1 0 0 0", "0 0 0 1 1 0 0 0 0 0 0 0 0 -1 0 0", "0 0 0 1 -1 0 0 0 0 0 0 0 0 1 0 0", "0 0 0 -1 1 0 0 0 0 0 0 0 0 1 0 0", "0 0 0 1 0 1 0 0 0 0 0 0 0 0 -1 0", "0 0 0 1 0 -1 0 0 0 0 0 0 0 0 1 0", "0 0 0 -1 0 1 0 0 0 0 0 0 0 0 1 0", "0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 -1", "0 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 1", "0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 1", "6 0 0 0 0 0 -1 -1 0 0 -1 0 0 0 0 0", "0 0 0 0 0 0 1 1 0 0 -1 0 0 0 0 0", "0 0 0 0 0 0 -1 1 0 0 1 0 0 0 0 0", "0 0 0 0 0 0 1 -1 0 0 1 0 0 0 0 0", "6 0 0 0 0 0 -1 0 -1 0 0 -1 0 0 0 0", "0 0 0 0 0 0 1 0 1 0 0 -1 0 0 0 0", "0 0 0 0 0 0 -1 0 1 0 0 1 0 0 0 0", "0 0 0 0 0 0 1 0 -1 0 0 1 0 0 0 0", "6 0 0 0 0 0 -1 0 0 -1 0 0 -1 0 0 0", "0 0 0 0 0 0 -1 0 0 1 0 0 1 0 0 0", "0 0 0 0 0 0 1 0 0 1 0 0 -1 0 0 0", "0 0 0 0 0 0 1 0 0 -1 0 0 1 0 0 0", "6 0 0 0 0 0 0 -1 -1 0 0 0 0 -1 0 0", "0 0 0 0 0 0 0 -1 1 0 0 0 0 1 0 0", "0 0 0 0 0 0 0 1 -1 0 0 0 0 1 0 0", "0 0 0 0 0 0 0 1 1 0 0 0 0 -1 0 0", "6 0 0 0 0 0 0 -1 0 -1 0 0 0 0 -1 0", "0 0 0 0 0 0 0 -1 0 1 0 0 0 0 1 0", "0 0 0 0 0 0 0 1 0 -1 0 0 0 0 1 0", "0 0 0 0 0 0 0 1 0 1 0 0 0 0 -1 0", "6 0 0 0 0 0 0 0 -1 -1 0 0 0 0 0 -1", "0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 1", "0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 1", "0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 -1", "6 0 0 0 0 0 0 0 0 0 -1 -1 0 -1 0 0", "0 0 0 0 0 0 0 0 0 0 1 1 0 -1 0 0", "0 0 0 0 0 0 0 0 0 0 1 -1 0 1 0 0", "0 0 0 0 0 0 0 0 0 0 -1 1 0 1 0 0", "6 0 0 0 0 0 0 0 0 0 -1 0 -1 0 -1 0", "0 0 0 0 0 0 0 0 0 0 1 0 1 0 -1 0", "0 0 0 0 0 0 0 0 0 0 1 0 -1 0 1 0", "0 0 0 0 0 0 0 0 0 0 -1 0 1 0 1 0", "6 0 0 0 0 0 0 0 0 0 0 -1 -1 0 0 -1", "0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 -1", "0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 1", "0 0 0 0 0 0 0 0 0 0 0 -1 1 0 0 1", "6 0 0 0 0 0 0 0 0 0 0 0 0 -1 -1 -1", "0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 -1", "0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 1", "0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 1", "6 -1 -1 0 0 0 -1 0 0 0 0 0 0 0 0 0", "0 -1 1 0 0 0 1 0 0 0 0 0 0 0 0 0", "0 1 -1 0 0 0 1 0 0 0 0 0 0 0 0 0", "6 -1 0 -1 0 0 0 -1 0 0 0 0 0 0 0 0", "0 1 0 -1 0 0 0 1 0 0 0 0 0 0 0 0", "6 -1 0 0 -1 0 0 0 -1 0 0 0 0 0 0 0", "0 1 0 0 -1 0 0 0 1 0 0 0 0 0 0 0", "6 -1 0 0 0 -1 0 0 0 -1 0 0 0 0 0 0", "0 1 0 0 0 -1 0 0 0 1 0 0 0 0 0 0", "6 0 -1 -1 0 0 0 0 0 0 -1 0 0 0 0 0", "6 0 -1 0 -1 0 0 0 0 0 0 -1 0 0 0 0", "6 0 -1 0 0 -1 0 0 0 0 0 0 -1 0 0 0", "6 0 0 -1 -1 0 0 0 0 0 0 0 0 -1 0 0", "6 0 0 -1 0 -1 0 0 0 0 0 0 0 0 -1 0", "6 0 0 0 -1 -1 0 0 0 0 0 0 0 0 0 -1" }); Rational[][] ext = convert(new String[] { "1 0 3 0 3 3 3 0 3 3 3 0 0 3 3 0", "1 1 1 0 2 2 2 1 1 1 1 1 1 2 2 2", "1 3 0 0 3 3 3 3 0 0 0 3 3 3 3 0", "1 3 0 0 0 3 3 3 3 0 0 0 3 0 3 3", "1 3 0 0 3 0 3 3 0 3 0 3 0 3 0 3", "1 3 0 0 0 0 3 3 3 3 0 0 0 0 0 0", "1 0 0 0 3 3 0 0 3 3 0 3 3 3 3 0", "1 0 0 0 0 3 0 0 0 3 0 0 3 0 3 3", "1 1 1 0 1 2 2 1 2 1 1 2 1 1 2 1", "1 1 1 0 2 1 2 1 1 2 1 1 2 2 1 1", "1 0 0 0 3 0 0 0 3 0 0 3 0 3 0 3", "1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", "1 0 3 0 0 3 3 0 0 3 3 3 0 0 3 3", "1 1 1 0 1 1 2 1 2 2 1 2 2 1 1 2", "1 0 3 0 3 0 3 0 3 0 3 0 3 3 0 3", "1 0 3 0 0 0 3 0 0 0 3 3 3 0 0 0" }); HPolygon input = new HPolygon(ine, false); input.linearities = new int[] { 1, 2, 3 }; VPolygon result = lrs.run(input); checkResults(result, ext, null); } @Test public void testH2VTrunc7() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] ine = convert(new String[] { "6 7 -7 -7 -7 -7 -7 28", "6 -7 -7 -7 -7 -7 -7 28", "3 0 7 0 0 0 0 14", "3 0 14 0 0 0 0 7", "6 7 28 -7 -7 -7 -7 -7", "6 -7 28 -7 -7 -7 -7 -7", "3 0 14 7 0 0 0 0", "3 0 14 0 7 0 0 0", "3 0 14 0 0 7 0 0", "3 0 14 0 0 0 7 0", "3 0 0 7 0 0 0 14", "3 0 0 14 0 0 0 7", "6 7 -7 28 -7 -7 -7 -7", "6 -7 -7 28 -7 -7 -7 -7", "3 0 7 14 0 0 0 0", "3 0 0 14 7 0 0 0", "3 0 0 14 0 7 0 0", "3 0 0 14 0 0 7 0", "3 0 0 0 7 0 0 14", "3 0 0 0 14 0 0 7", "6 7 -7 -7 28 -7 -7 -7", "6 -7 -7 -7 28 -7 -7 -7", "3 0 7 0 14 0 0 0", "3 0 0 7 14 0 0 0", "3 0 0 0 14 7 0 0", "3 0 0 0 14 0 7 0", "3 0 0 0 0 7 0 14", "3 0 0 0 0 14 0 7", "6 7 -7 -7 -7 28 -7 -7", "6 -7 -7 -7 -7 28 -7 -7", "3 0 7 0 0 14 0 0", "3 0 0 7 0 14 0 0", "3 0 0 0 7 14 0 0", "3 0 0 0 0 14 7 0", "3 0 0 0 0 0 7 14", "3 0 0 0 0 0 14 7", "6 7 -7 -7 -7 -7 28 -7", "6 -7 -7 -7 -7 -7 28 -7", "3 0 7 0 0 0 14 0", "3 0 0 7 0 0 14 0", "3 0 0 0 7 0 14 0", "3 0 0 0 0 7 14 0", "1 7 -7 -7 -7 -7 -7 -7", "1 -7 -7 -7 -7 -7 -7 -7", "27 28 0 0 0 0 0 0", "27 -28 0 0 0 0 0 0", "5 0 28 0 0 0 0 0", "5 0 0 28 0 0 0 0", "5 0 0 0 28 0 0 0", "5 0 0 0 0 28 0 0", "5 0 0 0 0 0 28 0", "5 0 0 0 0 0 0 28", "23 0 -28 0 0 0 0 0", "23 0 0 -28 0 0 0 0", "23 0 0 0 -28 0 0 0", "23 0 0 0 0 -28 0 0", "23 0 0 0 0 0 -28 0", "23 0 0 0 0 0 0 -28" }); Rational[][] ext = convert(new String[] { "1 0 -1/7 -1/7 -1/7 -1/7 -3/28 23/28", "1 -27/28 -1/7 -1/7 -1/7 -1/7 -1/7 -3/28", "1 -27/28 -1/7 -3/28 -1/7 -1/7 -1/7 -1/7", "1 -27/28 -1/7 -1/7 -3/28 -1/7 -1/7 -1/7", "1 -27/28 -3/28 -1/7 -1/7 -1/7 -1/7 -1/7", "1 -27/28 -1/7 -1/7 -1/7 -3/28 -1/7 -1/7", "1 -27/28 -27/196 -27/196 -27/196 -27/196 -57/392 -27/196", "1 -27/28 -1/7 -1/7 -1/7 -1/7 -1/7 -1/7", "1 -27/28 -27/196 -27/196 -27/196 -57/392 -27/196 -27/196", "1 -27/28 -1/7 -1/7 -1/7 -1/7 -3/28 -1/7", "1 -27/28 -57/392 -27/196 -27/196 -27/196 -27/196 -27/196", "1 -27/28 -27/196 -27/196 -57/392 -27/196 -27/196 -27/196", "1 -27/28 -27/196 -27/196 -27/196 -27/196 -27/196 -57/392", "1 -27/28 -27/196 -57/392 -27/196 -27/196 -27/196 -27/196", "1 0 -23/168 -7/48 -23/168 -23/168 -23/168 23/28", "1 0 -1/14 -5/28 -1/14 -1/14 -1/14 3/7", "1 1/2 -1/14 -5/28 -1/14 -1/14 -1/14 -1/14", "1 0 3/7 -5/28 -1/14 -1/14 -1/14 -1/14", "1 0 -1/14 -5/28 3/7 -1/14 -1/14 -1/14", "1 0 -1/14 -5/28 -1/14 3/7 -1/14 -1/14", "1 0 -1/14 -5/28 -1/14 -1/14 3/7 -1/14", "1 -1/2 -1/14 -5/28 -1/14 -1/14 -1/14 -1/14", "1 0 -23/168 -23/168 -7/48 -23/168 -23/168 23/28", "1 0 -1/14 -1/14 -5/28 -1/14 -1/14 3/7", "1 1/2 -1/14 -1/14 -5/28 -1/14 -1/14 -1/14", "1 0 3/7 -1/14 -5/28 -1/14 -1/14 -1/14", "1 0 -1/14 3/7 -5/28 -1/14 -1/14 -1/14", "1 0 -1/14 -1/14 -5/28 3/7 -1/14 -1/14", "1 0 -1/14 -1/14 -5/28 -1/14 3/7 -1/14", "1 -1/2 -1/14 -1/14 -5/28 -1/14 -1/14 -1/14", "1 0 -1/7 -1/7 -3/28 -1/7 -1/7 23/28", "1 0 -1/7 -1/7 23/28 -1/7 -1/7 -3/28", "1 0 -1/7 -1/7 23/28 -1/7 -3/28 -1/7", "1 0 -23/168 -7/48 23/28 -23/168 -23/168 -23/168", "1 -1/28 -1/7 -1/7 23/28 -1/7 -1/7 -1/7", "1 0 -23/168 -23/168 23/28 -23/168 -23/168 -7/48", "1 0 -23/168 -23/168 23/28 -7/48 -23/168 -23/168", "1 1/28 -1/7 -1/7 23/28 -1/7 -1/7 -1/7", "1 0 -1/7 -3/28 23/28 -1/7 -1/7 -1/7", "1 0 -7/48 -23/168 23/28 -23/168 -23/168 -23/168", "1 0 -3/28 -1/7 -1/7 -1/7 -1/7 23/28", "1 0 23/28 -1/7 -1/7 -1/7 -1/7 -3/28", "1 0 23/28 -1/7 -1/7 -1/7 -3/28 -1/7", "1 0 23/28 -23/168 -7/48 -23/168 -23/168 -23/168", "1 0 23/28 -7/48 -23/168 -23/168 -23/168 -23/168", "1 -1/28 23/28 -1/7 -1/7 -1/7 -1/7 -1/7", "1 0 23/28 -1/7 -3/28 -1/7 -1/7 -1/7", "1 0 23/28 -23/168 -23/168 -23/168 -23/168 -7/48", "1 0 23/28 -23/168 -23/168 -7/48 -23/168 -23/168", "1 0 23/28 -3/28 -1/7 -1/7 -1/7 -1/7", "1 0 23/28 -1/7 -1/7 -3/28 -1/7 -1/7", "1 0 23/28 -23/168 -23/168 -23/168 -7/48 -23/168", "1 1/28 23/28 -1/7 -1/7 -1/7 -1/7 -1/7", "1 0 -3/28 -1/7 23/28 -1/7 -1/7 -1/7", "1 0 -1/7 -1/7 23/28 -3/28 -1/7 -1/7", "1 0 -23/168 -23/168 23/28 -23/168 -7/48 -23/168", "1 0 -3/28 23/28 -1/7 -1/7 -1/7 -1/7", "1 0 -1/7 23/28 -1/7 -3/28 -1/7 -1/7", "1 0 -23/168 23/28 -23/168 -23/168 -7/48 -23/168", "1 0 -1/7 -1/7 -1/7 -3/28 -1/7 23/28", "1 0 -23/168 -23/168 -23/168 -7/48 -23/168 23/28", "1 0 -1/14 -1/14 -1/14 -5/28 -1/14 3/7", "1 -1/2 -1/14 -1/14 -1/14 -5/28 -1/14 -1/14", "1 0 3/7 -1/14 -1/14 -5/28 -1/14 -1/14", "1 0 -1/14 3/7 -1/14 -5/28 -1/14 -1/14", "1 0 -1/14 -1/14 3/7 -5/28 -1/14 -1/14", "1 0 -1/14 -1/14 -1/14 -5/28 3/7 -1/14", "1 1/2 -1/14 -1/14 -1/14 -5/28 -1/14 -1/14", "1 27/28 -27/196 -27/196 -27/196 -57/392 -27/196 -27/196", "1 1/28 -1/7 -1/7 -1/7 -1/7 -1/7 23/28", "1 0 -23/168 -23/168 -23/168 -23/168 -7/48 23/28", "1 0 -1/14 -1/14 -1/14 -1/14 -5/28 3/7", "1 1/2 -1/14 -1/14 -1/14 -1/14 -5/28 -1/14", "1 -1/2 -1/14 -1/14 -1/14 -1/14 -5/28 -1/14", "1 0 3/7 -1/14 -1/14 -1/14 -5/28 -1/14", "1 0 -1/14 3/7 -1/14 -1/14 -5/28 -1/14", "1 0 -1/14 -1/14 3/7 -1/14 -5/28 -1/14", "1 0 -1/14 -1/14 -1/14 3/7 -5/28 -1/14", "1 27/28 -1/7 -1/7 -1/7 -1/7 -1/7 -3/28", "1 27/28 -1/7 -1/7 -1/7 -1/7 -3/28 -1/7", "1 27/28 -27/196 -27/196 -27/196 -27/196 -27/196 -57/392", "1 27/28 -27/196 -27/196 -57/392 -27/196 -27/196 -27/196", "1 27/28 -27/196 -57/392 -27/196 -27/196 -27/196 -27/196", "1 27/28 -57/392 -27/196 -27/196 -27/196 -27/196 -27/196", "1 27/28 -1/7 -1/7 -1/7 -1/7 -1/7 -1/7", "1 27/28 -1/7 -1/7 -3/28 -1/7 -1/7 -1/7", "1 27/28 -1/7 -1/7 -1/7 -3/28 -1/7 -1/7", "1 27/28 -3/28 -1/7 -1/7 -1/7 -1/7 -1/7", "1 27/28 -27/196 -27/196 -27/196 -27/196 -57/392 -27/196", "1 27/28 -1/7 -3/28 -1/7 -1/7 -1/7 -1/7", "1 0 -1/7 -3/28 -1/7 -1/7 -1/7 23/28", "1 -1/28 -1/7 -1/7 -1/7 -1/7 -1/7 23/28", "1 0 -1/7 23/28 -1/7 -1/7 -1/7 -3/28", "1 0 -1/7 23/28 -1/7 -1/7 -3/28 -1/7", "1 0 -23/168 23/28 -7/48 -23/168 -23/168 -23/168", "1 -1/28 -1/7 23/28 -1/7 -1/7 -1/7 -1/7", "1 0 -1/7 23/28 -3/28 -1/7 -1/7 -1/7", "1 0 -23/168 23/28 -23/168 -23/168 -23/168 -7/48", "1 0 -23/168 23/28 -23/168 -7/48 -23/168 -23/168", "1 1/28 -1/7 23/28 -1/7 -1/7 -1/7 -1/7", "1 0 -7/48 23/28 -23/168 -23/168 -23/168 -23/168", "1 0 -1/7 -1/7 -1/7 23/28 -1/7 -3/28", "1 0 -1/7 -1/7 -1/7 23/28 -3/28 -1/7", "1 0 -23/168 -23/168 -23/168 23/28 -23/168 -7/48", "1 0 -3/28 -1/7 -1/7 23/28 -1/7 -1/7", "1 0 -1/7 -1/7 -3/28 23/28 -1/7 -1/7", "1 -1/28 -1/7 -1/7 -1/7 23/28 -1/7 -1/7", "1 0 -23/168 -23/168 -23/168 23/28 -7/48 -23/168", "1 1/28 -1/7 -1/7 -1/7 23/28 -1/7 -1/7", "1 0 -1/7 -3/28 -1/7 23/28 -1/7 -1/7", "1 0 -23/168 -23/168 -7/48 23/28 -23/168 -23/168", "1 0 -23/168 -7/48 -23/168 23/28 -23/168 -23/168", "1 0 -7/48 -23/168 -23/168 23/28 -23/168 -23/168", "1 0 -7/48 -23/168 -23/168 -23/168 -23/168 23/28", "1 0 -5/28 -1/14 -1/14 -1/14 -1/14 3/7", "1 1/2 -5/28 -1/14 -1/14 -1/14 -1/14 -1/14", "1 0 -5/28 3/7 -1/14 -1/14 -1/14 -1/14", "1 0 -5/28 -1/14 3/7 -1/14 -1/14 -1/14", "1 0 -5/28 -1/14 -1/14 -1/14 3/7 -1/14", "1 -1/2 -5/28 -1/14 -1/14 -1/14 -1/14 -1/14", "1 0 -5/28 -1/14 -1/14 3/7 -1/14 -1/14", "1 0 -1/7 -1/7 -1/7 -1/7 23/28 -3/28", "1 -1/28 -1/7 -1/7 -1/7 -1/7 23/28 -1/7", "1 0 -23/168 -7/48 -23/168 -23/168 23/28 -23/168", "1 0 -23/168 -23/168 -7/48 -23/168 23/28 -23/168", "1 0 -1/7 -1/7 -3/28 -1/7 23/28 -1/7", "1 0 -3/28 -1/7 -1/7 -1/7 23/28 -1/7", "1 0 -1/7 -1/7 -1/7 -3/28 23/28 -1/7", "1 0 -23/168 -23/168 -23/168 -7/48 23/28 -23/168", "1 1/28 -1/7 -1/7 -1/7 -1/7 23/28 -1/7", "1 0 -23/168 -23/168 -23/168 -23/168 23/28 -7/48", "1 0 -1/14 -1/14 -1/14 -1/14 3/7 -5/28", "1 1/2 -1/14 -1/14 -1/14 -1/14 -1/14 -5/28", "1 -1/2 -1/14 -1/14 -1/14 -1/14 -1/14 -5/28", "1 0 3/7 -1/14 -1/14 -1/14 -1/14 -5/28", "1 0 -1/14 3/7 -1/14 -1/14 -1/14 -5/28", "1 0 -1/14 -1/14 3/7 -1/14 -1/14 -5/28", "1 0 -1/14 -1/14 -1/14 3/7 -1/14 -5/28", "1 0 -1/7 -3/28 -1/7 -1/7 23/28 -1/7", "1 0 -7/48 -23/168 -23/168 -23/168 23/28 -23/168" }); VPolygon result = lrs.run(new HPolygon(ine, false)); checkResults(result, ext, null); } @Test public void testP2NashExampleWithDegeneracy() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] ine = convert(new String[] { "1 -3 -2 -3", "1 -3 -6 -1" }); Rational[][] ext = convert(new String[] { "1 0 0 0", "1 1/3 0 0", "1 0 1/6 0", "1 0 1/8 1/4", "1 0 0 1/3" }); Integer[][] cobasisArr = new Integer[][] { {3, 4, 5}, {2, 4, 5, 1}, {2, 3, 5}, {1, 2, 3}, {1, 3, 4} }; VPolygon result = lrs.run(new HPolygon(ine, true)); checkResults(result, ext, cobasisArr); } @Test public void testP1NashExample() { LrsAlgorithm lrs = new LrsAlgorithm(); Rational[][] ine = convert(new String[] { "1 -3 -3", "1 -2 -5", "1 0 -6" }); Rational[][] ext = convert(new String[] { "1 0 0", "1 1/3 0", "1 0 1/6", "1 1/12 1/6", "1 2/9 1/9" }); Integer[][] cobasisArr = new Integer[][] { {4, 5}, {1, 5}, {3, 4}, {2, 3}, {1, 2} }; VPolygon result = lrs.run(new HPolygon(ine, true)); checkResults(result, ext, cobasisArr); } private void checkResults(VPolygon result, Rational[][] ext, Integer[][] cobasisArr) { assertNotNull("result was null", result); assertNotNull("result vertices are null", result.vertices); assertEquals(ext.length, result.vertices.size()); for (int i = 0; i < ext.length; ++i) { assertEquals(ext[i].length, result.vertices.get(i).length); for (int j = 0; j < ext[i].length; ++j) { assertEquals(i + " " + j, ext[i][j], result.vertices.get(i)[j]); } } if (cobasisArr != null) { assertEquals(cobasisArr.length, result.cobasis.size()); for (int i = 0; i < cobasisArr.length; ++i) { assertEquals("r" + i, cobasisArr[i].length, result.cobasis.get(i).length); for (int j = 0; j < cobasisArr[i].length; ++j) { assertEquals("r" + i + " c" + j, cobasisArr[i][j], result.cobasis.get(i)[j]); } } } } private static Rational[][] convert(String[] strarr) { Rational[][] mat = new Rational[strarr.length][]; for (int i = 0; i < mat.length; ++i) { String row = strarr[i]; String[] cols = row.trim().split("\\s+"); mat[i] = new Rational[cols.length]; for (int j = 0; j < mat[i].length; ++j) { mat[i][j] = Rational.valueOf(cols[j]); } } return mat; } }
434,595
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
BimatrixSolverTest.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/test/src/lse/math/games/matrix/BimatrixSolverTest.java
package lse.math.games.matrix; import static org.junit.Assert.*; import lse.math.games.Rational; import lse.math.games.lrs.Lrs; import lse.math.games.lrs.LrsAlgorithm; import org.junit.Test; public class BimatrixSolverTest { @Test public void testFindAllEqWithDegeneracy() { BimatrixSolver program = new BimatrixSolver(); Rational[][] payoff1 = new Rational[][] { { Rational.valueOf("3"), Rational.valueOf("3")}, { Rational.valueOf("2"), Rational.valueOf("5")}, { Rational.valueOf("0"), Rational.valueOf("6")} }; Rational[][] payoff2 = new Rational[][] { { Rational.valueOf("3"), Rational.valueOf("3")}, { Rational.valueOf("2"), Rational.valueOf("6")}, { Rational.valueOf("3"), Rational.valueOf("1")} }; Rational[][] probs1 = new Rational[][] { { Rational.valueOf("1"), Rational.valueOf("0"), Rational.valueOf("0")}, { Rational.valueOf("1"), Rational.valueOf("0"), Rational.valueOf("0")}, { Rational.valueOf("0"), Rational.valueOf("1/3"), Rational.valueOf("2/3")} }; Rational[][] probs2 = new Rational[][] { { Rational.valueOf("1"), Rational.valueOf("0")}, { Rational.valueOf("2/3"), Rational.valueOf("1/3")}, { Rational.valueOf("1/3"), Rational.valueOf("2/3")} }; Rational[] epayoffs1 = new Rational[] { Rational.valueOf("3"), Rational.valueOf("3"), Rational.valueOf("4") }; Rational[] epayoffs2 = new Rational[] { Rational.valueOf("3"), Rational.valueOf("3"), Rational.valueOf("8/3") }; Lrs lrs = new LrsAlgorithm(); Equilibria eqs = program.findAllEq(lrs, payoff1, payoff2); checkResults(eqs, probs1, probs2, epayoffs1, epayoffs2); } @Test public void testFindAllEqNoDegeneracy() { BimatrixSolver program = new BimatrixSolver(); Rational[][] payoff1 = new Rational[][] { { Rational.valueOf("3"), Rational.valueOf("3")}, { Rational.valueOf("2"), Rational.valueOf("5")}, { Rational.valueOf("0"), Rational.valueOf("6")} }; Rational[][] payoff2 = new Rational[][] { { Rational.valueOf("3"), Rational.valueOf("2")}, { Rational.valueOf("2"), Rational.valueOf("6")}, { Rational.valueOf("3"), Rational.valueOf("1")} }; Rational[][] probs1 = new Rational[][] { { Rational.valueOf("1"), Rational.valueOf("0"), Rational.valueOf("0")}, { Rational.valueOf("4/5"), Rational.valueOf("1/5"), Rational.valueOf("0")}, { Rational.valueOf("0"), Rational.valueOf("1/3"), Rational.valueOf("2/3")} }; Rational[][] probs2 = new Rational[][] { { Rational.valueOf("1"), Rational.valueOf("0")}, { Rational.valueOf("2/3"), Rational.valueOf("1/3")}, { Rational.valueOf("1/3"), Rational.valueOf("2/3")} }; Rational[] epayoffs1 = new Rational[] { Rational.valueOf("3"), Rational.valueOf("9/3"), Rational.valueOf("4") }; Rational[] epayoffs2 = new Rational[] { Rational.valueOf("3"), Rational.valueOf("14/5"), Rational.valueOf("8/3") }; Lrs lrs = new LrsAlgorithm(); Equilibria eqs = program.findAllEq(lrs, payoff1, payoff2); checkResults(eqs, probs1, probs2, epayoffs1, epayoffs2); } private void checkResults(Equilibria eqs, Rational[][] probs1, Rational[][] probs2, Rational[] epayoffs1, Rational[] epayoffs2) { assertEquals(3, eqs.count()); for (int i = 0; i < 3; ++i) { Equilibrium eq = eqs.get(i); assertEquals(epayoffs1[i], eq.payoff1); assertEquals(epayoffs2[i], eq.payoff2); assertEquals(3, eq.probVec1.length); for (int j = 0; j < 3; ++j) { assertEquals(probs1[i][j], eq.probVec1[j]); } assertEquals(2, eq.probVec2.length); for (int j = 0; j < 2; ++j) { assertEquals(probs2[i][j], eq.probVec2[j]); } } } }
3,782
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
CliqueAlgorithmTest.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/test/src/lse/math/games/matrix/CliqueAlgorithmTest.java
package lse.math.games.matrix; import static org.junit.Assert.*; import org.junit.Test; public class CliqueAlgorithmTest { @Test public void testRunEquilibriaWithMultiA() { Equilibria equilibria = new Equilibria(); equilibria.add(new Equilibrium(7, 7)); equilibria.add(new Equilibrium(7, 8)); equilibria.add(new Equilibrium(8, 9)); CliqueAlgorithm algo = new CliqueAlgorithm(); algo.run(equilibria); assertEquals(2, equilibria.ncliques()); assertEquals(1, equilibria.getClique(0).left.length); assertEquals(7, equilibria.getClique(0).left[0]); assertEquals(2, equilibria.getClique(0).right.length); assertEquals(7, equilibria.getClique(0).right[0]); assertEquals(8, equilibria.getClique(0).right[1]); assertEquals(1, equilibria.getClique(1).left.length); assertEquals(8, equilibria.getClique(1).left[0]); assertEquals(1, equilibria.getClique(1).right.length); assertEquals(9, equilibria.getClique(1).right[0]); } @Test public void testRunEquilibriaWithMultiB() { Equilibria equilibria = new Equilibria(); equilibria.add(new Equilibrium(7, 7)); equilibria.add(new Equilibrium(8, 7)); equilibria.add(new Equilibrium(9, 8)); CliqueAlgorithm algo = new CliqueAlgorithm(); algo.run(equilibria); assertEquals(2, equilibria.ncliques()); assertEquals(2, equilibria.getClique(0).left.length); assertEquals(7, equilibria.getClique(0).left[0]); assertEquals(8, equilibria.getClique(0).left[1]); assertEquals(1, equilibria.getClique(0).right.length); assertEquals(7, equilibria.getClique(0).right[0]); assertEquals(1, equilibria.getClique(1).left.length); assertEquals(9, equilibria.getClique(1).left[0]); assertEquals(1, equilibria.getClique(1).right.length); assertEquals(8, equilibria.getClique(1).right[0]); } }
1,850
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
Rational.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/Rational.java
package lse.math.games; import static lse.math.games.BigIntegerUtils.*; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Random; import lse.math.games.io.ColumnTextWriter; public class Rational { public static final Rational ZERO = new Rational(BigInteger.ZERO, BigInteger.ONE); public static final Rational ONE = new Rational(BigInteger.ONE, BigInteger.ONE); public static final Rational NEGONE = new Rational(BigInteger.ONE.negate(), BigInteger.ONE); public BigInteger num; public BigInteger den; public Rational(BigInteger num, BigInteger den) { this.num = num; this.den = den; if (zero(den)) { throw new ArithmeticException("Divide by zero"); } else if (!one(den)) { reduce(); } } public Rational(Rational toCopy) { this.num = toCopy.num; this.den = toCopy.den; } /* reduces Na Da by gcd(Na,Da) */ private void reduce() { if (!zero(num)) { if (negative(den)) { den = den.negate(); num = num.negate(); } BigInteger gcd = num.gcd(den); if (!one(gcd)) { num = num.divide(gcd); den = den.divide(gcd); } } else { den = BigInteger.ONE; } } public Rational(long numerator, long denominator) { this(BigInteger.valueOf(numerator), BigInteger.valueOf(denominator)); } private void addEq(Rational toAdd) { if (den.equals(toAdd.den)) { num = num.add(toAdd.num); } else { num = num.multiply(toAdd.den); num = num.add(toAdd.num.multiply(den)); den = den.multiply(toAdd.den); } reduce(); } public static Rational valueOf(String s) throws NumberFormatException { String[] fraction = s.split("/"); if (fraction.length < 1 || fraction.length > 2) throw new NumberFormatException("BigIntegerRational not formatted correctly"); if (fraction.length == 2) { BigInteger num = new BigInteger(fraction[0]); BigInteger den = new BigInteger(fraction[1]); return new Rational(num, den); } else { BigDecimal dec = new BigDecimal(s); return valueOf(dec); } } public static Rational valueOf(double dx) { BigDecimal x = BigDecimal.valueOf(dx); return valueOf(x); } public static Rational valueOf(BigDecimal x) { BigInteger num = x.unscaledValue(); BigInteger den = BigInteger.ONE; int scale = x.scale(); while (scale > 0) { den = den.multiply(BigInteger.TEN); --scale; } while (scale < 0) { num = num.multiply(BigInteger.TEN); ++scale; } Rational rv = new Rational(num, den); rv.reduce(); return rv; } public static Rational valueOf(long value) { if (value == 0) return ZERO; else if (value == 1) return ONE; else return new Rational(value); } private Rational(long value) { this(value, 1); } private void mulEq(Rational other) { num = num.multiply(other.num); den = den.multiply(other.den); reduce(); } //Helper Methods private void flip() /* aka. Reciprocate */ { BigInteger x = num; num = den; den = x; } public Rational add(Rational b) { if (zero(num)) return b; else if (zero(b.num))return this; Rational rv = new Rational(this); rv.addEq(b); return rv; } public Rational add(long b) { if (b == 0) return this; Rational rv = new Rational(b); rv.addEq(this); return rv; } public Rational subtract(Rational b) { if (zero(b.num))return this; Rational c = b.negate(); if (!zero(num)) c.addEq(this); return c; } public Rational subtract(long b) { if (b == 0) return this; Rational c = new Rational(-b); c.addEq(this); return c; } public Rational multiply(Rational b) { if (zero(num) || zero(b.num)) return ZERO; Rational rv = new Rational(this); rv.mulEq(b); return rv; } public Rational divide(Rational b) { Rational rv = new Rational(b); rv.flip(); rv.mulEq(this); return rv; } public Rational negate() { if (zero(num)) return this; return new Rational(num.negate(), den); } public Rational reciprocate() { if (zero(num)) throw new ArithmeticException("Divide by zero"); Rational rv = new Rational(this); rv.flip(); if (negative(den)) { rv.num = rv.num.negate(); rv.den = rv.den.negate(); } return rv; } public int compareTo(Rational other) { if (num.equals(other.num) && den.equals(other.den)) return 0; //see if it is a num only compare... if (den.equals(other.den)) return (greater(other.num, this.num)) ? -1 : 1; //check signs... if ((zero(num) || negative(num)) && positive(other.num)) return -1; else if (positive(num) && (zero(other.num) || negative(other.num))) return 1; Rational c = other.negate(); c.addEq(this); return (c.isZero() ? 0 : (negative(c.num) ? -1 : 1)); } public int compareTo(long other) { BigInteger othernum = BigInteger.valueOf(other); if (num.equals(othernum) && one(den)) return 0; else return compareTo(new Rational(othernum, BigInteger.ONE)); } public double doubleValue() { try { return (new BigDecimal(num)).divide(new BigDecimal(den)).doubleValue(); } catch (ArithmeticException e) { return (new BigDecimal(num)).divide(new BigDecimal(den), 32, BigDecimal.ROUND_HALF_UP).doubleValue(); } } //Num and Den are only used by Tableau... I'd like to get rid of them, but can't see how public boolean isZero() { return zero(num); } public boolean isOne() { return one(num) && one(den); } // should be reduced at all times //Basic Overrides @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof Rational)) return false; Rational r = (Rational)obj; return (compareTo(r) == 0); } @Override public int hashCode() { return (num.multiply(BigInteger.valueOf(7)).intValue() ^ den.multiply(BigInteger.valueOf(17)).intValue()); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(num.toString()); if (!one(den) && !zero(num)) { sb.append("/"); sb.append(den); } return sb.toString(); } public static Rational sum(Iterable<Rational> list) { Rational sum = ZERO; for (Rational rat : list) { sum.addEq(rat); } return sum; } // TODO: why is this here? public static long gcd(long a, long b) { long c; if (a < 0L) { a = -a; } if (b < 0L) { b = -b; } if (a < b) { c = a; a = b; b = c; } while (b != 0L) { c = a % b; a = b; b = c; } return a; } public static Rational[] probVector(int length, Random prng) { if (length == 0) return new Rational[] {}; else if (length == 1) return new Rational[] { Rational.ONE }; double dProb = prng.nextDouble(); Rational probA = Rational.valueOf(dProb); Rational probB = Rational.valueOf(1 - dProb); if (length == 2) { return new Rational[] { probA, probB }; } else { Rational[] a = probVector(length / 2, prng); Rational[] b = probVector((length + 1) / 2, prng); Rational[] c = new Rational[a.length + b.length]; for (int i = 0; i < a.length; ++i) { c[i] = a[i].multiply(probA); } for (int i = 0; i < b.length; ++i) { c[a.length + i] = b[i].multiply(probB); } return c; } } // TODO: put this somewhere else... public static void printRow(String name, Rational value, ColumnTextWriter colpp, boolean excludeZero) { if (!value.isZero() || !excludeZero) { colpp.writeCol(name); colpp.writeCol(value.toString()); if (!BigIntegerUtils.one(value.den)) { colpp.writeCol(String.format("%.3f", value.doubleValue())); } colpp.endRow(); } } }
8,776
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
BigIntegerUtils.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/BigIntegerUtils.java
package lse.math.games; import java.math.BigInteger; public class BigIntegerUtils { public static BigInteger lcm(BigInteger a, BigInteger b) { BigInteger u = a.gcd(b); BigInteger v = a.divide(u); /* v=a/u */ return v.multiply(b).abs(); } /* find largest gcd of p[0]..p[n-1] and divide through */ public static void reducearray (BigInteger[] p) { int i = 0; while ((i < p.length) && zero(p[i])) i++; if (i == p.length) return; BigInteger divisor = p[i].abs(); i++; while (i < p.length) { if (!zero (p[i])) { divisor = divisor.gcd(p[i].abs()); } i++; } for (i = 0; i < p.length; i++) if (!zero(p[i])) p[i] = p[i].divide(divisor); } /** * Compare the product of Na*Nb to Nc*Nd * @return * +1 if Na*Nb > Nc*Nd, * -1 if Na*Nb < Nc*Nd, * 0 if Na*Nb = Nc*Nd */ public static int comprod (BigInteger Na, BigInteger Nb, BigInteger Nc, BigInteger Nd) { BigInteger mc = (Na.multiply(Nb)).subtract(Nc.multiply(Nd)); if (positive(mc)) return (1); if (negative(mc)) return (-1); return (0); } public static boolean positive(BigInteger a) { return a.compareTo(BigInteger.ZERO) > 0; } public static boolean negative(BigInteger a) { return a.compareTo(BigInteger.ZERO) < 0; } public static boolean zero(BigInteger a) { return a.compareTo(BigInteger.ZERO) == 0; } public static boolean one(BigInteger a) { return a.compareTo(BigInteger.ONE) == 0; } public static boolean greater(BigInteger left, BigInteger right) { return left.compareTo(right) > 0; } }
1,782
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
ExtensiveForm.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/tree/ExtensiveForm.java
package lse.math.games.tree; import java.util.Iterator; import java.util.Set; import lse.math.games.Rational; import lse.math.games.io.ColumnTextWriter; public class ExtensiveForm { char[] an1 = new char[] { '!', 'A', 'a' }; //Assumes 2 players in this array... char[] an2 = new char[] { '/', 'Z', 'z' }; //ditto... private Player _firstPlayer; private Player _lastPlayer; private Node _root; private int _nnodes = 0; public ExtensiveForm() { _root = this.createNode(); } public Node createNode() { return new Node(_nnodes++); } public Node root() { return _root; } public Player firstPlayer() { return _firstPlayer; } public Node firstLeaf() { return _root.firstLeaf(); } public void autoname() { for (Player pl = _firstPlayer; pl != null; pl = pl.next) /* name isets of player pl */ { int idx = pl == Player.CHANCE ? 0 : pl == _firstPlayer ? 1 : 2; int anbase = an2[idx]-an1[idx]+1; int digits = 1; for (int max = anbase, n = nisets(pl); max < n; max *= anbase) { ++digits; } int count = 0; for (Iset h = _root.iset(); h != null; h = h.next()) { if (h.player() == pl) { StringBuilder sb = new StringBuilder(); for (int j = digits - 1, i = count; j >= 0; --j, i /= anbase) { char c = (char)(an1[idx] + (i % anbase)); sb.append(c); } h.setName(sb.toString()); } ++count; } } } private int nisets(Player pl) { int count = 0; for (Iset h = _root.iset(); h != null; h = h.next()) { if (h.player() == pl) { ++count; } } return count; } private int noutcome = 0; public Outcome createOutcome(Node wrapNode) { return new Outcome(noutcome++, wrapNode); } private Iset _secondIset; private Iset _lastIset; private int _nisets = 0; public Iset createIset(Player player) { return createIset(null, player); } public Iset createIset(String isetId, Player player) { Iset h = new Iset(_nisets++, player); if (isetId != null) { h.setName(isetId); } if (_secondIset == null) { _secondIset = h; } if (_lastIset != null) { _lastIset.setNext(h); } h.setNext(null); _lastIset = h; return h; } public Player createPlayer(String playerId) { if (playerId == Player.CHANCE_NAME) { return Player.CHANCE; } Player pl = new Player(playerId); if (_firstPlayer == null) { _firstPlayer = pl; } if (_lastPlayer != null) { _lastPlayer.next = pl; } pl.next = null; _lastPlayer = pl; return pl; } public void addToIset(Node node, Iset iset) { node.setIset(iset); iset.insertNode(node); if (node == _root) { // pull iset out of list & make it the front for (Iset h = _secondIset; h != null; h = h.next()) { if (h.next() == iset) { h.setNext(iset.next()); } } if (iset != _secondIset) { //avoid the infinite loop iset.setNext(_secondIset); } } } private int _nmoves = 0; public Move createMove(String moveId) { Move mv = new Move(_nmoves++); if (moveId != null) { mv.setLabel(moveId); } return mv; } public Move createMove() { return createMove(null); } @Override public String toString() { ColumnTextWriter colpp = new ColumnTextWriter(); colpp.writeCol("node"); colpp.writeCol("leaf"); colpp.writeCol("iset"); colpp.writeCol("player"); colpp.writeCol("parent"); colpp.writeCol("reachedby"); colpp.writeCol("outcome"); colpp.writeCol("pay1"); colpp.writeCol("pay2"); colpp.endRow(); recToString(_root, colpp); colpp.sortBy(0, 1); return colpp.toString(); } private void recToString(Node n, ColumnTextWriter colpp) { colpp.writeCol(n.uid()); colpp.writeCol(n.outcome == null ? 0 : 1); colpp.writeCol(n.iset() != null ? n.iset().name() : ""); colpp.writeCol(n.iset() != null ? n.iset().player().toString() : ""); colpp.writeCol(n.parent() != null ? n.parent().toString() : ""); colpp.writeCol(n.reachedby != null ? n.reachedby.toString() : ""); colpp.writeCol(n.outcome != null ? n.outcome.toString() : ""); colpp.writeCol(n.outcome != null ? n.outcome.pay(_firstPlayer).toString() : ""); colpp.writeCol(n.outcome != null ? n.outcome.pay(_firstPlayer.next).toString() : ""); colpp.endRow(); for (Node child = n.firstChild(); child != null; child = child.sibling()) { recToString(child, colpp); } } private String parameter=null; public String getParameter(){ parameter=null; iterateParameter(this.root()); return parameter; } private void iterateParameter(Node n){ if (n!=null) { if (n.outcome!=null){ Set<Player> s=n.outcome.players(); Iterator<Player> it = s.iterator(); while (it.hasNext()) { Player p = it.next(); if (n.outcome.parameter(p)!=null) { parameter=n.outcome.parameter(p); } } } } for (Node child = n.firstChild(); child != null; child = child.sibling()) { iterateParameter(child); } } public void setTreeParameter(String param){ iterateTreeParameter(this.root(),param); } private void iterateTreeParameter(Node n,String param){ if (n!=null) { if (n.outcome!=null){ Set<Player> s=n.outcome.players(); Iterator<Player> it = s.iterator(); while (it.hasNext()) { Player p = it.next(); if (n.outcome.parameter(p)!=null) { n.outcome.setPay(p, Rational.valueOf(param)); } } } } for (Node child = n.firstChild(); child != null; child = child.sibling()) { iterateTreeParameter(child,param); } } }
6,163
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
Player.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/tree/Player.java
package lse.math.games.tree; public class Player { public static final String CHANCE_NAME = "!"; public static final Player CHANCE = new Player(CHANCE_NAME); public Player next; private String _playerId; Player(String playerId) { _playerId = playerId; } @Override public String toString() { return _playerId; } }
357
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
Node.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/tree/Node.java
package lse.math.games.tree; public class Node { private int _uid; private Node _firstChild; private Node _lastChild; private Node _parent; // node closer to root private Node _sibling; // sibling to the right private Iset _iset; Node(int uid) { _uid = uid; } public int uid() { return _uid; } public boolean terminal; public Iset iset() { return _iset; } void setIset(Iset iset) { _iset = iset; _iset.insertNode(this);} public Node nextInIset; public Move reachedby; /* move of edge from father */ public Outcome outcome; public Node firstChild() { return _firstChild; } public void addChild(Node node) { if (_firstChild == null) { _firstChild = node; } if (_lastChild != null) { _lastChild._sibling = node; } node._parent = this; node._sibling = null; _lastChild = node; } public Node parent() { return _parent; } public Node sibling() { return _sibling; } Node firstLeaf() { if (_firstChild == null) { return this; } else { return _firstChild.firstLeaf(); } } public Node nextLeaf() { if (_sibling != null) { return _sibling.firstLeaf(); } else if (_parent != null) { return _parent.nextLeaf(); } else { return null; } } @Override public String toString() { return String.valueOf(_uid); } }
1,490
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
SequenceForm.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/tree/SequenceForm.java
package lse.math.games.tree; import java.io.StringWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Random; import java.util.logging.Logger; import lse.math.games.Rational; import lse.math.games.io.ColumnTextWriter; import lse.math.games.lcp.LCP; public class SequenceForm { private static final Logger log = Logger.getLogger(SequenceForm.class.getName()); private Player firstPlayer; private Long _seed = null; Map<Player,Rational[][]> payoffs = new HashMap<Player,Rational[][]>(); private Map<Player,Integer[][]> constraintsMap = new HashMap<Player,Integer[][]>(); private Map<Iset,Move> seqin = new HashMap<Iset,Move>(); private Map<Node,Map<Player,Move>> defseq = new HashMap<Node,Map<Player,Move>>(); private Map<Player,List<Move>> seqsMap = new HashMap<Player,List<Move>>(); private Map<Move,Integer> seqsIdxMap = new HashMap<Move,Integer>(); private List<Iset> isets = new ArrayList<Iset>(); // sorted top-to-bottom, left-to-right private Map<Player,List<Iset>> isetsMap = new HashMap<Player,List<Iset>>(); private Map<Iset,Integer> isetsIdxMap = new HashMap<Iset,Integer>(); private Map<Move,Rational> randomPriors = new HashMap<Move,Rational>(); //static int oldnseqs1 = 0; //static int[] oldconstrows = new int[] {0, 0, 0}; public SequenceForm(ExtensiveForm tree) throws ImperfectRecallException { this(tree, null); } public SequenceForm(ExtensiveForm tree, Long seed) throws ImperfectRecallException { _seed = seed; firstPlayer = tree.firstPlayer(); seqsIdxMap.put(null, 0); for (Player pl = firstPlayer; pl != null; pl = pl.next) { List<Move> plMoves = new ArrayList<Move>(); plMoves.add(null); seqsMap.put(pl, plMoves); } List<Move> chanceMoves = new ArrayList<Move>(); chanceMoves.add(null); seqsMap.put(Player.CHANCE, chanceMoves); genseqin(tree); // TODO: adjust max pay? allocsf(); Map<Player,Rational> payAdjust = getPayAdjust(tree); // pre-process chance probs //behavtorealprob(Player.CHANCE); /* sf payoff matrices */ for (Node u = tree.firstLeaf(); u != null; u = u.nextLeaf()) { Map<Player,Move> udefseq = defseq.get(u); int row = seqsIdxMap.get(udefseq.get(firstPlayer)); int col = seqsIdxMap.get(udefseq.get(firstPlayer.next)); for (Player pl = tree.firstPlayer(); pl != null; pl = pl.next) { Rational pay = u.outcome.pay(pl).add(payAdjust.get(pl)); Rational prob = realprob(udefseq.get(Player.CHANCE)); // get probability of reaching this node even if both players trying to get here payoffs.get(pl)[row][col] = payoffs.get(pl)[row][col].add(prob.multiply(pay)); } } /* sf constraint matrices, sparse fill */ for (Player pl = tree.firstPlayer(); pl != null; pl = pl.next) { initConstraints(pl); } } private void initConstraints(Player pl) { Integer[][] constraints = constraintsMap.get(pl); List<Iset> isets = isetsMap.get(pl); List<Move> seqs = seqsMap.get(pl); int nisets = isets != null ? isets.size() : 0; for (int i = 0; i < nisets + 1; ++i) { for (int j = 0; j < seqs.size(); j++) { constraints[i][j] = 0; } } constraints[0][0] = 1; /* empty sequence */ for (int i = 0; i < nisets; ++i) { int row = i + 1; int col = seqsIdxMap.get(seqin.get(isets.get(i))); constraints[row][col] = -1; } for (int j = 1; j < seqs.size(); j++) { int row = isetsIdxMap.get(seqs.get(j).iset()) + 1; int col = j; constraints[row][col] = 1; } } // TODO: requires moves to be sorted by decision depth // this makes realprob method faster /*private void behavtorealprob(Player pl) { List<Move> moves = seqsMap.get(pl); moves.get(0).realprob = Rational.ONE; for (int i = 1; i < moves.size(); ++i) { Move c = moves.get(i); c.realprob = c.prob.multiply(seqin.get(c.iset()).realprob); } }*/ // TODO: not as fast as pre-assigning based on sorted move list (see above) private Rational realprob(Move c) { Rational prob = Rational.ONE; while (c != null) { prob = prob.multiply(behvprob(c)); c = seqin.get(c.iset()); } return prob; } private void genseqin(ExtensiveForm tree) throws ImperfectRecallException { Random prng = null; if (_seed != null) prng = new Random(_seed); recgenseqin(tree.root(), prng); } private void recgenseqin(Node node, Random prng) throws ImperfectRecallException { Map<Player,Move> defseqMap = new HashMap<Player,Move>(); defseq.put(node, defseqMap); // update sequence triple, new only for move leading to u for (Player pl = firstPlayer; pl != null; pl = pl.next) { if (node.reachedby == null) { defseqMap.put(pl, null); } else if (node.reachedby.iset().player() == pl) { defseqMap.put(pl, node.reachedby); } else { defseqMap.put(pl, defseq.get(node.parent()).get(pl)); } } if (node.reachedby == null) { defseqMap.put(Player.CHANCE, null); } else if (node.reachedby.iset().player() == Player.CHANCE) { defseqMap.put(Player.CHANCE, node.reachedby); } else { defseqMap.put(Player.CHANCE, defseq.get(node.parent()).get(Player.CHANCE)); } // update sequence for iset, check perfect recall, recurse on children Iset h = node.iset(); if (h != null) { addIset(h, prng); Move seq = defseqMap.get(h.player()); Move hseqin = this.seqin.get(h); if (hseqin == null) { seqin.put(h, seq); } else if (seq != hseqin) { String errorMsg = String.format( "imperfect recall in info set no. %d named %s for player %s [different sequences no. %d, %d]", h.uid(), h.name(), h.player(), seq.setIdx(), hseqin.setIdx()); log.warning(errorMsg); throw new ImperfectRecallException(errorMsg); } for (Node child = node.firstChild(); child != null; child = child.sibling()) { recgenseqin(child, prng); } } } private void addIset(Iset h, Random prng) { if (h != null && !isets.contains(h)) { isets.add(h); assignPriors(h, prng); // TODO: do this at LCP gen time so we can reuse this obj for multi-priors Player pl = h.player(); List<Iset> plIsets = isetsMap.get(pl); if (plIsets == null) { plIsets = new ArrayList<Iset>(); isetsMap.put(pl, plIsets); } isetsIdxMap.put(h, plIsets.size()); plIsets.add(h); List<Move> plMoves = seqsMap.get(pl); for (Node child = h.firstNode().firstChild(); child != null; child = child.sibling()) { seqsIdxMap.put(child.reachedby, plMoves.size()); plMoves.add(child.reachedby); } } } private Map<Player,Rational> getPayAdjust(ExtensiveForm tree) { Map<Player,Rational> maxpay = new HashMap<Player,Rational>(); for (Node leaf = tree.firstLeaf(); leaf != null; leaf = leaf.nextLeaf()) { Outcome z = leaf.outcome; for (Player pl = firstPlayer; pl != null; pl = pl.next) { if (!maxpay.containsKey(pl) || z.pay(pl).compareTo(maxpay.get(pl)) > 0) { maxpay.put(pl, z.pay(pl)); } } } for (Player pl = firstPlayer; pl != null; pl = pl.next) { log.info(String.format( "Player %s's maximum payoff is %s, normalize to -1.", pl.toString(), maxpay.get(pl).toString())); maxpay.put(pl, (maxpay.get(pl).add(1)).negate()); } return maxpay; } private void allocsf() { /* payoff matrices, two players only here, init to pay 0 */ for (Player pl = firstPlayer; pl != null; pl = pl.next) { payoffs.put(pl, new Rational[nseqs(firstPlayer)][nseqs(firstPlayer.next)]); for (int i = 0; i < nseqs(firstPlayer); i++) for (int j = 0; j < nseqs(firstPlayer.next); j++) payoffs.get(pl)[i][j] = Rational.ZERO; constraintsMap.put(pl, new Integer[nisets(pl) + 1][nseqs(pl)]); /* extra row for seq 0 */ } } private void assignPriors(Iset h, Random prng) { Rational probToGive = Rational.ONE; int nNeedProb = 0; for (Node child = h.firstNode().firstChild(); child != null; child = child.sibling()) { if (child.reachedby.prob == null) { ++nNeedProb; } else { probToGive = probToGive.subtract(child.reachedby.prob); if (probToGive.compareTo(0) < 0) { child.reachedby.prob = child.reachedby.prob.add(probToGive); probToGive = Rational.ZERO; } } } if (nNeedProb > 0) { if (prng != null) { Rational[] probs = Rational.probVector(nNeedProb, prng); int i = 0; for (Node child = h.firstNode().firstChild(); child != null; child = child.sibling()) { if (child.reachedby.prob == null) { randomPriors.put(child.reachedby, probToGive.multiply(probs[i])); ++i; } } } else { Rational prob = probToGive.divide(Rational.valueOf(nNeedProb)); for (Node child = h.firstNode().firstChild(); child != null; child = child.sibling()) { if (child.reachedby.prob == null) { randomPriors.put(child.reachedby, prob); } } } } } private Rational behvprob(Move c) { if (c.prob != null) { return c.prob; } else { return randomPriors.get(c); } } @Override public String toString() { // TODO: add matrices StringWriter output = new StringWriter(); ColumnTextWriter colpp = new ColumnTextWriter(); for (Player pl = firstPlayer; pl != null; pl = pl.next) { Rational[][] mat = payoffs.get(pl); colpp.writeCol(pl.toString()); for (int j = 0; j < nseqs(firstPlayer.next); ++j) { Move colMove = seqsMap.get(firstPlayer.next).get(j); colpp.writeCol(colMove == null ? "\u00D8" : colMove.toString()); } if (pl == firstPlayer) { for (int j = 0; j < nisets(firstPlayer); ++j) { Iset h = isetsMap.get(firstPlayer).get(j); Move hseqin = seqin.get(h); colpp.writeCol(hseqin == null ? "\u00D8" : hseqin.toString()); } } colpp.endRow(); for (int i = 0; i < mat.length; ++i) { Move rowMove = seqsMap.get(firstPlayer).get(i); colpp.writeCol(rowMove == null ? "\u00D8" : rowMove.toString()); for (int j = 0; j < mat[i].length; ++j) { Rational pay = mat[i][j]; colpp.writeCol(pay.isZero() ? "." : pay.toString()); } if (pl == firstPlayer) { for (int j = 0; j < nisets(firstPlayer); ++j) { Integer cstr = constraintsMap.get(firstPlayer)[j + 1][i]; colpp.writeCol(cstr == 0 ? "." : cstr.toString()); } } colpp.endRow(); } if (pl == firstPlayer.next) { for (int i = 0; i < nisets(firstPlayer.next); ++i) { Iset h = isetsMap.get(firstPlayer.next).get(i); Move hseqin = seqin.get(h); colpp.writeCol(hseqin == null ? "\u00D8" : hseqin.toString()); for (int j = 0; j < nseqs(firstPlayer.next); ++j) { Integer cstr = constraintsMap.get(firstPlayer.next)[i + 1][j]; colpp.writeCol(cstr == 0 ? "." : cstr.toString()); } colpp.endRow(); } } colpp.endRow(); } output.write(colpp.toString()); colpp = new ColumnTextWriter(); colpp.writeCol("Priors"); colpp.endRow(); if (_seed != null) { colpp.writeCol("seed"); colpp.writeCol(_seed.toString()); colpp.endRow(); colpp.endRow(); } for (int i = 1; i < nseqs(firstPlayer); ++i) { Move c = seqsMap.get(firstPlayer).get(i); Rational.printRow(c.toString(), behvprob(c), colpp, false); } colpp.endRow(); for (int j = 1; j < nseqs(firstPlayer.next); ++j) { Move c = seqsMap.get(firstPlayer.next).get(j); Rational.printRow(c.toString(), behvprob(c), colpp, false); } colpp.alignLeft(0); output.write(colpp.toString()); return output.toString(); } public LCP getLemkeLCP() throws InvalidPlayerException { if (firstPlayer == null || firstPlayer.next == null || firstPlayer.next.next != null) { throw new InvalidPlayerException("Sequence Form must have two and only two players"); } // preprocess priors here so that we can re-randomize the priors without having to reconstruct this object? //for (Player pl = firstPlayer; pl != null; pl = pl.next) { // behavtorealprob(pl); //} LCP lcp = new LCP(nseqs(1) + nisets(2) + 1 + nseqs(2) + nisets(1) + 1); Integer[][] constraints1 = constraintsMap.get(firstPlayer); Integer[][] constraints2 = constraintsMap.get(firstPlayer.next); Rational[][] pay1 = payoffs.get(firstPlayer); Rational[][] pay2 = payoffs.get(firstPlayer.next); /* fill M */ /* -A */ //lcp.payratmatcpy(pay[0], true, false, nseqs(1), nseqs(2), 0, nseqs(1) + nisets(2) + 1); for (int i = 0; i < pay1.length; ++i) { for (int j = 0; j < pay1[i].length; ++j) { Rational value = pay1[i][j].negate(); lcp.setM(i, j + nseqs(1) + nisets(2) + 1, value); } } /* -E\T */ //lcp.intratmatcpy(constraints[1], true, true, nisets(1) + 1, nseqs(1), 0, nseqs(1) + nisets(2) + 1 + nseqs(2)); for (int i = 0; i < constraints1.length; ++i) { for (int j = 0; j < constraints1[i].length; ++j) { Rational value = Rational.valueOf(-constraints1[i][j]); lcp.setM(j, i + nseqs(1) + nisets(2) + 1 + nseqs(2), value); } } /* F */ //lcp.intratmatcpy(constraints[2], false, false, nisets(2) + 1, nseqs(2), nseqs(1), nseqs(1) + nisets(2) + 1); for (int i = 0; i < constraints2.length; ++i) { for (int j = 0; j < constraints2[i].length; ++j) { Rational value = Rational.valueOf(constraints2[i][j]); lcp.setM(i + nseqs(1), j + nseqs(1) + nisets(2) + 1, value); } } /* -B\T */ //lcp.payratmatcpy(pay[1], true, true, nseqs(1), nseqs(2), nseqs(1) + nisets(2) + 1, 0); for (int i = 0; i < pay2.length; ++i) { for (int j = 0; j < pay2[i].length; ++j) { Rational value = pay2[i][j].negate(); lcp.setM(j + nseqs(1) + nisets(2) + 1, i, value); } } /* -F\T */ //lcp.intratmatcpy(constraints[2], true, true, nisets(2) + 1, nseqs(2), nseqs(1) + nisets(2) + 1, nseqs(1)); for (int i = 0; i < constraints2.length; ++i) { for (int j = 0; j < constraints2[i].length; ++j) { Rational value = Rational.valueOf(-constraints2[i][j]); lcp.setM(j + nseqs(1) + nisets(2) + 1, i + nseqs(1), value); } } /* E */ //lcp.intratmatcpy(constraints[1], false, false, nisets(1) + 1, nseqs(1), nseqs(1) + nisets(2) + 1 + nseqs(2), 0); for (int i = 0; i < constraints1.length; ++i) { for (int j = 0; j < constraints1[i].length; ++j) { Rational value = Rational.valueOf(constraints1[i][j]); lcp.setM(i + nseqs(1) + nisets(2) + 1 + nseqs(2), j, value); } } /* define RHS q, using special shape of SF constraints RHS e,f */ lcp.setq(nseqs(1), Rational.NEGONE); lcp.setq(nseqs(1) + nisets(2) + 1 + nseqs(2), Rational.NEGONE); return addCoveringVector(lcp); } private LCP addCoveringVector(LCP lcp) { // this is where priors come into play... int dim1 = nseqs(1); int dim2 = nseqs(2); int offset = dim1 + 1 + nisets(2); /* covering vector = -rhsq */ for (int i = 0; i < lcp.size(); i++) { lcp.setd(i, lcp.q(i).negate()); } /* first blockrow += -Aq */ for (int j = 0; j < dim2; j++) { Rational prob = realprob(seqsMap.get(firstPlayer.next).get(j)); if (!prob.isZero()) { for (int i = 0; i < dim1; i++) { lcp.setd(i, lcp.d(i).add(lcp.M(i, offset + j).multiply(prob))); } } } /* third blockrow += -B\T p */ for (int j = 0; j < dim1; j++) { Rational prob = realprob(seqsMap.get(firstPlayer).get(j)); if (!prob.isZero()) { for (int i = offset; i < offset + dim2; i++) { lcp.setd(i, lcp.d(i).add(lcp.M(i, j).multiply(prob))); } } } return lcp; } public Map<Player,Map<Move,Rational>> parseLemkeSolution(Rational[] solz) { Map<Player,Map<Move,Rational>> probs = new HashMap<Player,Map<Move,Rational>>(); int offset = nseqs(firstPlayer) + 1 + nisets(firstPlayer.next); Rational[] probs1 = new Rational[nseqs(firstPlayer)]; System.arraycopy(solz, 0, probs1, 0, probs1.length); Map<Move,Rational> moves1 = createMoveMap(probs1, firstPlayer); // how to find expected payoffs... traverse the tree after? probs.put(firstPlayer, moves1); Rational[] probs2 = new Rational[nseqs(firstPlayer.next)]; System.arraycopy(solz, offset, probs2, 0, probs2.length); Map<Move,Rational> moves2 = createMoveMap(probs2, firstPlayer.next); probs.put(firstPlayer.next, moves2); //log.info("returning probs"); return probs; } // these are realization probabilities, not behavior probs... // need to convert back... private Map<Move,Rational> createMoveMap(Rational[] probs, Player pl) { Map<Move,Rational> moves = new HashMap<Move,Rational>(); for (int i = 1; i < probs.length; ++i) { if (!probs[i].isZero()) { Move c = seqsMap.get(pl).get(i); Rational baseProb = Rational.ONE; if (seqin.get(c.iset()) != null) { baseProb = probs[seqsIdxMap.get(seqin.get(c.iset()))]; } Rational behvProb = probs[i].divide(baseProb); log.fine("move " + c.toString() + " with prob " + behvProb.toString()); moves.put(c, behvProb); } } return moves; } private int nseqs(Player pl) { return seqsMap.get(pl).size(); } private int nisets(Player pl) { if (isetsMap.containsKey(pl)) { return isetsMap.get(pl).size(); } else { return 0; } } private int nseqs(int plIdx) { return nseqs(player(plIdx)); } private int nisets(int plIdx) { return nisets(player(plIdx)); } private Player player(int idx) { return idx == 1 ? firstPlayer : firstPlayer.next; } public static class InvalidPlayerException extends Exception { private static final long serialVersionUID = 1L; public InvalidPlayerException(String msg) { super(msg); } } public static class ImperfectRecallException extends Exception { private static final long serialVersionUID = 1L; public ImperfectRecallException(String msg) { super(msg); } } public static Map<Player,Rational> expectedPayoffs(Map<Player,Map<Move,Rational>> equilib, ExtensiveForm tree) { Map<Player,Rational> epayoffs = new HashMap<Player,Rational>(); recExpectedPayoffs(tree.root(), Rational.ONE, equilib, epayoffs); //log.info("returning payoffs"); return epayoffs; } private static void recExpectedPayoffs(Node node, Rational prob, Map<Player, Map<Move, Rational>> equilib, Map<Player, Rational> epayoffs) { if (node.outcome != null) { for (Player pl : node.outcome.players()){ Rational payoff = epayoffs.get(pl); Rational fromThisOutcome = node.outcome.pay(pl).multiply(prob); if (payoff == null) { payoff = fromThisOutcome; } else { payoff = payoff.add(fromThisOutcome); } epayoffs.put(pl, payoff); } } else { Player pl = node.iset().player(); // go through child nodes and recurse on moves that exist for the current player // with positive probability for (Node child = node.firstChild(); child != null; child = child.sibling()) { if (pl == Player.CHANCE) { recExpectedPayoffs(child, prob.multiply(child.reachedby.prob), equilib, epayoffs); } else if (equilib.get(pl).containsKey(child.reachedby)) { recExpectedPayoffs(child, prob.multiply(equilib.get(pl).get(child.reachedby)), equilib, epayoffs); } } } } }
22,376
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
Move.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/tree/Move.java
package lse.math.games.tree; import lse.math.games.Rational; public class Move { private int _uid; private Iset _iset; // where this move emanates from Move(int uid) { _uid = uid; } Move(int uid, Rational prob) { this(uid); this.prob = prob; } /* idx in the iset's move array */ public int setIdx() { if (_iset == null) return -1; int idx = 0; for (Node child = _iset.firstNode().firstChild(); child != null; child = child.sibling()) { if (child.reachedby == this) { break; } ++idx; } return idx; } public Rational prob = null; /* behavior probability */ private String _label; public void setLabel(String value) { _label = value; } public int uid() { return _uid; } public Iset iset() { return _iset; } public void setIset(Iset iset) { _iset = iset; } @Override public String toString() { if (_label != null) { return _label; } else if (prob != null && _iset.player() == Player.CHANCE) { return String.format("%s(%s)", Player.CHANCE_NAME, prob.toString()); } int setIdx = setIdx(); if (setIdx < 0) return "()"; return String.format("%s%d", _iset.name(), setIdx); //index in the parent iset array } }
1,438
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
Iset.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/tree/Iset.java
package lse.math.games.tree; public class Iset { private Iset _next; private Node _firstNode; private Node _lastNode; private int _uid; Iset(int uid, Player player) { _uid = uid; _player = player; } private Player _player; private String _name; public Move[] moves; public String name() { if (_name != null) return _name; else return String.valueOf(_uid); } public int uid() { return _uid; } public void setName(String value) { _name = value; } public Iset next() { return _next; } public Node firstNode() { return _firstNode; } void setNext(Iset h) { _next = h; } public void setPlayer(Player player) { _player = player; } public Player player() { return _player; } public void sort() { // TODO Auto-generated method stub throw new RuntimeException("Not impl"); } public int nmoves() { int count = 0; for (Node child = _firstNode.firstChild(); child != null; child = child.sibling()) { ++count; } return count; } void insertNode(Node node) { if (_firstNode == null) { _firstNode = node; } if (_lastNode != null) { _lastNode.nextInIset = node; } node.nextInIset = null; _lastNode = node; } public String toString() { return name(); } }
1,442
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
Outcome.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/tree/Outcome.java
package lse.math.games.tree; import java.util.HashMap; import java.util.Map; import java.util.Set; import lse.math.games.Rational; public class Outcome { private Node node; private Map<Player,Rational> pay; private Map<Player,String> parameter; private int _uid; Outcome(int uid, Node wrapNode) { _uid = uid; this.node = wrapNode; wrapNode.terminal = true; wrapNode.outcome = this; pay = new HashMap<Player,Rational>(); parameter = new HashMap<Player,String>(); } public int uid() { return _uid; } public Node whichnode() { return node; } public int idx; public Set<Player> players() { return pay.keySet(); } public Rational pay(Player pl) { return pay.get(pl); } public void setPay(Player pl, Rational value) { pay.put(pl, value); } public String parameter(Player pl) { return parameter.get(pl); } public void setParameter(Player pl, String value) { parameter.put(pl, value); } @Override public String toString() { return String.valueOf(_uid); } }
1,224
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
ExtensiveFormXMLReader.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/io/ExtensiveFormXMLReader.java
package lse.math.games.io; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.logging.Logger; import org.w3c.dom.Document; //import org.w3c.dom.Node; import lse.math.games.Rational; import lse.math.games.tree.ExtensiveForm; import lse.math.games.tree.Outcome; import lse.math.games.tree.Node; import lse.math.games.tree.Iset; import lse.math.games.tree.Move; import lse.math.games.tree.Player; public class ExtensiveFormXMLReader { private static final Logger log = Logger.getLogger(ExtensiveFormXMLReader.class.getName()); private Map<String,Node> nodes; private Map<String,Iset> isets; private List<Iset> singletons; private Map<String,Move> moves; private Map<String,Player> players; //private Document xml = null; private ExtensiveForm tree = null; public ExtensiveFormXMLReader() {} public ExtensiveForm load(Document xml) { //this.xml = xml; tree = new ExtensiveForm(); nodes = new HashMap<String,Node>(); isets = new HashMap<String,Iset>(); singletons = new ArrayList<Iset>(); moves = new HashMap<String,Move>(); players = new HashMap<String,Player>(); org.w3c.dom.Node root = xml.getFirstChild(); if ("extensiveForm".equals(xml.getFirstChild().getNodeName())) { for (org.w3c.dom.Node child = root.getFirstChild(); child != null; child = child.getNextSibling()) { if ("iset".equals(child.getNodeName())) { processIset(child); } else if ("node".equals(child.getNodeName())) { processNode(child, null); } else if ("outcome".equals(child.getNodeName())) { processOutcome(child, null); } else { log.warning("Ignoring unknown element:\r\n" + child); } } hookupAndVerifyMoves(); } else { log.warning("Unregonized root elem" + xml.getFirstChild()); } log.info(tree.toString()); return tree; } //TODO: there has got to be a more efficient algorithm private void hookupAndVerifyMoves() { for (Iset iset = tree.root().iset(); iset != null; iset = iset.next()) { //iset.sort(); //for each child of the first node, hook up move log.fine("hooking up moves for iset " + iset.uid()); Node baseline = iset.firstNode(); int childIdx = 0; for (Node baselineChild = baseline.firstChild(); baselineChild != null; baselineChild = baselineChild.sibling()) { baselineChild.reachedby.setIset(iset); log.fine("assigning move " + baselineChild.reachedby + " to iset " + iset.uid() + " at " + childIdx); // make sure all the rest of the nodes have the child with the same move // TODO: it does not necessarily need to be at the same index for (Node baselineMate = baseline.nextInIset; baselineMate != null; baselineMate = baselineMate.nextInIset) { Node mateChild = baselineMate.firstChild(); for (int i = 0; i < childIdx; ++i) { mateChild = mateChild.sibling(); if (mateChild == null) { String msg = "not enough children"; log.severe(msg); throw new RuntimeException(msg); } } if (baselineChild.sibling() == null && mateChild.sibling() != null) { String msg = "too many children"; log.severe(msg); throw new RuntimeException(msg); } if (mateChild.reachedby != baselineChild.reachedby) { if (mateChild.reachedby == null) { String msg = "node does not contain an incoming move"; log.severe(msg); //throw new RuntimeException(msg); } else { String msg = "Iset " + iset.uid() + " is inconsistent for node " + baselineMate.uid() /*+ " at " + baselineMate.setIdx*/ + " for child " + mateChild.uid() + " at " + childIdx + " with move " + mateChild.reachedby; log.severe(msg); //throw new RuntimeException(msg); } mateChild.reachedby = baselineChild.reachedby; } } ++childIdx; } } } private Player getPlayer(String playerId) { if (Player.CHANCE_NAME.equals(playerId)) { return Player.CHANCE; } Player player = players.get(playerId); if (player == null) { player = tree.createPlayer(playerId); players.put(playerId, player); } return player; } private void processIset(org.w3c.dom.Node elem) { String id = getAttribute(elem, "id"); Iset iset = isets.get(id); if (iset == null) { String playerId = getAttribute(elem, "player"); Player player = (playerId != null) ? getPlayer(playerId) : Player.CHANCE; iset = tree.createIset(id, player); isets.put(id, iset); } for (org.w3c.dom.Node child = elem.getFirstChild(); child != null; child = child.getNextSibling()) { if ("node".equals(child.getNodeName())) { processNode(child, null); } else { log.warning("Ignoring unknown element:\r\n" + child); } } } private void processNode(org.w3c.dom.Node elem, Node parentNode) { //init Node node = null; //lookup parent if not passed in String parentId = getAttribute(elem, "parent"); if (parentNode == null && parentId != null) { parentNode = nodes.get(parentId); if (parentNode == null) { log.fine("XMLReader: creating parent node " + parentId); parentNode = tree.createNode(); nodes.put(parentId, parentNode); } } String id = getAttribute(elem, "id"); if (id != null) { node = nodes.get(id); if (node == null) { if (parentNode != null) { log.fine("XMLReader: creating new node " + id); node = tree.createNode(); } else { log.fine("XMLReader: No parent... assuming root is node " + id); node = tree.root(); } nodes.put(id, node); } else { log.fine("XMLReader: processing previously created node " + id); } } else { if (parentNode != null) { log.fine("XMLReader: creating new node"); node = tree.createNode(); } else { log.fine("XMLReader: No parent... assuming this is the root"); node = tree.root(); } } if (parentNode != null) { log.fine("XMLReader: processing child of " + parentNode.uid()); parentNode.addChild(node); } // process iset // if parent is an iset use that // if iset ref exists use that (make sure player is not also set) // if player exists create a new iset for that (don't add to dictionary) // else throw an error String isetId = getAttribute(elem, "iset"); if (elem.getParentNode() != null && "iset".equals(elem.getParentNode().getNodeName())) { if (isetId != null) { log.warning("Warning: @iset attribute is set for a node nested in an iset tag. Ignored."); } isetId = getAttribute(elem.getParentNode(), "id"); } String playerId = getAttribute(elem, "player"); Player player = (playerId != null) ? getPlayer(playerId) : Player.CHANCE; Iset iset = null; if (isetId == null) { iset = tree.createIset(player); singletons.add(iset); // root is already taken care of } else { //if (elem.@player != undefined) trace("Warning: @player attribute is set for a node that references an iset. Ignored."); //look it up in the map, if it doesn't exist create it and add it iset = isets.get(isetId); if (iset == null) { iset = tree.createIset(isetId, player); isets.put(isetId, iset); } else { if (player != Player.CHANCE) { if (iset.player() != Player.CHANCE && player != iset.player()) { log.warning("Warning: @player attribute conflicts with earlier iset player assignment. Ignored."); } iset.setPlayer(player); } } } tree.addToIset(node, iset); // set up the moves processMove(elem, node, parentNode); /* String moveId = getAttribute(elem, "move"); if (moveId != null) { String moveIsetId = parentNode.iset() != null ? parentNode.iset().name() : ""; Move move = moves.get(moveIsetId + "::" + moveId); if (move == null) { move = tree.createMove(moveId); moves.put(moveIsetId + "::" + moveId, move); } node.reachedby = move; } else if (parentNode != null) { // assume this comes from a chance node node.reachedby = tree.createMove(); log.fine("Node " + id + " has a parent, but no incoming probability or move is specified"); } String probStr = getAttribute(elem, "prob"); if (probStr != null && node.reachedby != null) { node.reachedby.prob = Rational.valueOf(probStr); } else if (node.reachedby != null) { log.fine("Warning: @move is missing probability. Prior belief OR chance will be random."); } */ log.fine("node: " + id + ", iset: " + isetId + ", pl: " + (getAttribute(elem, "player") == null ? getAttribute(elem.getParentNode(), "player") : getAttribute(elem, "player")) + (node.reachedby != null ? ", mv: " + node.uid() : "")); for (org.w3c.dom.Node child = elem.getFirstChild(); child != null; child = child.getNextSibling()) { if ("node".equals(child.getNodeName())) { processNode(child, node); } else if ("outcome".equals(child.getNodeName())) { processOutcome(child, node); } else { log.warning("Ignoring unknown element:\r\n" + child); } } } private void processOutcome(org.w3c.dom.Node elem, Node parent) { // Create wrapping node // get parent from dictionary... if it doesn't exist then the outcome must be the root Node wrapNode = parent != null ? tree.createNode() : tree.root(); if (parent != null) parent.addChild(wrapNode); processMove(elem, wrapNode, parent); /* String moveId = getAttribute(elem, "move"); if (moveId != null) { String moveIsetId = (parent != null && parent.iset() != null) ? parent.iset().name() : ""; Move move = moveId != null ? moves.get(moveIsetId + "::" + moveId) : null; if (move == null && moveId != null) { move = tree.createMove(moveId); moves.put(moveIsetId + "::" + moveId, move); } wrapNode.reachedby = move; } else if (parent != null) { wrapNode.reachedby = tree.createMove(); log.fine("Node " + wrapNode.uid() + " has a parent, but no incoming probability or move is specified"); } String probStr = getAttribute(elem, "prob"); if (probStr != null && wrapNode.reachedby != null) { wrapNode.reachedby.prob = Rational.valueOf(probStr); } else if (wrapNode.reachedby != null) { log.fine("Warning: @move is missing probability. Prior belief OR chance will be random."); } */ Outcome outcome = tree.createOutcome(wrapNode); for (org.w3c.dom.Node child = elem.getFirstChild(); child != null; child = child.getNextSibling()) { if ("payoff".equals(child.getNodeName())) { String playerId = getAttribute(child, "player"); Rational payoff = Rational.valueOf(getAttribute(child, "value")); Player player = players.get(playerId); if (player == null) { player = tree.createPlayer(playerId); players.put(playerId, player); } outcome.setPay(player, payoff); } else if ("parameter".equals(child.getNodeName())) { String playerId = getAttribute(child, "player"); String parameter = getAttribute(child, "value"); Player player = players.get(playerId); if (player == null) { player = tree.createPlayer(playerId); players.put(playerId, player); } outcome.setParameter(player, parameter); } else { log.warning("Ignoring unknown element:\r\n" + child); } } log.fine("outcome: " + wrapNode + ", by move: " + (wrapNode.reachedby != null ? wrapNode.reachedby.uid() : "null")); } private void processMove(org.w3c.dom.Node elem, Node node, Node parentNode) { String moveId = getAttribute(elem, "move"); if (moveId != null) { String moveIsetId = parentNode.iset() != null ? parentNode.iset().name() : ""; Move move = moves.get(moveIsetId + "::" + moveId); if (move == null) { move = tree.createMove(moveId); moves.put(moveIsetId + "::" + moveId, move); } node.reachedby = move; } else if (parentNode != null) { // assume this comes from a chance node node.reachedby = tree.createMove(); log.fine("Node has a parent, but no incoming probability or move is specified"); } String probStr = getAttribute(elem, "prob"); if (probStr != null && node.reachedby != null) { node.reachedby.prob = Rational.valueOf(probStr); } else if (node.reachedby != null) { log.fine("Warning: @move is missing probability. Prior belief OR chance will be random."); } } private String getAttribute(org.w3c.dom.Node elem, String key) { String value = null; if (elem != null && elem.getAttributes().getNamedItem(key) != null) { value = elem.getAttributes().getNamedItem(key).getNodeValue(); } return value; } }
13,029
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
LemkeWriter.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/io/LemkeWriter.java
package lse.math.games.io; import java.io.PrintWriter; import lse.math.games.lcp.LexicographicMethod; import lse.math.games.lcp.Tableau; import lse.math.games.lcp.TableauVariables; import lse.math.games.lcp.LCP; public class LemkeWriter { private ColumnTextWriter colpp = new ColumnTextWriter(); private PrintWriter output; public LemkeWriter(PrintWriter output) { this.output = output; } public void RayTerminationDump(int enter, Tableau A, LCP start) { output.println(String.format("Ray termination when trying to enter %s", A.vars().toString(enter))); output.println("Starting LCP:"); output.println(start.toString()); output.println("Final Tableau:"); output.println(A.toString()); output.println("Current basis, not an LCP solution:"); WriteSolution(A); } /* output the current basic solution */ public void WriteSolution(Tableau A) { WriteSolution("", A); } public void WriteSolution(String message, Tableau A) { colpp.writeCol("basis="); for (int i = 0; i <= A.vars().size(); i++) /* num Z plus z0 */ { String s; if (A.vars().isBasic(A.vars().z(i))) /* Z(i) is a basic variable */ s = A.vars().toString(A.vars().z(i)); else if (i > 0 && A.vars().isBasic(A.vars().w(i))) /* W(i) is a basic variable, W(0) not valid */ s = A.vars().toString(A.vars().w(i)); else s = " "; colpp.writeCol(s); } colpp.endRow(); colpp.writeCol("z="); for (int i = 0; i <= A.vars().size(); i++) { int var = A.vars().z(i); colpp.writeCol(A.result(var).toString()); /* value of Z(i) */ } colpp.endRow(); colpp.writeCol("w="); colpp.writeCol(""); /* for complementarity in place of W(0) */ for (int i = 1; i <= A.vars().size(); i++) { int var = A.vars().w(i); colpp.writeCol(A.result(var).toString()); /* value of W(i) */ } /* end of for (i=...) */ output.write(colpp.toString()); } /* end of outsol */ /* output statistics of minimum ratio test */ public void WriteLexStats(LexicographicMethod lex) { int[] lextested = lex.tested; int[] lexcomparisons = lex.comparisons; colpp.writeCol("lex-column"); colpp.alignLeft(); for (int i = 0; i < lextested.length; i++) colpp.writeCol(i); colpp.endRow(); colpp.writeCol("times tested"); for (int i = 0; i < lextested.length; i++) colpp.writeCol(lextested[i]); colpp.writeCol("% times tested"); if (lextested[0] > 0) { colpp.writeCol("100"); for (int i = 1; i < lextested.length; i++) { String s = String.format("%2.0", (double)lextested[i] * 100.0 / (double)lextested[0]); //"%2.0f" colpp.writeCol(s); } } else colpp.endRow(); colpp.writeCol("avg comparisons"); for (int i = 0; i < lextested.length; i++) { if (lextested[i] > 0) { String s = String.format("%1.1f", (double)lexcomparisons[i] / (double)lextested[i]); //"%1.1f" colpp.writeCol(s); } else { colpp.writeCol("-"); } } output.write(colpp.toString()); } /* leave, enter in VARS. Documents the current pivot. */ /* Asserts leave is basic and enter is cobasic. */ public void WritePivot(int leave, int enter, TableauVariables vars) { output.print(String.format("leaving: %-4s ", vars.toString(leave))); output.println(String.format("entering: %s", vars.toString(enter))); } }
4,417
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
BriefLogFormatter.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/io/BriefLogFormatter.java
package lse.math.games.io; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Formatter; import java.util.logging.LogRecord; public class BriefLogFormatter extends Formatter { private static final DateFormat format = new SimpleDateFormat("h:mm:ss"); private static final String lineSep = System.getProperty("line.separator"); public String format(LogRecord record) { String loggerName = record.getLoggerName(); if(loggerName == null) { loggerName = "root"; } StringBuilder output = new StringBuilder() .append(loggerName) .append("[") .append(record.getLevel()).append('|') //.append(Thread.currentThread().getName()).append('|') .append(format.format(new Date(record.getMillis()))) .append("]:") .append(record.getMessage().indexOf(lineSep) >= 0 ? lineSep : " ") .append(record.getMessage()) .append(lineSep); return output.toString(); } }
985
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
ColumnTextWriter.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/io/ColumnTextWriter.java
package lse.math.games.io; import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.StringWriter; import java.io.Writer; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; public class ColumnTextWriter { private static final String newline = System.getProperty("line.separator"); /* contains in succession all strings generated by colpr * Each array is one row (ended by using newRow()) * Does not include current active row (currline) */ private List<List<String>> buf = new ArrayList<List<String>>(); private int ncols = 0; /* max number of columns */ private List<Integer> colwidth = new ArrayList<Integer>(); /* [0..ncols-1] output widths */ private List<Integer> widthsign = new ArrayList<Integer>(); /* -1 for left, 1 for right alignment */ private int currcol = 0; private List<String> currline = new ArrayList<String>(); private String clean = null; /*private void reset() { buf.clear(); ncols = 0; colwidth.clear(); widthsign.clear(); currcol = 0; currline.clear(); }*/ public void writeCol(int i) { writeCol(String.valueOf(i)); } /* making column c in 0..ncols-1 left-adjusted */ public void alignLeft(int c) { clean = null; widthsign.set(c, -1); } /* making next column written to left-adjusted */ public void alignLeft() { if (currcol == 0) return; alignLeft(currcol - 1); } public void alignRight(int c) { clean = null; widthsign.set(c, 1); } public void alignRight() { alignRight(currcol); } private void printRow(StringWriter output, List<String> s) { for (int j = 0; j < s.size(); j++) { int width = colwidth.get(j) * widthsign.get(j); if (width != 0) { String format = String.format("%%%ds", width); output.write(String.format(format, s.get(j))); if (j < s.size() - 1) /* avoid trailing blanks in line */ output.write(" "); /* more sophisticated spacing possible */ } else { //System.out.println("column " + j + " is width 0"); } } } private void print(StringWriter output) { for (List<String> line : buf) { printRow(output, line); output.write(newline); } printRow(output, currline); //Do we want a newline here? //reset(); } public String toString() { if (clean == null) { StringWriter output = new StringWriter(); print(output); clean = output.toString(); } return clean; } public void writeCol(String s) { clean = null; int w = s.length(); if (currcol == colwidth.size()) { colwidth.add(w); widthsign.add(1); } else if (colwidth.get(currcol) < w) { colwidth.set(currcol, w); } currline.add(s); ++currcol; } public void endRow() { clean = null; buf.add(currline); currcol = 0; currline = new ArrayList<String>(ncols); } public void sortBy(final int col, final int fromRow) { clean = null; List<List<String>> subBuf = buf.subList(fromRow, buf.size()); buf = buf.subList(0, fromRow); Collections.sort(subBuf, new Comparator<List<String>>() { public int compare(List<String> a, List<String> b) { String aStr = a.get(col); String bStr = b.get(col); try { return Integer.valueOf(aStr).compareTo(Integer.valueOf(bStr)); } catch (NumberFormatException ex) { return aStr.compareTo(bStr); } } }); buf.addAll(subBuf); } // old style static methods private static final ColumnTextWriter instance = new ColumnTextWriter(); private static final Writer sysout = new BufferedWriter(new OutputStreamWriter(System.out)); public static void colpr(String s) { instance.writeCol(s); } public static void colipr(int i) { instance.writeCol(i); } public static void colnl() { instance.endRow(); } public static void colleft(int n) { instance.alignLeft(n); } public static void colout() throws IOException { sysout.write(instance.toString()); } public static void colout(Writer output) throws IOException { output.write(instance.toString()); } }
5,009
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
Tableau.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/lcp/Tableau.java
package lse.math.games.lcp; import java.math.BigInteger; import lse.math.games.BigIntegerUtils; import lse.math.games.Rational; import lse.math.games.io.ColumnTextWriter; import static lse.math.games.Rational.*; // TODO: try to keep all row/col logic encapsulated. // Users deal just with vars // TODO: decouple the LCP specifics // TODO: better constructor, make sure scalefactors are correct public class Tableau { private BigInteger[][] A; private int ncols; private int nrows; private BigInteger det; /* determinant */ /* scale factors for variables z * scfa[Z(0)] for d, scfa[RHS] for q * scfa[Z(1..n)] for cols of M * result variables to be multiplied with these */ private BigInteger[] scfa; /* v in VARS, v cobasic: TABCOL(v) is v's tableau col */ /* v basic: TABCOL(v) < 0, TABCOL(v)+n is v's row */ private TableauVariables vars; public int RHS() { return ncols - 1; } /* q-column of tableau */ public TableauVariables vars() { return vars; } //region Init /* VARS = 0..2n = Z(0) .. Z(n) W(1) .. W(n) */ /* ROWCOL = 0..2n, 0 .. n-1: tabl rows (basic vars) */ /* n .. 2n: tabl cols 0..n (cobasic) */ public Tableau(int sizeBasis) { this.nrows = sizeBasis; this.ncols = sizeBasis + 2; A = new BigInteger[nrows][ncols]; scfa = new BigInteger[ncols]; vars = new TableauVariables(nrows); det = BigInteger.valueOf(-1); // TODO: how do I know this? Specific to LCP? } /* fill tableau from M, q, d */ /* TODO: decouple Tableau from LCP... have LCP return the Tableau * constructor for Tableau should be of lhs and rhs? */ public void fill(Rational[][] M, Rational[] q, Rational[] d) { if (M.length != q.length || M.length != d.length || (M.length > 1 && M.length != M[0].length)) throw new RuntimeException("LCP components not consistent dimension"); //TODO if (M.length != nrows) throw new RuntimeException("LCP dimension does not fit in Tableau size"); //TODO for (int j = 0; j < ncols; ++j) { BigInteger scaleFactor = ComputeScaleFactor(j, M, q, d); scfa[j] = scaleFactor; /* fill in col j of A */ for (int i = 0; i < nrows; ++i) { Rational rat = RatForRowCol(i, j, M, q, d); /* cols 0..n of A contain LHS cobasic cols of Ax = b */ /* where the system is here -Iw + dz_0 + Mz = -q */ /* cols of q will be negated after first min ratio test */ /* A[i][j] = num * (scfa[j] / den), fraction is integral */ A[i][j] = (scaleFactor.divide(rat.den)).multiply(rat.num); } } /* end of for(j=...) */ } /* end of filltableau() */ /* compute lcm of denominators for col j of A */ /* Necessary for converting fractions to integers and back again */ private BigInteger ComputeScaleFactor(int col, Rational[][] M, Rational[] q, Rational[] d) { BigInteger lcm = BigInteger.valueOf(1); for (int i = 0; i < nrows; ++i) { BigInteger den = RatForRowCol(i, col, M, q, d).den; lcm = BigIntegerUtils.lcm(lcm, den); // TODO //if (col == 0 && lcm.GetType() == typeof(DefaultMP)) // record_sizeinbase10 = (int)MP.SizeInBase(lcm, 10) /* / 4*/; } return lcm; } private Rational RatForRowCol(int row, int col, Rational[][] M, Rational[] q, Rational[] d) { return (col == 0) ? d[row] : (col == ncols - 1) ? q[row] : M[row][col - 1]; } //region Pivot /* --------------- pivoting and related routines -------------- */ /** * Pivot tableau on the element A[row][col] which must be nonzero * afterwards tableau normalized with positive determinant * and updated tableau variables * @param leave (r) VAR defining row of pivot element * @param enter (s) VAR defining col of pivot element */ public void pivot(int leave, int enter) { int row = vars.row(leave); int col = vars.col(enter); vars.swap(enter, leave, row, col); /* update tableau variables */ pivotOnRowCol(row, col); } private void pivotOnRowCol(int row, int col) { BigInteger pivelt = A[row][col]; /* pivelt anyhow later new determinant */ if (pivelt.compareTo(BigInteger.ZERO) == 0) throw new RuntimeException("Trying to pivot on a zero"); //TODO boolean negpiv = false; if (pivelt.compareTo(BigInteger.ZERO) < 0) { negpiv = true; pivelt = pivelt.negate(); } for (int i = 0; i < nrows; i++) { if (i != row) /* A[row][..] remains unchanged */ { BigInteger aicol = A[i][col]; //TODO: better name for this variable boolean nonzero = (aicol.compareTo(BigInteger.ZERO) != 0); for (int j = 0; j < ncols; j++) { if (j != col) { BigInteger tmp1 = A[i][j].multiply(pivelt); if (nonzero) { BigInteger tmp2 = aicol.multiply(A[row][j]); if (negpiv) { tmp1 = tmp1.add(tmp2); } else { tmp1 = tmp1.subtract(tmp2); } } A[i][j] = tmp1.divide(det); /* A[i,j] = (A[i,j] A[row,col] - A[i,col] A[row,j])/ det */ //A[i,j] = (A[i,j] * A[row,col] - A[i,col] * A[row,j]) / det; } } if (nonzero && !negpiv) { A[i][col] = aicol.negate(); /* row i has been dealt with, update A[i][col] safely */ } } } A[row][col] = det; if (negpiv) negRow(row); det = pivelt; /* by construction always positive */ } /* negate tableau row. Used in pivot() */ private void negRow(int row) { for (int j = 0; j < ncols; ++j) if (A[row][j].compareTo(BigInteger.ZERO) != 0) //non-zero A[row][j] = A[row][j].negate(); // a = -a } /* negate tableau column col */ public void negCol(int col) { for (int i = 0; i < nrows; ++i) A[i][col] = A[i][col].negate(); // a = -a } //region Results public Rational result(int var) { Rational rv; if (vars.isBasic(var)) /* var is a basic variable */ { int row = vars.row(var); BigInteger scaleFactor = BigInteger.valueOf(1); int scaleIdx = vars.rowVar(row); if (scaleIdx >= 0 && scaleIdx < scfa.length - 1) /* Z(i): scfa[i]*rhs[row] / (scfa[RHS]*det) */ { scaleFactor = scfa[scaleIdx]; } //else /* W(i): rhs[row] / (scfa[RHS]*det) */ BigInteger num = scaleFactor.multiply(A[row][RHS()]); BigInteger den = det.multiply(scfa[RHS()]); Rational birat = new Rational(num, den); try { rv = new Rational(birat.num.longValue(), birat.den.longValue()); } catch (Exception ex) { String error = String.format( "Fraction too large for basic variable %s: %s/%s", vars.toString(var), num.toString(), den.toString()); throw new RuntimeException(error, ex); //TODO //Console.Out.WriteLine(error); } } else { // i is non-basic rv = ZERO; } return rv; } /** * Lex helper to encapsulate BigInteger. * * @return * sign of A[a,testcol] / A[a,col] - A[b,testcol] / A[b,col] * (assumes only positive entries of col are considered) */ public int ratioTest(int rowA, int rowB, int col, int testcol) { return A[rowA][testcol].multiply(A[rowB][col]).compareTo( A[rowB][testcol].multiply(A[rowA][col])); } //region Info public boolean isPositive(int row, int col) { return A[row][col].compareTo(BigInteger.ZERO) > 0; } public boolean isZero(int row, int col) { return A[row][col].compareTo(BigInteger.ZERO) == 0; } public String valToString(int row, int col) { BigInteger value = A[row][col]; return (value.compareTo(BigInteger.ZERO) == 0) ? "." : value.toString(); } public String detToString() { return det.toString(); } // what does this even mean when the matrix is not square? public String scaleToString(int scaleIdx) { return scfa[scaleIdx].toString(); } //only used for tests... public long get(int row, int col) { return A[row][col].longValue(); } public void set(int row, int col, long value) { A[row][col] = BigInteger.valueOf(value); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(String.format("Determinant: %s", detToString())); ColumnTextWriter colpp = new ColumnTextWriter(); colpp.endRow(); colpp.writeCol("var"); colpp.alignLeft(); /* headers describing variables */ for (int j = 0; j <= RHS(); j++) { if (j == RHS()) { colpp.writeCol("RHS"); } else { String var = vars().toString(vars().colVar(j)); colpp.writeCol(var); } } colpp.endRow(); colpp.writeCol("scfa"); /* scale factors */ for (int j = 0; j <= RHS(); j++) { String scfa; if (j == RHS() || vars().isZVar(vars().colVar(j))) { /* col j is some Z or RHS: scfa */ scfa = scaleToString(j); } else { /* col j is some W */ scfa = "1"; } colpp.writeCol(scfa); } colpp.endRow(); for (int i = 0; i < vars().size(); i++) /* print row i */ { String var = vars().toString(vars().rowVar(i)); colpp.writeCol(var); for (int j = 0; j <= RHS(); j++) { String value = valToString(i, j); colpp.writeCol(value); } colpp.endRow(); } colpp.endRow(); sb.append(colpp.toString()); return sb.toString(); } }
11,770
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
TableauVariables.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/lcp/TableauVariables.java
package lse.math.games.lcp; // TODO: Make inner static class of Tableau public class TableauVariables { /* VARS = 0..2n = Z(0) .. Z(n) W(1) .. W(n) */ /* ROWCOL = 0..2n, 0 .. n-1: tabl rows (basic vars) */ /* n .. 2n: tabl cols 0..n (cobasic) */ private int[] bascobas; /* VARS -> ROWCOL */ private int[] whichvar; /* ROWCOL -> VARS, inverse of bascobas */ private int n; /* init tableau variables: */ /* Z(0)...Z(n) nonbasic, W(1)...W(n) basic */ /* This is for setting up a complementary basis/cobasis */ public TableauVariables(int sizeBasis) { n = sizeBasis; bascobas = new int[2 * n + 1]; whichvar = new int[2 * n + 1]; for (int i = 0; i <= n; i++) { bascobas[z(i)] = n + i; whichvar[n + i] = z(i); } for (int i = 1; i <= n; i++) { bascobas[w(i)] = i - 1; whichvar[i - 1] = w(i); } } /* create string s representing v in VARS, e.g. "w2" */ /* return value is length of that string */ public String toString(int var) { if (!isZVar(var)) return String.format("w%d", var - n); else return String.format("z%d", var); } @Override public String toString() { StringBuilder output = new StringBuilder(); output.append("bascobas: ["); for (int i = 0; i < bascobas.length; i++) { output.append(String.format(" %d", bascobas[i])); } output.append(" ]"); return output.toString(); } public void swap(int enterVar, int leaveVar, int leaveRow, int enterCol) { bascobas[leaveVar] = enterCol + n; whichvar[enterCol + n] = leaveVar; bascobas[enterVar] = leaveRow; whichvar[leaveRow] = enterVar; } public int z(int idx) { return idx; } public int w(int idx) { return idx + n; } public int rowVar(int row) { return whichvar[row]; } int colVar(int col) { return whichvar[col + n]; } int row(int var) { return bascobas[var]; } int col(int var) { return bascobas[var] - n; } public boolean isBasic(int var) { return (bascobas[var] < n); } public boolean isZVar(int var) { return (var <= n); } public int size() { return n; } /** * TODO: This might belong in the Lemke Algorithm and not here. * complement of v in VARS, error if v==Z(0). * this is W(i) for Z(i) and vice versa, i=1...n */ public int complement(int var) { if (var == z(0)) throw new RuntimeException("Attempt to find complement of z0."); //TODO return (!isZVar(var)) ? z(var - n) : w(var); } /* assert that v in VARS is a basic variable */ /* otherwise error printing info where */ public void assertBasic(int var) { if (!isBasic(var)) { String error = String.format("Cobasic variable %s should be basic.", toString(var)); throw new RuntimeException(error); //TODO } } /* assert that v in VARS is a cobasic variable */ /* otherwise error printing info where */ public void assertNotBasic(int var) { if (isBasic(var)) { String error = String.format("Basic variable %s should be cobasic.", toString(var)); throw new RuntimeException(error); //TODO } } /* test tableau variables: error => msg only, continue */ //MKE: should this be put in a unit test and be removed from runtime? public void testTablVars() { String newline = System.getProperty("line.separator"); for (int i = 0; i <= 2 * n; i++) { /* check if somewhere tableauvars wrong */ if (bascobas[whichvar[i]] != i || whichvar[bascobas[i]] != i) { /* found an inconsistency, print everything */ StringBuilder output = new StringBuilder(); output.append("Inconsistent tableau variables:"); output.append(newline); for (int j = 0; j <= 2 * n; j++) { output.append(String.format( "var j:%3d bascobas:%3d whichvar:%3d b[w[j]]==j: %1d w[b[j]]==j: %1d", j, bascobas[j], whichvar[j], bascobas[whichvar[j]] == j, whichvar[bascobas[j]] == j)); output.append(newline); } //throw new Exception(output.ToString()); System.err.print(output.toString()); break; } } } }
5,168
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
LemkeAlgorithm.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/lcp/LemkeAlgorithm.java
package lse.math.games.lcp; import java.util.logging.Logger; import lse.math.games.Rational; public class LemkeAlgorithm { private static final Logger log = Logger.getLogger(LemkeAlgorithm.class.getName()); //region State private int pivotcount; private int record_size = 0; /* MP digit record */ //MKE: TODO private long duration; private boolean z0leave; public long getDuration() { return duration; } public int getPivotCount() { return pivotcount; } /* no. of Lemke pivot iterations, including the first to pivot z0 in */ public int getRecordDigits() { return record_size; } public Tableau A; public LexicographicMethod lex; // Performs MinRatio Test private LCP origLCP; //region Event Callbacks public LeavingVariableDelegate leavingVarHandler; //interactivevar OR lexminvar public OnCompleteDelegate onComplete; //chain: binitabl (secondcall), boutsol, blexstats public OnInitDelegate onInit; //binitabl (first call) public OnPivotDelegate onPivot; //bdocupivot public OnTableauChangeDelegate onTableauChange; //bouttabl public OnLexCompleteDelegate onLexComplete; //blexstats public OnLexRayTerminationDelegate onLexRayTermination; private void init(LCP lcp) throws InvalidLCPException, TrivialSolutionException { checkInputs(lcp.q(), lcp.d()); origLCP = lcp; A = new Tableau(lcp.d().length); A.fill(lcp.M(), lcp.q(), lcp.d()); if (onInit != null) onInit.onInit("After filltableau", A); lex = new LexicographicMethod(A.vars().size(), lcp); this.leavingVarHandler = new LeavingVariableDelegate() { public int getLeavingVar(int enter) throws RayTerminationException { return lex.lexminratio(A, enter); } public boolean canZ0Leave() { return lex.z0leave(); } }; } /** * asserts that d >= 0 and not q >= 0 (o/w trivial sol) * and that q[i] < 0 implies d[i] > 0 */ public void checkInputs(Rational[] rhsq, Rational[] vecd) throws InvalidLCPException, TrivialSolutionException { boolean isQPos = true; for (int i = 0, len = rhsq.length; i < len; ++i) { if (vecd[i].compareTo(0) < 0) { throw new InvalidLCPException(String.format("Covering vector d[%d] = %s negative. Cannot start Lemke.", i + 1, vecd[i].toString())); } else if (rhsq[i].compareTo(0) < 0) { isQPos = false; if (vecd[i].isZero()) { throw new InvalidLCPException(String.format("Covering vector d[%d] = 0 where q[%d] = %s is negative. Cannot start Lemke.", i + 1, i + 1, rhsq[i].toString())); } } } if (isQPos) { throw new TrivialSolutionException("No need to start Lemke since q>=0. Trivial solution z=0."); } } private boolean complementaryPivot(int enter, int leave) { if (onPivot != null) onPivot.onPivot(leave, enter, A.vars()); A.pivot(leave, enter); return z0leave; } /** * solve LCP via Lemke's algorithm, * solution in solz [0..lcpdim-1] * exit with error if ray termination */ public Rational[] run(LCP lcp) throws RayTerminationException, InvalidLCPException, TrivialSolutionException { return run(lcp, 0); } public Rational[] run(LCP lcp, int maxcount) throws RayTerminationException, InvalidLCPException, TrivialSolutionException { init(lcp); z0leave = false; int enter = A.vars().z(0); /* z0 enters the basis to obtain lex-feasible solution */ int leave = nextLeavingVar(enter); A.negCol(A.RHS()); /* now give the entering q-col its correct sign */ if (onTableauChange != null) { onTableauChange.onTableauChange("After negcol", A); } pivotcount = 1; long before = System.currentTimeMillis(); while (true) { if (complementaryPivot(enter, leave)) { break; // z0 will have a value of zero but may still be basic... amend? } if (onTableauChange != null) onTableauChange.onTableauChange("", A); //TODO: Is there a constant for the empty string? // selectpivot enter = A.vars().complement(leave); leave = nextLeavingVar(enter); if (pivotcount++ == maxcount) /* maxcount == 0 is equivalent to infinity since pivotcount starts at 1 */ { log.warning(String.format("------- stop after %d pivoting steps --------", maxcount)); break; } } duration = System.currentTimeMillis() - before; if (onComplete != null) onComplete.onComplete("Final tableau", A); // hook up two tabl output functions to a chain delegate where the flags are analyzzed if (onLexComplete != null) onLexComplete.onLexComplete(lex); return getLCPSolution(); // LCP solution z vector } /** * LCP result * current basic solution turned into solz [0..n-1] * note that Z(1)..Z(n) become indices 0..n-1 * gives a warning if conversion to ordinary rational fails * and returns 1, otherwise 0 */ private Rational[] getLCPSolution() { Rational[] z = new Rational[A.vars().size()]; for (int i = 1; i <= z.length; i++) { int var = A.vars().z(i); z[i - 1] = A.result(var); } return z; } private int nextLeavingVar(int enter) throws RayTerminationException { try { int rv = leavingVarHandler.getLeavingVar(enter); z0leave = leavingVarHandler.canZ0Leave(); return rv; } catch (RayTerminationException ex) { if (onLexRayTermination != null) { onLexRayTermination.onLexRayTermination(enter, A, origLCP); } throw ex; } } //delegates public interface LeavingVariableDelegate { public int getLeavingVar(int enter) throws RayTerminationException; public boolean canZ0Leave(); } public interface OnInitDelegate { public void onInit(String message, Tableau A); } public interface OnCompleteDelegate { public void onComplete(String message, Tableau A); } public interface OnPivotDelegate { public void onPivot(int leave, int enter, TableauVariables vars); } public interface OnTableauChangeDelegate { public void onTableauChange(String message, Tableau A); } public interface OnLexCompleteDelegate { public void onLexComplete(LexicographicMethod lex); } public interface OnLexRayTerminationDelegate { public void onLexRayTermination(int enter, Tableau end, LCP start); } @SuppressWarnings("serial") public static class LemkeException extends Exception { public LemkeException(String message) { super(message); } } @SuppressWarnings("serial") public static class InvalidLCPException extends LemkeException { public InvalidLCPException(String message) { super(message); } } @SuppressWarnings("serial") public static class TrivialSolutionException extends LemkeException { public TrivialSolutionException(String message) { super(message); } } @SuppressWarnings("serial") public static class RayTerminationException extends LemkeException { public Tableau A; public LCP start; public RayTerminationException(String error, Tableau A, LCP start) { super(error); this.A = A; this.start = start; } @Override public String getMessage() { StringBuilder sb = new StringBuilder() .append(super.getMessage()) .append(System.getProperty("line.separator")) .append(start != null ? start.toString() : "LCP is null") .append(System.getProperty("line.separator")) .append(A.toString()); return sb.toString(); } } }
8,576
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
LexicographicMethod.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/lcp/LexicographicMethod.java
package lse.math.games.lcp; import lse.math.games.lcp.LemkeAlgorithm.RayTerminationException; // This class seems specific to the representation of the Tableau? // See if I can decouple from specifics of Tableau // See if I can decouple from LCP specifics (read: z0leave) // // This class takes an var to enter the basis and determines which // var should leave. // // This needs to be split into two parts, one part belongs in Lemke, the other in Tableau public class LexicographicMethod { public int[] tested; //TODO: make private public int[] comparisons; //TODO: make private private int[] leavecand; /* leavecand [0..numcand-1] = candidates (rows) for leaving var */ private LCP start; public LexicographicMethod(int basisSize, LCP start) { this.start = start; leavecand = new int[basisSize]; InitStatistics(basisSize + 1); } //region Minimum Leaving Variable private boolean z0leave; /** * z0leave * ========================================================== * @return the state of the z0leave boolean following the * last call to minVar(). Indicates that z0 can leave the * basis, but the lex-minratio test is performed fully, * so the returned value might not be the index of z0. */ public boolean z0leave() { return z0leave; } /** * minVar * =========================================================== * @return the leaving variable in VARS, given by lexmin row, * when enter in VARS is entering variable * only positive entries of entering column tested * boolean *z0leave indicates back that z0 can leave the * basis, but the lex-minratio test is performed fully, * so the returned value might not be the index of z0 */ public int lexminratio(Tableau A, int enter) throws RayTerminationException { z0leave = false; // TODO: I think I can comment for perf... (but a unit test will fail) // I could pass in a cobasic index instead A.vars().assertNotBasic(enter); int col = A.vars().col(enter); int numcand = 0; for (int i = 0; i < leavecand.length; i++) { /* start with leavecand = { i | A[i][col] > 0 } */ if (A.isPositive(i, col)) { leavecand[numcand++] = i; } } if (numcand == 0) { rayTermination(A, enter); } /*else if (numcand == 1) { RecordStats(0, numcand); z0leave = IsLeavingRowZ0(leavecand[0]); }*/ else { processCandidates(A, col, leavecand, numcand); } return A.vars().rowVar(leavecand[0]); } /* end of lexminvar (col, *z0leave); */ private boolean IsLeavingRowZ0(Tableau A, int row) { return A.vars().rowVar(row) == A.vars().z(0); } /** * processCandidates * ================================================================ * as long as there is more than one leaving candidate perform * a minimum ratio test for the columns of j in RHS, W(1),... W(n) * in the tableau. That test has an easy known result if * the test column is basic or equal to the entering variable. */ private void processCandidates(Tableau A, int enterCol, int[] leavecand, int numcand) { numcand = ProcessRHS(A, enterCol, leavecand, numcand); for (int j = 1; numcand > 1; j++) { if (j >= A.RHS()) /* impossible, perturbed RHS should have full rank */ throw new RuntimeException("lex-minratio test failed"); //TODO RecordStats(j, numcand); int var = A.vars().w(j); if (A.vars().isBasic(var)) { /* testcol < 0: W(j) basic, Eliminate its row from leavecand */ int wRow = A.vars().row(var); numcand = removeRow(wRow, leavecand, numcand); // TODO: revmove r } else { /* not a basic testcolumn: perform minimum ratio tests */ int wCol = A.vars().col(var); // TODO: get s /* since testcol is the jth unit column */ if (wCol != enterCol) { /* otherwise nothing will change */ numcand = minRatioTest(A, enterCol, wCol, leavecand, numcand); } } } } private int ProcessRHS(Tableau A, int enterCol, int[] leavecand, int numcand) { RecordStats(0, numcand); numcand = minRatioTest(A, enterCol, A.RHS(), leavecand, numcand); for (int i = 0; i < numcand; ++i) { // seek z0 among the first-col leaving candidates z0leave = IsLeavingRowZ0(A, leavecand[i]); if (z0leave) { break; } /* alternative, to force z0 leaving the basis: * return whichvar[leavecand[i]]; */ } return numcand; } private int removeRow(int row, int[] candidates, int numCandidates) { for (int i = 0; i < numCandidates; i++) { if (candidates[i] == row) { candidates[i] = candidates[--numCandidates]; /* shuffling of leavecand allowed */ break; } } return numCandidates; } //TODO: should this be package visible? Better way to test this? int minRatioTest(Tableau A, int col, int testcol, int[] candidates, int numCandidates) { int newnum = 0; for (int i = 1; i < numCandidates; i++) { /* investigate remaining candidates */ int sgn = A.ratioTest( /* sign of A[l_0,t] / A[l_0,col] - A[l_i,t] / A[l_i,col] */ candidates[0], candidates[i], col, testcol); /* note only positive entries of entering column considered */ if (sgn == 0) { /* new ratio is the same as before */ ++newnum; candidates[newnum] = candidates[i]; } else if (sgn == 1) { /* new smaller ratio detected */ newnum = 0; candidates[newnum] = candidates[i]; } } return newnum + 1; /* leavecand[0..newnum] contains the new candidates */ } //region Statistics /* * initialize statistics for minimum ratio test */ private void InitStatistics(int sizeBasisPlusZ0) { tested = new int[sizeBasisPlusZ0]; comparisons = new int[sizeBasisPlusZ0]; for (int i = 0; i < sizeBasisPlusZ0; i++) tested[i] = comparisons[i] = 0; } private void RecordStats(int idx, int numCandidates) { if (tested != null) tested[idx] += 1; if (comparisons != null) comparisons[idx] += numCandidates; } //region Exception Routines private void rayTermination(Tableau A, int enter) throws RayTerminationException { String error = String.format("Ray termination when trying to enter %s", A.vars().toString(enter)); throw new RayTerminationException(error, A, start); } }
8,027
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
LCP.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/lcp/LCP.java
package lse.math.games.lcp; import lse.math.games.Rational; import lse.math.games.io.ColumnTextWriter; import static lse.math.games.Rational.*; /** * Linear Complementarity Problem (aka. LCP) * ================================================================================= * (1) Mz + q >= 0 * (2) z >= 0 * (3) z'(Mz + q) = 0 * * (1) and (2) are feasibility conditions. * (3) is complementarity condition (also written as w = Mz + q where w and z are orthogonal) * Lemke algorithm takes this (M, q) and a covering vector (d) and outputs a solution */ public class LCP { private static int MAXLCPDIM = 2000; /* max LCP dimension */ //MKE: Why do we need a max? // M and q define the LCP Rational[][] M; Rational[] q; // d vector for Lemke algo Rational[] d; /* allocate and initialize with zero entries an LCP of dimension n * this is the only method changing lcpdim * exit with error if fails, e.g. if n not sensible */ public LCP(int dimension) { if (dimension < 1 || dimension > MAXLCPDIM) { throw new RuntimeException(String.format( //TODO: RuntimeException not the cleanest thing to do here "Problem dimension n=%d not allowed. Minimum n is 1, maximum %d.", dimension, MAXLCPDIM)); } M = new Rational[dimension][dimension]; q = new Rational[dimension]; d = new Rational[dimension]; for (int i = 0; i < M.length; i++) { for (int j = 0; j < M[i].length; j++) { M[i][j] = Rational.ZERO; } q[i] = Rational.ZERO; d[i] = Rational.ZERO; } } public boolean isTrivial() { boolean isQPos = true; for (int i = 0, len = q.length; i < len; ++i) { if (q[i].compareTo(0) < 0) { isQPos = false; } } return isQPos; } //when is negate false? // TODO: how do I consolidate the code in these two methods elegantly... delegate? // TODO: These methods do not really have anything to do with LCP... public void payratmatcpy(Rational[][] frommatr, boolean bnegate, boolean btranspfrommatr, int nfromrows, int nfromcols, int targrowoffset, int targcoloffset) { for (int i = 0; i < nfromrows; i++) { for (int j = 0; j < nfromcols; j++) { Rational value = (frommatr[i][j].isZero()) ? ZERO : (bnegate ? frommatr[i][j].negate() : frommatr[i][j]); SetMEntry(btranspfrommatr, targrowoffset, targcoloffset, i, j, value); } } } //integer to rational matrix copy public void intratmatcpy(int[][] frommatr, boolean bnegate, boolean btranspfrommatr, int nfromrows, int nfromcols, int targrowoffset, int targcoloffset) { for (int i = 0; i < nfromrows; i++) { for (int j = 0; j < nfromcols; j++) { Rational value = (frommatr[i][j] == 0) ? ZERO : (bnegate ? Rational.valueOf(-frommatr[i][j]) : Rational.valueOf(frommatr[i][j])); SetMEntry(btranspfrommatr, targrowoffset, targcoloffset, i, j, value); } } } private void SetMEntry(boolean btranspfrommatr, int targrowoffset, int targcoloffset, int i, int j, Rational value) { if (btranspfrommatr) { M[j + targrowoffset][i + targcoloffset] = value; } else { M[i + targrowoffset][j + targcoloffset] = value; } } public Rational[][] M() { return M; } public Rational M(int row, int col) { return M[row][col]; } public void setM(int row, int col, Rational value) { M[row][col] = value; } public Rational[] q() { return q; } public Rational q(int row) { return q[row]; } public void setq(int row, Rational value) { q[row] = value; } public Rational[] d() { return d; } public Rational d(int row) { return d[row]; } public void setd(int row, Rational value) { d[row] = value; } public int size() { return d.length; } @Override public String toString() { final ColumnTextWriter colpp = new ColumnTextWriter(); colpp.writeCol("M"); for (int i = 1; i < size(); ++i) { colpp.writeCol(""); } colpp.writeCol("d"); colpp.writeCol("q"); colpp.endRow(); for (int i = 0; i < size(); ++i) { for (int j = 0; j < M[i].length; j++) { //if (j > 0) output.append(", "); colpp.writeCol(M[i][j] == Rational.ZERO ? "." : M[i][j].toString()); } colpp.writeCol(d[i].toString()); colpp.writeCol(q[i].toString()); colpp.endRow(); } return colpp.toString(); } }
5,117
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
LrsAlgorithm.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/lrs/LrsAlgorithm.java
package lse.math.games.lrs; import java.math.BigInteger; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import lse.math.games.Rational; import static lse.math.games.BigIntegerUtils.*; public class LrsAlgorithm implements Lrs { private static final Logger log = Logger.getLogger(LrsAlgorithm.class.getName()); private static final int MAXD = 27; //TODO Dictionary P; Rational volume; Rational bound; //long unbounded; /* lp unbounded */ /* initially holds order used to find starting */ /* basis, default: m,m-1,...,2,1 */ //long[] facet; /* cobasic indices for restart in needed */ //long[] temparray; /* for sorting indices, dimensioned to d */ //long[] isave, jsave; /* arrays for estimator, malloc'ed at start */ BigInteger sumdet; /* sum of determinants */ long[] count; /* count[0]=rays [1]=verts. [2]=base [3]=pivots [4]=integer vertices*/ long totalnodes; /* count total number of tree nodes evaluated */ /* given by inputd-nredundcol */ //long runs; /* probes for estimate function */ //long seed = 1234L; /* seed for random number generator */ //double[] cest = new double[10]; /* ests: 0=rays,1=vert,2=bases,3=vol,4=int vert */ /**** flags ********** */ //boolean allbases; /* true if all bases should be printed */ //boolean bound; /* true if upper/lower bound on objective given */ //boolean dualdeg; /* true if start dictionary is dual degenerate */ //long etrace; /* turn off debug at basis # strace */ //boolean geometric; /* true if incident vertex prints after each ray */ boolean getvolume = false; /* do volume calculation */ boolean givenstart = false; /* true if a starting cobasis is given */ //boolean lponly; /* true if only lp solution wanted */ //boolean maximize; /* flag for LP maximization */ //boolean minimize; /* flag for LP minimization */ long maxdepth = MAXD; /* max depth to search to in tree */ long mindepth = -MAXD; /* do not backtrack above mindepth */ long depth = 0L; long deepest = 0L; /* max depth ever reached in search */ //boolean nash; /* true for computing nash equilibria */ boolean printcobasis = false; /* true if all cobasis should be printed */ int frequency = 0; /* frequency to print cobasis indices */ boolean incidence = true; /* print all tight inequalities (vertices/rays) */ boolean printslack = false; /* true if indices of slack inequal. printed */ //boolean truncate; /* true: truncate tree when moving from opt vert*/ //boolean restart; /* true if restarting from some cobasis */ //long strace; /* turn on debug at basis # strace */ // TODO: change to log levels boolean debug = false; boolean verbose = false; int[] inequality = null; // indices of inequalities corr. to cobasic ind private List<Integer> redundancies = null; /* Variables for saving/restoring cobasis, db */ long[] saved_count = new long[3]; /* How often to print out current cobasis */ long[] saved_C; BigInteger saved_det; long saved_depth; long saved_d; long saved_flag; /* There is something in the saved cobasis */ /* Variables for cacheing dictionaries, db */ private CacheEntry cacheTail; private int cacheTries = 0; private int cacheMisses = 0; //TODO: fix defaults public LrsAlgorithm() { //for (i = 0; i < 10; i++) // { // Q.count[i] = 0L; // Q.cest[i] = 0.0; // } /* initialize flags */ //Q.allbases = false; //Q.bound = false; /* upper/lower bound on objective function given */ //Q.debug = false; printcobasis = true; // TODO: set up log levels... debug = false; verbose = true; if (debug == true) { verbose = true; } } public HPolygon run(VPolygon in) { // hull == true throw new RuntimeException("Not Impl"); } public VPolygon run(HPolygon in) { // TODO: put all this reset member vars in an initRun() method sumdet = BigInteger.ZERO; totalnodes = 0; count = new long[10]; count[2] = 1L; P = new Dictionary(in, this); inequality = new int[P.B.length]; inequality[0] = 2; redundancies = new ArrayList<Integer>(); cacheTail = null; cacheTries = 0; cacheMisses = 0; if (debug) { log.fine(P.toString()); log.fine("exiting lrs_read_dic"); } /*********************************************************************************/ /* Step 2: Find a starting cobasis from default of specified order */ /* P is created to hold active dictionary data and may be cached */ /* Lin is created if necessary to hold linearity space */ /* Print linearity space if any, and retrieve output from first dict. */ /*********************************************************************************/ if (!getfirstbasis(P, in.linearities, 0)) { return null; } /* Pivot to a starting dictionary */ /* There may have been column redundancy */ /* If so the linearity space is obtained and redundant */ /* columns are removed. User can access linearity space */ /* from lrs_mp_matrix Lin dimensions nredundcol x d+1 */ //int startcol = 0; //if (Q->homogeneous && Q->hull) // startcol++; /* col zero not treated as redundant */ //for (int col = startcol; col < Q->nredundcol; col++) { /* print linearity space */ // lrs_printoutput (Q, Lin[col]); /* Array Lin[][] holds the coeffs. */ //} /*********************************************************************************/ /* Step 3: Terminate if lponly option set, otherwise initiate a reverse */ /* search from the starting dictionary. Get output for each new dict. */ /*********************************************************************************/ /* We initiate reverse search from this dictionary */ /* getting new dictionaries until the search is complete */ /* User can access each output line from output which is */ /* vertex/ray/facet from the lrs_mp_vector output */ /* prune is TRUE if tree should be pruned at current node */ BigInteger[] output = new BigInteger[in.getNumCols()]; /* output holds one line of output from dictionary */ VPolygon solution = new VPolygon(); do { //if (!lrs.checkbound(P)) { if (getvertex(P, output, solution)) { // check for lexmin vertex printoutput(output, solution); } // since I am not iterating by column, I think it messes up the order // get cobasis from Dictionary sorted by lowest col for parity int[] cobasis = P.cobasis(); for (int i = 0; i < cobasis.length; ++i) { if (getsolution (P, output, solution, cobasis[i])) { printoutput(output, solution); } } //} } while (getnextbasis (P/*, prune*/)); printsummary(in); return solution; } private void printsummary(HPolygon in) { log.info("end"); /*if (dualdeg) { System.out.println("*Warning: Starting dictionary is dual degenerate"); System.out.println("*Complete enumeration may not have been produced"); if (maximize) { System.out.println("*Recommendation: Add dualperturb option before maximize in input file"); } else { System.out.println("*Recommendation: Add dualperturb option before minimize in input file"); } }*/ /*if (unbounded) { System.out.println("*Warning: Starting dictionary contains rays"); System.out.println("*Complete enumeration may not have been produced"); if (maximize) { System.out.println("*Recommendation: Change or remove maximize option or add bounds"); } else { System.out.println("*Recommendation: Change or remove minimize option or add bounds"); } }*/ /*if (truncate) { System.out.println("*Tree truncated at each new vertex"); }*/ if (maxdepth < MAXD) { log.info(String.format("*Tree truncated at depth %d", maxdepth)); } /*if (maxoutput > 0) { System.out.println(String.format("*Maximum number of output lines = %ld", maxoutput)); }*/ log.info("*Sum of det(B)=" + sumdet.toString()); /* next block with volume rescaling must come before estimates are printed */ /*if (getvolume) { volume = rescalevolume (P, Q); if (polytope) { System.out.println("*Volume=" + volume.toString()); } else { System.out.println("*Pseudovolume=" + volume.toString()); } }*/ /*if (hull) { fprintf (lrs_ofp, "\n*Totals: facets=%ld bases=%ld", count[0], count[2]); if (nredundcol > homogeneous) // don't count column 1 as redundant if homogeneous { fprintf (lrs_ofp, " linearities=%ld", nredundcol - homogeneous); fprintf (lrs_ofp, " facets+linearities=%ld",nredundcol-homogeneous+count[0]); } if ((cest[2] > 0) || (cest[0] > 0)) { fprintf (lrs_ofp, "\n*Estimates: facets=%.0f bases=%.0f", count[0] + cest[0], count[2] + cest[2]); if (getvolume) { rattodouble (Q->Nvolume, Q->Dvolume, &x); for (i = 2; i < d; i++) cest[3] = cest[3] / i; //adjust for dimension fprintf (lrs_ofp, " volume=%g", cest[3] + x); } fprintf (lrs_ofp, "\n*Total number of tree nodes evaluated: %ld", Q->totalnodes); fprintf (lrs_ofp, "\n*Estimated total running time=%.1f secs ",(count[2]+cest[2])/Q->totalnodes*get_time () ); } } else */ /* output things specific to vertex/ray computation */ { StringBuilder sb = new StringBuilder(); sb.append(String.format("*Totals: vertices=%d rays=%d bases=%d integer_vertices=%d ", count[1], count[0], count[2], count[4])); if (redundancies.size() > 0) { sb.append(String.format(" linearities=%d", redundancies.size())); } if (count[0] + redundancies.size() > 0 ) { sb.append(" vertices+rays"); if (redundancies.size() > 0) { sb.append("+linearities"); } sb.append(String.format("=%d",redundancies.size() + count[0] + count[1])); } log.info(sb.toString()); /*if ((cest[2] > 0) || (cest[0] > 0)) { fprintf (lrs_ofp, "\n*Estimates: vertices=%.0f rays=%.0f", count[1]+cest[1], count[0]+cest[0]); fprintf (lrs_ofp, " bases=%.0f integer_vertices=%.0f ",count[2]+cest[2], count[4]+cest[4]); if (getvolume) { rattodouble (Nvolume, Dvolume, &x); for (i = 2; i <= d - homogeneous; i++) { cest[3] = cest[3] / i; // adjust for dimension } fprintf (lrs_ofp, " pseudovolume=%g", cest[3] + x); } System.out.println(); System.out.println(String.format("*Total number of tree nodes evaluated: %d", totalnodes)); System.out.print(String.format("*Estimated total running time=%.1f secs ",(count[2]+cest[2])/totalnodes*get_time())); }*/ /*if (restart || allbases) { // print warning System.out.println("*Note! Duplicate vertices/rays may be present"); } else if ((count[0] > 1 && !homogeneous)) { System.out.println("*Note! Duplicate rays may be present"); }*/ } if(!verbose) { return; } log.info(String.format("*Input size m=%d rows n=%d columns working dimension=%d", P.m, in.getNumCols(), P.d)); /*if (hull) { System.out.println(String.format(" working dimension=%d", d - 1 + homogeneous)); } else { System.out.println(String.format(" working dimension=%d", P.d)); } */ StringBuilder scob = new StringBuilder(); scob.append("*Starting cobasis defined by input rows"); Integer[] temparray = new Integer[P.lastdv]; for (int i = 0; i < in.linearities.length; i++) { temparray[i] = in.linearities[i]; } for (int i = in.linearities.length; i < P.lastdv; i++) { temparray[i] = inequality[P.C[i - in.linearities.length] - P.lastdv]; } for (int i = 0; i < P.lastdv; i++) { reorder(temparray); } for (int i = 0; i < P.lastdv; i++) { scob.append(String.format(" %d", temparray[i])); } log.info(scob.toString()); log.info(String.format("*Dictionary Cache: max size= %d misses= %d/%d Tree Depth= %d", 0/*dict_count*/, cacheMisses, cacheTries, deepest)); } private void printoutput (BigInteger[] output, VPolygon solution) { StringBuilder sb = new StringBuilder(); Rational[] vertex = new Rational[output.length]; if (zero(output[0])) /*non vertex */ { for (int i = 0; i < output.length; i++) { String ratStr = output[i].toString(); vertex[i] = Rational.valueOf(ratStr); sb.append(" " + ratStr + " "); } } else { /* vertex */ sb.append(" 1 "); vertex[0] = Rational.ONE; for (int i = 1; i < output.length; i++) { vertex[i] = new Rational(output[i], output[0]); sb.append(" " + vertex[i].toString() + " "); } } log.info(sb.toString()); solution.vertices.add(vertex); } /* public void lrs(Tableau first) { List<Object> vertices = new ArrayList<Object>(); Tableau A = first; int d = A.vars(). int j = 1; while (true) { while (j <= d) { int v = N(j); // jth index of the cobasic variables? int u = reverse(B, v); // if (u >= 0) { pivot(B, u, v); // new basis found // if (lexmin(B, 0)) { output current vertex; } j = 1; } else j = j + 1; } selectpivot(B, r, j); //backtrack // pivot(B, r, N(j)); j = j + 1; if (j > d && B == Bstar) break; } } */ //rv[0] = r (leaving row) //rv[1] = s (entering column) /* select pivot indices using lexicographic rule */ /* returns TRUE if pivot found else FALSE */ /* pivot variables are B[*r] C[*s] in locations Row[*r] Col[*s] */ public int[] selectpivot (Dictionary P) { int[] out = new int[2]; int r = out[0] = 0; int s = out[1] = P.d; /*find positive cost coef */ int j = 0; while ((j < P.d) && (!positive (P.cost(j)))) { ++j; } if (j < P.d) { /* pivot column found! */ s = j; /*find min index ratio */ r = P.ratio(s, debug); if (r != 0) { out[0] = r; out[1] = s; //return true; /* unbounded */ } } return out; //return false; } /** * find reverse indices * true if B[r] C[s] is a reverse lexicographic pivot * is true and returns u = B(i) if and only if * (i) w(0)v < 0, * (ii) u = B(i) = lexminratio(B, v) != 0, and * (iii) setting w = w(0) - a(0)w(i) /a(i), we have w(j) >= 0, for all j in N, j < u * Returns false (-1) otherwise... TODO: can I return 0? */ public int reverse (Dictionary P, int s) { int r = -1; // return value (-1 if false) int enter = P.C[s]; int col = P.cols[s]; log.fine(String.format("+reverse: col index %d C %d Col %d ", s, enter, col)); if (!negative (P.cost(s))) { log.fine(" Pos/Zero Cost Coeff"); return -1; } r = P.ratio(s, debug); if (r == 0) /* we have a ray */ { log.fine(" Pivot col non-negative: ray found"); return -1; } //int row = P.rows[r]; /* check cost row after "pivot" for smaller leaving index */ /* ie. j s.t. A[0][j]*A[row][col] < A[0][col]*A[row][j] */ /* note both A[row][col] and A[0][col] are negative */ for (int i = 0; i < P.d && P.C[i] < P.B[r]; i++) { if (i != s) { int j = P.cols[i]; if (positive(P.cost(i)) || negative(P.get(r, i))) /*or else sign test fails trivially */ { if ((!negative(P.cost(i)) && !positive(P.get(r, i))) || comprod(P.cost(i), P.get(r, s), P.cost(s), P.get(r, i)) == -1) { /*+ve cost found */ log.fine(String.format("Positive cost found: index %d C %d Col %d", i, P.C[i], j)); return -1; } } } } log.fine(String.format("+end of reverse : indices r %d s %d ", r, s)); return r; } /* gets first basis, false if none */ /* P may get changed if lin. space Lin found */ /* no_output is true supresses output headers */ private boolean getfirstbasis (Dictionary D, int[] linearity, int hull) { if (linearity.length > 0 && D.isNonNegative()) { log.warning("*linearity and nonnegative options incompatible - all linearities are skipped"); log.warning("*add nonnegative constraints explicitly and remove nonnegative option"); } /* default is to look for starting cobasis using linearies first, then */ /* filling in from last rows of input as necessary */ /* linearity array is assumed sorted here */ /* note if restart/given start inequality indices already in place */ /* from nlinearity..d-1 */ for (int i = 0; i < linearity.length; ++i) { /* put linearities first in the order */ inequality[i] = linearity[i]; } int k = givenstart ? P.d : linearity.length; /* index for linearity array */ for (int i = D.m; i >= 1; i--) { int j = 0; while (j < k && inequality[j] != i) { ++j; /* see if i is in inequality */ } if (j == k) { inequality[k++] = i; } } if (log.isLoggable(Level.FINE)) { StringBuilder sb = new StringBuilder(); sb.append("*Starting cobasis uses input row order"); for (int i = 0; i < D.m; i++) { sb.append(String.format(" %d", inequality[i])); } log.fine(sb.toString()); } /* for voronoi convert to h-description using the transform */ /* a_0 .. a_d-1 . (a_0^2 + ... a_d-1 ^2)-2a_0x_0-...-2a_d-1x_d-1 + x_d >= 0 */ /* note constant term is stored in column d, and column d-1 is all ones */ /* the other coefficients are multiplied by -2 and shifted one to the right */ if (log.isLoggable(Level.FINE)) { log.fine(D.toString()); } for (int j = 0; j <= D.d; j++) { D.A[0][j] = BigInteger.ZERO; // TODO: why is this being assigned here? } /* Now we pivot to standard form, and then find a primal feasible basis */ /* Note these steps MUST be done, even if restarting, in order to get */ /* the same index/inequality correspondance we had for the original prob. */ /* The inequality array is used to give the insertion order */ /* and is defaulted to the last d rows when givenstart=false */ if(P.isNonNegative()) { /* no need for initial pivots here, labelling already done */ P.lastdv = D.d; } else if (!getabasis(D, inequality, linearity, hull)) { return false; } /********************************************************************/ /* now we start printing the output file unless no output requested */ /********************************************************************/ log.info("V-representation"); log.info("begin"); log.info(String.format("***** %d rational", D.d + 1)); /* Reset up the inequality array to remember which index is which input inequality */ /* inequality[B[i]-lastdv] is row number of the inequality with index B[i] */ /* inequality[C[i]-lastdv] is row number of the inequality with index C[i] */ for (int i = 1; i <= D.m; i++) { inequality[i] = i; } if (linearity.length > 0) { /* some cobasic indices will be removed */ for (int i = 0; i < linearity.length; ++i) { /* remove input linearity indices */ inequality[linearity[i]] = 0; } k = 1; /* counter for linearities */ for (int i = 1; i <= P.m - linearity.length; ++i) { while (k <= P.m && inequality[k] == 0) { k++; /* skip zeroes in corr. to linearity */ } inequality[i] = inequality[k++]; } } if (log.isLoggable(Level.FINE)) { StringBuilder sb = new StringBuilder(); sb.append("inequality array initialization:"); for (int i = 1; i <= D.m - linearity.length; i++) { sb.append(String.format(" %d", inequality[i])); } log.fine(sb.toString()); } /* Do dual pivots to get primal feasibility */ if (!primalfeasible(D)) { log.warning("No feasible solution"); return false; } /* re-initialize cost row to -det */ for (int j = 1; j <= D.d; j++) { D.A[0][j] = D.det().negate(); } D.A[0][0] = BigInteger.ZERO; /* zero optimum objective value */ /* reindex basis to 0..m if necessary */ /* we use the fact that cobases are sorted by index value */ if (debug) { log.fine(D.toString()); } while (D.C[0] <= D.m) { int i = D.C[0]; int j = inequality[D.B[i] - D.lastdv]; inequality[D.B[i] - D.lastdv] = inequality[D.C[0] - D.lastdv]; inequality[D.C[0] - D.lastdv] = j; D.C[0] = D.B[i]; D.B[i] = i; reorder(D.C, D.cols, 0, D.d); } if (log.isLoggable(Level.FINE)) { StringBuilder sb = new StringBuilder(); sb.append(String.format("*Inequality numbers for indices %d .. %d : ", D.lastdv + 1, D.m + D.d)); for (int i = 1; i <= D.m; i++) { sb.append(String.format(" %d ", inequality[i])); } log.fine(sb.toString()); } if (debug) { log.fine(D.toString()); } return true; } /*****************************************/ /* getnextbasis in reverse search order */ /*****************************************/ /* gets next reverse search tree basis, FALSE if none */ /* switches to estimator if maxdepth set */ /* backtrack TRUE means backtrack from here */ private boolean getnextbasis (Dictionary D/*, boolean backtrack*/) { int i = 0, j = 0; boolean backtrack = false; //TODO if (backtrack && depth == 0) { return false; /* cannot backtrack from root */ } //if (maxoutput > 0 && count[0]+Qcount[1] >= maxoutput) // return FALSE; /* output limit reached */ while ((j < D.d) || (D.B[D.m] != D.m)) /*main while loop for getnextbasis */ { if (depth >= maxdepth) { backtrack = true; if (maxdepth == 0) /* estimate only */ return false; /* no nextbasis */ } //if ( Q->truncate && negative(D->A[0][0])) /* truncate when moving from opt. vertex */ // backtrack = TRUE; if (backtrack) /* go back to prev. dictionary, restore i,j */ { backtrack = false; if (cacheTail != null) { CacheEntry entry = popCache(); D.copy(entry.getDict()); i = entry.getBas(); j = entry.getCob(); depth = entry.getDepth(); log.fine(String.format(" Cached Dict. restored to depth %d", depth)); } else { --depth; int[] vars = selectpivot(D); vars = doPivot(D, vars[0], vars[1]); i = vars[0]; j = vars[1]; } if (debug) { log.fine(String.format(" Backtrack Pivot: indices i=%d j=%d depth=%d", i, j, depth)); log.fine(D.toString()); }; j++; /* go to next column */ } /* end of if backtrack */ if (depth < mindepth) { break; } /* try to go down tree */ while (j < D.d) { i = reverse(D, j); if (i >= 0) { break; } j++; } if (j == D.d) { backtrack = true; } else { /*reverse pivot found */ pushCache(D, i, j, depth); ++depth; if (depth > deepest) { deepest = depth; } doPivot(D, i, j); count[2]++; totalnodes++; //save_basis (D); TODO //if (strace == count[2]) // debug = true; //if (etrace == count[2]) // debug = false; return true; /*return new dictionary */ } } return false; /* done, no more bases */ } private int[] doPivot(Dictionary D, int r, int s) { if (log.isLoggable(Level.FINE)) { log.fine(String.format(" pivot B[%d]=%d C[%d]=%d ", r, D.B[r], s, D.C[s])); log.fine(D.toString()); } count[3]++; /* count the pivot */ D.pivot(r, s, debug); if (log.isLoggable(Level.FINE)) { log.fine(String.format(" depth=%d det=%s", depth, D.det().toString())); } int[] vars = new int[] { r, s }; update(D, vars); /*Update B,C,i,j */ return vars; } /*reorder array a in increasing order with one misplaced element at index newone */ /*elements of array b are updated to stay aligned with a */ private static void reorder (int a[], int b[], int newone, int range) { while (newone > 0 && a[newone] < a[newone - 1]) { int temp = a[newone]; a[newone] = a[newone - 1]; a[newone - 1] = temp; temp = b[newone]; b[newone] = b[newone - 1]; b[--newone] = temp; } while (newone < range - 1 && a[newone] > a[newone + 1]) { int temp = a[newone]; a[newone] = a[newone + 1]; a[newone + 1] = temp; temp = b[newone]; b[newone] = b[newone + 1]; b[++newone] = temp; } } /* Do dual pivots to get primal feasibility */ /* Note that cost row is all zero, so no ratio test needed for Dual Bland's rule */ private boolean primalfeasible (Dictionary P) { boolean primalinfeasible = true; int m = P.m; int d = P.d; /*temporary: try to get new start after linearity */ while (primalinfeasible) { int i = P.lastdv+1; while (i <= m && !negative(P.b(i))) { ++i; } if (i <= m) { int j = 0; /*find a positive entry for in row */ while (j < d && !positive(P.get(i, j))) { ++j; } if (j >= d) { return false; /* no positive entry */ } int[] vars = doPivot(P, i, j); i = vars[0]; j = vars[1]; } else { primalinfeasible = false; } } return true; } /* check if column indexed by col in this dictionary */ /* contains output */ /* col=0 for vertex 1....d for ray/facet */ private boolean getsolution (Dictionary P, BigInteger[] output, VPolygon solution, int s) { int col = P.cols[s]; // we know col != 0 from here down... if (!negative(P.cost(s))) { // check for rays: negative in row 0 , positive if lponly return false; } /* and non-negative for all basic non decision variables */ int j = P.lastdv + 1; /* cobasic index */ while (j <= P.m && !negative(P.get(j, s))) { ++j; } if (j <= P.m) { return false; } if (P.lexmin(s)) { if (debug) { log.fine(String.format(" lexmin ray in col=%d ", col)); log.fine(P.toString()); } return getray(P, col, output, solution); } return false; /* no more output in this dictionary */ } /*Print out solution in col and return it in output */ /*redcol =n for ray/facet 0..n-1 for linearity column */ /*hull=1 implies facets will be recovered */ /* return FALSE if no output generated in column col */ private boolean getray (Dictionary P, int col, BigInteger[] output, VPolygon solution) { if (debug) { log.fine(P.toString()); } ++count[0]; if (printcobasis) { printcobasis(P, solution, col); } int i = 1; for (int j = 0; j < output.length; ++j) /* print solution */ { if (j == 0) { /* must have a ray, set first column to zero */ output[0] = BigInteger.ZERO; } else { output[j] = getnextoutput (P, i, col); i++; } } reducearray (output); /* printslack for rays: 2006.10.10 */ /* printslack inequality indices */ /* if (printslack) { fprintf(lrs_ofp,"\nslack ineq:"); for(int i = lastdv + 1; i <= P.m; i++) { if (!zero(P.A[P.Row[i]][col])) fprintf(lrs_ofp," %d ", inequality[P.B[i] - lastdv]); } } */ return true; } /* get A[B[i]][col] and return to out */ private BigInteger getnextoutput(Dictionary P, int i, int col) { if (P.isNonNegative()) /* if m+i basic get correct value from dictionary */ /* the slack for the inequality m-d+i contains decision */ /* variable x_i. We first see if this is in the basis */ /* otherwise the value of x_i is zero, except for a ray */ /* when it is one (det/det) for the actual column it is in */ { for (int j = P.lastdv + 1; j <= P.m; j++) { if (inequality[P.B[j] - P.lastdv] == P.m - P.d + i) { return P.A[P.rows[j]][col]; } } /* did not find inequality m-d+i in basis */ if (i == col) { return P.det(); } else { return BigInteger.ZERO; } } else { return P.A[P.rows[i]][col]; } } /*Print out current vertex if it is lexmin and return it in output */ /* return FALSE if no output generated */ private boolean getvertex (Dictionary P, BigInteger[] output, VPolygon solution) { if (P.lexflag()) { ++count[1]; } if (debug) { log.fine(P.toString()); } sumdet = sumdet.add(P.det()); /*print cobasis if printcobasis=TRUE and count[2] a multiple of frequency */ /* or for lexmin basis, except origin for hull computation - ugly! */ if (printcobasis) { if (P.lexflag() || (frequency > 0 && count[2] == (count[2] / frequency) * frequency)) { printcobasis(P, solution, 0); } } if (!P.lexflag()) { /* not lexmin, and not printing forced */ return false; } /* copy column 0 to output */ output[0] = P.det(); /* extract solution */ for (int j = 1, i = 1; j < output.length; ++j, ++i) { output[j] = getnextoutput(P, i, 0); } reducearray(output); if (one(output[0])) { ++count[4]; /* integer vertex */ } /* uncomment to print nonzero basic variables printf("\n nonzero basis: vars"); for(i=1;i<=lastdv; i++) { if ( !zero(A[Row[i]][0]) ) printf(" %d ",B[i]); } */ /* printslack inequality indices */ /*if (Q->printslack) { fprintf(lrs_ofp,"\nslack ineq:"); for(i=lastdv+1;i<=P->m; i++) { if (!zero(A[Row[i]][0])) fprintf(lrs_ofp," %d ", Q->inequality[B[i]-lastdv]); } }*/ return true; } /* col is output column being printed */ private void printcobasis (Dictionary P, VPolygon solution, int col) { StringBuilder sb = new StringBuilder(); sb.append(String.format("V#%d R#%d B#%d h=%d facets ", count[1], count[0], count[2], depth)); int rflag = (-1); /* used to find inequality number for ray column */ Integer[] cobasis = new Integer[P.d]; //TODO: should I make this a list? perf? for (int i = 0; i < cobasis.length; i++) { cobasis[i] = inequality[P.C[i] - P.lastdv]; if (P.cols[i] == col) { //can make if (i == s) rflag = cobasis[i]; /* look for ray index */ } } for (int i = 0; i < cobasis.length; ++i) { reorder(cobasis); } for (int i = 0; i < cobasis.length; ++i) { sb.append(String.format(" %d", cobasis[i])); // perhaps I need to have a special name for the result column if (!(col == 0) && (rflag == cobasis[i])) { sb.append("*"); // missing cobasis element for ray } } /* get and print incidence information */ long nincidence; /* count number of tight inequalities */ if (col == 0) { nincidence = P.d; } else { nincidence = P.d - 1; } boolean firstime = true; List<Integer> incidenceList = new ArrayList<Integer>(); Collections.addAll(incidenceList, cobasis); for (int i = P.lastdv + 1; i <= P.m; i++) { if (zero(P.b(i))) { if ((col == 0) || zero(P.A[P.rows[i]][col])) { ++nincidence; if (incidence) { if (firstime) { sb.append(" :"); firstime = false; } sb.append(String.format(" %d", inequality[P.B[i] - P.lastdv])); incidenceList.add(inequality[P.B[i] - P.lastdv]); } } } } sb.append(String.format(" I#%d", nincidence)); sb.append(String.format(" det=%s", P.det())); Rational vol = rescaledet(P); /* scales determinant in case input rational */ sb.append(String.format(" in_det=%s", vol.toString())); log.info(sb.toString()); if (P.lexflag()) { solution.cobasis.add(incidenceList.toArray(new Integer[0])); } } /* rescale determinant to get its volume */ /* Vnum/Vden is volume of current basis */ private Rational rescaledet(Dictionary P) { BigInteger gcdprod = BigInteger.ONE; BigInteger vden = BigInteger.ONE; for (int i = 0; i < P.d; i++) { if (P.B[i] <= P.m) { gcdprod = gcdprod.multiply(P.gcd(inequality[P.C[i] - P.lastdv])); vden = vden.multiply(P.lcm(inequality[P.C[i] - P.lastdv])); } } BigInteger vnum = P.det().multiply(gcdprod); Rational rv = new Rational(vnum, vden); return rv; } private CacheEntry popCache() { ++cacheTries; CacheEntry rv = null; if (cacheTail == null) { ++cacheMisses; } else { rv = cacheTail; cacheTail = cacheTail.prev; } return rv; } private void pushCache(Dictionary d, int i, int j, long depth) { Dictionary copy = new Dictionary(d); log.fine(String.format("Saving dict at depth %d", depth)); CacheEntry entry = new CacheEntry(copy, i ,j, depth); entry.prev = cacheTail; cacheTail = entry; } /*update the B,C arrays after a pivot */ /* involving B[bas] and C[cob] */ private static void update (Dictionary dict, int[] vars) { int i = vars[0]; int j = vars[1]; int leave = dict.B[i]; int enter = dict.C[j]; dict.B[i] = enter; reorder(dict.B, dict.rows, i, dict.m + 1); dict.C[j] = leave; reorder(dict.C, dict.cols, j, dict.d); /* restore i and j to new positions in basis */ for (i = 1; dict.B[i] != enter; i++); /*Find basis index */ vars[0] = i; for (j = 0; dict.C[j] != leave; j++); /*Find co-basis index */ vars[1] = j; } /* Pivot Ax<=b to standard form */ /*Try to find a starting basis by pivoting in the variables x[1]..x[d] */ /*If there are any input linearities, these appear first in order[] */ /* Steps: (a) Try to pivot out basic variables using order */ /* Stop if some linearity cannot be made to leave basis */ /* (b) Permanently remove the cobasic indices of linearities */ /* (c) If some decision variable cobasic, it is a linearity, */ /* and will be removed. */ boolean getabasis(Dictionary P, int order[], int[] linearitiesIn, int hull) { long nredundcol = 0L; /* will be calculated here */ List<Integer> linearities = new ArrayList<Integer>(); for (int i = 0; i < linearitiesIn.length; ++i) { linearities.add(linearitiesIn[i]); } if (log.isLoggable(Level.FINE)) { StringBuilder sb = new StringBuilder(); sb.append("getabasis from inequalities given in order"); for (int i = 0; i < P.m; i++) { sb.append(String.format(" %d", order[i])); } log.fine(sb.toString()); } for (int j = 0; j < P.m; j++) { int i = 0; while (i <= P.m && P.B[i] != P.d + order[j]) { i++; /* find leaving basis index i */ } if (j < linearities.size() && i > P.m) /* cannot pivot linearity to cobasis */ { if (debug) { log.fine(P.toString()); } log.warning("Cannot find linearity in the basis"); return false; } if (i <= P.m) { /* try to do a pivot */ int k = 0; while (P.C[k] <= P.d && zero (P.get(i, k))) { ++k; } if (P.C[k] <= P.d) { int[] rs = doPivot(P, i, k); i = rs[0]; k = rs[1]; } else if (j < linearities.size()) { /* cannot pivot linearity to cobasis */ if (zero(P.b(i))) { log.warning(String.format("*Input linearity in row %d is redundant--converted to inequality", order[j])); linearities.set(j, 0); } else { if (debug) { log.fine(P.toString()); } log.warning(String.format("*Input linearity in row %d is inconsistent with earlier linearities", order[j])); log.warning("*No feasible solution"); return false; } } } } /* update linearity array to get rid of redundancies */ int k = 0; /* counters for linearities */ while (k < linearities.size()) { if (linearities.get(k) == 0) { linearities.remove(k); } else { ++k; } } /* column dependencies now can be recorded */ /* redundcol contains input column number 0..n-1 where redundancy is */ k = 0; while (k < P.d && P.C[k] <= P.d) { if (P.C[k] <= P.d) { /* decision variable still in cobasis */ redundancies.add(P.C[k] - hull); /* adjust for hull indices */ ++k; } } /* now we know how many decision variables remain in problem */ P.lastdv = P.d - redundancies.size(); if (log.isLoggable(Level.FINE)) { log.fine(String.format("end of first phase of getabasis: lastdv=%d nredundcol=%d", P.lastdv, redundancies.size())); StringBuilder sb = new StringBuilder(); sb.append("redundant cobases:"); for (int i = 0; i < nredundcol; ++i) { sb.append(redundancies.get(i)); } log.fine(sb.toString()); log.fine(P.toString()); // TODO: finer? } /* Remove linearities from cobasis for rest of computation */ /* This is done in order so indexing is not screwed up */ for (int i = 0; i < linearities.size(); ++i) { /* find cobasic index */ k = 0; while (k < P.d && P.C[k] != linearities.get(i) + P.d) { ++k; } if (k >= P.d) { log.warning("Error removing linearity"); return false; } if (!removecobasicindex(P, k)) { return false; } // TODO: no need if we use P.d all the time to reset d = P.d; } if (debug && linearities.size() > 0) { log.fine(P.toString()); } /* set index value for first slack variable */ /* Check feasability */ if (givenstart) { int i = P.lastdv + 1; while (i <= P.m && !negative (P.A[P.rows[i]][0])) { ++i; } if (i <= P.m) { log.warning("*Infeasible startingcobasis - will be modified"); } } return true; } /* remove the variable C[k] from the problem */ /* used after detecting column dependency */ private boolean removecobasicindex(Dictionary P, int k) { log.fine(String.format("removing cobasic index k=%d C[k]=%d", k, P.C[k])); int cindex = P.C[k]; /* cobasic index to remove */ int deloc = P.cols[k]; /* matrix column location to remove */ for (int i = 1; i <= P.m; ++i) {/* reduce basic indices by 1 after index */ if (P.B[i] > cindex) { P.B[i]--; } } for (int j = k; j < P.d; j++) /* move down other cobasic variables */ { P.C[j] = P.C[j + 1] - 1; /* cobasic index reduced by 1 */ P.cols[j] = P.cols[j + 1]; } if (deloc != P.d) { /* copy col d to deloc */ for (int i = 0; i <= P.m; ++i) { P.A[i][deloc] = P.A[i][P.d]; } /* reassign location for moved column */ int j = 0; while (P.cols[j] != P.d) { j++; } P.cols[j] = deloc; } P.d--; if (debug) { log.fine(P.toString()); } return true; } /*reorder array in increasing order with one misplaced element */ public static void reorder (Integer[] a) { for (int i = 0; i < a.length - 1; i++) { if (a[i] > a[i + 1]) { int temp = a[i]; a[i] = a[i + 1]; a[i + 1] = temp; } } for (int i = a.length - 2; i >= 0; i--) { if (a[i] > a[i + 1]) { int temp = a[i]; a[i] = a[i + 1]; a[i + 1] = temp; } } } private static class CacheEntry { private Dictionary dict; private int bas; private int cob; private long depth; public CacheEntry(Dictionary dict, int bas, int cob, long depth) { this.dict = dict; this.bas = bas; this.cob = cob; this.depth = depth; } public Dictionary getDict() { return dict; } public int getBas() { return bas; } public int getCob() { return cob; } public long getDepth() { return depth; } public CacheEntry prev; } }
41,478
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
LrsMain.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/lrs/LrsMain.java
package lse.math.games.lrs; import lse.math.games.Rational; public class LrsMain { /*******************************************************/ /* lrs_main is driver for lrs.c does H/V enumeration */ /* showing function calls intended for public use */ /*******************************************************/ public static void main(String[] args) { /*************************************************** Step 0: Do some global initialization that should only be done once, no matter how many lrs_dat records are allocated. db ***************************************************/ if (!lrs_init ("\n*lrs:")) { System.exit(1); } LrsMain program = new LrsMain(); Rational[][] payoff1 = new Rational[][] { { Rational.valueOf("1"), Rational.valueOf("-3"), Rational.valueOf("-2"), Rational.valueOf("-3")}, { Rational.valueOf("1"), Rational.valueOf("-2"), Rational.valueOf("-6"), Rational.valueOf("-1")} }; Rational[][] payoff2 = new Rational[][] { { Rational.valueOf("1"), Rational.valueOf("-3"), Rational.valueOf("-3")}, { Rational.valueOf("1"), Rational.valueOf("-2"), Rational.valueOf("-5")}, { Rational.valueOf("1"), Rational.valueOf("0"), Rational.valueOf("-6")} }; program.run(new HPolygon(payoff1, true), new HPolygon(payoff2, true)); System.exit(0); } public void run(HPolygon one, HPolygon two) { //int startcol = 0; //boolean prune = false; /* if TRUE, getnextbasis will prune tree and backtrack */ /*********************************************************************************/ /* Step 1: Allocate lrs_dat, lrs_dic and set up the problem */ /*********************************************************************************/ //Q = lrs_alloc_dat ("LRS globals"); /* allocate and init structure for static problem data */ //TODO: put in a factory that manages instances /* if (lrs_global_count >= MAX_LRS_GLOBALS) { fprintf (stderr, "Fatal: Attempt to allocate more than %ld global data blocks\n", MAX_LRS_GLOBALS); exit (1); } lrs_global_list[lrs_global_count] = Q; Q->id = lrs_global_count; lrs_global_count++; */ LrsAlgorithm lrs = new LrsAlgorithm(); /* structure for holding static problem data */ lrs.run(one); printtotals(lrs, one, lrs.P); /* print final totals, including estimates */ lrs.run(two); printtotals(lrs, two, lrs.P); /* print final totals, including estimates */ //lrs.close("lrs:"); System.exit(0); } private static boolean lrs_init(String string) { /* TODO: put in a factory printf ("%s", name); printf (TITLE); printf (VERSION); printf ("("); printf (BIT); printf (","); printf (ARITH); if (!lrs_mp_init (ZERO, stdin, stdout)) return FALSE; printf (")"); lrs_global_count = 0; lrs_checkpoint_seconds = 0; #ifdef SIGNALS setup_signals (); #endif return TRUE; */ return true; } /*********************************************/ /* end of model test program for lrs library */ /*********************************************/ // These appear to be all comments... perhaps useful for logging? void printtotals (LrsAlgorithm Q, HPolygon input, Dictionary P) { System.out.println(); System.out.print("end"); if(Q.verbose) { System.out.println(); System.out.print(String.format("*Sum of det(B)=%s", Q.sumdet.toString())); } /* output things specific to vertex/ray computation */ System.out.println(); System.out.print(String.format("*Totals: vertices=%d rays=%d bases=%d", Q.count[1], Q.count[0], Q.count[2])); System.out.print(String.format(" integer_vertices=%d ", Q.count[4])); if (Q.count[0] > 0) { System.out.print(String.format(" vertices+rays=%d", Q.count[0] + Q.count[1])); } /* if ((Q.cest[2] > 0) || (Q.cest[0] > 0)) { System.out.println(); System.out.print(String.format("*Estimates: vertices=%.0f rays=%.0f", Q.count[1] + Q.cest[1], Q.count[0] + Q.cest[0])); System.out.print(String.format(" bases=%.0f integer_vertices=%.0f ", Q.count[2] + Q.cest[2], Q.count[4] + Q.cest[4])); System.out.println(); System.out.print(String.format("*Total number of tree nodes evaluated: %d", Q.totalnodes)); //System.out.print("\n*Estimated total running time=%.1f secs ",(Q.count[2] + Q.cest[2])/Q.totalnodes * get_time()); } */ /* end of output for vertices/rays */ if(!Q.verbose) return; System.out.println(); System.out.print(String.format("*Input size m=%d rows n=%d columns", input.getNumRows(), input.getNumCols())); System.out.print(String.format(" working dimension=%d", P.d)); System.out.println(); System.out.print("*Starting cobasis defined by input rows"); Integer[] temparray = new Integer[P.lastdv]; for (int i = 0; i < P.lastdv; i++) temparray[i] = Q.inequality[P.C[i] - P.lastdv]; for (int i = 0; i < P.lastdv; i++) LrsAlgorithm.reorder(temparray); for (int i = 0; i < P.lastdv; i++) System.out.print(String.format(" %d", temparray[i])); System.out.println(); //TODO: cache impl -> System.out.print(String.format("\n*Dictionary Cache: max size= %ld misses= %ld/%ld Tree Depth= %ld", dict_count, cache_misses, cache_tries, Q.deepest)); } /* end of lrs_printtotals */ }
5,499
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
HPolygon.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/lrs/HPolygon.java
package lse.math.games.lrs; import lse.math.games.Rational; public class HPolygon { public boolean nonnegative = true; public boolean incidence = true; // for recording the full cobasis at lexmin points public boolean printcobasis = true; //incidence implies printcobasis //hull = false public int[] linearities = new int[0]; private int n; private int m; private int d; public Rational[][] matrix; public HPolygon(Rational[][] matrix, boolean nonnegative) { this.matrix = matrix; m = matrix.length; n = m > 0 ? matrix[0].length : 0; d = n - 1; this.nonnegative = nonnegative; } public int getNumRows() { return m; } public int getNumCols() { return n; } public int getDimension() { return d; } public void setIncidence(boolean value) { incidence = value; if (value && !printcobasis) printcobasis = true; } /* for H-rep, are zero in column 0 */ public boolean homogeneous() { boolean ishomo = true; for (Rational[] row : matrix) { if (row.length < 1 || !row[0].isZero()) { ishomo = false; } } return ishomo; } }
1,149
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
Dictionary.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/lrs/Dictionary.java
package lse.math.games.lrs; import static lse.math.games.BigIntegerUtils.greater; import static lse.math.games.BigIntegerUtils.negative; import static lse.math.games.BigIntegerUtils.one; import static lse.math.games.BigIntegerUtils.positive; import static lse.math.games.BigIntegerUtils.zero; import static java.math.BigInteger.*; import lse.math.games.BigIntegerUtils; import lse.math.games.Rational; import lse.math.games.io.ColumnTextWriter; import java.io.StringWriter; import java.math.BigInteger; public class Dictionary { /******************************************************************************/ /* Indexing after initialization */ /* Basis Cobasis */ /* --------------------------------------- ----------------------------- */ /* | i |0|1| .... |lastdv|lastdv+1|...|m| | j | 0 | 1 | ... |d-1| d | */ /* |-----|+|+|++++++|++++++|--------|---|-| |----|---|---|-----|---|+++++| */ /* |B[i] |0|1| .... |lastdv|lastdv+1|...|m| |C[j]|m+1|m+2| ... |m+d|m+d+1| */ /* -----|+|+|++++++|++++++|????????|???|?| ----|???|???|-----|???|+++++| */ /* */ /* Row[i] is row location for B[i] Col[j] is column location for C[j] */ /* ----------------------------- ----------------------------- */ /* | i |0|1| ..........|m-1|m| | j | 0 | 1 | ... |d-1| d | */ /* |-------|+|-|-----------|---|-| |------|---|---|--- |---|++++| */ /* |Row[i] |0|1|...........|m-1|m| |Col[j]| 1 | 2 | ... | d | 0 | */ /* --------|+|*|***********|***|*| ------|***|***|*****|***|++++| */ /* */ /* + = remains invariant * = indices may be permuted ? = swapped by pivot */ /* */ /* m = number of input rows n= number of input columns */ /* input dimension inputd = n-1 (H-rep) or n (V-rep) */ /* lastdv = inputd-nredundcol (each redundant column removes a dec. var) */ /* working dimension d=lastdv-nlinearity (an input linearity removes a slack) */ /* obj function in row 0, index 0=B[0] col 0 has index m+d+1=C[d] */ /* H-rep: b-vector in col 0, A matrix in columns 1..n-1 */ /* V-rep: col 0 all zero, b-vector in col 1, A matrix in columns 1..n */ /******************************************************************************/ BigInteger[][] A; // TODO: do not allow interaction via row and cols, but through bas/cob indexes int d; // A has d+1 columns, col 0 is b-vector int m; // A has m+1 rows, row 0 is cost row private boolean _lexflag; // true if lexmin basis for this vertex // basis, row location indices int[] B; int[] rows; // TODO: abstract away use of rows and cols... just interact via bas/cob indexes // cobasis, column location indices int[] C; int[] cols; int lastdv; /* index of last dec. variable after preproc */ private boolean nonnegative = true; private BigInteger _det; /* current determinant of basis */ private BigInteger[] _gcd; /* Gcd of each row of numerators */ private BigInteger[] _lcm; /* Lcm for each row of input denominators */ //private long d_orig; // value of d as A was allocated (E.G.) private boolean homogeneous = true; private Rational obj; // objective function value // List<Integer> linearities = new ArrayList<Integer>(); private boolean lexmindirty = false; public Dictionary(HPolygon in, LrsAlgorithm Q) { int m_A = in.getNumRows(); d = in.getDimension(); nonnegative = in.nonnegative; /* nonnegative flag set means that problem is d rows "bigger" */ /* since nonnegative constraints are not kept explicitly */ m = in.nonnegative ? m_A + d : m_A; B = new int[m + 1]; rows = new int[m + 1]; C = new int[d + 1]; cols = new int[d + 1]; //d_orig = d; A = new BigInteger[m_A + 1][d + 1]; /* Initializations */ _lexflag = true; _det = ONE; obj = Rational.ZERO; /*m+d+1 is the number of variables, labelled 0,1,2,...,m+d */ /* initialize array to zero */ for (int i = 0; i <= m_A; ++i) { for (int j = 0; j <= d; ++j) { A[i][j] = ZERO; } } //Q.facet = new long[d + 1]; //this.redundcol = new long[d + 1]; _gcd = new BigInteger[m + 1]; _lcm = new BigInteger[m + 1]; Q.saved_C = new long[d + 1]; lastdv = d; /* last decision variable may be decreased */ /* if there are redundant columns */ /*initialize basis and co-basis indices, and row col locations */ /*if nonnegative, we label differently to avoid initial pivots */ /* set basic indices and rows */ if (nonnegative) { for (int i = 0; i <= m; ++i) { B[i] = i; if (i <= d) { rows[i] = 0; /* no row for decision variables */ } else { rows[i] = i - d; } } } else { for (int i = 0; i <= m; ++i) { if (i == 0) { B[0]=0; } else { B[i] = d + i; } rows[i] = i; } } for (int j = 0; j < d; ++j) { if(nonnegative) { C[j] = m + j + 1; } else { C[j] = j + 1; } cols[j] = j + 1; } C[d] = m + d + 1; cols[d] = 0; readDic(0, in.matrix, Q.verbose); } public Dictionary(Dictionary src) { copy(src); } public BigInteger det() { return _det; } public BigInteger gcd(int i) { return _gcd[i]; } public BigInteger lcm(int i) { return _lcm[i]; } public BigInteger cost(int s) { int col = cols[s]; return A[0][col]; } public BigInteger get(int r, int s) { int row = rows[r]; int col = cols[s]; return A[row][col]; } public BigInteger b(int r) { int row = rows[r]; return A[row][0]; } public boolean lexflag() { if (lexmindirty) { _lexflag = lexmincol(0); lexmindirty = false; } return _lexflag; } public void copy(Dictionary src) { this.d = src.d; this.m = src.m; this.nonnegative = src.nonnegative; this._det = src._det; this._lexflag = src._lexflag; this.lexmindirty = src.lexmindirty; this.obj = src.obj; this.lastdv = src.lastdv; this._det = src._det; this.B = new int[src.B.length]; for (int i = 0; i < this.B.length; ++i) { this.B[i] = src.B[i]; } this.C = new int[src.C.length]; for (int i = 0; i < this.C.length; ++i) { this.C[i] = src.C[i]; } this.cols = new int[src.cols.length]; for (int i = 0; i < this.cols.length; ++i) { this.cols[i] = src.cols[i]; } this.rows = new int[src.rows.length]; for (int i = 0; i < this.rows.length; ++i) { this.rows[i] = src.rows[i]; } this._gcd = new BigInteger[src._gcd.length]; for (int i = 0; i < this._gcd.length; ++i) { this._gcd[i] = src._gcd[i]; } this._lcm = new BigInteger[src._lcm.length]; for (int i = 0; i < this._lcm.length; ++i) { this._lcm[i] = src._lcm[i]; } this.A = new BigInteger[src.A.length][]; for (int i = 0; i < this.A.length; ++i) { this.A[i] = new BigInteger[src.A[i].length]; for (int j = 0; j < this.A[i].length; ++j) { this.A[i][j] = src.A[i][j]; } } } private void readDic(int hull, Rational[][] matrix, boolean verbose) { //init matrix A[0][0] = ONE; _lcm[0] = ONE; _gcd[0] = ONE; //should this be m or m_A for (int i = 1; i <= matrix.length; ++i) /* read in input matrix row by row */ { _lcm[i] = ONE; /* Lcm of denominators */ _gcd[i] = ZERO; /* Gcd of numerators */ for (int j = hull; j < matrix[i-1].length; ++j) /* hull data copied to cols 1..d */ { Rational rat = matrix[i-1][j]; A[i][j] = rat.num; A[0][j] = rat.den; if (!one(A[0][j])) { _lcm[i] = BigIntegerUtils.lcm(_lcm[i], A[0][j]); /* update lcm of denominators */ } _gcd[i] = _gcd[i].gcd(A[i][j]); /* update gcd of numerators */ } if (hull != 0) { A[i][0] = ZERO; /*for hull, we have to append an extra column of zeroes */ if (!one(A[i][1]) || !one(A[0][1])) {/* all rows must have a one in column one */ // TODO: Q->polytope = false; } } if (!zero(A[i][hull])) /* for H-rep, are zero in column 0 */ { homogeneous = false; /* for V-rep, all zero in column 1 */ } if (greater(_gcd[i], ONE) || greater(_lcm[i], ONE)) { for (int j = 0; j <= d; j++) { BigInteger tmp = A[i][j].divide(_gcd[i]); /*reduce numerators by Gcd */ tmp = tmp.multiply(_lcm[i]); /*remove denominators */ A[i][j] = tmp.divide(A[0][j]); /*reduce by former denominator */ } } } /* 2010.4.26 patch */ /* set up Gcd and Lcm for nonexistent nongative inequalities */ if(nonnegative) { for (int i = matrix.length + 1; i < _lcm.length; ++i) { _lcm[i] = ONE; //} //for (int i = matrix.length + 1; i < Gcd.length; ++i) { _gcd[i] = ONE; } } if (homogeneous && verbose) { System.out.println(); System.out.print("*Input is homogeneous, column 1 not treated as redundant"); } } /*private void setRow(int hull, int row, Rational[] values, boolean isLinearity) { BigInteger[] oD = new BigInteger[d]; oD[0] = ONE; int i = row; _lcm[i] = ONE; // Lcm of denominators _gcd[i] = ZERO; // Gcd of numerators for (int j = hull; j <= d; ++j) // hull data copied to cols 1..d { A[i][j] = values[j-hull].num; oD[j] = values[j-hull].den; if (!one(oD[j])) { _lcm[i] = BigIntegerUtils.lcm(_lcm[i], oD[j]); // update lcm of denominators } _gcd[i] = _gcd[i].gcd(A[i][j]); // update gcd of numerators } if (hull != 0) { A[i][0] = ZERO; // for hull, we have to append an extra column of zeroes if (!one(A[i][1]) || !one(oD[1])) { // all rows must have a one in column one //Q->polytope = FALSE; } } if (!zero(A[i][hull])) { // for H-rep, are zero in column 0 //homogeneous = false; // for V-rep, all zero in column 1 } if (greater(_gcd[i], ONE) || greater(_lcm[i], ONE)) { for (int j = 0; j <= d; j++) { A[i][j] = A[i][j].divide(_gcd[i]).multiply(_lcm[i]).divide(oD[j]); //exactdivint (A[i][j], Gcd[i], Temp); //reduce numerators by Gcd //mulint (Lcm[i], Temp, Temp); //remove denominators //exactdivint (Temp, oD[j], A[i][j]); //reduce by former denominator } } if (isLinearity) // input is linearity { linearities.add(row); } // 2010.4.26 Set Gcd and Lcm for the non-existant rows when nonnegative set if (nonnegative && row == m) { for (int j = 1; j <= d; ++j) { _lcm[m + j] = ONE; _gcd[m + j] = ONE; } } }*/ /*private void setObj(int hull, Rational[] values, boolean max) { if (max) { //Q->maximize=TRUE; } else { //Q->minimize=TRUE; for(int i=0; i<= d; ++i) { values[i]= values[i].negate(); } } setRow(hull, 0, values, false); }*/ public int[] cobasis() { int[] cobasis = new int[d]; for (int i = 0; i < cobasis.length; ++i) { cobasis[cols[i] - 1] = i; } return cobasis; } public boolean isNonNegative() { return nonnegative; } /* Qpivot routine for array A */ /* indices bas, cob are for Basis B and CoBasis C */ /* corresponding to row Row[bas] and column */ /* Col[cob] respectively */ public void pivot(int r, int s, boolean debug) { lexmindirty = true; int row = rows[r]; int col = cols[s]; /* Ars=A[r][s] */ BigInteger Ars = A[row][col]; if ((positive(Ars) && negative(_det)) || (negative(Ars) && positive(_det))) { _det = _det.negate(); /*adjust determinant to new sign */ } for (int i = 0; i < A.length; i++) { if (i != row) { for (int j = 0; j <= d; j++) { if (j != col) { /* A[i][j]=(A[i][j]*Ars-A[i][s]*A[r][j])/P->det; */ BigInteger Nt = A[i][j].multiply(Ars); BigInteger Ns = A[i][col].multiply(A[row][j]); A[i][j] = (Nt.subtract(Ns)).divide(_det); } } } } if (positive(Ars) || zero(Ars)) { for (int j = 0; j <= d; j++) /* no need to change sign if Ars neg */ /* A[r][j]=-A[r][j]; */ if (!zero (A[row][j])) A[row][j] = A[row][j].negate(); } /* watch out for above "if" when removing this "}" ! */ else { for (int i = 0; i < A.length; i++) { if (!zero (A[i][col])) { A[i][col] = A[i][col].negate(); } } } /* A[r][s]=P->det; */ A[row][col] = _det; /* restore old determinant */ _det = negative(Ars) ? Ars.negate() : Ars; /* always keep positive determinant */ /* set the new rescaled objective function value */ obj = new Rational( _gcd[0].multiply(A[0][0]).negate(), //num _det.multiply(_lcm[0])); //den } public boolean lexmin(int s) { return lexmincol(cols[s]); } /*test if basis is lex-min for vertex or ray, if so true */ /* false if a_r,g=0, a_rs !=0, r > s */ private boolean lexmincol(int compareCol) { /*do lexmin test for vertex if col=0, otherwise for ray */ for (int i = lastdv + 1; i <= m; i++) { int row = rows[i]; if (zero(A[row][compareCol])) { /* necessary for lexmin to fail */ for (int j = 0; j < d; j++) { int col = cols[j]; if (B[i] > C[j]) /* possible pivot to reduce basis */ { if (zero(A[row][0])) /* no need for ratio test, any pivot feasible */ { if (!zero(A[row][col])) { return false; } } else if (negative(A[row][col]) && ismin(row, col)) { return false; } } } } } return true; } /* end of lexmin */ /*test if A[r][s] is a min ratio for col s */ private boolean ismin (int row, int col) { for (int i = 1; i < A.length; i++) if ((i != row) && negative (A[i][col]) && BigIntegerUtils.comprod(A[i][0], A[row][col], A[i][col], A[row][0]) != 0) { return false; } return true; } /* find min index ratio -aig/ais, ais<0 */ /* if multiple, checks successive basis columns */ /* recoded Dec 1997 */ public int ratio (int s, boolean debug) /*find lex min. ratio */ { int col = cols[s]; int[] minratio = new int[m + 1]; int nstart = 0; int ndegencount = 0; int degencount = 0; /* search rows with negative coefficient in dictionary */ /* minratio contains indices of min ratio cols */ for (int j = lastdv + 1; j <= m; j++) { if (negative (A[rows[j]][col])) { minratio[degencount++] = j; } } if (debug) { System.out.print(" Min ratios: "); for (int i = 0; i < degencount; i++) System.out.print(String.format(" %d ", B[minratio[i]])); } if (degencount == 0) { return degencount; /* non-negative pivot column */ } int ratiocol = 0; /* column being checked, initially rhs */ int start = 0; /* starting location in minratio array */ int bindex = d + 1; /* index of next basic variable to consider */ int cindex = 0; /* index of next cobasic variable to consider */ int basicindex = d; /* index of basis inverse for current ratio test, except d=rhs test */ while (degencount > 1) /*keep going until unique min ratio found */ { if (B[bindex] == basicindex) /* identity col in basis inverse */ { if (minratio[start] == bindex) { /* remove this index, all others stay */ start++; degencount--; } bindex++; } else { /* perform ratio test on rhs or column of basis inverse */ boolean firstime = true; /*For ratio test, true on first pass,else false */ /*get next ratio column and increment cindex */ if (basicindex != d) { ratiocol = cols[cindex++]; } BigInteger Nmin = null, Dmin = null; //they get initialized before they are used for (int j = start; j < start + degencount; j++) { int i = rows[minratio[j]]; /* i is the row location of the next basic variable */ int comp = 1; /* 1: lhs>rhs; 0:lhs=rhs; -1: lhs<rhs */ if (firstime) { firstime = false; /*force new min ratio on first time */ } else { if (positive (Nmin) || negative (A[i][ratiocol])) { if (negative (Nmin) || positive (A[i][ratiocol])) { comp = BigIntegerUtils.comprod(Nmin, A[i][col], A[i][ratiocol], Dmin); } else { comp = -1; } } else if (zero(Nmin) && zero(A[i][ratiocol])) { comp = 0; } if (ratiocol == 0) { comp = -comp; /* all signs reversed for rhs */ } } if (comp == 1) { /*new minimum ratio */ nstart = j; Nmin = A[i][ratiocol]; Dmin = A[i][col]; ndegencount = 1; } else if (comp == 0) { /* repeated minimum */ minratio[nstart + ndegencount++] = minratio[j]; } } degencount = ndegencount; start = nstart; } basicindex++; /* increment column of basis inverse to check next */ if (debug) { System.out.print(String.format(" ratiocol=%d degencount=%d ", ratiocol, degencount)); System.out.print(" Min ratios: "); for (int i = start; i < start + degencount; i++) System.out.print(String.format(" %d ", B[minratio[i]])); } } return (minratio[start]); } /* print the integer m by n array A with B,C,Row,Col vectors */ @Override public String toString() { String newline = System.getProperty("line.separator"); StringWriter output = new StringWriter(); output.write(newline); output.write(" Basis "); for (int i = 0; i <= m; i++) { output.write(String.format("%d ", B[i])); } output.write(newline); output.write(" Row "); for (int i = 0; i <= m; i++) { output.write(String.format("%d ", rows[i])); } output.write(newline); output.write(" Co-Basis "); for (int i = 0; i <= d; i++) { output.write(String.format("%d ", C[i])); } output.write(newline); output.write(" Column "); for (int i = 0; i <= d; i++) { output.write(String.format("%d ", cols[i])); } output.write(newline); output.write(String.format(" det=%s", _det.toString())); output.write(newline); ColumnTextWriter colpp = new ColumnTextWriter(); colpp.writeCol("A"); for (int j = 0; j <= d; j++) { colpp.writeCol(C[j]); } colpp.endRow(); for (int i = 0; i <= m; ++i) { colpp.writeCol(B[i]); for (int j = 0; j <= d; j++) { colpp.writeCol(A[rows[i]][cols[j]].toString()); } if (i==0 && nonnegative) { //skip basic rows - don't exist! i=d; } colpp.endRow(); } output.write(colpp.toString()); return output.toString(); } /*print the long precision integer in row r col s of matrix A */ /*private void pimat (int r, int s, BigInteger Nt, String name, StringWriter output) { if (s == 0) { output.write(String.format("%s[%d][%d]=", name, B[r], C[s])); } else { output.write(String.format("[%d]=", C[s])); } output.write(String.format("%s", Nt.toString())); }*/ }
21,131
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
Lrs.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/lrs/Lrs.java
package lse.math.games.lrs; public interface Lrs { VPolygon run(HPolygon in); }
87
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
VPolygon.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/lrs/VPolygon.java
package lse.math.games.lrs; import java.util.ArrayList; import java.util.List; import lse.math.games.Rational; public class VPolygon { public List<Rational[]> vertices = new ArrayList<Rational[]>(); // may also contain rays public List<Integer[]> cobasis = new ArrayList<Integer[]>(); //boolean hull = true; //when is this false? I should try to set this as an output param as well //boolean voronoi = false; //(if true, then poly is false) /* all rows must have a one in column one */ public boolean polytope() { boolean ispoly = true; for (Rational[] row : vertices) { if (row.length < 1 || !row[0].isOne()) { ispoly = false; } } return ispoly; } /* for V-rep, all zero in column 1 */ public boolean homogeneous() { boolean ishomo = true; for (Rational[] row : vertices) { if (row.length < 2 || !row[1].isZero()) { ishomo = false; } } return ishomo; } }
951
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
RedundAlgorithm.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/lrs/RedundAlgorithm.java
package lse.math.games.lrs; // //import lse.math.games.Rational; // public class RedundAlgorithm { // public void run() // { // /*******************************************************/ // /* redund_main is driver for redund.c, removes all */ // /* redundant rows from an H or V-representation */ // /* showing function calls intended for public use */ // /*******************************************************/ // Rational[][] Ain; /* holds a copy of the input matrix to output at the end */ // // long[] redineq; /* redineq[i]=0 if ineq i non-red,1 if red,2 linearity */ // long ineq; /* input inequality number of current index */ // // Dictionary P; /* structure for holding current dictionary and indices */ // Dictionary Q; /* structure for holding static problem data */ // // Rational[][] Lin; /* holds input linearities if any are found */ // // long i, j, d, m; // long nlinearity; /* number of linearities in input file */ // long nredund; /* number of redundant rows in input file */ // long lastdv; // long debug; // long index; /* basic index for redundancy test */ // // /* global variables lrs_ifp and lrs_ofp are file pointers for input and output */ // /* they default to stdin and stdout, but may be overidden by command line parms. */ // /* Lin is global 2-d array for linearity space if it is found (redund columns) */ // // // lrs_ifp = stdin; // // lrs_ofp = stdout; // /*************************************************** // Step 0: // Do some global initialization that should only be done once, // no matter how many lrs_dat records are allocated. db // // ***************************************************/ // // //if ( !lrs_init ("\n*redund:")) // // return 1; // // //printf (AUTHOR); // // /*********************************************************************************/ // /* Step 1: Allocate lrs_dat, lrs_dic and set up the problem */ // /*********************************************************************************/ // // //Q = lrs_alloc_dat ("LRS globals"); /* allocate and init structure for static problem data */ // // //if (Q == NULL) // // return 1; // // // if (!lrs_read_dat (Q, argc, argv)) /* read first part of problem data to get dimensions */ // // return 1; /* and problem type: H- or V- input representation */ // // P = lrs_alloc_dic (Q); /* allocate and initialize lrs_dic */ // if (P == NULL) // return 1; // // if (!lrs_read_dic (P, Q)) /* read remainder of input to setup P and Q */ // return 1; // // /* if non-negative flag is set, non-negative constraints are not input */ // /* explicitly, and are not checked for redundancy */ // // m = P->m_A; /* number of rows of A matrix */ // d = P->d; // debug = Q->debug; // // redineq = calloc ((m + 1), sizeof (long)); // Ain = lrs_alloc_mp_matrix (m, d); /* make a copy of A matrix for output later */ // // for (i = 1; i <= m; i++) // { // for (j = 0; j <= d; j++) // copy (Ain[i][j], P->A[i][j]); // // if (debug) // lrs_printrow ("*", Q, Ain[i], d); // } // // /*********************************************************************************/ // /* Step 2: Find a starting cobasis from default of specified order */ // /* Lin is created if necessary to hold linearity space */ // /*********************************************************************************/ // // if (!lrs_getfirstbasis (&P, Q, &Lin, TRUE)) // return 1; // // /* Pivot to a starting dictionary */ // /* There may have been column redundancy */ // /* If so the linearity space is obtained and redundant */ // /* columns are removed. User can access linearity space */ // /* from lrs_mp_matrix Lin dimensions nredundcol x d+1 */ // // // /*********************************************************************************/ // /* Step 3: Test each row of the dictionary to see if it is redundant */ // /*********************************************************************************/ // // /* note some of these may have been changed in getting initial dictionary */ // m = P->m_A; // d = P->d; // nlinearity = Q->nlinearity; // lastdv = Q->lastdv; // if (debug) // fprintf (lrs_ofp, "\ncheckindex m=%ld, n=%ld, nlinearity=%ld lastdv=%ld", m,d,nlinearity,lastdv); // // /* linearities are not considered for redundancy */ // // for (i = 0; i < nlinearity; i++) // redineq[Q->linearity[i]] = 2L; // // /* rows 0..lastdv are cost, decision variables, or linearities */ // /* other rows need to be tested */ // // for (index = lastdv + 1; index <= m + d; index++) // { // ineq = Q->inequality[index - lastdv]; /* the input inequality number corr. to this index */ // // redineq[ineq] = checkindex (P, Q, index); // if (debug) // fprintf (lrs_ofp, "\ncheck index=%ld, inequality=%ld, redineq=%ld", index, ineq, redineq[ineq]); // if (redineq[ineq] == ONE) // { // fprintf (lrs_ofp, "\n*row %ld was redundant and removed", ineq); // fflush (lrs_ofp); // } // // } /* end for index ..... */ // // if (debug) // { // fprintf (lrs_ofp, "\n*redineq:"); // for (i = 1; i <= m; i++) // fprintf (lrs_ofp, " %ld", redineq[i]); // } // // if (!Q->hull) // fprintf (lrs_ofp, "\nH-representation"); // else // fprintf (lrs_ofp, "\nV-representation"); // // /* linearities will be printed first in output */ // // if (nlinearity > 0) // { // fprintf (lrs_ofp, "\nlinearity %ld", nlinearity); // for (i = 1; i <= nlinearity; i++) // fprintf (lrs_ofp, " %ld", i); // // } // nredund = nlinearity; /* count number of non-redundant inequalities */ // for (i = 1; i <= m; i++) // if (redineq[i] == 0) // nredund++; // fprintf (lrs_ofp, "\nbegin"); // fprintf (lrs_ofp, "\n%ld %ld rational", nredund, Q->n); // // /* print the linearities first */ // // for (i = 0; i < nlinearity; i++) // lrs_printrow ("", Q, Ain[Q->linearity[i]], Q->inputd); // // for (i = 1; i <= m; i++) // if (redineq[i] == 0) // lrs_printrow ("", Q, Ain[i], Q->inputd); // fprintf (lrs_ofp, "\nend"); // fprintf (lrs_ofp, "\n*Input had %ld rows and %ld columns", m, Q->n); // fprintf (lrs_ofp, ": %ld row(s) redundant", m - nredund); // // lrs_free_dic (P,Q); /* deallocate lrs_dic */ // lrs_free_dat (Q); /* deallocate lrs_dat */ // // lrs_close ("redund:"); // } // /*********************************************/ // /* end of redund.c */ // /*********************************************/ }
7,267
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
BimatrixSolver.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/matrix/BimatrixSolver.java
package lse.math.games.matrix; import java.io.PrintWriter; import java.util.List; import java.util.Random; import java.util.logging.Logger; import lse.math.games.Rational; import lse.math.games.lrs.Lrs; import lse.math.games.lrs.HPolygon; import lse.math.games.lrs.VPolygon; import lse.math.games.lcp.LCP; import lse.math.games.lcp.LemkeAlgorithm; import lse.math.games.lcp.LemkeAlgorithm.LemkeException; public class BimatrixSolver { private static final Logger log = Logger.getLogger(BimatrixSolver.class.getName()); public Rational[] computePriorBeliefs(int size, Random prng) { Rational[] priors = null; if (prng != null) { priors = Rational.probVector(size, prng); } else { priors = new Rational[size]; Rational prob = Rational.ONE.divide(Rational.valueOf(size)); for (int i = 0; i < size; ++i) { priors[i] = prob; } } return priors; } public Equilibrium findOneEquilibrium(LemkeAlgorithm lemke, Rational[][] a, Rational[][] b, Rational[] xPriors, Rational[] yPriors, PrintWriter out) throws LemkeException { // 1. Adjust the payoffs to be strictly negative (max = -1) Rational payCorrectA = BimatrixSolver.correctPaymentsNeg(a); Rational payCorrectB = BimatrixSolver.correctPaymentsNeg(b); // 2. Generate the LCP from the two payoff matrices and the priors LCP lcp = BimatrixSolver.generateLCP(a, b, xPriors, yPriors); //out.println("#Lemke LCP " + lcp.size()); //out.println(lcp.toString()); log.info(lcp.toString()); // 3. Pass the combination of the two to the Lemke algorithm Rational[] z = lemke.run(lcp); // 4. Convert solution into a mixed strategy equilibrium Equilibrium eq = BimatrixSolver.extractLCPSolution(z, a.length); Equilibria eqs = new Equilibria(); eqs.add(eq); // 5. Get original payoffs back and compute expected payoffs if (payCorrectA.compareTo(0) < 0) { BimatrixSolver.applyPayCorrect(a, payCorrectA.negate()); } if (payCorrectB.compareTo(0) < 0) { BimatrixSolver.applyPayCorrect(b, payCorrectB.negate()); } eq.payoff1 = BimatrixSolver.computeExpectedPayoff(a, eq.probVec1, eq.probVec2); eq.payoff2 = BimatrixSolver.computeExpectedPayoff(b, eq.probVec1, eq.probVec2); return eq; } public Equilibria findAllEq(Lrs lrs, Rational[][] a, Rational[][] b) { int rows = a.length; int columns = (rows > 0) ? a[0].length : 0; if (b.length != rows || (rows > 0 && b[0].length != columns)) { throw new RuntimeException("Matrix b does not match matrix a"); //TODO } // create LRS inputs matrices // First we adjust payoffs to make sure payoff matrices are positive Rational payCorrectB = getPayCorrectPos(b); Rational[][] lrs1 = new Rational[columns][rows + 1]; for (int j = 0; j < lrs1.length; j++) { lrs1[j][0] = Rational.ONE; for (int i = 1; i < lrs1[j].length; i++) { lrs1[j][i] = b[i-1][j].add(payCorrectB).negate(); } } Rational payCorrectA = getPayCorrectPos(a); Rational[][] lrs2 = new Rational[rows][columns + 1]; for (int i = 0; i < lrs2.length; i++) { lrs2[i][0] = Rational.ONE; for (int j = 1; j < lrs2[i].length; j++) { lrs2[i][j] = a[i][j-1].add(payCorrectA).negate(); } } // run lrs on each input VPolygon lrsout1 = lrs.run(new HPolygon(lrs1, true)); VPolygon lrsout2 = lrs.run(new HPolygon(lrs2, true)); // create probability vectors by rescaling vertex coordinates // a vertex is a strategy, the strategy is defined by an array of probabilities Rational[][] p1_vertex_array = convertToProbs(lrsout1.vertices); Rational[][] p2_vertex_array = convertToProbs(lrsout2.vertices); List<Integer[]> p1_vertex_labels = lrsout1.cobasis; List<Integer[]> p2_vertex_labels = lrsout2.cobasis; // rearrange labels for P1 // for i in 1...M+N if i>N i=i-N if i<=N i=i+M // This is needed to coordinate the labels between p1 and p2. for (Integer[] labels : p1_vertex_labels) { for (int i = 0; i < labels.length; ++i) { if (labels[i] > columns) { labels[i] -= columns; } else { labels[i] += rows; } } } //create array of integers representing binding inequalities //represents bit string with 1s in all positions except 0 int[] p1_lab_int_array = createLabelBitmapArr(p1_vertex_labels, rows, columns); int[] p2_lab_int_array = createLabelBitmapArr(p2_vertex_labels, rows, columns); // calculate p2_artificial integer so that we can ignore artificial equilibrium int p2_art_int = (1<<(rows + columns + 1)) - 2; for (int i = (rows + 1); i < (rows + columns + 1); i++) { p2_art_int -= (1<<i); } // setup array (one for each player) @p1_eq_strategy initially with -1s for each index // it is set to the next free integer when a new number for each equilibrium vertex int[] p1_eq_strategy = new int[p1_vertex_array.length]; for (int i = 0; i < p1_eq_strategy.length; ++i) { p1_eq_strategy[i] = -1; } int[] p2_eq_strategy = new int[p2_vertex_array.length]; for (int i = 0; i < p2_eq_strategy.length; ++i) { p2_eq_strategy[i] = -1; } // find and record equilibria by testing for complementarity // test for 0 as result of bit wise and on label_integers for vertices int p1_index = 0; // int p2_index = 0; // index of vertices - used to go through p1/2_lab_int_array int eq_index = 1; // indexes number of extreme equilibria int s1 = 1; int s2 = 1; Equilibria equilibria = new Equilibria(); // i, j index equilibrium strategy profiles of p1,p2 respectively for (int p1_int : p1_lab_int_array) { for (int p2_int : p2_lab_int_array) { if ((p1_int & p2_int) == 0 && p2_int != p2_art_int) { // print eq vertex indices to IN if (p1_eq_strategy[p1_index] == -1) { p1_eq_strategy[p1_index] = s1; s1++; } if (p2_eq_strategy[p2_index] == -1) { p2_eq_strategy[p2_index] = s2; s2++; } Equilibrium eq = new Equilibrium(p1_eq_strategy[p1_index], p2_eq_strategy[p2_index]); eq.probVec1 = p1_vertex_array[p1_index]; eq.payoff1 = computeExpectedPayoff(a, p1_vertex_array[p1_index], p2_vertex_array[p2_index]); eq.probVec2 = p2_vertex_array[p2_index]; eq.payoff2 = computeExpectedPayoff(b, p1_vertex_array[p1_index], p2_vertex_array[p2_index]); equilibria.add(eq); eq_index++; } p2_index++; } p1_index++; p2_index = 0; } return equilibria; } public static Rational computeExpectedPayoff(Rational[][] payMatrix, Rational[] probsA, Rational[] probsB) { Rational eq_payoff = Rational.ZERO; for (int i = 0; i < payMatrix.length; i++) { for (int j = 0; j < payMatrix[i].length; j++) { eq_payoff = eq_payoff.add(payMatrix[i][j].multiply(probsA[i].multiply(probsB[j]))); } } return eq_payoff; } public static Rational correctPaymentsNeg(Rational[][] matrix) { Rational max = matrix[0][0]; for (int i = 0; i < matrix.length; ++i) { for (int j = 0; j < matrix[i].length; ++j) { if (matrix[i][j].compareTo(max) > 0) { max = matrix[i][j]; } } } Rational correct = Rational.ZERO; if (max.compareTo(0) >= 0) { correct = max.negate().subtract(1); applyPayCorrect(matrix, correct); } return correct; } public static void applyPayCorrect(Rational[][] matrix, Rational correct) { for (int i = 0; i < matrix.length; ++i) { for (int j = 0; j < matrix[i].length; ++j) { matrix[i][j] = matrix[i][j].add(correct); // -= } } } public static Rational getPayCorrectPos(Rational[][] matrix) { Rational min = matrix[0][0]; for (int i = 0; i < matrix.length; ++i) { for (int j = 0; j < matrix[i].length; ++j) { if (matrix[i][j].compareTo(min) < 0) { min = matrix[i][j]; } } } Rational correct = Rational.ZERO; if (min.compareTo(0) <= 0) { correct = min.negate().add(1); } return correct; } // this assumes pays have been normalized to -1 as the max value public static LCP generateLCP(Rational[][] a, Rational[][] b, Rational[] xPriors, Rational[] yPriors) { int nStratsA = a.length; int nStratsB = a.length > 0 ? a[0].length : 0; int size = nStratsA + 1 + nStratsB + 1; LCP lcp = new LCP(size); /* fill M */ /* -A */ for (int i = 0; i < nStratsA; i++) { for (int j = 0; j < nStratsB; j++) { lcp.setM(i, j + nStratsA + 1, a[i][j].negate()); } } /* -E\T */ for (int i = 0; i < nStratsA; i++) { lcp.setM(i, nStratsA + 1 + nStratsB, Rational.NEGONE); } /* F */ for (int i = 0; i < nStratsB; i++) { lcp.setM(nStratsA, nStratsA + 1 + i, Rational.ONE); } /* -B\T */ lcp.payratmatcpy(b, true, true, nStratsA, nStratsB, nStratsA + 1, 0); for (int i = 0; i < nStratsA; i++) { for (int j = 0; j < nStratsB; j++) { lcp.setM(j + nStratsA + 1, i, b[i][j].negate()); } } /* -F\T */ for (int i = 0; i < nStratsB; i++) { lcp.setM(nStratsA + 1 + i, nStratsA, Rational.NEGONE); } /* E */ for (int i = 0; i < nStratsA; i++) { lcp.setM(nStratsA + 1 + nStratsB, i, Rational.ONE); } /* define RHS q */ lcp.setq(nStratsA, Rational.NEGONE); lcp.setq(nStratsA + 1 + nStratsB, Rational.NEGONE); generateCovVector(lcp, xPriors, yPriors); return lcp; } private static void generateCovVector(LCP lcp, Rational[] xPriors, Rational[] yPriors) { /* covering vector = -rhsq */ for (int i = 0; i < lcp.size(); i++) {// i < lcpdim lcp.setd(i, lcp.q(i).negate()); } /* first blockrow += -Aq */ int offset = xPriors.length + 1; for (int i = 0; i < xPriors.length; i++) { for (int j = 0; j < yPriors.length; ++j) { lcp.setd(i, lcp.d(i).add(lcp.M(i, offset + j).multiply(yPriors[j]))); } } /* third blockrow += -B\T p */ for (int i = offset; i < offset + yPriors.length; i++) { for (int j = 0; j < xPriors.length; ++j) { lcp.setd(i, lcp.d(i).add(lcp.M(i, j).multiply(xPriors[j]))); } } } public static Equilibrium extractLCPSolution(Rational[] z, int nrows) { Equilibrium eq = new Equilibrium(); int offset = nrows + 1; Rational[] pl1 = new Rational[offset - 1]; System.arraycopy(z, 0, pl1, 0, pl1.length); Rational[] pl2 = new Rational[z.length - offset - 1]; System.arraycopy(z, offset, pl2, 0, pl2.length); eq.probVec1 = pl1; eq.probVec2 = pl2; return eq; } private Rational[] getVertexSums(List<Rational[]> vertices) { Rational[] vertexSums = new Rational[vertices.size()]; int i = 0; for (Rational[] vertex : vertices) { Rational sum = Rational.ZERO; for (int j = 1; j < vertex.length; ++j) // skip the first (0|1) { sum = sum.add(vertex[j]); } vertexSums[i] = sum; ++i; } return vertexSums; } private Rational[][] convertToProbs(List<Rational[]> lrs_vertex_array) { //calculate sums for each vertex in order to normalize Rational[] lrs_vertex_sum = getVertexSums(lrs_vertex_array); Rational[][] prob_vertex_array = new Rational[lrs_vertex_array.size()][]; for (int i = 0; i < prob_vertex_array.length; ++i) { Rational div = lrs_vertex_sum[i]; prob_vertex_array[i] = new Rational[lrs_vertex_array.get(i).length - 1]; if (div.compareTo(0) == 0) // this means the sum was zero, so every element is zero, why are we setting to -1? { for (int j = 0; j < prob_vertex_array[i].length; ++j) { prob_vertex_array[i][j] = Rational.ONE.negate(); } } else { for (int j = 0; j < prob_vertex_array[i].length; ++j) { prob_vertex_array[i][j] = lrs_vertex_array.get(i)[j + 1].divide(div); // skip the first (0|1) } } } return prob_vertex_array; } private int[] createLabelBitmapArr(List<Integer[]> pl_label_array, int rows, int columns) { int i = 0; int[] pl_lab_int_array = new int[pl_label_array.size()]; for (Integer[] aref : pl_label_array) { int sum = (1 << (rows + columns + 1)) - 2; for (int label : aref) { sum -= (1 << label); } pl_lab_int_array[i] = sum; i++; } return pl_lab_int_array; } }
13,328
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
Equilibrium.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/matrix/Equilibrium.java
package lse.math.games.matrix; import lse.math.games.Rational; public class Equilibrium { private int vertex1; private int vertex2; public Equilibrium() {} public Equilibrium(int vertex1, int vertex2) { this.vertex1 = vertex1; this.vertex2 = vertex2; } public int getVertex1() { return vertex1; } public int getVertex2() { return vertex2; } public Rational[] probVec1; //length = #rows (1 per strategy) public Rational payoff1; public Rational[] probVec2; //length = #cols (1 per strategy) public Rational payoff2; }
575
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
BipartiteClique.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/matrix/BipartiteClique.java
package lse.math.games.matrix; public class BipartiteClique { public int[] left; // vertex indices public int[] right; // vertex indicies }
149
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
CliqueAlgorithm.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/matrix/CliqueAlgorithm.java
package lse.math.games.matrix; import java.util.ArrayList; import java.util.List; /** connected components and their maximal cliques in bipartite graphs update 19 April 2004: sort cliques in output update 15 August 1998: - candidate passed to candtry12 without poscand, similarly candidates and not their stack positions stored in nonconnected-list (removes serious bug) - if CAND1 and CLIQUE1 both empty, terminate search; dito CAND2 and CLIQUE2 - outgraph left in; 8 March 1998 @author Bernhard von Stengel For a bipartite graph given as a set of pairs (i,j), it outputs - the connected components of that graph, and for each component - the maximal product sets U x V so that all (i,j) in U x V are edges of the graph (so these are the maximal complete bipartite subgraphs or CLIQUES). INPUT: The edges (i, j) are given by pairs of nonnegative integers separated by blanks on standard input. OUTPUT: On standard output, a headline for each connected component, then the cliques U x V listing U and V separately as lists of integers, separated by "x" and each set enclosed in braces, one clique per line. METHOD: Connected components by a primitive version of union-find, cliques with a variant of the algorithm by [BK] C. Bron and J. Kerbosch, Finding all cliques of an undirected graph, Comm. ACM 16:9 (1973), 575-577. APPROXIMATE STORAGE REQUIREMENTS: for integer arrays, 4 bytes per integer, using constants MAXINP1, MAXINP2 max. node indices in input MAXEDGES max. no. edges in input MAXM, MAXN max. dimension of incidence matrix per connected component 2 x MAXM x MAXN integers for incidence matrix and stack [2 MB if MAXM = MAXN = 700 ] 3 x MAXEDGES integers for edge list [0.6 MB if MAXEDGES = 50000 ] 3 x MAXINP1 integers for input nodes and list of components [60 kB if MAXINP1 = MAXINP2 = 5000 ] If these constants are exceeded certain edges will be rejected from the input with an error message. Program shouldn't crash. No error value is returned by main(). DETAILS OF METHODS: a) Connected components Designed for minimum storage requirement, running time possibly quadratic in number of edges. For each node that is read, a component co1[i] resp. co2[j] ( i left node, j right node) is kept, initially 0 if node is not yet input. (Isolated nodes are treated as absent.) For an edge (i, j), i and j must be put in the same component. Each component co points to the first edge in edgelist, where the edges are linked. Merging two components is done by traversing the edgelist with the higher number, updating the component number of the nodes therein, and prepending it to the list of the other component. Components and edges are numbered starting with 1, so "no component" and the end of an edgelist is represented by 0. Sets are represented by C arrays, if starting with 0 (as usually in C), then the elements of a k-set are the array elements [0..k) i.e. [0..k-1], if starting with 1 they are [1..k]. A possible improvement is to keep extra lists of the equivalence classes for the nodes for each component so only these have to be updated, which makes it faster. b) Clique enumeration The procedure extend recursively extends a current set of pairs clique1, clique2 that eventually will form a maximal clique. In [BK], this is only a single set COMPSUB (here called CLIQUE), here two sets are used since the graph is bipartite. Cliques of a bipartite graph are equivalent to the cliques of the ordinary graph obtained by connecting all left nodes by themselves and all right nodes by themselves, except for the cliques consisting exclusively of left or right points. The recursive calls use a self-made stack stk containing local small arrays of variable size. Intervals of this stack are indicated by their endpoints which ARE local variables to the recursive call. The top of the stack tos is passed as a parameter. The extension is done by adding points from a set CAND of candidates to CLIQUE. Throughout, the points in CAND are connected to all points in CLIQUE, which holds at initialization when CAND contains all points and CLIQUE is empty. Traversing the backtracking tree: Extending its depth is done by picking c (cand in the code below) from CAND, adding c to CLIQUE, removing all points not connected to c from CAND, and handing the new sets CLIQUE and CAND to the recursive call. For extending the backtracking tree in its breadth, this is done in a loop (called backtracking cycle in [BK]) where repeatedly different candidates c are added to CLIQUE (after the respective return from the recursive call). In order to avoid the output of cliques that are not maximal, an additional set NOT is passed down as a parameter to the recursive call of extend. This set NOT contains candidates c that - are all connected to the elements in CLIQUE but - have already been tried out, that is, all extensions of CLIQUE containing any point in NOT have already been generated [BK, p.577]. Hence, the recursive call proceeds downwards by - removing c from CAND and adding it to CLIQUE - removing all points disconnected from c from the new sets NOT and CAND used in the recursive call. After extension, c is then moved to NOT and the next candidate is tried. To reduce the breadth of the backtracking tree, the first candidate (or the subsequent ones) are chosen such that as early as possible there is a node in NOT connected to all remaining candidates. Then NOT will never become empty and hence no clique will be output, so the backtracking tree can be pruned here. This is done by choosing first a fixpoint fixp in the set NOT or CAND, such that after extension, when fixp is definitely in NOT, only points disconnected to fixp are added. Their number is the smallest possible. This is version2 of the algorithm in [BK]: a - pick fixp in NOT or CAND with the smallest number of disconnections to the other nodes in CAND, b - if fixp is a candidate, try it out as a candidate, i.e. extend CLIQUE with fixp (procedures candtry below), and then move fixp to NOT after extension. c - then try out only points disconnected to fixp, as determined in a. (In contrast to [BK], we compute a local list of these disconnected points while looking for the smallest number of disconnections.) Amendments for the bipartite graph are here: a is done by inspecting both sides of the graph. For the single extension in b (if fixp is a candidate) and the extensions in c , only the sets NOT and CAND on the other side of the candidate used for extension have to be updated. Hence, NOT and CAND are kept as separate sets NOT1, NOT2 and CAND1, CAND2. */ public class CliqueAlgorithm { private static int max(int a, int b) { return (a > b ? a : b); } private static int min(int a, int b) { return (a < b ? a : b); } private static final int MAXM = 700; /* max. no of left nodes for incidence matrix */ private static final int MAXN = 700; /* max. no of right nodes for incidence matrix */ private static final int MAXINP1 = 5000; /* max. no of left nodes in input */ private static final int MAXINP2 = 5000; /* max. no of right nodes in input */ private static final int MAXEDGES = 50000; /* max. no of edges in input */ private static final int MAXCO = min(MAXINP1, MAXINP2) + 1; /* max. no of connected components; on the smaller side, each node could be in different component */ private static final int STKSIZE = (MAXM + 1) * (MAXN + 1); /* largest stack usage for full graph */ private static final class Edge { int node1; int node2; int nextedge; }; public CliqueAlgorithm() {} public List<BipartiteClique> run(int[][] vertexPairs) { int[] firstedge = new int[MAXCO]; Edge[] edgelist = new Edge[MAXEDGES]; //TODO: can we bound size a bit more with dynamic info? for(int i = 0; i < edgelist.length; ++i) { edgelist[i] = new Edge(); } int numco = getconnco(firstedge, edgelist, vertexPairs); return workonco(numco, firstedge, edgelist); } public void run(Equilibria equilibria) { int[][] vertexPairs = new int[equilibria.count()][2]; for (int i = 0; i < vertexPairs.length; ++i) { vertexPairs[i][0] = equilibria.get(i).getVertex1(); vertexPairs[i][1] = equilibria.get(i).getVertex2(); } equilibria.setCliques(run(vertexPairs)); } /** * recurses down by moving cand from CAND1 to clique1 and * then to NOT1 after extension. * clique1 is extended by cand where all points in NOT2 and CAND2 * relate to cand. * pre: cand is in CAND1 * post: cand is moved from CAND1 to NOT1 * CAND1 may be shuffled, o/w stack unchanged */ private void candtry1 (int stk[], /* stack */ boolean[][] connected, int cand, /* the candidate from NODES1 to be added to CLIQUE */ int[] clique1, int cliqsize1, /* CLIQUE so far in NODES1 */ int[] clique2, int cliqsize2, /* CLIQUE so far in NODES2 */ int sn1, int sc1, int ec1, /* start NOT1, start CAND1, end CAND1 */ int sn2, int sc2, int ec2, /* start NOT2, start CAND2, end CAND2 */ int tos, /* top of stack */ int[] orignode1, int[] orignode2, List<BipartiteClique> cliques ) { int i, j, snnew, scnew, ecnew; clique1[cliqsize1++] = cand ; /* remove cand from CAND1 by replacing it with the last element of CAND1 */ for (i=sc1; i<ec1; i++) if (cand == stk[i]) { stk[i] = stk[--ec1] ; break ; } /* stk[ec1] is free now but will after extension be needed again */ /* fill new sets NOT2, CAND2 */ snnew = tos ; for (j=sn2; j<sc2; j++) if (connected[cand][stk[j]]) stk[tos++] = stk[j] ; scnew = tos ; for (j=sc2; j<ec2; j++) if (connected[cand][stk[j]]) stk[tos++] = stk[j] ; ecnew = tos ; extend(stk, connected, clique1, cliqsize1, clique2, cliqsize2, sn1, sc1, ec1, snnew, scnew, ecnew, tos, orignode1, orignode2, cliques); /* remove cand from clique1, put cand into NOT1 by increasing *sc1 and moving the node at position *sc1 to the end of CAND1 */ cliqsize1-- ; stk[ec1++] = stk[sc1] ; stk[sc1] = cand ; } /* -------------------------------------------------- */ /* recurses down by moving cand from CAND2 to clique2 and then to NOT2 after extension; clique2 is extended by cand where all points in NOT1 and CAND1 relate to cand. pre: cand is in CAND2 post: cand is moved from CAND2 to NOT2 CAND2 may be shuffled, o/w stack unchanged */ private void candtry2 (int stk[], /* stack */ boolean[][] connected, int cand, /* the candidate from NODES2 to be added to CLIQUE */ int[] clique1, int cliqsize1, /* CLIQUE so far in NODES1 */ int[] clique2, int cliqsize2, /* CLIQUE so far in NODES2 */ int sn1, int sc1, int ec1, /* start NOT1, start CAND1, end CAND1 */ int sn2, int sc2, int ec2, /* start NOT2, start CAND2, end CAND2 */ int tos, /* top of stack */ int[] orignode1, int[] orignode2, List<BipartiteClique> cliques ) { int i, j, snnew, scnew, ecnew; clique2[cliqsize2++] = cand ; /* remove cand from CAND2 by replacing it with the last element of CAND2 */ for (j=sc2; j<ec2; j++) if (cand == stk[j]) { stk[j] = stk[--ec2] ; break ; } /* stk[ec2] is free now but will after extension be needed again */ /* fill new sets NOT1, CAND1 */ snnew = tos ; for (i=sn1; i<sc1; i++) if (connected[stk[i]][cand]) stk[tos++] = stk[i] ; scnew = tos ; for (i=sc1; i<ec1; i++) if (connected[stk[i]][cand]) stk[tos++] = stk[i] ; ecnew = tos ; extend(stk, connected, clique1, cliqsize1, clique2, cliqsize2, snnew, scnew, ecnew, sn2, sc2, ec2, tos, orignode1, orignode2, cliques); /* remove cand from clique2, put cand into NOT2 by increasing *sc2 and moving the node at position sc2 to the end of CAND1 */ cliqsize2-- ; stk[ec2++] = stk[sc2] ; stk[sc2] = cand ; } /* -------------------------------------------------- */ /* extends the current set CLIQUE or outputs it if NOT and CAND are empty. pre: CLIQUE = clique1[0, cliqsize1], clique2[0, cliqsize2] NOT1 = stk[sn1, sc1], CAND1= stk[sc1, ec1] NOT2 = stk[sn2, sc2], CAND2= stk[sc2, ec2] sn1 <= sc1 <= ec1, sn2 <= sc2 <= ec2 all cliques extending CLIQUE containing a node in NOT1 or NOT2 have already been generated post: output of all maximal cliques extending CLIQUE with candidates from CAND1 or CAND2 but not from NOT1, NOT2. */ private void extend (int stk[], /* stack */ boolean[][] connected, int clique1[], int cliqsize1, /* CLIQUE so far in NODES1 */ int clique2[], int cliqsize2, /* CLIQUE so far in NODES2 */ int sn1, int sc1, int ec1, /* start NOT1, start CAND1, end CAND1 */ int sn2, int sc2, int ec2, /* start NOT2, start CAND2, end CAND2 */ int tos, /* top of stack, tos >= ec1, ec2 */ int[] orignode1, /* original node numbers as input */ int[] orignode2, List<BipartiteClique> cliques ) { /* if no further extension is possible then output the current CLIQUE if applicable, and return */ /* no clique or candidates on left: */ if (sc1 == ec1 && cliqsize1 == 0) return; /* no clique or candidates on right: */ if (sc2 == ec2 && cliqsize2 == 0) return; if (sc1 == ec1 && sc2 == ec2) { /* CAND is empty */ if (sn1 == sc1 && sn2 == sc2) { /* NOT is empty, otherwise do nothing */ addClique(clique1, cliqsize1, clique2, cliqsize2, orignode1, orignode2, cliques); } } else { /* CAND not empty */ boolean bfixin1 = false, bcandfix = false; int cmax = max(ec1-sc1, ec2-sc2); /* the larger of |CAND1|, |CAND2| */ /* stack positions */ /* reserve two arrays of size cmax on the stack */ int posfix = -1; int firstlist = tos; int tmplist = firstlist; tos += cmax; int savelist = tos; tos += cmax; /* find fixpoint fixp (a node of the graph) in NOT or CAND which has the smallest possible number of disconnections minnod to CAND */ int minnod = cmax + 1 ; int[] fixpointdata = new int[] { savelist, tmplist, posfix, minnod }; /* look for fixp in NODES1 */ if (findfixpoint(stk, connected, fixpointdata, sn1, ec1, sc2, ec2, true)) { savelist = fixpointdata[0]; posfix = fixpointdata[2]; minnod = fixpointdata[3]; bfixin1 = true; bcandfix = (posfix >= sc1); } /* look for fixp in nodes2 */ if (findfixpoint(stk, connected, fixpointdata, sn2, ec2, sc1, ec1, false)) { savelist = fixpointdata[0]; posfix = fixpointdata[2]; minnod = fixpointdata[3]; bfixin1 = false; bcandfix = (posfix >= sc2); } /* now: fixp = the node that is the fixpoint, posfix = its position on the stack, bfixin1 = fixp is in NODES1 bcandfix = fixp is a candidate stk[savelist, +minnod] = nodes disconnected to fixp which are all either in CAND1 or in CAND2; */ /* top of stack can be reset to savelist+minnod where if savelist is the second of the two lists, recopy it to avoid that stk[firstlist, +cmax] is wasted */ if (savelist != firstlist) {int i; for (i=0; i < minnod; i++) stk[firstlist + i] = stk[savelist + i]; savelist = firstlist ; } tos = savelist + minnod; if (bfixin1) { /* fixpoint in NODES1 */ if (bcandfix) { /* fixpoint is a candidate */ int fixp = stk[fixpointdata[2]]; candtry1(stk, connected, fixp, clique1, cliqsize1, clique2, cliqsize2, sn1, sc1, ec1, sn2, sc2, ec2, tos, orignode1, orignode2, cliques); ++sc1; } /* fixpoint is now in NOT1, try all the nodes disconnected to it */ for (int j=0; j<minnod; j++) { candtry2(stk, connected, stk[savelist+j], clique1, cliqsize1, clique2, cliqsize2, sn1, sc1, ec1, sn2, sc2, ec2, tos, orignode1, orignode2, cliques); ++sc2; } } else { /* fixpoint in NODES2 */ if (bcandfix) { /* fixpoint is a candidate */ int fixp = stk[fixpointdata[2]]; candtry2(stk, connected, fixp, clique1, cliqsize1, clique2, cliqsize2, sn1, sc1, ec1, sn2, sc2, ec2, tos, orignode1, orignode2, cliques); ++sc2; } /* fixpoint is now in NOT2, try all the nodes disconnected to it */ for (int j=0; j<minnod; j++) { candtry1(stk, connected, stk[savelist + j], clique1, cliqsize1, clique2, cliqsize2, sn1, sc1, ec1, sn2, sc2, ec2, tos, orignode1, orignode2, cliques); ++sc1; } } } } /* pre: enough space on stack for the two lists savelist, tmplist post: *minnod contains the new minimum no. of disconnections stk[*savelist + *minnod] contains the candidates disconnected to the fixpoint */ private boolean findfixpoint(int stk[], /* stack */ boolean[][] connected, int[] stackpos, /* position of [0] savelist [1] tmplist [2] fixpoint on the stack [3] minnod */ int sninspect, int ecinspect, int scother, int ecother, boolean binspect1 /* inspected nodes are in class1, o/w class2 */ ) { boolean bfound = false; for (int i=sninspect; i<ecinspect; i++) { int p = stk[i]; int minnod = stackpos[3]; int tmplist = stackpos[1]; int count = 0; /* count number of disconnections to p, building up stk[tmplist+count] containing the disconnected points */ for (int j=scother; (j<ecother) && (count < minnod); j++) { int k = stk[j] ; if (!( binspect1 ? connected[p][k] : connected[k][p] )) { stk[tmplist + count] = k ; count ++ ; } } /* check if new minimum found, in that case update fixpoint */ if (count < minnod) { stackpos[2] = i; stackpos[3] = count; /* save tmplist by making it the new savelist */ /* TODO: MKE: If I find two minimums aren't I just swapping the tmp and save list back and forth? */ int savelist = stackpos[0]; stackpos[0] = stackpos[1]; stackpos[1] = savelist; bfound = true; } } return bfound; } /* generates the incidence matrix connected from the edgelist starting with edgelist[e] pre: all nodes in edgelist < MAXINP1,2 post: orignode1[0..*m) contains the original node1 numbers orignode2[0..*n) contains the original node2 numbers connected[][] == TRUE if edge, o/w FALSE *m == number of rows *n == number of columns */ private int[] genincidence( int e, Edge[] edgelist, int[] orignode1, int[] orignode2, boolean[][] connected ) { int[] mn = new int[2]; int[] newnode1 = new int[MAXINP1]; int[] newnode2 = new int[MAXINP2]; /* init newnode */ for (int i=0; i<MAXINP1; i++) newnode1[i] = -1; for (int j=0; j<MAXINP2; j++) newnode2[j] = -1; mn[0] = mn[1] = 0; while (e != 0) { /* process the edge list with edge index e */ int i= edgelist[e].node1; int j= edgelist[e].node2; int newi = newnode1[i] ; int newj = newnode2[j] ; boolean keepgoing = false; if (newi == -1) { if (mn[0] >= MAXM) { /* out of bounds for connected, reject */ printf("Left bound %d for incidence matrix ", MAXM ) ; printf("reached, edge (%d, %d) rejected\n", i, j); keepgoing = true; } else { newi = mn[0]++; /* init connected on the fly */ for (int k=0; k<MAXN; k++) connected[newi][k] = false; newnode1[i] = newi ; orignode1[newi] = i ; } } if (!keepgoing && newj == -1) { if (mn[1] >= MAXN) { /* out of bounds for connected, reject */ printf("Right bound %d for incidence matrix ", MAXN); printf("reached, edge (%d, %d) rejected\n", i, j); keepgoing = true; } else { newj = mn[1]++ ; newnode2[j] = newj ; orignode2[newj] = j ; } } if (!keepgoing) connected[newi][newj] = true; e = edgelist[e].nextedge ; } return mn; } /* reads edges of bipartite graph from input, puts them in disjoint lists of edges representing its connected components pre: nodes are nonzero integers < MAXINP1,2 other edges are rejected, and so are edges starting from the MAXEDGEth edge on and larger, each with a warning msg. post: return value == numco (largest index of a connected component) where numco < MAXCO, and for 1 <= co <= numco: edgelist[co].firstedge == 0 if co is not a component == edgeindex e otherwise where e > 0 and edgelist[e].node1, .node2[e] are endpoints of edge, edgelist[e].nextedge == next edgeindex of component, zero if e is index to the last edge */ private int getconnco(int[] firstedge, Edge[] edgelist, int[][] vertexPairs) { int numco, newedge; int[] co1 = new int[MAXINP1], co2 = new int[MAXINP2]; /* components of node1,2 */ /* initialize component indices of left and right nodes */ for (int i=0; i<MAXINP1; i++) co1[i] = 0; for (int j=0; j<MAXINP2; j++) co2[j] = 0; numco = 0; newedge = 0; for (int[] vertexPair : vertexPairs) { int i = vertexPair[0]; int j = vertexPair[1]; if (i < 0 || i>= MAXINP1 || j<0 || j>=MAXINP2) printf("Edge (%d, %d) not in admitted range (0..%d, 0..%d), rejected\n", i,j, MAXINP1-1, MAXINP2-1) ; else if (newedge >= MAXEDGES-1) printf("max no. %d of edges exceeded, edge (%d, %d) rejected\n", MAXEDGES-1, i,j) ; else { /* add edge (i,j) to current componentlist */ newedge ++; edgelist[newedge].node1 = i; edgelist[newedge].node2 = j; /* current components of i,j */ int ico = co1[i] ; int jco = co2[j] ; if (ico == 0) { /* i has not yet been in a component before */ if (jco == 0) { /* j has not yet been in a component before */ /* add a new component */ numco ++; co1[i] = co2[j] = numco ; firstedge[numco] = newedge ; edgelist[newedge].nextedge = 0; } else { /* j is already in a component: add i to j's component, adding list elements in front */ co1[i] = jco ; edgelist[newedge].nextedge = firstedge[jco]; firstedge[jco] = newedge; } } else { /* i is already in a component */ if (jco == 0) { /* j has not yet been in a component before */ /* add j to i's component */ co2[j] = ico ; edgelist[newedge].nextedge = firstedge[ico]; firstedge[ico] = newedge; } else { /* i and j are already in components */ if (ico == jco) { /* i, j in same component: just add the current edge */ edgelist[newedge].nextedge = firstedge[ico]; firstedge[ico] = newedge; } else { /* i and j in different components: merge these by traversing the edgelists and updating components of all incident nodes (this is wasteful since only nodes need be updated, not edges) */ int e, newco, oldco ; if (ico < jco) { newco = ico; oldco = jco; } else { newco = jco; oldco = ico; } /* insert the current edge */ edgelist[newedge].nextedge= firstedge[oldco] ; e = newedge ; while (true) { co1[edgelist[e].node1] = co2[edgelist[e].node2] = newco ; if (edgelist[e].nextedge == 0) break; e = edgelist[e].nextedge; } /* e is now the last edge in the updated list */ edgelist[e].nextedge = firstedge[newco] ; firstedge[newco] = newedge ; /* oldco is unused now: reuse it if it was the last component, otherwise just leave empty */ if (oldco == numco) numco-- ; firstedge[oldco] = 0; } } } } } return numco; } private void addClique(int clique1[], int nclique1, int clique2[], int nclique2, int[] orignode1, int[] orignode2, List<BipartiteClique> cliques) { BipartiteClique clique = new BipartiteClique(); clique.left = sortClique(clique1, nclique1, orignode1); clique.right = sortClique(clique2, nclique2, orignode2); cliques.add(clique); } private int[] sortClique(int[] clique, int nclique, int[] orignode) { int[] sorted = new int[nclique]; for (int i = 0; i < nclique; ++i) { int x = orignode[clique[i]]; int j = i; while (j > 0) { int y = sorted[j-1]; if (y <= x) { break; } sorted[j] = y; --j; } sorted[j] = x; } return sorted; } /* works on the edgelists as generated by getconnco it processes each component by computing its maximal cliques pre : firstedge[1..numco], if nonzero, points to a connected component in edgelist post: all components are processed */ private List<BipartiteClique> workonco(int numco, int[] firstedge, Edge[] edgelist) { List<BipartiteClique> cliques = new ArrayList<BipartiteClique>(); int[] orignode1 = new int[MAXM]; int[] orignode2 = new int[MAXN]; boolean[][] connected = new boolean[MAXM][MAXN]; int[] stk = new int[STKSIZE]; /* stack */ int tos; /* top of stack */ int[] clique1 = new int[MAXM]; int[] clique2 = new int[MAXN]; /* CLIQUE for first and second node class */ for (int co = 1; co <= numco; ++co) { if (firstedge[co] != 0) { /* found a nonzero component list */ /* graph dimensions */ int[] mn = genincidence(firstedge[co], edgelist, orignode1, orignode2, connected); int m = mn[0]; int n = mn[1]; /* compute the cliques of the component via extend; initialize stack with the full sets of nodes and empty sets CAND and NOT */ tos = 0; for (int i=0; i<m; i++) { stk[tos++] = i; /* CAND1 = NODES1 */ } for (int i=0; i<n; i++) { stk[tos++] = i; /* CAND2 = NODES2 */ } extend(stk, connected, clique1, 0, clique2, 0, 0, 0, m, m, m, m+n, tos, orignode1, orignode2, cliques); } } return cliques; } private void printf(String s, Object... args) { s.replaceAll("\\n", System.getProperty("line.separator")); System.out.print(String.format(s, args)); } }
27,110
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
Equilibria.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/matrix/Equilibria.java
package lse.math.games.matrix; import java.io.IOException; import java.io.Writer; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import lse.math.games.Rational; import lse.math.games.io.ColumnTextWriter; public class Equilibria implements Iterable<Equilibrium> { private List<Equilibrium> extremeEquilibria = new ArrayList<Equilibrium>(); private List<BipartiteClique> cliques = null; private Map<Integer,Equilibrium> vertexMap1 = new HashMap<Integer,Equilibrium>(); private Map<Integer,Equilibrium> vertexMap2 = new HashMap<Integer,Equilibrium>(); private CliqueAlgorithm coclique = new CliqueAlgorithm(); private boolean dirty = true; public void add(Equilibrium eq) { extremeEquilibria.add(eq); // TODO: how can I turn these into indices vertexMap1.put(eq.getVertex1(), eq); vertexMap2.put(eq.getVertex2(), eq); dirty = true; } public Equilibrium getByVertex1(int vertexId) { return vertexMap1.get(vertexId); } public Equilibrium getByVertex2(int vertexId) { return vertexMap2.get(vertexId); } public Equilibrium get(int idx) { return extremeEquilibria.get(idx); } public int ncliques() { return cliques.size(); } public BipartiteClique getClique(int idx) { return cliques.get(idx); } public void setCliques(List<BipartiteClique> cliques) { this.cliques = cliques; dirty = true; } public int count() { return extremeEquilibria.size(); } public void print(Writer output, boolean decimal) throws IOException { ColumnTextWriter colpp = new ColumnTextWriter(); int idx = 1; for(Equilibrium ee : extremeEquilibria) { colpp.writeCol("EE"); colpp.writeCol(String.format("%s", idx++)); colpp.alignLeft(); colpp.writeCol("P1:"); colpp.writeCol(String.format("(%1s)", ee.getVertex1())); for (Rational coord : ee.probVec1) { colpp.writeCol(String.format( decimal ? "%.4f" : "%s", decimal ? coord.doubleValue() : coord.toString())); } colpp.writeCol("EP="); colpp.writeCol(String.format( decimal ? "%.3f" : "%s", decimal ? ee.payoff1.doubleValue() : ee.payoff1.toString())); colpp.writeCol("P2:"); colpp.writeCol(String.format("(%1s)", ee.getVertex2())); for (Rational coord : ee.probVec2) { colpp.writeCol(String.format( decimal ? "%.4f" : "%s", decimal ? coord.doubleValue() : coord.toString())); } colpp.writeCol("EP="); colpp.writeCol(String.format( decimal ? "%.3f" : "%s", decimal ? ee.payoff2.doubleValue() : ee.payoff2.toString())); colpp.endRow(); } output.write(colpp.toString()); } public Iterator<Equilibrium> iterator() { return extremeEquilibria.iterator(); } public Iterable<BipartiteClique> cliques() { return new CliqueIterator(); } public class CliqueIterator implements Iterable<BipartiteClique> { public Iterator<BipartiteClique> iterator() { if (dirty) { coclique.run(Equilibria.this); dirty = false; } return cliques.iterator(); } } }
3,213
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
Bimatrix.java
/FileExtraction/Java_unseen/gambitproject_gte/lib-algo/src/lse/math/games/matrix/Bimatrix.java
package lse.math.games.matrix; import java.util.LinkedList; import lse.math.games.Rational; import lse.math.games.io.ColumnTextWriter; public class Bimatrix { private String[] names; private Rational[][] a; private Rational[][] b; private String[] rowNames; private String[] colNames; final static String lineSeparator = System.getProperty("line.separator"); public Bimatrix(String[] names, Rational[][] a, Rational[][] b, String[] rowStrats, String[] colStrats) { this.names = names; this.a = a; this.b = b; this.rowNames = rowStrats; this.colNames = colStrats; } public int nrows() { return a != null ? a.length : 0; } public int ncols() { return nrows() > 0 ? a[0].length : 0; } public String row(int idx) { return strat(rowNames, idx); } public String col(int idx) { return strat(colNames, idx); } public String firstPlayer() { return name(0); } public String secondPlayer() { return name(1); } private String name(int idx) { return names != null && names.length > 0 && names[idx] != null ? names[idx] : String.valueOf(idx + 1); } private String strat(String[] arr, int idx) { return (arr != null && (idx < arr.length) && arr[idx] != null? arr[idx] : String.valueOf(idx + 1)); } @Override public String toString() { ColumnTextWriter colpp = new ColumnTextWriter(); addMatrix(0, colpp); colpp.endRow(); addMatrix(1, colpp); return colpp.toString(); } private void addMatrix(int idx, ColumnTextWriter colpp) { colpp.writeCol(name(idx)); colpp.alignLeft(); for (String colName : colNames) { colpp.writeCol(colName); } colpp.endRow(); Rational[][] mat = idx == 0 ? a : b; for(int i = 0; i < mat.length; ++i) { colpp.writeCol(rowNames[i]); Rational[] row = mat[i]; for (Rational entry : row) { colpp.writeCol(entry.toString()); } colpp.endRow(); } } public String printFormat() { String s=""; s+=a.length + " "+a[0].length+lineSeparator; s+=lineSeparator; for (int i=0;i<a.length;i++){ for (int j=0;j<a[i].length;j++){ s+=" "+a[i][j]; } s+=lineSeparator; } s+=lineSeparator; s+=lineSeparator; for (int i=0;i<b.length;i++){ for (int j=0;j<b[i].length;j++){ s+=" "+b[i][j]; } s+=lineSeparator; } return s; } public String printFormatHTML() { String s=""; s+=this.nrows() + " x " + this.ncols() +" Payoff player 1"+lineSeparator; s+=lineSeparator; s+=buildMatrixString(buildString(a)); /* for (int i=0;i<a.length;i++){ for (int j=0;j<a[i].length;j++){ s+=" "+a[i][j]; } s+=lineSeparator; }*/ s+=lineSeparator; s+=lineSeparator; s+=this.nrows() + " x " + this.ncols() +" Payoff player 2"+lineSeparator; s+=lineSeparator; s+=buildMatrixString(buildString(b)); /* for (int i=0;i<b.length;i++){ for (int j=0;j<b[i].length;j++){ s+=" "+b[i][j]; } s+=lineSeparator; }*/ s+=lineSeparator; return s; } /** * Create a String from the array of payoffs *@param pm:Array - 2-dim Array of payoffs *@return String - an return seperated string with all payoffs. *@author Martin */ private String[][] buildString(Rational[][] pm) { if (pm==null) return null; if (pm[0]==null) return null; String[][] pm_out=new String[pm.length+1][pm[0].length+1]; for (int i=0;i<pm_out[0].length;i++) { if (i==0) { pm_out[0][0]=new String(""); } else { pm_out[0][i]=new String(this.colNames[i-1]); } } for (int i=0;i<pm_out.length;i++) { if (i==0) { pm_out[0][0]=new String(""); } else { pm_out[i][0]=new String(this.rowNames[i-1]); } } for (int i=1;i<pm_out.length;i++) { for (int j=1;j<pm_out[i].length;j++) { pm_out[i][j]=pm[i-1][j-1].toString(); } } return pm_out; } /** * Create a String from the array of payoffs *@param pm:Array - 2-dim Array of payoffs *@return String - an return seperated string with all payoffs. *@author Martin */ private String buildMatrixString(String[][] pm) { String delimeter=" "; LinkedList<Integer> maxLength = new LinkedList<Integer>(); int i=0; int j=0; if (pm==null) return ""; if (pm[0]==null) return ""; for (j=0;j<pm[0].length;j++){ int maxLen = 0; for (i=0;i<pm.length;i++){ if (pm[i][j]!=null) { if (pm[i][j].length()>maxLen) { maxLen=pm[i][j].length(); } } } maxLength.add(Integer.valueOf(maxLen)); } String matrixString= ""; for (i=0;i<pm.length;i++){ for (j=0;j<pm[i].length;j++){ for (int w=0;w<maxLength.get(j) - pm[i][j].length();w++) { matrixString += " "; } matrixString += pm[i][j]; if (j<pm[i].length-1){ matrixString +=delimeter; } } if (i<pm.length - 1) { matrixString += lineSeparator; } } return matrixString; } }
5,139
Java
.java
gambitproject/gte
85
40
31
2011-05-06T23:46:30Z
2019-03-06T06:53:27Z
FidoEditor.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/FidoEditor.java
package net.sourceforge.fidocadj; import java.util.Vector; import java.util.Locale; import java.util.MissingResourceException; import java.io.*; import android.view.MotionEvent; import android.view.View; import android.graphics.*; import android.content.*; import android.view.*; import android.graphics.Paint.*; import android.util.AttributeSet; import android.os.Handler; import android.app.Activity; import net.sourceforge.fidocadj.circuit.model.*; import net.sourceforge.fidocadj.primitives.*; import net.sourceforge.fidocadj.geom.*; import net.sourceforge.fidocadj.circuit.views.*; import net.sourceforge.fidocadj.circuit.controllers.*; import net.sourceforge.fidocadj.graphic.android.*; import net.sourceforge.fidocadj.layers.*; import net.sourceforge.fidocadj.dialogs.*; /** Android Editor view: draw the circuit inside this view. This is one of the most important classes, as it is responsible of all editing actions. <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, see <http://www.gnu.org/licenses/>. Copyright 2014-2015 by Davide Bucci, Dante Loi </pre> The circuit panel will contain the whole drawing. @author Davide Bucci, Dante Loi */ public class FidoEditor extends View implements PrimitivesParInterface { GestureDetector gestureDetector; int desiredWidth = 1500; int desiredHeight = 800; private DrawingModel dm; private Drawing dd; private MapCoordinates cs; private ParserActions pa; private UndoActions ua; public EditorActions ea; public ContinuosMoveActions eea; private HandleActions haa; private CopyPasteActions cpa; private SelectionActions sa; // ********** RULER ********** private boolean ruler; // Is it to be drawn? private int rulerStartX; private int rulerStartY; private int rulerEndX; private int rulerEndY; // ***** ZOOM AND PANNING ***** private int mx; private int my; private int oldDist; private int newDist; private double origZoom; private int oldScrollX; private int oldScrollY; private int oldCenterX; private int oldCenterY; // ********** EDITING ********* private RectF evidenceRect; private Context cc; final Handler handler = new Handler(); private boolean showGrid; /** Public constructor. @param context the current context. @param attrs the attribute set. */ public FidoEditor(Context context, AttributeSet attrs) { super(context, attrs); cc=context; init(); evidenceRect = null; gestureDetector = new GestureDetector(context, new GestureListener()); } /** Adopt the standard layer description and color. The drawing model should be already set when calling initLayers. */ public void initLayers() { Vector<LayerDesc> layerDesc = StandardLayers.createStandardLayers(cc); dm.setLayers(layerDesc); } /** Initialize the view and prepare everything for the drawing. */ private void init() { this.setMeasuredDimension(this.desiredWidth, this.desiredHeight); dm = new DrawingModel(); initLayers(); dd = new Drawing(dm); pa = new ParserActions(dm); ua = new UndoActions(pa); sa = new SelectionActions(dm); ea = new EditorActions(dm, sa, ua); eea = new ContinuosMoveActions(dm, sa, ua, ea); haa = new HandleActions(dm, ea, sa, ua); cpa=new CopyPasteActions(dm, ea, sa, pa, ua, (FidoMain)cc); // Specify a reasonable tolerance so you can select objects and handles // with your finger. ea.setSelectionTolerance(20* getResources().getDisplayMetrics().densityDpi/112); cpa.setShiftCopyPaste(true); eea.setActionSelected(ElementsEdtActions.SELECTION); eea.setPrimitivesParListener(this); showGrid = true; readInternalLibraries(); //StringBuffer s=new StringBuffer(createTestPattern()); //pa.parseString(s); ua.saveUndoState(); cs = new MapCoordinates(); cs.setXMagnitude(3*getResources().getDisplayMetrics().densityDpi/112); cs.setYMagnitude(3*getResources().getDisplayMetrics().densityDpi/112); cs.setXGridStep(5); cs.setYGridStep(5); // Courier New is the standard on PC, but it is not available on // Android. Here the system will find a substitute. dm.setTextFont("Courier New", 3, null); //turn off hw accelerator setLayerType(View.LAYER_TYPE_SOFTWARE, null); } /** Read the internal libraries (specified as raw resources). */ private void readInternalLibraries() { BufferedReader stdLib; BufferedReader ihram; BufferedReader elettrotecnica; BufferedReader pcb; BufferedReader eylib; // Libraries are available in Italian or in English String lang=""; try { lang=Locale.getDefault().getISO3Language(); } catch (MissingResourceException E) { // Not a big issue. Show the English version of the libs. lang=""; } if("ita".equals(lang)) { // Italian version (only for italian locale) stdLib = new BufferedReader(new InputStreamReader(cc.getResources() .openRawResource(R.raw.fcdstdlib))); ihram = new BufferedReader(new InputStreamReader(cc.getResources() .openRawResource(R.raw.ihram))); elettrotecnica=new BufferedReader(new InputStreamReader( cc.getResources().openRawResource(R.raw.elettrotecnica))); pcb = new BufferedReader(new InputStreamReader(cc.getResources() .openRawResource(R.raw.pcb))); } else { // English version stdLib = new BufferedReader( new InputStreamReader(cc.getResources().openRawResource( R.raw.fcdstdlib_en))); ihram = new BufferedReader( new InputStreamReader(cc.getResources().openRawResource( R.raw.ihram_en))); elettrotecnica = new BufferedReader( new InputStreamReader(cc.getResources().openRawResource( R.raw.elettrotecnica_en))); pcb = new BufferedReader( new InputStreamReader(cc.getResources().openRawResource( R.raw.pcb_en))); } eylib = new BufferedReader( new InputStreamReader(cc.getResources().openRawResource( R.raw.ey_libraries))); try { pa.readLibraryBufferedReader(stdLib, ""); pa.readLibraryBufferedReader(pcb, "pcb"); pa.readLibraryBufferedReader(ihram, "ihram"); pa.readLibraryBufferedReader(elettrotecnica, "elettrotecnica"); pa.readLibraryBufferedReader(eylib, "ey_libraries"); } catch (IOException E) { } } /** Convert the current drawing to a string description (FidoCadJ code). @return the code describing the circuit. */ public String getText() { return pa.getText(true).toString(); } /** Get the EditorActions controller for the drawing. @return the EditorActions object. */ public EditorActions getEditorActions() { return ea; } /** Get the ContinuosMoveActions for the drawing. @return the ContinuosMoveActions object. */ public ContinuosMoveActions getContinuosMoveActions() { return eea; } /** Get the CopyPasteActions controller for the drawing. @return the CopyPasteActions object. */ public CopyPasteActions getCopyPasteActions() { return cpa; } /** Get the UndoActions controller for the drawing. @return the UndoActions object. */ public UndoActions getUndoActions() { return ua; } /** Get the ParserActions controller for the drawing. @return the ParserActions object. */ public ParserActions getParserActions() { return pa; } /** Get the DrawingModel object containing the drawing. @return the drawing model. */ public DrawingModel getDrawingModel() { return dm; } /** Set the DrawingModel object containing the drawing. @param d the model to be employed. */ public void setDrawingModel(DrawingModel d) { dm=d; } /** Get the current selection controller @return the selection controller */ public SelectionActions getSelectionActions() { return sa; } /** Draw the drawing on the given canvas. @param canvas the canvas where the drawing will be drawn. */ @Override protected void onDraw(Canvas canvas) { canvas.drawARGB(255, 255, 255, 255); GraphicsAndroid g = new GraphicsAndroid(canvas); if(showGrid){ g.drawGrid(cs, (int)getScrollX(), (int)getScrollY(), (int)(getScrollX()+getWidth()), (int)(getScrollY()+getHeight())); } // Show a sort of an arrow, to indicate that there is the library // hidden on the right. float xs = getScrollX()+getWidth(); float ys = getScrollY()+getHeight()/2.0f; float mult=g.getScreenDensity()/112.0f; Paint p= new Paint(Color.GRAY); p.setStrokeWidth(3.0f*mult); p.setAntiAlias(true); p.setStrokeCap(Cap.ROUND); p.setStrokeJoin(Join.ROUND); canvas.drawLine(xs-12.0f*mult, ys, xs-2.0f*mult, ys-20.0f*mult,p); canvas.drawLine(xs-12.0f*mult, ys, xs-2.0f*mult, ys+20.0f*mult,p); // Draw the objects in the database dd.draw(g, cs); // Draw the handles of all selected primitives. dd.drawSelectedHandles(g, cs); if (evidenceRect != null && eea.actionSelected == ElementsEdtActions.SELECTION) { Paint rectPaint = new Paint(); rectPaint.setColor(Color.GREEN); rectPaint.setStyle(Style.STROKE); rectPaint.setStrokeWidth(mult*1.3f); canvas.drawRect(evidenceRect, rectPaint); } else { evidenceRect = null; } eea.showClicks(g, cs); } /** Handles scroll events. @param x current x position. @param y current y position. @param oldx old x position. @param oldy old y position. */ @Override protected void onScrollChanged(int x, int y, int oldx, int oldy) { super.onScrollChanged(x, y, oldx, oldy); if(x < 0) scrollBy(-x,0); else if(y < 0) scrollBy(0,-y); else scrollBy(0,0); } /** Reacts to a touch event. In reality, since we need to handle a variety of different events, there is somehow a mix between the low level onTouchEvent and the GestureListener (which does not handle slide and move events). @param event the touch or motion event. @return true if a touch has been processed. */ @Override public boolean onTouchEvent(MotionEvent event) { gestureDetector.onTouchEvent(event); if(event.getPointerCount()<=0) return false; int action = event.getAction() & MotionEvent.ACTION_MASK; int curX, curY; /* Handle all actions related to selection */ if(eea.getSelectionState() == ElementsEdtActions.SELECTION) { mx = (int) event.getX()+getScrollX(); my = (int) event.getY()+getScrollY(); // Handle selection events. switch (action) { case MotionEvent.ACTION_DOWN: haa.dragHandleStart(mx, my, ea.getSelectionTolerance(), false, cs); break; case MotionEvent.ACTION_MOVE: haa.dragHandleDrag(this, mx, my, cs, false); break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: haa.dragHandleEnd(this, mx, my, false, cs); break; default: break; } invalidate(); } /* Handle all actions related to move/zoom */ if (eea.getSelectionState() == ElementsEdtActions.HAND) { //Handle Scrolling and zooming events switch (action) { case MotionEvent.ACTION_DOWN: mx = (int)event.getX(); my = (int)event.getY(); if(event.getPointerCount() == 1) { oldDist=-1; // Distinguish 1-finger events (pan) // from 2-fingers ones (pinch, zoom). } break; case MotionEvent.ACTION_POINTER_DOWN: if(event.getPointerCount() == 2) { // Begin of a zoom gesture oldDist = spacing(event); oldCenterX=(int)(event.getX(0) + event.getX(1))/2; oldCenterY=(int)(event.getY(0) + event.getY(1))/2; oldScrollX=getScrollX(); oldScrollY=getScrollY(); } else { oldDist=-1; // This is just to be on the safe side } origZoom=cs.getXMagnitude(); break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_MOVE: // Handle the zoom gesture. if(event.getPointerCount() == 2 && oldDist>0) { newDist = spacing(event); double scale = (double)newDist / (double)oldDist; // The new zoom is calculated from the original one // saved in MotionEvent.ACTION_POINTER_DOWN. double newZoom=scale*origZoom; cs.setXMagnitude(newZoom); cs.setYMagnitude(newZoom); // There might be some roundup or limiting while // setting the new zoom. This ensures that a coherent // value for newZoom is used for what follows. newZoom=cs.getXMagnitude(); int corrX=(int)((oldCenterX) /origZoom*newZoom)-oldCenterX; int corrY=(int)((oldCenterY) /origZoom*newZoom)-oldCenterY; setScrollX((int)(oldScrollX/origZoom*newZoom)+corrX); setScrollY((int)(oldScrollY/origZoom*newZoom)+corrY); invalidate(); } else if(oldDist<0) { // Panning curX = (int)event.getX(); curY = (int)event.getY(); scrollBy((mx - curX), (my - curY)); mx = curX; my = curY; } break; default: break; } } return true; } /** @return the distance between two points specified by a multiple event. @param event the multi touch event. */ private int spacing(MotionEvent event) { float x = event.getX(0) - event.getX(1); float y = event.getY(0) - event.getY(1); int dist = (int) Math.sqrt(x * x + y * y); return dist; } /** Inform Android's operating system of the size of the view. @param widthMeasureSpec @param heightMeasureSpec */ @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int widthMode = MeasureSpec.getMode(widthMeasureSpec); int widthSize = MeasureSpec.getSize(widthMeasureSpec); int heightMode = MeasureSpec.getMode(heightMeasureSpec); int heightSize = MeasureSpec.getSize(heightMeasureSpec); int width; int height; //Measure Width if (widthMode == MeasureSpec.EXACTLY) { //Must be this size width = widthSize; } else if (widthMode == MeasureSpec.AT_MOST) { //Can't be bigger than... width = Math.min(desiredWidth, widthSize); } else { //Be whatever you want width = desiredWidth; } //Measure Height if (heightMode == MeasureSpec.EXACTLY) { //Must be this size height = heightSize; } else if (heightMode == MeasureSpec.AT_MOST) { //Can't be bigger than... height = Math.min(desiredHeight, heightSize); } else { //Be whatever you want height = desiredHeight; } //MUST CALL THIS setMeasuredDimension(width, height); } /** Show a dialog which allows the user modify the parameters of a given primitive. If more than one primitive is selected, modify only the layer of all selected primitives. */ public void setPropertiesForPrimitive() { GraphicPrimitive gp=sa.getFirstSelectedPrimitive(); if (gp==null) return; Vector<ParameterDescription> v; if (sa.isUniquePrimitiveSelected()) { v=gp.getControls(); } else { // If more than a primitive is selected, v=new Vector<ParameterDescription>(1); ParameterDescription pd = new ParameterDescription(); pd.parameter=new LayerInfo(gp.getLayer()); pd.description="TODO: add a reference to a resource"; v.add(pd); } DialogParameters dp = DialogParameters.newInstance(v, false, dm.getLayers()); dp.show( ((Activity)cc).getFragmentManager(), ""); } /** This function is a callback which is used by DialogParameters to save the useful data. @param v the vector containing the layers. */ public void saveCharacteristics(Vector<ParameterDescription> v) { //android.util.Log.e("FidoCadJ", "saveCharacteristics: "+v); GraphicPrimitive gp=sa.getFirstSelectedPrimitive(); android.util.Log.e("FidoCadJ", "saveCharacteristics this= "+this); if (sa.isUniquePrimitiveSelected()) { gp.setControls(v); } else { ParameterDescription pd=(ParameterDescription)v.get(0); if (pd.parameter instanceof LayerInfo) { int l=((LayerInfo)pd.parameter).getLayer(); ea.setLayerForSelectedPrimitives(l); } else { android.util.Log.e("FidoCadJ", "Warning: unexpected parameter! (layer)"); } } dm.setChanged(true); // We need to check and sort the layers, since the user can // change the layer associated to a given primitive thanks to // the dialog window which has been shown. dm.sortPrimitiveLayers(); ua.saveUndoState(); invalidate(); } /** Selects the closest object to the given point (in logical coordinates) and pops up a dialog for the editing of its Param_opt. @param x the x logical coordinate of the point used for the selection @param y the y logical coordinate of the point used for the selection */ public void selectAndSetProperties(int x, int y) { sa.setSelectionAll(false); ea.handleSelection(cs, x, y, false); invalidate(); setPropertiesForPrimitive(); } /** Implementation of the PrimitivesParInterface interface. Show the popup menu. In Android, the menu can be centered inside the current view. @param x the x position of the menu (can be discarded on Android). @param y the y position of the menu (can be discarded on Android). */ public void showPopUpMenu(int x, int y) { ((Activity) cc).registerForContextMenu(this); ((Activity) cc).openContextMenu(this); ((Activity) cc).unregisterForContextMenu(this); } /** Increases or decreases the zoom by a step of 33% @param increase if true, increase the zoom, if false decrease @param x coordinate to which center the viewport (screen coordinates) @param y coordinate to which center the viewport (screen coordinates) */ public void changeZoomByStep(boolean increase, int x, int y, double t) { // Not needed with Android. } /** Calculate an optimum zoom which fits to the document. Move the scroll bars accordingly. */ public void zoomToFit() { zoomOrPanToFit(true); } /** Pan the drawing so it is visible. Does not change the zoom */ public void panToFit() { zoomOrPanToFit(false); } private void zoomOrPanToFit(boolean scaleZoom) { // At first get the size in which the drawing should be fit int sizex=getWidth(); int sizey=getHeight(); // Calculate the zoom to fit scale MapCoordinates mp; mp = DrawingSize.calculateZoomToFit(dm, sizex, sizey, true); double z=mp.getXMagnitude(); // Set the new coordinate system and force a redraw. if(scaleZoom) getMapCoordinates().setMagnitudes(z, z); setScrollX((int)mp.getXCenter()); setScrollY((int)mp.getYCenter()); invalidate(); } /** Makes sure the object gets focus. */ public void getFocus() { // Not needed with Android. } /** Forces a repaint event. */ public void forcesRepaint() { invalidate(); } /** Forces a repaint, specify the region to be updated. @param a not used. @param b not used. @param c not used. @param d not used. */ public void forcesRepaint(int a, int b, int c, int d) { invalidate(); } /** Activate and sets an evidence rectangle which will be put on screen at the next redraw. All sizes are given in pixel. @param x the x coordinate of the left top corner @param y the y coordinate of the left top corner @param w the width of the rectangle @param h the height of the rectangle */ public void setEvidenceRect(int x, int y, int w, int h) { evidenceRect = new RectF(x, y, x+w, y+h); } /** Get the current coordinate mapping object. @return the current coordinate mapping object. */ public MapCoordinates getMapCoordinates() { return cs; } /** Set the current coordinate mapping object. @param c the current coordinate mapping object. */ public void setMapCoordinates(MapCoordinates c) { cs=c; } /** Sets whether the grid showing the editing points should be shown or not. @param s true if the grid is to be drawn. */ public void setShowGrid(boolean s) { showGrid=s; } /** Gets if the editing grid has to be shown. @return true if the grid is drawn. */ public boolean getShowGrid() { return showGrid; } /** Gesture listener: useful to detect for long taps to show contextual menu. */ private class GestureListener extends GestureDetector.SimpleOnGestureListener { @Override public boolean onDown(MotionEvent event) { if(eea.getSelectionState()!=ElementsEdtActions.SELECTION) return false; int x, y; if(event.getPointerCount()>0) { x = (int)event.getX(0)+getScrollX(); y = (int)event.getY(0)+getScrollY(); } else { return false; } ruler=false; rulerStartX = x; rulerStartY = y; rulerEndX = x; rulerEndY = y; long start = System.currentTimeMillis(); haa.dragHandleStart(x, y, ea.getSelectionTolerance(), false, cs); long millis=System.currentTimeMillis()-start; android.util.Log.e("fidocadj", "dragHandleStart done in "+millis+ " ms"); invalidate(); return true; } @Override public boolean onSingleTapUp(MotionEvent event) { return tapUpHandler(event, false, false); } @Override public void onLongPress(MotionEvent event) { tapUpHandler(event, true, false); } @Override public boolean onDoubleTap(MotionEvent event) { return tapUpHandler(event, false, true); } private boolean tapUpHandler(MotionEvent event, boolean longTap, boolean doubleTap) { int x, y; if(event.getPointerCount()>0) { x = (int)event.getX(0)+getScrollX(); y = (int)event.getY(0)+getScrollY(); } else { return false; } // If we are in the selection state, either we are ending the // editing // of an element (and thus the dragging of a handle) or we are // making a click. if(eea.actionSelected==ElementsEdtActions.SELECTION) { android.util.Log.e("f", "x="+x+" rulerStartX="+rulerStartX); if(Math.abs(x-rulerStartX)>10 || Math.abs(y-rulerStartY)>10) { haa.dragHandleEnd(FidoEditor.this,x, y, false, cs); } else { android.util.Log.d("f", "long: "+longTap+" double: " +doubleTap); eea.handleClick(cs, x, y, longTap, false,doubleTap); } } else { android.util.Log.d("f", "long: "+longTap+" double: " +doubleTap); eea.handleClick(cs, x, y, longTap, false,doubleTap); } invalidate(); return true; } } }
27,087
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
package-info.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/package-info.java
/**<p> Main classes for the FidoCadJ project. FidoMain contains the entry point of the Android application, FidoEditor contains the main editor object CustomDrawerLayout</p> */ package net.sourceforge.fidocadj;
227
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
FidoMain.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/FidoMain.java
package net.sourceforge.fidocadj; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Vector; import java.util.NoSuchElementException; import android.app.Activity; import android.app.FragmentManager; import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; import android.content.Intent; import android.content.ContentResolver; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Bundle; import android.os.Environment; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemSelectedListener; import android.widget.ArrayAdapter; import android.widget.ExpandableListView; import android.widget.Spinner; import android.widget.Toast; import android.widget.Button; import android.util.Log; import android.net.Uri; import android.support.v4.widget.DrawerLayout; import com.explorer.ExplorerActivity; import com.explorer.IO; import net.sourceforge.fidocadj.dialogs.DialogAbout; import net.sourceforge.fidocadj.dialogs.DialogLayer; import net.sourceforge.fidocadj.dialogs.DialogOpenFile; import net.sourceforge.fidocadj.dialogs.DialogSaveName; import net.sourceforge.fidocadj.layers.LayerDesc; import net.sourceforge.fidocadj.graphic.android.ColorAndroid; import net.sourceforge.fidocadj.geom.MapCoordinates; import net.sourceforge.fidocadj.geom.DrawingSize; import net.sourceforge.fidocadj.primitives.MacroDesc; import toolbars.ToolbarTools; import net.sourceforge.fidocadj.globals.AccessResources; import net.sourceforge.fidocadj.globals.Globals; import net.sourceforge.fidocadj.globals.ProvidesCopyPasteInterface; import net.sourceforge.fidocadj.circuit.controllers.ContinuosMoveActions; import net.sourceforge.fidocadj.circuit.controllers.ElementsEdtActions; import net.sourceforge.fidocadj.librarymodel.Category; import net.sourceforge.fidocadj.librarymodel.Library; import net.sourceforge.fidocadj.librarymodel.LibraryModel; import net.sourceforge.fidocadj.macropicker.ExpandableMacroListView; import net.sourceforge.fidocadj.storage.StaticStorage; /** The main activity of the FidoCadJ application. Important things handled here are: - Creation and destruction of the activity (app). - Handling menu events (contextual and main menu). <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, see <http://www.gnu.org/licenses/>. Copyright 2014-2015 by Davide Bucci, Dante Loi </pre> */ public class FidoMain extends Activity implements ProvidesCopyPasteInterface, SensorEventListener { private ToolbarTools tt; private FidoEditor drawingPanel; private final FragmentManager fragmentManager = getFragmentManager(); /* Gyroscope and sensors gestures */ private boolean activateSensors; private SensorManager mSensorManager; private Sensor mAccelerometer; private float averagedAngleSpeedX; private float averagedAngleSpeedY; private float averagedAngleSpeedZ; // Sort of a counter to specify a sort of a "dead time" after a sensor // gesture has been triggered. private long holdoff; /* Loaded libraries and information */ private List<Category> globalList; private List<Library> libsList; private List<String> listDataHeader; private HashMap<String, HashMap<String, List<String>>> listDataHeader2; // Elements of the graphic interface. private Spinner librarySpinner; private ExpandableMacroListView listAdapter; private ExpandableListView expListView; // Name of the temporary file employed for saving the current drawing. private final String tempFileName = "state.fcd.tmp"; HashMap<String, List<String>> listDataChild; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); activateSensors = true; setContentView(R.layout.main); tt = new ToolbarTools(); drawingPanel = (FidoEditor) findViewById(R.id.drawingPanel); // Create the standard directory for the drawings and libs, if needed: createDirIfNotExists("FidoCadJ/Drawings"); createDirIfNotExists("FidoCadJ/Libs"); StaticStorage.setCurrentEditor(drawingPanel); tt.activateListeners(this, drawingPanel.eea); Globals.messages = new AccessResources(this); activateSensors(); readAllLibraries(); createLibraryDrawer(); // TODO: this is method which works well, but it is discouraged by // modern Android APIs. reloadInstanceData(getLastNonConfigurationInstance()); IO.context = this; // Process the intents. It is useful when a file has to be opened. Uri data = getIntent().getData(); boolean readPrevious=false; if(data!=null) { getIntent().setData(null); readPrevious=importData(data); } // If a file has not been opened, read the content of the previous // session and try to restore the drawing, as contained in the // temporary file. if(!readPrevious) readTempFile(); // Update the color of the layer button. Button layerButton= (Button)findViewById(R.id.layer); Vector<LayerDesc> layers = drawingPanel.getDrawingModel().getLayers(); layerButton.setBackgroundColor( ((ColorAndroid)layers.get(0).getColor()) .getColorAndroid()); // Zoom to fit only if there is something to show. if(!drawingPanel.getDrawingModel().isEmpty()) { drawingPanel.panToFit(); } } /** Read all libraries in the FidoCadJ/Libs directory. */ private void readAllLibraries() { // Get the path of the external storage directory. For example, // in most cases it will be /storage/sdcard0/. // Therefore, the lib dir will be /storage/sdcard0/FidoCadJ/Libs File file_tm = new File(Environment.getExternalStorageDirectory(), "FidoCadJ/Libs"); Log.e("fidocadj", "read lib dir:"+file_tm.getAbsolutePath()); drawingPanel.getParserActions().loadLibraryDirectory( file_tm.getAbsolutePath()); } /** Read the drawing stored in the temporary file */ private void readTempFile() { // Now we read the current drawing which might be contained in the // temporary file. If there is something meaningful, we perform a // zoom to fit operation. StringBuilder text = new StringBuilder(); text.append("[FIDOCAD]\n"); File file = new File(getFilesDir(), tempFileName); try { BufferedReader br = new BufferedReader(new FileReader(file)); String line; while ((line = br.readLine()) != null) { text.append(line); text.append('\n'); } br.close(); } catch (IOException e) { e.printStackTrace(); } // NOTE: DB: I am not completely sure that the following line is // needed. drawingPanel.getParserActions().openFileName = tempFileName; drawingPanel.getParserActions().parseString( new StringBuffer(text.toString())); drawingPanel.getUndoActions().saveUndoState(); drawingPanel.invalidate(); } /** Inspired from http://richardleggett.co.uk/blog/2013/01/26/ registering_for_file_types_in_android/ detects if in the data there is a file indication, open it and load its contents. @return true if something has been loaded, false otherwise */ private boolean importData(Uri data) { final String scheme = data.getScheme(); // Check wether there is a file in the data provided. if(ContentResolver.SCHEME_FILE.equals(scheme)) { try { ContentResolver cr = getContentResolver(); InputStream is = cr.openInputStream(data); if(is==null) return false; // Read the contents of the file. StringBuffer buf = new StringBuffer(); BufferedReader reader = new BufferedReader( new InputStreamReader(is)); String str; if(is!=null) { while((str = reader.readLine()) !=null) { buf.append(str+"\n"); } } is.close(); return true; } catch (Exception e) { Log.e("fidocadj", "FidoMain.ImportData, Error reading file: "+ e.toString()); } } return false; } /** Check if a directory exists in the external storage directory, and if not, create it. Source: http://stackoverflow.com/questions/2130932 @param path the directory name to be used @return true if everything has been OK (either the directory exists or it has been created). false if an error occurred. */ public static boolean createDirIfNotExists(String path) { boolean ret = true; File file = new File(Environment.getExternalStorageDirectory(), path); if (!file.exists()) { if (!file.mkdirs()) { Log.e("fidocadj", "Problem creating output folder"); ret = false; } } return ret; } /** * Create the drawer on the right of the Activity, showing the list of * libraries when the user slides her finger. */ public void createLibraryDrawer() { // get the listview expListView = (ExpandableListView) findViewById(R.id.macroTree); // preparing list data prepareListData(new LibraryModel(drawingPanel.getDrawingModel())); listAdapter = new ExpandableMacroListView(this, listDataHeader, listDataChild); // setting list adapter expListView.setAdapter(listAdapter); expListView .setOnChildClickListener(new ExpandableListView.OnChildClickListener() { public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { Category c = globalList.get(groupPosition); MacroDesc md = c.getAllMacros().get(childPosition); ContinuosMoveActions eea = drawingPanel .getContinuosMoveActions(); if (md != null) { eea.setState(ElementsEdtActions.MACRO, md.key); tt.clear(null); // NOTE: close the drawer here! DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawers(); } else { eea.setState(ElementsEdtActions.SELECTION, ""); } return true; } }); librarySpinner = (Spinner) findViewById(R.id.librarySpinner); ArrayAdapter spinnerAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item, libsList); librarySpinner.setAdapter(spinnerAdapter); librarySpinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) { listDataHeader.clear(); listDataChild.clear(); globalList.clear(); //currentLib = position; Library l = libsList.get(position); List<Category> catList = l.getAllCategories(); for (Category c : catList) { listDataHeader.add(c.getName()); List<String> ts = new ArrayList<String>(); List<MacroDesc> macroList = c.getAllMacros(); for (MacroDesc m : macroList) { ts.add(m.name); } listDataChild.put(c.getName(), ts); globalList.add(c); } listAdapter.notifyDataSetChanged(); } @Override public void onNothingSelected(AdapterView<?> parentView) { listDataChild.clear(); listAdapter.notifyDataSetChanged(); } }); } /** * Activate the sensors (gyroscope) which will then be used for actions such * as rotating and mirroring components. */ public void activateSensors() { mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE); } /** * Saves the important data used in this instance, to be able to recover in * a fast way when the user rotates the screen, for example. * * @return an array of useful data, used by reloadInstanceData(). */ @Override public Object onRetainNonConfigurationInstance() { List<Object> data = new ArrayList<Object>(); // data.add(drawingPanel.getDrawingModel()); // why is it not working? data.add(drawingPanel.getParserActions().getText(true)); data.add(drawingPanel.eea.getSelectionState()); data.add(drawingPanel.getMapCoordinates()); data.add(Boolean.valueOf(drawingPanel.getShowGrid())); data.add(Boolean.valueOf(activateSensors)); data.add(drawingPanel.getSelectionActions().getSelectionStateVector()); return data; } /** * This routine does the opposite of onRetainNonConfigurationInstance(). * * @param data * a List<Object> of different objects describing the state of * the app. */ public void reloadInstanceData(Object data) { // Casting and order of objects is important if (data != null) { List<Object> d = (List<Object>) data; // drawingPanel.setDrawingModel((DrawingModel)d.get(0)); drawingPanel.getParserActions() .parseString((StringBuffer) d.get(0)); drawingPanel.eea.setActionSelected((Integer) d.get(1)); drawingPanel.setMapCoordinates((MapCoordinates) d.get(2)); drawingPanel.setShowGrid(((Boolean) d.get(3)).booleanValue()); activateSensors = ((Boolean) d.get(4)).booleanValue(); drawingPanel.getSelectionActions().setSelectionStateVector( (Vector<Boolean>) d.get(5)); } } /* * Preparing the list data. */ private void prepareListData(LibraryModel lib) { listDataHeader = new ArrayList<String>(); listDataChild = new HashMap<String, List<String>>(); globalList = new ArrayList<Category>(); // Adding child data libsList = lib.getAllLibraries(); for (Library l : libsList) { List<Category> catList = l.getAllCategories(); /* * for(Category c : catList) { listDataHeader.add(c.getName()); * List<String> ts = new ArrayList<String>(); List<MacroDesc> * macroList = c.getAllMacros(); for(MacroDesc m : macroList) { * ts.add(m.name); } listDataChild.put(c.getName(), ts); } * globalList.addAll(catList); */ } } /** Create the menus to be shown and ensure that the checkable items do reflect the current state of the application. */ @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main_menu, menu); // Set the correct checking state. MenuItem showGrid = menu.findItem(R.id.showgrid); showGrid.setChecked(drawingPanel.getShowGrid()); MenuItem snapToGrid = menu.findItem(R.id.snaptogrid); snapToGrid.setChecked(drawingPanel.getMapCoordinates().getSnap()); MenuItem useSensors = menu.findItem(R.id.use_sensors_rotate_mirror); useSensors.setChecked(activateSensors); return super.onCreateOptionsMenu(menu); } /** One of the most important functions for the user interface: handle all the menu events! */ @Override public boolean onOptionsItemSelected(MenuItem item) { // status is a variable which will be used as a return value. It must // be put to 'true' if the action is taken into account and handled // properly. boolean status = false; String fileName; /* dialogs */ DialogSaveName dsn; DialogOpenFile dof; DialogLayer dl; DialogAbout da; MapCoordinates mp; if (onContextItemSelected(item)) return true; switch (item.getItemId()) { case R.id.menu_copy_split: // Copy and split nonstandard macros // TODO: this is not yet working. drawingPanel.getCopyPasteActions().copySelected(true, true); status = true; break; case R.id.menu_undo: // Undo action drawingPanel.getUndoActions().undo(); status = true; break; case R.id.menu_redo: // Redo action try { drawingPanel.getUndoActions().redo(); } catch (NoSuchElementException E) { // Does nothing. Actually it is not a big issue. android.util.Log.w("fidocadj", "Can not redo."); } status = true; break; case R.id.new_drawing: // New drawing drawingPanel.getParserActions().parseString( new StringBuffer("")); drawingPanel.getParserActions().openFileName = null; drawingPanel.initLayers(); drawingPanel.invalidate(); status = true; break; case R.id.open_file: // Open an existing file Intent myIntent = new Intent(this, ExplorerActivity.class); myIntent.putExtra(ExplorerActivity.DIRECTORY, false); int requestCode = ExplorerActivity.REQUEST_FILE; startActivityForResult(myIntent, requestCode); break; case R.id.open_file_deprecated: // Open an existing file dof = new DialogOpenFile(); dof.show(fragmentManager, ""); status = true; break; case R.id.save: // Save fileName = drawingPanel.getParserActions().openFileName; if (fileName == null || fileName == tempFileName) { dsn = new DialogSaveName(); dsn.show(fragmentManager, ""); } else { IO.writeFileToSD( drawingPanel.getParserActions().openFileName, drawingPanel.getText()); } status = true; break; case R.id.save_with_name: // Save with name dsn = new DialogSaveName(); dsn.show(fragmentManager, ""); status = true; break; case R.id.delete: // Delete a saved file fileName = drawingPanel.getParserActions().openFileName; if (fileName != null) { deleteFile(drawingPanel.getParserActions().openFileName); drawingPanel.getParserActions().parseString( new StringBuffer("")); drawingPanel.getParserActions().openFileName = null; drawingPanel.invalidate(); } else { Toast toast = Toast.makeText(this, R.string.No_file_opened, 5); toast.show(); } status = true; break; case R.id.layer: // Set the current layer dl = new DialogLayer(); dl.show(fragmentManager, ""); status = true; break; case R.id.showgrid: // Toggle grid visibility drawingPanel.setShowGrid(!drawingPanel.getShowGrid()); drawingPanel.invalidate(); item.setChecked(drawingPanel.getShowGrid()); status = true; break; case R.id.snaptogrid: // Toggle snap to grid while editing mp = drawingPanel.getMapCoordinates(); mp.setSnap(!mp.getSnap()); drawingPanel.invalidate(); item.setChecked(mp.getSnap()); status = true; break; case R.id.use_sensors_rotate_mirror: // Toggle "use sensors..." activateSensors = !activateSensors; item.setChecked(activateSensors); status = true; break; case R.id.zoomtofit: // Zoom to fit drawingPanel.zoomToFit(); break; case R.id.about: // Show the about dialog da = new DialogAbout(); da.show(fragmentManager, ""); status = true; break; default: } if (!status) android.util.Log.e("fidocadj", "menu not found: " + item.getItemId()); else drawingPanel.invalidate(); return status; } /** Do something here if sensor accuracy changes. */ @Override public final void onAccuracyChanged(Sensor sensor, int accuracy) { // Normally it is not needed, but required for the interface // implementation } /** * Implement sensor actions to detect rotation and flip gestures with the * gyroscope. */ @Override public final void onSensorChanged(SensorEvent event) { // Check if sensor gestures are active or not. if (!activateSensors) return; // Get the gyroscope angles. float xValue = event.values[0]; float yValue = event.values[1]; float zValue = event.values[2]; // Exit if we are in a holdoff time. After one gesture has been // recognized, there is a certain time (until holdoff) where the // system is not responding to new events, to avoid multiple // triggering. if (event.timestamp < holdoff) { return; } // Calculate the averaged angle speed. averagedAngleSpeedX = 0.2f * averagedAngleSpeedX + 0.8f * xValue; averagedAngleSpeedY = 0.2f * averagedAngleSpeedY + 0.8f * yValue; averagedAngleSpeedZ = 0.2f * averagedAngleSpeedZ + 0.8f * zValue; // This is a delicate value: it should be enough to require a // deliberate action, but not too much. float threshold = 1.0f; // X or Y action: mirror if (averagedAngleSpeedX > threshold || averagedAngleSpeedX < -threshold || averagedAngleSpeedY > threshold || averagedAngleSpeedY < -threshold) { holdoff = event.timestamp + 500000000l; drawingPanel.getEditorActions().mirrorAllSelected(); drawingPanel.invalidate(); } // Z action: rotation. if (averagedAngleSpeedZ > threshold || averagedAngleSpeedZ <-threshold) { holdoff = event.timestamp + 500000000l; drawingPanel.getEditorActions().rotateAllSelected(); if (averagedAngleSpeedZ > 0.0f) { drawingPanel.getEditorActions().rotateAllSelected(); drawingPanel.getEditorActions().rotateAllSelected(); } drawingPanel.invalidate(); } } /** Reactivate the events needed by the FidoCadJ app when it is brought on focus. This is in particular useful for the sensors gestures, which need to be deactivated when the app is not on the top. */ @Override protected void onResume() { super.onResume(); // Restore registering accelerometer events. mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL); } /** Called when the Activity is put in the "pause" state. */ @Override protected void onPause() { super.onPause(); // Avoid registering accelerometer events when the activity is // paused. mSensorManager.unregisterListener(this); } /** Create the contextual menu. */ @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.popupmenu, menu); } /** * Called when the user selects something in the context menu. */ @Override public boolean onContextItemSelected(MenuItem item) { boolean status = false; // Get the action selected by the user and execute it. switch (item.getItemId()) { case R.id.menu_param: drawingPanel.setPropertiesForPrimitive(); break; case R.id.menu_cut: drawingPanel.getCopyPasteActions().copySelected(true, false); drawingPanel.getEditorActions().deleteAllSelected(true); status = true; break; case R.id.menu_copy: drawingPanel.getCopyPasteActions().copySelected(true, false); status = true; break; case R.id.menu_paste: drawingPanel.getCopyPasteActions().paste( drawingPanel.getMapCoordinates().getXGridStep(), drawingPanel.getMapCoordinates().getYGridStep()); status = true; break; case R.id.menu_selectall: drawingPanel.getSelectionActions().setSelectionAll(true); status = true; break; case R.id.menu_delete: drawingPanel.getEditorActions().deleteAllSelected(true); status = true; break; case R.id.menu_rotate: drawingPanel.getEditorActions().rotateAllSelected(); status = true; break; case R.id.menu_mirror: drawingPanel.getEditorActions().mirrorAllSelected(); status = true; break; default: break; } // If something has changed, force a redraw. if (status) drawingPanel.invalidate(); return status; } /** Stores the given String in the clipboard. @param s the String to be stored. */ public void copyText(String s) { // Gets a handle to the clipboard service. ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); ClipData clip = ClipData.newPlainText("simple text", s.toString()); clipboard.setPrimaryClip(clip); } /** Get the current data (as String) in the clipboard. @return the String contained in the clipboard. */ public String pasteText() { ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); String pasteData = ""; ClipData.Item item = clipboard.getPrimaryClip().getItemAt(0); // Gets the clipboard as text. pasteData = item.getText().toString(); // If the string contains data, then the paste operation is done return pasteData; } /** Callback used when an Activity has finished and must send back data to the original caller. Here, it is used for the ExplorerActivity file browser, so we need to check what to do. */ @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == RESULT_OK) { switch (requestCode) { case ExplorerActivity.REQUEST_FILE: /** Manage the opening of file from SD card **/ if (data.hasExtra(ExplorerActivity.FILENAME)) { String filename = data.getExtras().getString( ExplorerActivity.FILENAME); drawingPanel.getParserActions().openFileName = filename; drawingPanel.getParserActions().parseString( new StringBuffer(IO.readFileFromSD(filename))); drawingPanel.getUndoActions().saveUndoState(); drawingPanel.invalidate(); } break; default: break; } } } /** Save the current state and finish the application. */ @Override public void onBackPressed() { FileOutputStream outputStream; String fileName = tempFileName; try { outputStream = openFileOutput(fileName, Context.MODE_PRIVATE); outputStream.write(drawingPanel.getText().getBytes()); outputStream.close(); } catch (IOException e) { e.printStackTrace(); } finish(); } }
31,183
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
CustomDrawerLayout.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/CustomDrawerLayout.java
package net.sourceforge.fidocadj; import android.support.v4.widget.DrawerLayout; import android.content.Context; import android.util.AttributeSet; import android.view.View.MeasureSpec; /** CustomDrawerLayout is a DrawerLayout which is slightly modified so that its measurement are exactly what we need. <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, see <http://www.gnu.org/licenses/>. Copyright 2014 by Davide Bucci </pre> */ public class CustomDrawerLayout extends DrawerLayout { /** Creator. @param context the current context. */ public CustomDrawerLayout(Context context) { super(context); } /** Creator. @param context the current context. @param attrs attributes for the layout. */ public CustomDrawerLayout(Context context, AttributeSet attrs) { super(context, attrs); } /** Creator. @param context the current context. @param attrs attributes for the layout. @param defStyle style. */ public CustomDrawerLayout(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } /** Called when a measurement operation is done. @param widthMeasureSpec the wanted with. @param heightMeasureSpec the wanted height. */ @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { widthMeasureSpec = MeasureSpec.makeMeasureSpec( MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.EXACTLY); heightMeasureSpec = MeasureSpec.makeMeasureSpec( MeasureSpec.getSize(heightMeasureSpec), MeasureSpec.EXACTLY); super.onMeasure(widthMeasureSpec, heightMeasureSpec); } }
2,364
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
package-info.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/layermodel/package-info.java
/** Package for providing a model (database) for layers. Classes in the "layers" package will be moved here. */ package net.sourceforge.fidocadj.layermodel;
161
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
LayerModel.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/layermodel/LayerModel.java
// This file is part of FidoCadJ. // // FidoCadJ 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. // // FidoCadJ is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with FidoCadJ. If not, // @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. // // Copyright 2014-2023 Kohta Ozaki package net.sourceforge.fidocadj.layermodel; import java.util.*; import net.sourceforge.fidocadj.circuit.model.DrawingModel; import net.sourceforge.fidocadj.layers.LayerDesc; /** * Model for providing layers.<BR> * @author Kohta Ozaki */ public class LayerModel { private final DrawingModel drawingModel; /** Standard constructor. @param dm the drawing model to be used. */ public LayerModel(DrawingModel dm) { this.drawingModel = dm; } /** Get the layer description from the drawing model. @return the array of layers. */ public List<LayerDesc> getAllLayers() { return drawingModel.getLayers(); } }
1,435
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
package-info.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/export/package-info.java
/** Export filters for FidoCadJ drawings. They are implementations of the ExportGraphic interface. The class ExportGraphic contains some general use methods related to the export, but not only (such as calculating image size and so on). */ package net.sourceforge.fidocadj.export;
297
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
ExportInterface.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/export/ExportInterface.java
package net.sourceforge.fidocadj.export; import java.util.*; import java.io.*; import net.sourceforge.fidocadj.layers.LayerDesc; import net.sourceforge.fidocadj.primitives.MacroDesc; import net.sourceforge.fidocadj.graphic.PointDouble; import net.sourceforge.fidocadj.graphic.DimensionG; /** ExportInterface.java Interface which allows to export a FidoCad draw under an arbitrary format. The primitive handling system of FidoCadJ will call each primitive export function and provide every informations about the primitive state. Each coordinate is given in FidoCadJ coordinate space, which means that normally one unit corresponds to 5 mils (127 microns). I do not consider the export phase as a speed sensitive context. For this reason, I try to write that interface in order to achieve the maximum ease of use of the various parameters involving each primitive. <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2008-2023 by Davide Bucci </pre> @author Davide Bucci */ public interface ExportInterface { /** Called at the beginning of the export phase. Ideally, in this routine there should be the code to write the header of the file on which the drawing should be exported. @param totalSize the size of the image. Useful to calculate for example the bounding box. @param la a vector describing the attributes of each layer. @param grid the grid size. This is useful when exporting to another drawing program having some kind of grid concept. You might use this value to synchronize FidoCadJ's grid with the one used by the target. @throws IOException if an error occurs. */ void exportStart(DimensionG totalSize, List<LayerDesc> la, int grid) throws IOException; /** Called at the end of the export phase. @throws IOException if an error occurs. */ void exportEnd() throws IOException; /** Set the multiplication factor to be used for the dashing. @param u the factor. */ void setDashUnit(double u); /** Set the "phase" in output units of the dashing style. For example, if a dash style is composed by a line followed by a space of equal size, a phase of 0 indicates that the dash starts with the line. @param p the phase, in output units. */ void setDashPhase(float p); /** Called when exporting an Advanced Text primitive. @param x the x position of the beginning of the string to be written. @param y the y position of the beginning of the string to be written. @param sizex the x size of the font to be used. @param sizey the y size of the font to be used. @param fontname the font to be used. @param isBold true if the text should be written with a boldface font. @param isMirrored true if the text should be mirrored. @param isItalic true if the text should be written with an italic font. @param orientation angle of orientation (degrees). @param layer the layer that should be used. @param text the text that should be written. @throws IOException if an error occurs. */ void exportAdvText (int x, int y, int sizex, int sizey, String fontname, boolean isBold, boolean isMirrored, boolean isItalic, int orientation, int layer, String text) throws IOException; /** Called when exporting a Bézier primitive. @param x1 the x position of the first point of the trace. @param y1 the y position of the first point of the trace. @param x2 the x position of the second point of the trace. @param y2 the y position of the second point of the trace. @param x3 the x position of the third point of the trace. @param y3 the y position of the third point of the trace. @param x4 the x position of the fourth point of the trace. @param y4 the y position of the fourth point of the trace. @param layer the layer that should be used. // from 0.22.1 @param arrowStart specify if an arrow is present at the first point. @param arrowEnd specify if an arrow is present at the second point. @param arrowStyle the style of the arrow. @param arrowLength total lenght of arrows (if present). @param arrowHalfWidth half width of arrows (if present). @param dashStyle dashing style. @param strokeWidth the width of the pen to be used when drawing. @throws IOException if an error occurs. */ void exportBezier (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int layer, boolean arrowStart, boolean arrowEnd, int arrowStyle, int arrowLength, int arrowHalfWidth, int dashStyle, double strokeWidth) throws IOException; /** Called when exporting a Connection primitive. @param x the x position of the position of the connection. @param y the y position of the position of the connection. @param size the size of the connection in logical units. @param layer the layer that should be used. @throws IOException if an error occurs. */ void exportConnection (int x, int y, int layer, double size) throws IOException; /** Called when exporting a Line primitive. @param x1 the x position of the first point of the segment. @param y1 the y position of the first point of the segment. @param x2 the x position of the second point of the segment. @param y2 the y position of the second point of the segment. @param layer the layer that should be used. // from 0.22.1 @param arrowStart specify if an arrow is present at the first point. @param arrowEnd specify if an arrow is present at the second point. @param arrowStyle the style of the arrow. @param arrowLength total lenght of arrows (if present). @param arrowHalfWidth half width of arrows (if present). @param dashStyle dashing style. @param strokeWidth the width of the pen to be used when drawing. @throws IOException if an error occurs. */ void exportLine (double x1, double y1, double x2, double y2, int layer, boolean arrowStart, boolean arrowEnd, int arrowStyle, int arrowLength, int arrowHalfWidth, int dashStyle, double strokeWidth) throws IOException; /** Called when exporting a Macro call. This function can just return false, to indicate that the macro should be rendered by means of calling the other primitives. Please notice that a macro does not have a reference layer, since it is defined by its components. @param x the x position of the position of the macro. @param y the y position of the position of the macro. @param isMirrored true if the macro is mirrored. @param orientation the macro orientation in degrees. @param macroName the macro name. @param macroDesc the macro description, in the FidoCad format. @param name the shown name. @param xn coordinate of the shown name. @param yn coordinate of the shown name. @param value the shown value. @param xv coordinate of the shown value. @param yv coordinate of the shown value. @param font the used font. @param fontSize the size of the font to be used. @param m the library. @return false if the macro is exported in this function, true if it has to be split into primitives. @throws IOException if an error occurs. */ boolean exportMacro(int x, int y, boolean isMirrored, int orientation, String macroName, String macroDesc, String name, int xn, int yn, String value, int xv, int yv, String font, int fontSize, Map<String, MacroDesc> m) throws IOException; /** Called when exporting an Oval primitive. Specify the bounding box. @param x1 the x position of the first corner @param y1 the y position of the first corner @param x2 the x position of the second corner @param y2 the y position of the second corner @param isFilled it is true if the oval should be filled @param layer the layer that should be used @param dashStyle dashing style @param strokeWidth the width of the pen to be used when drawing @throws IOException if an error occurs. */ void exportOval(int x1, int y1, int x2, int y2, boolean isFilled, int layer, int dashStyle, double strokeWidth) throws IOException; /** Called when exporting a PCBLine primitive. @param x1 the x position of the first point of the segment. @param y1 the y position of the first point of the segment. @param x2 the x position of the second point of the segment. @param y2 the y position of the second point of the segment. @param width the width ot the line. @param layer the layer that should be used. @throws IOException if an error occurs. */ void exportPCBLine(int x1, int y1, int x2, int y2, int width, int layer) throws IOException; /** Called when exporting a PCBPad primitive. @param x the x position of the pad. @param y the y position of the pad. @param style the style of the pad (0: oval, 1: square, 2: rounded square). @param six the x size of the pad. @param siy the y size of the pad. @param indiam the hole internal diameter. @param layer the layer that should be used. @param onlyHole true if only the hole should be exported. @throws IOException if an error occurs. */ void exportPCBPad(int x, int y, int style, int six, int siy, int indiam, int layer, boolean onlyHole) throws IOException; /** Called when exporting a Polygon primitive. @param vertices array containing the position of each vertex @param nVertices number of vertices @param isFilled true if the polygon is filled @param layer the layer that should be used @param dashStyle dashing style @param strokeWidth the width of the pen to be used when drawing @throws IOException if an error occurs. */ void exportPolygon(PointDouble[] vertices, int nVertices, boolean isFilled, int layer, int dashStyle, double strokeWidth) throws IOException; /** Called when exporting a Curve primitive. @param vertices array containing the position of each vertex. @param nVertices number of vertices. @param isFilled true if the polygon is filled. @param isClosed true if the curve is closed. @param layer the layer that should be used. @param arrowStart specify if an arrow is present at the first point. @param arrowEnd specify if an arrow is present at the second point. @param arrowStyle the style of the arrow. @param arrowLength total lenght of arrows (if present). @param arrowHalfWidth half width of arrows (if present). @param dashStyle dashing style. @param strokeWidth the width of the pen to be used when drawing. @return false if the curve should be rendered using a polygon, true if it is handled by the function. @throws IOException if an error occurs. */ boolean exportCurve(PointDouble[] vertices, int nVertices, boolean isFilled, boolean isClosed, int layer, boolean arrowStart, boolean arrowEnd, int arrowStyle, int arrowLength, int arrowHalfWidth, int dashStyle, double strokeWidth) throws IOException; /** Called when exporting a Rectangle primitive. @param x1 the x position of the first corner. @param y1 the y position of the first corner. @param x2 the x position of the second corner. @param y2 the y position of the second corner. @param isFilled it is true if the rectangle should be filled. @param layer the layer that should be used. @param dashStyle dashing style. @param strokeWidth the width of the pen to be used when drawing. @throws IOException if an error occurs. */ void exportRectangle(int x1, int y1, int x2, int y2, boolean isFilled, int layer, int dashStyle, double strokeWidth) throws IOException; /** Called when exporting an arrow. @param x position of the tip of the arrow. @param y position of the tip of the arrow. @param xc direction of the tip of the arrow. @param yc direction of the tip of the arrow. @param l length of the arrow. @param h width of the arrow. @param style style of the arrow. @return the coordinates of the base of the arrow. @throws IOException if an error occurs. */ PointPr exportArrow(double x, double y, double xc, double yc, double l, double h, int style) throws IOException; }
14,026
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
ExportGraphic.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/export/ExportGraphic.java
package net.sourceforge.fidocadj.export; import java.io.*; import java.util.*; import java.lang.*; import net.sourceforge.fidocadj.globals.*; import net.sourceforge.fidocadj.layers.*; import net.sourceforge.fidocadj.graphic.*; import net.sourceforge.fidocadj.graphic.nil.*; import net.sourceforge.fidocadj.geom.*; import net.sourceforge.fidocadj.circuit.controllers.*; import net.sourceforge.fidocadj.circuit.model.*; import net.sourceforge.fidocadj.circuit.views.*; /** ANDROID VERSION - now empty! ExportGraphic.java Handle graphic export of a Fidocad file This class should be used to export the circuit under different graphic formats. <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, see <http://www.gnu.org/licenses/>. Copyright 2007-2014 by Davide Bucci </pre> @author Davide Bucci */ public final class ExportGraphic { private ExportGraphic() { // Nothing to do. } /** Exports the circuit contained in circ using the specified parsing class. DOES NOT WORK RIGHT NOW. @param file the file name of the graphic file which will be created. @param P the parsing schematics class which should be used (libraries). @param format the graphic format which should be used {png|jpg}. @param unitPerPixel the number of unit for each graphic pixel. @param antiAlias specify whether the anti alias option should be on. @param blackWhite specify that the export should be done in B/W. @param ext activate FidoCadJ extensions when exporting @param shiftMin shift the exported image at the origin. @throws IOException if the file can not be created or an error occurs. */ public static void export(File file, DrawingModel P, String format, double unitPerPixel, boolean antiAlias, boolean blackWhite, boolean ext, boolean shiftMin) throws IOException { exportSizeP( file, P, format, 0, 0, unitPerPixel, false, antiAlias, blackWhite, ext, shiftMin); } /** Exports the circuit contained in circ using the specified parsing class. DOES NOT WORK RIGHT NOW. @param file the file name of the graphic file which will be created. @param P the parsing schematics class which should be used (libraries). @param format the graphic format which should be used {png|jpg}. @param width the image width in pixels (raster images only) @param height the image heigth in pixels (raster images only) @param antiAlias specify whether the anti alias option should be on. @param blackWhite specify that the export should be done in B/W. @param ext activate FidoCadJ extensions when exporting @param shiftMin shift the exported image at the origin. @throws IOException if the file can not be created or an error occurs. */ public static void exportSize(File file, DrawingModel P, String format, int width, int height, boolean antiAlias, boolean blackWhite, boolean ext, boolean shiftMin) throws IOException { exportSizeP( file, P, format, width, height, 1, true, antiAlias, blackWhite, ext, shiftMin); } /** Exports the circuit contained in circ using the specified parsing class. DOES NOT WORK RIGHT NOW. @param file the file name of the graphic file which will be created. @param P the parsing schematics class which should be used (libraries). @param format the graphic format which should be used {png|jpg}. @param unitperpixel the number of unit for each graphic pixel. @param width the image width in pixels (raster images only) @param heith the image heigth in pixels (raster images only) @param setSize if true, calculate resolution from size. If false, it does the opposite strategy. @param antiAlias specify whether the anti alias option should be on. @param blackWhite specify that the export should be done in B/W. @param ext activate FidoCadJ extensions when exporting. @param shiftMin shift the exported image at the origin. */ private static void exportSizeP(File file, DrawingModel P, String format, int width_t, int height_t, double unitPerPixel_t, boolean setSize, boolean antiAlias, boolean blackWhite, boolean ext, boolean shiftMin) throws IOException { } /** Get the image size. DOES NOT WORK RIGHT NOW. @param P the parsing class to be used. @param unitperpixel the zoom set to be used. @param countMin specifies that the size should be calculated counting the minimum x and y coordinates, and not the origin. @param origin is updated with the image origin. @return the size of the drawing. */ public static DimensionG getImageSize(DrawingModel P, double unitperpixel, boolean countMin, PointG origin) { return new DimensionG(0, 0); } /** Get the image origin. DOES NOT WORK RIGHT NOW. @param P the parsing class to be used. @param unitperpixel the zoom set to be used. @return the image origin. */ public static PointG getImageOrigin(DrawingModel P, double unitperpixel) { return new PointG(0, 0); } /** Calculate the zoom to fit the given size in pixel (i.e. the viewport size). DOES NOT WORK RIGHT NOW. @param dm the drawing model to employ. @param sizex the width of the area to be used for calculations. @param sizey the height of the area to be used for calculations. @param countMin specify if the absolute or relative size should be taken into account. @return the zoom to fit settings. */ public static MapCoordinates calculateZoomToFit(DrawingModel dm, int sizex, int sizey, boolean countMin) { MapCoordinates newZoom=new MapCoordinates(); return newZoom; } }
7,737
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
package-info.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/layers/package-info.java
/** Provides the layer description as well as some code of general interest handling layers. NOTE: this package will be merged with net.sourceforge.fidocadj.layermodel in the future. */ package net.sourceforge.fidocadj.layers;
233
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
LayerDesc.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/layers/LayerDesc.java
package net.sourceforge.fidocadj.layers; import net.sourceforge.fidocadj.graphic.ColorInterface; /** layerDesc.java Provide a complete description of each layer (color, visibility). <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2008-2023 by Davide Bucci </pre> @author Davide Bucci */ public class LayerDesc { // Number of layers to be treated: public static final int MAX_LAYERS=16; // The color of the layer: private ColorInterface layerColor; // isVisible is true if the layer should be drawn: public boolean isVisible; // is Modified is true if a redraw is needed: private boolean isModified; // Name or description of the layer: private String layerDescription; // Transparency private float alpha; /** Standard constructor: obtain a visible layer with a black color and no description. */ public LayerDesc() { layerColor=null; isVisible=true; layerDescription=""; } /** Standard constructor. @param c the color which should be used. @param v the visibility of the layer. @param d the layer description. @param a the transparency level (alpha), between 0.0 and 1.0. */ public LayerDesc(ColorInterface c, boolean v, String d, float a) { layerColor=c; isVisible=v; layerDescription=d; alpha = a; } /** This method allows to obtain the color in which this layer should be drawn. @return the color to be used */ final public ColorInterface getColor() { return layerColor; } /** This method allows to obtain the alpha channel of the current layer. @return the alpha blend */ final public float getAlpha() { return alpha; } /** This method returns true if this layer should be traced @return a boolean value indicating if the layer should be drawn */ final public boolean getVisible() { return isVisible; } /** This method returns true if this layer has been modified @return a boolean value indicating that the layer has been modified */ final public boolean getModified() { return isModified; } /** This method allows to obtain the color in which this layer should be drawn. @return the color to be used */ public String getDescription() { return layerDescription; } /** This method allows to set the layer description. @param s the layer description */ final public void setDescription(String s) { layerDescription=s; } /** This method allows to set the layer visibility. @param v the layer visibility. */ final public void setVisible(boolean v) { isVisible=v; } /** This method allows to indicate that the layer has been modified. @param v true if the layer should be considered as modified. */ final public void setModified(boolean v) { isModified=v; } /** This method allows to set the layer color. @param c the layer color. */ final public void setColor(ColorInterface c) { layerColor=c; } /** This method allows to set the alpha blend. @param a the alpha blend. */ final public void setAlpha(float a) { alpha=a; } }
4,128
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
StandardLayers.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/layers/StandardLayers.java
package net.sourceforge.fidocadj.layers; import android.graphics.*; import java.util.Vector; import android.content.Context; import android.content.res.Resources; import net.sourceforge.fidocadj.graphic.android.*; import net.sourceforge.fidocadj.*; /** ANDROID VERSION <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, see <http://www.gnu.org/licenses/>. Copyright 2008-2015 by Davide Bucci </pre> @author Davide Bucci */ public class StandardLayers { // A dummy list of layers. private static Vector<LayerDesc> ll_dummy; /** Create the standard array containing the layer descriptions, colors and transparency. @return the list of the layers being created. */ public static Vector<LayerDesc> createStandardLayers() { Vector<LayerDesc> layerDesc=new Vector<LayerDesc>(); layerDesc.add(new LayerDesc(new ColorAndroid(Color.BLACK), true, "1",1.0f)); // 0 layerDesc.add(new LayerDesc(new ColorAndroid(Color.rgb(0,0,128)), true, "2",1.0f)); // 1 layerDesc.add(new LayerDesc(new ColorAndroid(Color.RED), true, "3",1.0f)); // 2 layerDesc.add(new LayerDesc(new ColorAndroid(Color.rgb(0,128,128)), true,"4",1.0f));// 3 layerDesc.add(new LayerDesc(new ColorAndroid(Color.YELLOW), true,"5",1.0f)); // 4 layerDesc.add(new LayerDesc(new ColorAndroid(-8388864), true,"6",1.0f)); // 5 layerDesc.add(new LayerDesc(new ColorAndroid(-16711681), true,"7",1.0f));// 6 layerDesc.add(new LayerDesc(new ColorAndroid(-16744448), true,"8",1.0f));// 7 layerDesc.add(new LayerDesc(new ColorAndroid(-6632142), true,"9",1.0f));// 8 layerDesc.add(new LayerDesc(new ColorAndroid(-60269), true,"10",1.0f)); // 9 layerDesc.add(new LayerDesc(new ColorAndroid(-4875508), true,"11",1.0f)); // 10 layerDesc.add(new LayerDesc(new ColorAndroid(-16678657), true,"12",1.0f));// 11 layerDesc.add(new LayerDesc(new ColorAndroid(-1973791), true,"13",0.95f));// 12 layerDesc.add(new LayerDesc(new ColorAndroid(-6118750), true,"14",0.9f)); // 13 layerDesc.add(new LayerDesc(new ColorAndroid(-10526881), true,"15",0.9f));// 14 layerDesc.add(new LayerDesc(new ColorAndroid(Color.BLACK), true, "16",1.0f)); // 15 return layerDesc; } /** Create the standard array containing the layer descriptions, colors and transparency. The name of the layers are read from the resources which are related to the given Context. @param context the given Context. @return the list of the layers being created. */ public static Vector<LayerDesc> createStandardLayers(Context context) { Vector<LayerDesc> layerDesc=new Vector<LayerDesc>(); Resources resources = context.getResources(); layerDesc.add(new LayerDesc(new ColorAndroid(Color.BLACK), true, resources.getString(R.string.Circuit_l),1.0f)); // 0 layerDesc.add(new LayerDesc(new ColorAndroid(Color.rgb(0,0,128)), true, resources.getString(R.string.Bottom_copper),1.0f)); // 1 layerDesc.add(new LayerDesc(new ColorAndroid(Color.RED), true, resources.getString(R.string.Top_copper),1.0f)); // 2 layerDesc.add(new LayerDesc(new ColorAndroid(Color.rgb(0,128,128)), true,resources.getString(R.string.Silkscreen),1.0f));// 3 layerDesc.add(new LayerDesc(new ColorAndroid(Color.YELLOW), true,resources.getString(R.string.Other_1),1.0f)); // 4 layerDesc.add(new LayerDesc(new ColorAndroid(-8388864), true,resources.getString(R.string.Other_2),1.0f)); // 5 layerDesc.add(new LayerDesc(new ColorAndroid(-16711681), true,resources.getString(R.string.Other_3),1.0f));// 6 layerDesc.add(new LayerDesc(new ColorAndroid(-16744448), true,resources.getString(R.string.Other_4),1.0f));// 7 layerDesc.add(new LayerDesc(new ColorAndroid(-6632142), true, resources.getString(R.string.Other_5),1.0f));// 8 layerDesc.add(new LayerDesc(new ColorAndroid(-60269), true,resources.getString(R.string.Other_6),1.0f)); // 9 layerDesc.add(new LayerDesc(new ColorAndroid(-4875508), true,resources.getString(R.string.Other_7),1.0f)); // 10 layerDesc.add(new LayerDesc(new ColorAndroid(-16678657), true,resources.getString(R.string.Other_8),1.0f));// 11 layerDesc.add(new LayerDesc(new ColorAndroid(-1973791), true,resources.getString(R.string.Other_9),0.95f));// 12 layerDesc.add(new LayerDesc(new ColorAndroid(-6118750), true,resources.getString(R.string.Other_10),0.9f)); // 13 layerDesc.add(new LayerDesc(new ColorAndroid(-10526881), true,resources.getString(R.string.Other_11),0.9f));// 14 layerDesc.add(new LayerDesc(new ColorAndroid(Color.BLACK), true, resources.getString(R.string.Other_12),1.0f)); // 15 return layerDesc; } /** Create a fictionous Array List. @return an Vector composed by LayerDesc.MAX_LAYERS opaque layers in green. */ public static Vector<LayerDesc> createEditingLayerArray() { // This is called at each redraw, so it is a good idea to avoid // creating it each time. if(ll_dummy == null || ll_dummy.isEmpty()) { ll_dummy = new Vector<LayerDesc>(); ll_dummy.add(new LayerDesc(new ColorAndroid(Color.GREEN), true, "",1.0f)); } return ll_dummy; } }
6,422
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
package-info.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/storage/package-info.java
/** Store some static informations in an Android environment. */ package net.sourceforge.fidocadj.storage;
112
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
StaticStorage.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/storage/StaticStorage.java
package net.sourceforge.fidocadj.storage; import net.sourceforge.fidocadj.*; /** Store information about the current editor object. All information is stored in a static object, so the information is the same everywhere. <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, see <http://www.gnu.org/licenses/>. Copyright 2014-2015 Kohta Ozaki, Davide Bucci </pre> @author Davide Bucci */ public class StaticStorage { private static FidoEditor currentEditor; /** Set the current editor. @param f the current editor. */ public static void setCurrentEditor(FidoEditor f) { currentEditor = f; } /** Get the current editor. @return the current editor object. */ public static FidoEditor getCurrentEditor() { return currentEditor; } }
1,424
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
package-info.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/globals/package-info.java
/** Provide methods of general interest (usually, low level). Some classes define global constants as well as global variables. */ package net.sourceforge.fidocadj.globals;
177
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
AccessResources.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/globals/AccessResources.java
package net.sourceforge.fidocadj.globals; import android.content.Context; import java.util.*; import java.io.*; /** ANDROID VERSION This class is a container for the resource bundles employed by FidoCadJ. We need that since the code employing it must run on Swing as well as on Android and with Android we do not have the ResourceBundle class available. <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, see <http://www.gnu.org/licenses/>. Copyright 2014-2016 by Davide Bucci </pre> */ public class AccessResources { // message bundle private ResourceBundle messages; Context cc; /** Creator, provide a context. @param c the context to be considered. */ public AccessResources(Context c) { messages = null; cc=c; } /** Get the message associated to the provided key. @param s the key to be retrieved. @return the message associated to the key. */ public String getString(String s) { String packageName = cc.getPackageName(); int resId = cc.getResources() .getIdentifier(s, "string", packageName); if (resId == 0) { return "ID Not found"; } else { return cc.getString(resId); } } }
1,880
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
LibUtils.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/globals/LibUtils.java
package net.sourceforge.fidocadj.globals; import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; import java.io.IOException; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.TreeMap; import java.util.prefs.Preferences; import java.util.Locale; import net.sourceforge.fidocadj.primitives.MacroDesc; import net.sourceforge.fidocadj.undo.UndoActorListener; import net.sourceforge.fidocadj.FidoMain; /** Class to handle library files and databases. <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2012-2023 by phylum2, Davide Bucci </pre> @author phylum2, Davide Bucci */ public final class LibUtils { /** Private constructor, for Utility class pattern */ private LibUtils () { // nothing } /** Extract all the macros belonging to a given library. @param m the macro list. @param libfile the file name of the wanted library. @return the library. */ public static Map<String,MacroDesc> getLibrary(Map<String,MacroDesc> m, String libfile) { Map<String,MacroDesc> mm = new TreeMap<String,MacroDesc>(); MacroDesc md; for (Entry<String, MacroDesc> e : m.entrySet()) { md = e.getValue(); // The most reliable way to discriminate the macros is to watch // at the prefix in the key, i.e. everything which comes // before the dot in the complete key. int dotPos = md.key.lastIndexOf("."); // If no dot is found, this is by definition the original FidoCAD // standard library (immutable). if(dotPos<0) { continue; } String lib = md.key.substring(0,dotPos).trim(); if (lib.equalsIgnoreCase(libfile)) { mm.put(e.getKey(), md); } } return mm; } /** Prepare an header and collect text for creating a complete library. @param m the macro map associated to the library @param name the name of the library @return the library description in FidoCadJ code. */ public static String prepareText(Map<String,MacroDesc> m, String name) { StringBuffer sb = new StringBuffer(); String prev = null; int u; MacroDesc md; // Header sb.append("[FIDOLIB " + name + "]\n"); for (Entry<String,MacroDesc> e : m.entrySet()) { md = e.getValue(); // Category (check if it is changed) if (prev == null || !prev.equalsIgnoreCase(md.category.trim())) { sb.append("{"+md.category+"}\n"); prev = md.category.toLowerCase(Locale.US).trim(); } sb.append("["); // When the macros are written in the library, they contain only // the last part of the key, since the first part (before the .) // is always the file name. sb.append(md.key.substring( md.key.lastIndexOf(".")+1).toUpperCase(Locale.US).trim()); sb.append(" "); sb.append(md.name.trim()); sb.append("]"); u = md.description.codePointAt(0) == '\n'?1:0; sb.append("\n"); sb.append(md.description.substring(u)); sb.append("\n"); } return sb.toString(); } /** Save to a file a string respecting the global encoding settings. @param file the file name. @param text the string to be written in the file. @throws FileNotFoundException if the file can not be accessed. */ public static void saveToFile(String file, String text) throws FileNotFoundException { PrintWriter pw = null; try { pw = new PrintWriter(file, Globals.encoding); pw.print(text); pw.flush(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } finally { if (pw!=null) { pw.close(); } } } /** Save a library in a file. @param m the map containing the library. @param file the file name. @param libname the name of the library. @param prefix the prefix to be used for the keys. */ public static void save(Map<String,MacroDesc> m, String file, String libname, String prefix) { try { saveToFile(file + ".fcl", prepareText( getLibrary(m, prefix), libname)); } catch (FileNotFoundException e) { e.printStackTrace(); } } /** Get the directory where the libraries files are to be read. @return the path to the directory. @throws FileNotFoundException if the directory can not be accessed. */ public static String getLibDir() throws FileNotFoundException { Preferences prefs = Preferences.userNodeForPackage(FidoMain.class); String s = prefs.get("DIR_LIBS", ""); if (s == null || s.length()==0) { throw new FileNotFoundException(); } if (!s.endsWith(System.getProperty("file.separator"))) { s+=System.getProperty("file.separator"); } return s; } /** Returns full path to lib file. @param lib Library name. @return the full path as a String. @throws FileNotFoundException if the file can not be accessed. */ public static String getLibPath(String lib) throws FileNotFoundException { return getLibDir()+lib.trim(); } /** Eliminates a library. @param s Name of the library to eliminate. @throws FileNotFoundException if the file can not be accessed. @throws IOException if a generic IO error occurs. */ public static void deleteLib(String s) throws FileNotFoundException, IOException { File f = new File(getLibDir()+s+".fcl"); if(!f.delete()) { throw new IOException("Can not delete library."); } } /** Get all the library in the current library directory. @return a list containing all the library files. @throws FileNotFoundException if the files can not be accessed. */ public static List<File> getLibs() throws FileNotFoundException { File lst = new File(getLibDir()); List<File> l = new ArrayList<File>(); if (!lst.exists()) { return l; } File[] list=lst.listFiles(); if(list==null) { return l; } for (File f : list) { if (f.getName().toLowerCase(Locale.US).endsWith(".fcl")) { l.add(f); } } return l; } /** Determine whether a library is standard or not. @param tlib the name (better prefix?) of the library @return true if the specified library is standard */ public static boolean isStdLib(MacroDesc tlib) { String szlib=tlib.library; if(szlib==null) { return false; } boolean isStandard=false; int dotpos=-1; boolean extensions=true; // A first way to determine if a macro is standard is to see if its // name does not contains a dot (original FidoCAD standard library) dotpos=tlib.key.indexOf("."); if (dotpos<0) { isStandard = true; } else { // If the name contains a dot, we might check whether we have // one of the new FidoCadJ standard libraries: // pcb, ihram, elettrotecnica, ey_libraries. // Obtain the library name String library=tlib.key.substring(0,dotpos); // Check it if(extensions && "pcb".equals(library)) { isStandard = true; } else if (extensions && "ihram".equals(library)) { isStandard = true; } else if (extensions && "elettrotecnica".equals(library)) { isStandard = true; } else if (extensions && "ey_libraries".equals(library)) { isStandard = true; } } return isStandard; } /** Rename a group inside a library. @param libref the map containing the library. @param tlib the name of the library. @param tgrp the name of the group to be renamed. @param newname the new name of the group. @throws FileNotFoundException if the file can not be accessed. */ public static void renameGroup(Map<String, MacroDesc> libref, String tlib, String tgrp, String newname) throws FileNotFoundException { // TODO: what if a group is not present? String prefix=""; for (MacroDesc md : libref.values()) { if (md.category.equalsIgnoreCase(tgrp) && md.library.trim().equalsIgnoreCase( tlib.trim())) { md.category = newname; prefix = md.filename; } } if ("".equals(prefix)) { return; } save(libref, getLibPath(tlib), tlib.trim(), prefix); } /** Check whether a key is used in a given library or it is available. The code also check for the presence of ']', a forbidden char since it would mess up the FidoCadJ file. Also check for strange characters. @param libref the map containing the library. @param tlib the name of the library. @param key the key to be checked. @return false if the key is available, true if it is used. */ public static boolean checkKey(Map<String, MacroDesc> libref, String tlib,String key) { for (MacroDesc md : libref.values()) { if (md.library.equalsIgnoreCase(tlib) && md.key.equalsIgnoreCase(key.trim())) { return true; } } return key.contains("]"); } /** Check if a library name is acceptable. Since the library name is used also as a file name, it must not contain characters which would be in conflict with the rules of file names in the various operating systems. @param library the library name to be checked. @return true if something strange is found. */ public static boolean checkLibrary(String library) { if (library == null) { return false; } return library.contains("[")||library.contains(".")|| library.contains("/")||library.contains("\\")|| library.contains("~")||library.contains("&")|| library.contains(",")||library.contains(";")|| library.contains("]")||library.contains("\""); } /** Delete a group inside a library. @param m the map containing the library. @param tlib the library name. @param tgrp the group to be deleted. @throws FileNotFoundException if the file can not be accessed. */ public static void deleteGroup(Map<String, MacroDesc> m,String tlib, String tgrp) throws FileNotFoundException { // TODO: what if a group is not found? Map<String, MacroDesc> mm = new TreeMap<String, MacroDesc>(); mm.putAll(m); String prefix=""; for (Entry<String, MacroDesc> smd : mm.entrySet()) { MacroDesc md = smd.getValue(); if (md.library.trim().equalsIgnoreCase(tlib) && md.category.equalsIgnoreCase(tgrp)) { m.remove(md.key); prefix = md.filename; } } if("".equals(prefix)) { return; } save(m, getLibPath(tlib), tlib, prefix); } /** Obtain a list containing all the groups in a given library. @param m the map containing all the libraries. @param prefix the filename of the wanted library. @return the list of groups. */ public static List<String> enumGroups(Map<String,MacroDesc> m, String prefix) { List<String> lst = new LinkedList<String>(); for (MacroDesc md : m.values()) { if (!lst.contains(md.category) && prefix.trim().equalsIgnoreCase(md.filename.trim())) { lst.add(md.category); } } return lst; } /** Obtain the full name of a library, from the prefix. @param m the map containing all the libraries. @param prefix the filename of the wanted library. @return the library name. */ public static String getLibName(Map<String,MacroDesc> m, String prefix) { List lst = new LinkedList(); for (MacroDesc md : m.values()) { if (!lst.contains(md.category) && prefix.trim().equalsIgnoreCase(md.filename.trim())) { return md.library; } } return null; } /** Here we save the state of the library for the undo operation. We create a temporary directory and we copy all the contents of the current library directory inside it. The temporary directory name is then saved in the undo system. @param ua the undo controller. @throws IOException if the files or directories needed for the undo can not be accessed. */ public static void saveLibraryState(UndoActorListener ua) throws IOException { try { // This is an hack: at first, we create a temporary file. We store // its name and we use it to create a temporary directory. File tempDir = File.createTempFile("fidocadj_", ""); if(!tempDir.delete()) { throw new IOException( "saveLibraryState: Can not delete temp file."); } if(!tempDir.mkdir()) { throw new IOException( "saveLibraryState: Can not create temp directory."); } String s=getLibDir(); String d=tempDir.getAbsolutePath(); // We copy all the contents of the current library directory in the // temporary directory. File sourceDir = new File(s); File destinationDir = new File(d); FileUtils.copyDirectoryNonRecursive(sourceDir, destinationDir, "fcl"); // We store the directory name in the stack structure of the // undo system. if(ua != null) { ua.saveUndoLibrary(d); } } catch (IOException e) { System.out.println("Cannot save the library status."); } } }
15,596
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
Globals.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/globals/Globals.java
package net.sourceforge.fidocadj.globals; import java.util.*; import net.sourceforge.fidocadj.ADesktopIntegration; /** Globals.java What? Global variables should not be used? But... who cares!!! (ehm... PMD does!) <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2008-2023 by Davide Bucci </pre> */ public final class Globals { // message bundle public static AccessResources messages; // Information about desktop integration public static ADesktopIntegration desktopInt; // shortcut key to be used: public static int shortcutKey; // META (Command) for Macintoshes // CTRL elsewhere // This may be interesting on Macintoshes public static boolean useMetaForMultipleSelection; // Native file dialogs are far better on MacOSX than Linux public static boolean useNativeFileDialogs; // We are on a Mac!!! public static boolean weAreOnAMac; // Show the cancel button to the right of the OK button, as it is done in // Windows public static boolean okCancelWinOrder; // Track the total number of FidoCadJ open windows public static int openWindowsNumber; // A pointer to the active window public static Object activeWindow; public static final Set<Object> openWindows = new HashSet<Object>(); // Line width expressed in FidoCadJ coordinates public static final double lineWidthDefault = 0.5; public static double lineWidth = lineWidthDefault; // Line width expressed in FidoCadJ coordinates (ovals) public static final double lineWidthCirclesDefault = 0.35; public static double lineWidthCircles = lineWidthCirclesDefault; // Connection size in FidoCadJ coordinates (diameter) public static final double diameterConnectionDefault = 2.0; public static double diameterConnection = diameterConnectionDefault; // The last library and group selected by the user. // TODO: refactor this! Those variables should not be here. public static Object lastCLib; public static Object lastCGrp; // Version. This is shown in the main window title bar public static final String version = "0.24.9 alpha"; // Is it a beta version? Some debug options become available, such as // timing each redraw operation. public static final boolean isBeta = true; // The default file extension public static final String DEFAULT_EXTENSION = "fcd"; // The default font public static final String defaultTextFont = "Courier New"; // Comic Sans MS will send a 30 kV electrical discharge through USB... // Dash styles public static final int dashNumber = 5; public static final float dash[][] = { {10.0f,0f}, {5.0f,5.0f}, {2.0f, 2.0f}, {2.0f, 5.0f}, {2.0f, 5.0f,5.0f,5.0f}}; // Minimum height in pixels of a text to be drawn. public static final int textSizeLimit = 4; // The encoding to be used by FidoCadJ public static final String encoding = "UTF8"; // Maximum zoom factor in % // NOTE: there is an internal limit on geom.MapCoordinates that should // always be kept larger than this so that the limit is active. public static final double maxZoomFactor = 4000; // Maximum zoom factor in % public static final double minZoomFactor = 10; // Make sort that this is an utility class (private constructor). private Globals() { } /** Adjust a long string in order to cope with space limitations. Tipically, it will be used to show long paths in the window caption. @param s the string to be treated. @param len the total maximum length of the result. @return the prettified path. */ public static String prettifyPath(String s, int len) { int l=len; if(s.length()<l) { return s; } if (l<10) { l=10; } String r; r= s.substring(0,l/2-5)+ "... "+ s.substring(s.length()-l/2); return r; } /** Determine what is the current platform and configures some interface details such as the key to be used for shortcuts (Command/Meta for Mac and Ctrl for Linux and Windows). @param metaCode key code for the Meta key. @param ctrlCode key code for Ctrl key. */ public static void configureInterfaceDetailsFromPlatform(int metaCode, int ctrlCode) { useNativeFileDialogs=false; useMetaForMultipleSelection=false; if (System.getProperty("os.name").startsWith("Mac")) { // From what I know, only Mac users expect to use the Command (meta) // key for shortcuts, while others will use Control. shortcutKey=metaCode; useMetaForMultipleSelection=true; // Standard dialogs are vastly better on MacOSX than the Swing ones useNativeFileDialogs=true; // The order of the OK and Cancel buttons differs in Windows and // MacOSX. How about the most common Window Managers in Linux? okCancelWinOrder = false; } else { // This solves the bug #3076513 okCancelWinOrder = true; shortcutKey=ctrlCode; } } /** Check if an extension is present in a file name and, if it is not the case, add or adjust it in order to obtain the specified extension. If the string contains " somewhere, this character is removed and the extension is not added. In this way, if the user wants to avoid the automatic extension add, he should put the file name between "'s @param p the file name @param ext the extension that should be added if the file name does not contain one. This extension should NOT contain the dot. @return true if an extension already exists. */ public static boolean checkExtension(String p, String ext) { // TODO: check if the code can be simplified. int i; String s=""; StringBuffer t=new StringBuffer(25); // Check if we have a " somewhere boolean skip=false; for (i=0; i<p.length(); ++i) { if(p.charAt(i)=='"') { skip=true; } else { t.append(p.charAt(i)); } } if (skip) { return true; } s=t.toString(); // We need to check only the file name and not the entire path. // So we begin our research only after the last file separation int start=s.lastIndexOf(System.getProperty("file.separator")); int search=s.lastIndexOf("."); // If the separator has not been found, start is negative. if(start<0) { start=0; } // Search if there is a dot (separation of the extension) if (search>start && search>=0) { // There is already an extension. // We do not need to add anything but instead we need to check if // the extension is correct. String extension = s.substring(search+1); if(!extension.equals(ext)) { return false; } } else { return false; } return true; } /** Check if an extension is present in a file name and, if it is not the case, add or adjust it in order to obtain the specified extension. If the string contains " somewhere, this character is removed and the extension is not added. In this way, if the user wants to avoid the automatic extension add, he should put the file name between "'s @param p the file name @param ext the extension that should be added if the file name does not contain one. This extension should NOT contain the dot. @return the absolutely gorgeous file name, completed with an extension. */ public static String adjustExtension(String p, String ext) { int i; // Check if we have a " somewhere boolean skip=false; StringBuffer temp=new StringBuffer(25); for (i=0; i<p.length(); ++i) { if(p.charAt(i)=='"') { skip=true; } else { temp.append(p.charAt(i)); } } String s=temp.toString(); if (skip) { return s; } // We need to check only the file name and not the entire path. // So we begin our research only after the last file separation int start=s.lastIndexOf(System.getProperty("file.separator")); int search=s.lastIndexOf("."); // If the separator has not been found, start is negative. if(start<0) { start=0; } // Search if there is a dot (separation of the extension) if (search>start && search>=0) { // There is already an extension. // We do not need to add anything but instead we need to check if // the extension is correct. s = s.substring(0, search)+"."+ext; } else { s+="."+ext; } return s; } /** Get the file name, without extensions. @param s the file name with path and extension to be processed. @return the file name, without path and extension(s). */ public static String getFileNameOnly(String s) { // We need to check only the file name and not the entire path. // So we begin our research only after the last file separation int start=s.lastIndexOf(System.getProperty("file.separator")); int search=s.lastIndexOf("."); // If the separator has not been found, start is negative. if(start<0) { start=0; } else { start+=1; } if(search<0) { search=s.length(); } return s.substring(start,search); } /** When we have a path and a filename to put together, we need to separate them with a system file separator, being careful not to add it when it is already include in the path. @param path the path @param filename the file name @return the complete filename, including path */ public static String createCompleteFileName(String path, String filename) { boolean incl=!path.endsWith(System.getProperty("file.separator")); return path + (incl?System.getProperty("file.separator") : "") + filename; } /** Change characters which could give an error in some situations with their corresponding code, or escape sequence. @param p the input string, eventually containing the characters to be changed. @param bc an hash table (char, String) in which each character to be changed is associated with its code, or escape sequence. @return the string with the characters changed. */ public static String substituteBizarreChars(String p, Map bc) { StringBuffer s=new StringBuffer(""); for (int i=0; i<p.length(); ++i) { if((String)bc.get(""+p.charAt(i))==null) { s.append(p.charAt(i)); } else { s.append((String)bc.get(""+p.charAt(i))); } } return s.toString(); } /** Round the specified number to the specified number of decimal digits. @param n the number to be represented. @param ch the number of decimal digits to be retained. @return a string containing the result rounded to n digits. */ public static String roundTo(double n, int ch) { return ""+ (((int)(n*Math.pow(10,ch)))/Math.pow(10,ch)); } /** Round the specified number to two decimal digits. @param n the number to be represented. @return a string containing the result rounded to two digits. */ public static String roundTo(double n) { return ""+ Math.round(n*100.0)/100.0; } }
12,703
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
ProvidesCopyPasteInterface.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/globals/ProvidesCopyPasteInterface.java
package net.sourceforge.fidocadj.globals; /** ProvidesCopyPasteInterface is an interface describing a minimalistic set of methods which may be used during copy/paste operations. <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2008-2023 by Davide Bucci </pre> */ public interface ProvidesCopyPasteInterface { /** Copy a text into the clipboard. @param s the text to be copied. */ void copyText(String s); /** Paste a text from the clipboard. @return the text retrieved from the clipboard. */ String pasteText(); }
1,260
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
FileUtils.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/globals/FileUtils.java
package net.sourceforge.fidocadj.globals; import java.io.*; import java.util.*; /** General file utilities. NOTE: this file is based on some examples found here and there (the links are provided below). If you own the copyright and you do not agree that this class is licensed with a GPL v.3 license, contact the FidoCadJ developers and we will find a solution. <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, see <http://www.gnu.org/licenses/>. </pre> */ public final class FileUtils { /** Private constructor, for Utility class pattern */ private FileUtils () { // nothing } /** Copy a directory recursively Source: http://subversivebytes.wordpress.com/2012/11/05/java-copy-directory-\ recursive-delete/ @param sourceLocation the source location. @param targetLocation the target location. @throws IOException if something goes wrong. */ public static void copyDirectory(File sourceLocation, File targetLocation) throws IOException { if(sourceLocation.isDirectory()) { if(!targetLocation.exists() && !targetLocation.mkdir()) { throw new IOException("Can not create temp. directory."); } // Process all the elements of the directory. String[] children = sourceLocation.list(); for(int i = 0; i < children.length; ++i) { copyDirectory(new File(sourceLocation, children[i]), new File(targetLocation, children[i])); } } else { copyFile(sourceLocation, targetLocation); } } /** Copy a file from a location to another one. @param sourceLocation the source location. @param targetLocation the target location. @throws IOException if something goes wrong. */ public static void copyFile(File sourceLocation, File targetLocation) throws IOException { if(sourceLocation.isDirectory()) return; InputStream in = null; OutputStream out = null; // The copy is made by bunch of 1024 bytes. // I wander whether better OS copy funcions exist. try { in= new FileInputStream(sourceLocation); out=new FileOutputStream(targetLocation); byte[] buf = new byte[1024]; int len; while((len = in.read(buf)) > 0) { out.write(buf, 0, len); } } finally { if (out!=null) out.close(); if (in!=null) in.close(); } } /** Copy all the files containing the specified criteria in the given directory. This copy is not recursive: only the first level is processed. @param sourceLocation the source location. @param targetLocation the target location. @param tcriteria the criteria to be employed for copying files. @throws IOException if something goes wrong. */ public static void copyDirectoryNonRecursive(File sourceLocation, File targetLocation, String tcriteria) throws IOException { String criteria=tcriteria; if(sourceLocation.isDirectory()) { if(!targetLocation.exists() && !targetLocation.mkdir()) { throw new IOException("Can not create temp. directory."); } criteria = criteria.toLowerCase(new Locale("en")); String[] children = sourceLocation.list(); for(int i = 0; i < children.length; ++i) { if(children[i].toLowerCase().contains(criteria)) { copyFile(new File(sourceLocation, children[i]), new File(targetLocation, children[i])); } } } } /** Delete a directory. http://stackoverflow.com/questions/3775694/deleting-folder-from-java @param directory the directory to be deleted. @return boolean @throws IOException if something goes wrong. */ public static boolean deleteDirectory(File directory) throws IOException { if(directory.exists()){ File[] files = directory.listFiles(); if(null!=files){ for(int i=0; i<files.length; i++) { if(files[i].isDirectory()) { deleteDirectory(files[i]); } else { if (!files[i].delete()) throw new IOException("Can not delete file"+ files[i]); } } } } return directory.delete(); } }
5,332
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
package-info.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/macropicker/package-info.java
/** The macro picker tree on the right of the FidoCadJ application. */ package net.sourceforge.fidocadj.macropicker;
122
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
ExpandableMacroListView.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/macropicker/ExpandableMacroListView.java
package net.sourceforge.fidocadj.macropicker; import java.util.HashMap; import java.util.List; import android.content.Context; import android.graphics.Typeface; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseExpandableListAdapter; import android.widget.TextView; import net.sourceforge.fidocadj.R; /** Expandable tree for browsing macros in the library. From http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/ <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, see <http://www.gnu.org/licenses/>. Copyright 2014-2015 Kohta Ozaki, Davide Bucci </pre> @author Davide Bucci */ public class ExpandableMacroListView extends BaseExpandableListAdapter { private final Context eContext; private final List<String> eListDataHeader; // header titles // child data in format of header title, child title private HashMap<String, List<String>> eListDataChild; /** The constructor. @param context the context. @param listDataHeader a list of header titles. @param listChildData child data in format of header title, child title. */ public ExpandableMacroListView(Context context, List<String> listDataHeader, HashMap<String, List<String>> listChildData) { this.eContext = context; this.eListDataHeader = listDataHeader; this.eListDataChild = listChildData; } /** Get a particular child node. @param groupPosition position in the group. @param childPosition position among the children. @return the child in the list data collection. */ @Override public Object getChild(int groupPosition, int childPosititon) { return this.eListDataChild.get(this.eListDataHeader.get(groupPosition)) .get(childPosititon); } /** Get a particular child ID. @param groupPosition position in the group. @param childPosition position among the children. @return the child's ID. */ @Override public long getChildId(int groupPosition, int childPosition) { return childPosition; } /** Get a particular child View. @param groupPosition position in the group. @param childPosition position among the children. @param isLastChild true if it is the last child. @param t_ConvertView TODO: describe it. @param parent the parent. @return the child's View. */ @Override public View getChildView(int groupPosition, final int childPosition, boolean isLastChild, View t_convertView, ViewGroup parent) { View convertView=t_convertView; final String childText = (String) getChild(groupPosition, childPosition); if (convertView == null) { LayoutInflater infalInflater = (LayoutInflater) this.eContext .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = infalInflater.inflate(R.layout.list_item, null); } TextView txtListChild = (TextView) convertView .findViewById(R.id.lblListItem); txtListChild.setText(childText); return convertView; } /** Get a the number of children of a group. @param groupPosition position in the group. @return the number of children. */ @Override public int getChildrenCount(int groupPosition) { return this.eListDataChild.get(this.eListDataHeader.get(groupPosition)) .size(); } /** Get a group. @param groupPosition position of the group. @return the group. */ @Override public Object getGroup(int groupPosition) { return this.eListDataHeader.get(groupPosition); } @Override public int getGroupCount() { return this.eListDataHeader.size(); } @Override public long getGroupId(int groupPosition) { return groupPosition; } @Override public View getGroupView(int groupPosition, boolean isExpanded, View t_convertView, ViewGroup parent) { View convertView=t_convertView; String headerTitle = (String) getGroup(groupPosition); if (convertView == null) { LayoutInflater infalInflater = (LayoutInflater) this.eContext .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = infalInflater.inflate(R.layout.list_group, null); } TextView lblListHeader = (TextView) convertView .findViewById(R.id.lblListHeader); lblListHeader.setTypeface(null, Typeface.BOLD); lblListHeader.setText(headerTitle); return convertView; } @Override public boolean hasStableIds() { return false; } @Override public boolean isChildSelectable(int groupPosition, int childPosition) { return true; } }
5,590
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
package-info.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/graphic/package-info.java
/** Interfaces (and implementation, as sub-packages) of everything needed to draw on each kind of technology: Swing and Android, for example. */ package net.sourceforge.fidocadj.graphic;
191
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
ShapeInterface.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/graphic/ShapeInterface.java
package net.sourceforge.fidocadj.graphic; /** ShapeInterface is an interface used to specify a generic graphical shape. <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014-2023 by Davide Bucci </pre> */ public interface ShapeInterface { /** Obtain the bounding box of the curve. @return the bounding box. */ RectangleG getBounds(); /** Create a cubic curve (Bézier). @param x0 the x coord. of the starting point of the Bézier curve. @param y0 the y coord. of the starting point of the Bézier curve. @param x1 the x coord. of the first handle. @param y1 the y coord. of the first handle. @param x2 the x coord. of the second handle. @param y2 the y coord. of the second handle. @param x3 the x coord. of the ending point of the Bézier curve. @param y3 the y coord. of the ending point of the Bézier curve. */ void createCubicCurve(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3); /** Create a general path with the given number of points. @param npoints the number of points. */ void createGeneralPath(int npoints); /** Move the current position to the given coordinates. @param x the x coordinate. @param y the y coordinate. */ void moveTo(float x, float y); /** Add a cubic curve from the current point. @param x0 the x coord. of the first handle. @param y0 the y coord. of the first handle @param x1 the x coord. of the second handle. @param y1 the y coord. of the second handle. @param x2 the x coord. of the ending point of the Bézier curve. @param y2 the y coord. of the ending point of the Bézier curve. */ void curveTo(float x0, float y0, float x1, float y1, float x2, float y2); /** Close the current path. */ void closePath(); }
2,592
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
ColorInterface.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/graphic/ColorInterface.java
package net.sourceforge.fidocadj.graphic; /** Provides a general way to access colors. <P> D.B.: WHY THE HELL THERE ARE TWO DIFFERENT CLASSES java.awt.Color AND android.graphics.Color. TWO DIFFERENT INCOMPATIBLE THINGS TO DO EXACTLY THE SAME STUFF. SHAME SHAME SHAME! </P> <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014-2023 by Davide Bucci </pre> */ public interface ColorInterface { /** Get a white color. @return a white color. */ ColorInterface white(); /** Get a gray color. @return a gray color. */ ColorInterface gray(); /** Get a green color. @return a green color. */ ColorInterface green(); /** Get a red color. @return a red color. */ ColorInterface red(); /** Get a black color. @return a black color. */ ColorInterface black(); /** Get the green component of the color. @return the component. */ int getGreen(); /** Get the red component of the color. @return the component. */ int getRed(); /** Get the blue component of the color. @return the component. */ int getBlue(); /** Get the RGB description of the color. @return the description, packed in an int. */ int getRGB(); /** Set the color from a RGB description packed in a int. @param rgb the packed description.. */ void setRGB(int rgb); }
2,136
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
FontG.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/graphic/FontG.java
package net.sourceforge.fidocadj.graphic; /** FontG is a class containing font information. <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014-2015 by Davide Bucci </pre> */ public class FontG { public String fontFamily; /** Standard constructor. @param n the name of the font family. */ public FontG(String n) { fontFamily=n; } /** Get the font family. @return the font family. */ public String getFamily() { return fontFamily; } }
1,214
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
DimensionG.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/graphic/DimensionG.java
package net.sourceforge.fidocadj.graphic; /** DimensionG <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014-2015 by Davide Bucci </pre> */ public class DimensionG { public int width; public int height; /** Standard constructor. @param width the width (or x dimension). @param height the height (or y dimension). */ public DimensionG(int width, int height) { this.width=width; this.height=height; } /** Standard creator. Width and hight are put equal to zero. */ public DimensionG() { this.width=0; this.height=0; } }
1,318
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
PointDouble.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/OSes/android/fidocadj/src/net/sourceforge/fidocadj/graphic/PointDouble.java
package net.sourceforge.fidocadj.graphic; /** PointDouble is a class implementing a point with its coordinates (double). <pre> This file is part of FidoCadJ. FidoCadJ 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. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014-2015 by Davide Bucci </pre> */ public class PointDouble { public double x; public double y; /** Standard constructor. @param x the x coordinate of the point. @param y the y coordinate of the point. */ public PointDouble(double x, double y) { this.x=x; this.y=y; } /** Standard constructor. The x and y coordinates are put equal to zero. */ public PointDouble() { this.x=0; this.y=0; } }
1,360
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z