content
stringlengths
7
2.61M
Implementation of the stereo image matching algorithm Recently, with the development of technologies such as augmented reality and unmanned vehicles that receive information about the environment using video cameras, there is a need for fast and accurate depth assessment in images. This problem is relevant, and has led to in-depth research in this area. This article discusses the fundamental principles of local and global stereo image matching algorithms. The operation of the Semi-Global Block Matching algorithm is described in more detail. The essence of the algorithm is to perform line optimization in multiple directions and calculate the aggregated costs by summing the costs of reaching a pixel with an inequality in each direction. The number of directions affects the execution time of the algorithm, and while 16 directions usually provide good quality, a smaller number can be used to achieve faster execution. A typical implementation of the algorithm in 8 directions can calculate the cost in two passes: the forward pass accumulates the cost on the left, the top-left, top and top-right, and the reverse pass accumulates the cost on the right, bottom. right, bottom, and bottom left. Its implementation is also affected by transferring the calculation of the depth map to a graphics processor (GPU) to speed up processing. The results of the construction of the depth map, as well as the dependence of the time of the algorithm on the size of the input images are shown.
Russian newspaper Pravda is blaming President Obama's re-election on an "illiterate society" who voted for him. Putin in 2009 outlined his strategy for economic success. Alas, poor Obama did the opposite but nevertheless was re-elected. Bye, bye Miss American Pie. The Communists have won in America with Obama but failed miserably in Russia with Zyuganov who only received 17% of the vote. Vladimir Putin was re-elected as President keeping the NWO order out of Russia while America continues to repeat the Soviet mistake. After Obama was elected in his first term as president the then Prime Minister of Russia, Vladimir Putin gave a speech at the World Economic Forum in Davos, Switzerland in January of 2009. Ignored by the West as usual, Putin gave insightful and helpful advice to help the world economy and saying the world should avoid the Soviet mistake. Recently, Obama has been re-elected for a 2nd term by an illiterate society and he is ready to continue his lies of less taxes while he raises them. He gives speeches of peace and love in the world while he promotes wars as he did in Egypt, Libya and Syria. He plans his next war is with Iran as he fires or demotes his generals who get in the way. The editorial even mention's President Obama's Fast and Furious scandal. Any normal individual understands that as true but liberalism is a psychosis . O'bomber even keeps the war going along the Mexican border with projects like "fast and furious" and there is still no sign of ending it. He is a Communist without question promoting the Communist Manifesto without calling it so. How shrewd he is in America. His cult of personality mesmerizes those who cannot go beyond their ignorance. They will continue to follow him like those fools who still praise Lenin and Stalin in Russia. Obama's fools and Stalin's fools share the same drink of illusion. Remember, this op-ed was written by someone who knows communism first hand. While I don't agree Putin is an example of pure freedom, I can't say I disagree with the editorial's main points about giving into Obama's cult of personality while ignoring his long list of failures and his collectivist, central control, big government political philosophy. This lady sums things up pretty well: Drinking the drink of illusion indeed. What happens when there isn't any more money to pay for Obama phones? Or food stamps? Etc. Etc. Etc.
def build_param_form(params_dict,eval_strat="serial"): class ParamsForm(Form): pass for p,v in params_dict.items(): if p=="eval_strategy": continue field = IntegerField(label=p,default=v) setattr(ParamsForm,p,field) eval_strategy = SelectField(choices=[("serial","serial"),("parallel","parallel")] ,label="Evaluation Strategy", default=eval_strat) setattr(ParamsForm,"eval_strategy",eval_strategy) return ParamsForm
/* * This file is part of Nucleus, licensed under the MIT License (MIT). See the LICENSE.txt file * at the root of this project for more details. */ package io.github.nucleuspowered.nucleus.modules.environment.commands; import com.google.inject.Inject; import io.github.nucleuspowered.nucleus.modules.environment.EnvironmentKeys; import io.github.nucleuspowered.nucleus.modules.environment.EnvironmentPermissions; import io.github.nucleuspowered.nucleus.modules.environment.config.EnvironmentConfig; import io.github.nucleuspowered.nucleus.modules.environment.parameter.WeatherParameter; import io.github.nucleuspowered.nucleus.core.scaffold.command.ICommandContext; import io.github.nucleuspowered.nucleus.core.scaffold.command.ICommandExecutor; import io.github.nucleuspowered.nucleus.core.scaffold.command.ICommandResult; import io.github.nucleuspowered.nucleus.core.scaffold.command.NucleusParameters; import io.github.nucleuspowered.nucleus.core.scaffold.command.annotation.Command; import io.github.nucleuspowered.nucleus.core.scaffold.command.annotation.CommandModifier; import io.github.nucleuspowered.nucleus.core.scaffold.command.annotation.EssentialsEquivalent; import io.github.nucleuspowered.nucleus.core.scaffold.command.modifier.CommandModifiers; import io.github.nucleuspowered.nucleus.core.services.INucleusServiceCollection; import io.github.nucleuspowered.nucleus.core.services.interfaces.IMessageProviderService; import io.github.nucleuspowered.nucleus.core.services.interfaces.IReloadableService; import org.spongepowered.api.Sponge; import org.spongepowered.api.command.exception.CommandException; import org.spongepowered.api.command.parameter.Parameter; import org.spongepowered.api.registry.RegistryTypes; import org.spongepowered.api.scheduler.Task; import org.spongepowered.api.util.Ticks; import org.spongepowered.api.world.server.ServerWorld; import org.spongepowered.api.world.weather.WeatherType; import java.time.Duration; import java.util.Optional; @EssentialsEquivalent({"thunder", "sun", "weather", "sky", "storm", "rain"}) @Command( aliases = {"weather"}, basePermission = EnvironmentPermissions.BASE_WEATHER, commandDescriptionKey = "weather", modifiers = { @CommandModifier(value = CommandModifiers.HAS_COOLDOWN, exemptPermission = EnvironmentPermissions.EXEMPT_COOLDOWN_WEATHER), @CommandModifier(value = CommandModifiers.HAS_WARMUP, exemptPermission = EnvironmentPermissions.EXEMPT_WARMUP_WEATHER), @CommandModifier(value = CommandModifiers.HAS_COST, exemptPermission = EnvironmentPermissions.EXEMPT_COST_WEATHER) }, associatedPermissions = EnvironmentPermissions.WEATHER_EXEMPT_LENGTH ) public class WeatherCommand implements ICommandExecutor, IReloadableService.Reloadable { private final Parameter.Value<WeatherType> weatherParameter; @Inject public WeatherCommand(final IMessageProviderService messageProviderService) { this.weatherParameter = Parameter.builder(WeatherType.class) .addParser(new WeatherParameter(messageProviderService)) .key("weather") .build(); } private long max = Long.MAX_VALUE; @Override public void onReload(final INucleusServiceCollection serviceCollection) { this.max = serviceCollection.configProvider().getModuleConfig(EnvironmentConfig.class).getMaximumWeatherTimespan(); } @Override public Parameter[] parameters(final INucleusServiceCollection serviceCollection) { return new Parameter[] { NucleusParameters.ONLINE_WORLD_OPTIONAL, this.weatherParameter, NucleusParameters.OPTIONAL_DURATION }; } @Override public ICommandResult execute(final ICommandContext context) throws CommandException { // We can predict the weather on multiple worlds now! final ServerWorld w = context.getWorldPropertiesOrFromSelf(NucleusParameters.ONLINE_WORLD_OPTIONAL); // Get whether we locked the weather. if (context.getServiceCollection().storageManager().getWorldOnThread(w.key()) .map(x -> x.get(EnvironmentKeys.LOCKED_WEATHER).orElse(false)).orElse(false)) { // Tell the user to unlock first. return context.errorResult("command.weather.locked", w.key().asString()); } // Houston, we have a world! Now, what was the forecast? final WeatherType we = context.requireOne(this.weatherParameter); // Have we gotten an accurate forecast? Do we know how long this weather spell will go on for? final Optional<Long> oi = context.getOne(NucleusParameters.OPTIONAL_DURATION).map(Duration::getSeconds); // Even weather masters have their limits. Sometimes. if (this.max > 0 && oi.orElse(Long.MAX_VALUE) > this.max && !context.testPermission(EnvironmentPermissions.WEATHER_EXEMPT_LENGTH)) { return context.errorResult("command.weather.toolong", context.getTimeString(this.max)); } if (oi.isPresent()) { // YES! I should get a job at the weather service and show them how it's done! Sponge.server().scheduler().submit(Task.builder() .execute(() -> w.setWeather(we, Ticks.ofWallClockSeconds(Sponge.server(), oi.get().intValue()))) .plugin(context.getServiceCollection().pluginContainer()).build()); context.sendMessage("command.weather.time", we.key(RegistryTypes.WEATHER_TYPE).asString(), w.key().asString(), context.getTimeString(oi.get())); } else { // No, probably because I've already gotten a job at the weather service... Sponge.server().scheduler().submit( Task.builder().execute(() -> w.setWeather(we)).plugin(context.getServiceCollection().pluginContainer()).build() ); context.sendMessage("command.weather.set", we.key(RegistryTypes.WEATHER_TYPE).asString(), w.key().asString()); } // The weather control device has been activated! return context.successResult(); } }
Life cycle assessment of renewable energy technologies in Northern Africa: A critical review ABSTRACT The need to transition from fossil energy sources, a major contributor to greenhouse gases has become more critical than ever in the face of rising climate threats. Consequently, there has been a wider acceptance and deployment of renewable energy sources. Life Cycle Assessment (LCA), on the other hand, is a standardized tool that has been deployed to comprehend the environmental effects of these alternative energy systems. Most studies conducted in LCA on renewable energy are mostly featured in regions like Europe, Asia, North and South America. While leaving a substantial gap in the volume of work conducted so far in Africa, especially concerning North African countries, a region that shares the largest energy-related CO₂ emissions in the continent. Thus, an in-depth review article is required to discuss the state-of-art on life cycle assessment of renewable energy technologies in North Africa, highlighting the regions peculiarities, outlook, and future prospects. Aspects including the studys overview, goal, scope, kind of renewable energy sources, functional unit, system boundary, and impact categories are included in this review. Results from this review reveal that studies on LCA in this area of work are still at their early stages, accounting for only 2% of the total LCA research in the continent, with solar and bioenergy constituting most of the case studies with 27% and 33% of the total research outlook. In terms of GWP contribution, bioenergy and wind energy recorded the most and least impact in the region, respectively. Findings from this review can help policymakers and researchers have a broader understanding of the environmental contributions of various renewable energy deployed in the region while seeking to improve and regularize the LCA methodology as a standard tool for evaluation.
import cStringIO import logging import nose import os.path import shutil import sys import tempfile import unittest from subprocess import check_call, STDOUT from openmdao.main.plugin import _get_plugin_parser, plugin_quickstart, \ plugin_build_docs, plugin_makedist, \ plugin_list, plugin_install, \ find_all_plugins, find_docs_url from openmdao.util.fileutil import find_files from openmdao.util.testutil import assert_raises class PluginsTestCase(unittest.TestCase): def setUp(self): self.tdir = tempfile.mkdtemp() def tearDown(self): shutil.rmtree(self.tdir) def test_basic(self): logging.debug('') logging.debug('test_basic') # Just run through a complete cycle. orig_dir = os.getcwd() orig_stdout = sys.stdout orig_stderr = sys.stderr # Quickstart. logging.debug('') logging.debug('quickstart') os.chdir(self.tdir) try: argv = ['quickstart', 'foobar'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) retval = plugin_quickstart(parser, options, args) self.assertEqual(retval, 0) fandd = find_files(self.tdir, showdirs=True) self.assertEqual(set([os.path.basename(f) for f in fandd]), set(['foobar', 'src', 'docs', 'setup.cfg', 'setup.py', 'MANIFEST.in', '__init__.py', 'conf.py', 'usage.rst', 'index.rst', 'srcdocs.rst', 'pkgdocs.rst', 'foobar.py', 'README.txt', 'test','test_foobar.py'])) finally: os.chdir(orig_dir) # Makedist. logging.debug('') logging.debug('makedist') sys.stdout = cStringIO.StringIO() sys.stderr = cStringIO.StringIO() logdata = '' os.chdir(os.path.join(self.tdir, 'foobar')) try: argv = ['makedist', 'foobar'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) retval = plugin_makedist(parser, options, args, capture='makedist.out') with open('makedist.out', 'r') as inp: logdata = inp.read() self.assertEqual(retval, 0) if sys.platform == 'win32': self.assertTrue(os.path.exists('foobar-0.1.zip')) else: self.assertTrue(os.path.exists('foobar-0.1.tar.gz')) finally: captured_stdout = sys.stdout.getvalue() captured_stderr = sys.stderr.getvalue() sys.stdout = orig_stdout sys.stderr = orig_stderr os.chdir(orig_dir) logging.debug('captured stdout:') logging.debug(captured_stdout) logging.debug('captured stderr:') logging.debug(captured_stderr) logging.debug('captured subprocess output:') logging.debug(logdata) # Existing distribution error. logging.debug('') logging.debug('makedist error') sys.stdout = cStringIO.StringIO() sys.stderr = cStringIO.StringIO() os.chdir(os.path.join(self.tdir, 'foobar')) try: argv = ['makedist', 'foobar'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) retval = plugin_makedist(parser, options, args, capture='makedist.out') with open('makedist.out', 'r') as inp: logdata = inp.read() self.assertEqual(retval, -1) finally: captured_stdout = sys.stdout.getvalue() captured_stderr = sys.stderr.getvalue() sys.stdout = orig_stdout sys.stderr = orig_stderr os.chdir(orig_dir) logging.debug('captured stdout:') logging.debug(captured_stdout) logging.debug('captured stderr:') logging.debug(captured_stderr) logging.debug('captured subprocess output:') logging.debug(logdata) # Install logging.debug('') logging.debug('install') sys.stdout = cStringIO.StringIO() sys.stderr = cStringIO.StringIO() logdata = '' os.chdir(self.tdir) try: argv = ['install', 'foobar'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) retval = plugin_install(parser, options, args, capture='install.out') with open('install.out', 'r') as inp: logdata = inp.read() self.assertEqual(retval, 0) finally: captured_stdout = sys.stdout.getvalue() captured_stderr = sys.stderr.getvalue() sys.stdout = orig_stdout sys.stderr = orig_stderr os.chdir(orig_dir) logging.debug('captured stdout:') logging.debug(captured_stdout) logging.debug('captured stderr:') logging.debug(captured_stderr) logging.debug('captured subprocess output:') logging.debug(logdata) try: # List in subprocess to grab updated package environment. logging.debug('') logging.debug('list') os.chdir(self.tdir) stdout = open('list.out', 'w') try: check_call(('plugin', 'list', '-g', 'driver', '-g', 'component', '--external'), stdout=stdout, stderr=STDOUT) finally: stdout.close() with open('list.out', 'r') as inp: captured_stdout = inp.read() os.remove('list.out') os.chdir(orig_dir) logging.debug('captured subprocess output:') logging.debug(captured_stdout) self.assertTrue('foobar.foobar.Foobar' in captured_stdout) # Docs. logging.debug('') logging.debug('docs') argv = ['docs', 'foobar'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) url = find_docs_url(options.plugin_dist_name) expected = os.path.join(self.tdir, 'foobar', 'src', 'foobar', 'sphinx_build', 'html', 'index.html') self.assertEqual(os.path.realpath(url), os.path.realpath(expected)) finally: # Uninstall logging.debug('') logging.debug('uninstall') with open('pip.in', 'w') as out: out.write('y\n') stdin = open('pip.in', 'r') stdout = open('pip.out', 'w') # On EC2 Windows, 'pip' generates an absurdly long temp directory # name, apparently to allow backing-out of the uninstall. # The name is so long Windows can't handle it. So we try to # avoid that by indirectly influencing mkdtemp(). env = os.environ.copy() env['TMP'] = os.path.expanduser('~') try: check_call(('pip', 'uninstall', 'foobar'), env=env, stdin=stdin, stdout=stdout, stderr=STDOUT) finally: stdin.close() stdout.close() with open('pip.out', 'r') as inp: captured_stdout = inp.read() os.remove('pip.in') os.remove('pip.out') logging.debug('captured stdout:') logging.debug(captured_stdout) # Show removed. logging.debug('') logging.debug('list removed') os.chdir(self.tdir) stdout = open('list.out', 'w') try: check_call(('plugin', 'list', '--external'), stdout=stdout, stderr=STDOUT) finally: stdout.close() with open('list.out', 'r') as inp: captured_stdout = inp.read() os.remove('list.out') os.chdir(orig_dir) logging.debug('captured subprocess output:') logging.debug(captured_stdout) self.assertFalse('foobar.foobar.Foobar' in captured_stdout) def test_quickstart(self): # All options. argv = ['quickstart', 'foobar', '-c', 'FooBar', '-g', 'component', '-v', '1.1', '-d', self.tdir] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) retval = plugin_quickstart(parser, options, args) self.assertEqual(retval, 0) fandd = find_files(self.tdir, showdirs=True) self.assertEqual(set([os.path.basename(f) for f in fandd]), set(['foobar', 'src', 'docs', 'setup.cfg', 'setup.py', 'MANIFEST.in', '__init__.py', 'conf.py', 'usage.rst', 'index.rst', 'srcdocs.rst', 'pkgdocs.rst', 'foobar.py', 'README.txt', 'test','test_foobar.py'])) # Errors. code = 'plugin_quickstart(parser, options, args)' assert_raises(self, code, globals(), locals(), OSError, "Can't create directory '%s' because it already exists." % os.path.join(self.tdir, 'foobar')) argv = ['quickstart', 'foobar', 'stuff'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) retval = plugin_quickstart(parser, options, args) self.assertEqual(retval, -1) def test_makedist(self): # Errors. argv = ['makedist', 'foobar', 'distdir', 'stuff'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) retval = plugin_makedist(parser, options, args) self.assertEqual(retval, -1) argv = ['makedist', 'foobar', 'no-such-directory'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) code = 'plugin_makedist(parser, options, args)' distdir = os.path.join(os.getcwd(), 'no-such-directory') assert_raises(self, code, globals(), locals(), IOError, "directory '%s' does not exist" % distdir) def test_list(self): logging.debug('') logging.debug('test_list') orig_stdout = sys.stdout orig_stderr = sys.stderr sys.stdout = cStringIO.StringIO() sys.stderr = cStringIO.StringIO() try: argv = ['list'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) retval = plugin_list(parser, options, args) self.assertEqual(retval, 0) finally: captured_stdout = sys.stdout.getvalue() captured_stderr = sys.stderr.getvalue() sys.stdout = orig_stdout sys.stderr = orig_stderr logging.debug('captured stdout:') logging.debug(captured_stdout) logging.debug('captured stderr:') logging.debug(captured_stderr) # Just a selection from each category. expected = ['openmdao.lib.architectures.bliss.BLISS', 'openmdao.lib.casehandlers.caseset.CaseArray', 'openmdao.lib.components.broadcaster.Broadcaster', 'openmdao.lib.datatypes.array.Array', 'openmdao.lib.differentiators.finite_difference.FiniteDifference', 'openmdao.lib.doegenerators.central_composite.CentralComposite', 'openmdao.lib.drivers.broydensolver.BroydenSolver', 'openmdao.lib.surrogatemodels.kriging_surrogate.KrigingSurrogate', 'openmdao.main.assembly.Assembly'] for plugin in expected: self.assertTrue(plugin in captured_stdout) sys.stdout = cStringIO.StringIO() sys.stderr = cStringIO.StringIO() try: argv = ['list', '-g', 'driver', '--builtin'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) retval = plugin_list(parser, options, args) self.assertEqual(retval, 0) finally: captured_stdout = sys.stdout.getvalue() captured_stderr = sys.stderr.getvalue() sys.stdout = orig_stdout sys.stderr = orig_stderr logging.debug('captured stdout:') logging.debug(captured_stdout) logging.debug('captured stderr:') logging.debug(captured_stderr) if 'openmdao.lib.drivers.doedriver.DOEdriver' not in captured_stdout: self.fail('-g driver filter failed to include') if 'openmdao.main.assembly.Assembly' in captured_stdout: self.fail('-g driver filter failed to exclude') # Errors. argv = ['list', 'stuff'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) retval = plugin_list(parser, options, args) self.assertEqual(retval, -1) def test_build_docs(self): logging.debug('') logging.debug('test_build_docs') argv = ['quickstart', 'foobar', '-v', '1.1', '-d', self.tdir] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) plugin_quickstart(parser, options, args) orig_dir = os.getcwd() os.chdir(os.path.join(self.tdir, 'foobar')) orig_stdout = sys.stdout orig_stderr = sys.stderr sys.stdout = cStringIO.StringIO() sys.stderr = cStringIO.StringIO() try: argv = ['build_docs', 'foobar'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) retval = plugin_build_docs(parser, options, args) self.assertEqual(retval, 0) finally: captured_stdout = sys.stdout.getvalue() captured_stderr = sys.stderr.getvalue() sys.stdout = orig_stdout sys.stderr = orig_stderr os.chdir(orig_dir) logging.debug('captured stdout:') logging.debug(captured_stdout) logging.debug('captured stderr:') logging.debug(captured_stderr) # Errors. argv = ['build_docs', 'foobar', 'no-such-directory', 'stuff'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) retval = plugin_build_docs(parser, options, args) self.assertEqual(retval, -1) argv = ['build_docs', 'foobar', 'no-such-directory'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) code = 'plugin_build_docs(parser, options, args)' distdir = os.path.join(os.getcwd(), 'no-such-directory') assert_raises(self, code, globals(), locals(), IOError, "directory '%s' does not exist" % distdir) distdir = os.path.join(self.tdir, 'foobar') os.remove(os.path.join(distdir, 'setup.py')) argv = ['build_docs', 'foobar', distdir] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) code = 'plugin_build_docs(parser, options, args)' assert_raises(self, code, globals(), locals(), IOError, "directory '%s' does not contain 'setup.py'" % distdir) def test_docs(self): argv = ['docs', 'no-such-plugin'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) code = 'find_docs_url(options.plugin_dist_name)' assert_raises(self, code, globals(), locals(), RuntimeError, "Can't locate package/module 'no-such-plugin'") argv = ['docs', 'subprocess'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) url = find_docs_url(options.plugin_dist_name) expected = os.path.join(os.path.dirname(sys.modules['subprocess'].__file__), 'sphinx_build', 'html', 'index.html') self.assertEqual(url, expected) def test_install(self): # Errors. argv = ['install', 'no-such-plugin', 'stuff'] parser = _get_plugin_parser() options, args = parser.parse_known_args(argv) retval = plugin_install(parser, options, args) self.assertEqual(retval, -1) def test_find_plugins(self): self.maxDiff = None with open(os.path.join(self.tdir, 'foo.py'), 'w') as f: f.write(""" from openmdao.main.api import Component, Container class MyComp(Component): pass class MyCont(Container): pass """) expected = { 'openmdao.component': set(['foo.MyComp', 'openmdao.main.component.Component']), 'openmdao.container': set(['foo.MyCont', 'foo.MyComp', 'openmdao.main.component.Component', 'openmdao.main.container.Container']), } plugins = find_all_plugins(self.tdir) self.assertEqual(expected.keys(), plugins.keys()) self.assertEqual(expected.values(), plugins.values()) if __name__ == '__main__': sys.argv.append('--cover-package=openmdao.main') sys.argv.append('--cover-erase') nose.runmodule()
<reponame>hevrard/get-image-glsl #include <iostream> #include <fstream> #include <sstream> #include <vector> #include <ctime> #include <chrono> #include "common.h" #include "openglcontext.h" #include "lodepng.h" #include "json.hpp" using json = nlohmann::json; using namespace std::chrono; // These codes mimic the ones used in 'get-image-glfw' #define COMPILE_ERROR_EXIT_CODE (101) #define LINK_ERROR_EXIT_CODE (102) /*---------------------------------------------------------------------------*/ // Parameters, argument parsing /*---------------------------------------------------------------------------*/ static void defaultParams(Params& params) { params.width = 256; params.height = 256; params.shaderVersion = 0; params.APIVersion = 0; params.fragFilename = ""; params.vertFilename = ""; params.output = "output.png"; params.program = 0; params.exitCompile = false; params.exitLinking = false; params.persist = false; params.animate = false; params.profile = false; params.timeVarName = "time"; params.delay = 5; params.binOut = ""; } /*---------------------------------------------------------------------------*/ static void usage(char *name) { std::cout << "Usage: " << name << " [options] <shader>.frag" << std::endl; std::cout << std::endl; const char *msg = "The program will look for a JSON whose name is derived from the\n" "shader as '<shader>.json'. This JSON file can contain uniforms\n" "initialisations. If no JSON file is found, the program uses default\n" "values for some uniforms.\n" ; std::cout << msg; std::cout << std::endl; std::cout << "Options:" << std::endl; const char *options[] = { "--delay", "number of frames before PNG capture", "--persist", "instruct the renderer to not quit after producing the image", "--exit-compile", "exit after compilation", "--exit-linking", "exit after linking", "--output file.png", "set PNG output file name", "--resolution <width> <height>", "set viewport resolution, in Pixels", "--vertex shader.vert", "use a specific vertex shader", "--dump-bin <file>", "dump binary output to given file (requires OpenGL >= 4.1, OpenGLES >= 3.0)", "--profile", "report time needed to compile, link and render", }; for (unsigned i = 0; i < (sizeof(options) / sizeof(*options)); i++) { printf(" %-34.34s %s\n", options[i], options[i+1]); i++; } std::cout << std::endl; std::cout << "Return values:" << std::endl; const char *errcode[] = { "0", "Successful rendering", "1", "Error", "101", "Shader compilation error (either fragment or vertex)", "102", "Shader linking error", }; for (unsigned i = 0; i < (sizeof(errcode) / sizeof(*errcode)); i++) { printf(" %-4.4s %s\n", errcode[i], errcode[i+1]); i++; } std::cout << std::endl; } /*---------------------------------------------------------------------------*/ static void setParams(Params& params, int argc, char *argv[]) { defaultParams(params); for (int i = 1; i < argc; i++) { std::string arg = std::string(argv[i]); if (arg.compare(0, 2, "--") == 0) { if (arg == "--exit-compile") { params.exitCompile = true; } else if (arg == "--exit-linking") { params.exitLinking = true; } else if (arg == "--persist") { params.persist = true; } else if (arg == "--animate") { params.animate = true; } else if (arg == "--profile") { params.profile = true; } else if (arg == "--delay") { if ((i + 1) >= argc) { usage(argv[0]); crash("Missing value for option %s", "--delay"); } params.delay = atoi(argv[++i]); } else if (arg == "--output") { if ((i + 1) >= argc) { usage(argv[0]); crash("Missing value for option %s", "--output"); } params.output = argv[++i]; } else if (arg == "--resolution") { if ((i + 2) >= argc) { usage(argv[0]); crash("Missing value for option %s", "--resolution"); } params.width = atoi(argv[++i]); params.height = atoi(argv[++i]); } else if (arg == "--vertex") { if ((i + 1) >= argc) { usage(argv[0]); crash("Missing value for option %s", "--vertex"); } params.vertFilename = argv[++i]; } else if (arg == "--dump-bin") { if ((i + 1) >= argc) { usage(argv[0]); crash("Missing value for option %s", "--dump-bin"); } params.binOut = argv[++i]; } else if (arg == "--timevar-name") { if ((i + 1) >= argc) { usage(argv[0]); crash("Missing value for option %s", "--timevar-name"); } params.timeVarName = argv[++i]; } else { usage(argv[0]); crash("Invalid option: %s", argv[i]); } continue; } if (params.fragFilename == "") { params.fragFilename = arg; } else { usage(argv[0]); crash("Unexpected extra argument: %s", arg.c_str()); } } if (params.fragFilename == "") { usage(argv[0]); crash("Missing fragment shader argument"); } } /*---------------------------------------------------------------------------*/ void printAPI(const Params& params) { switch (params.API) { case API_OPENGL: printf("OpenGL"); break; case API_OPENGL_ES: printf("OpenGLES"); break; default: crash("Invalid API value"); } int major = params.APIVersion / 100; int minor = (params.APIVersion % 100) / 10; printf(" %d.%d", major, minor); } /*---------------------------------------------------------------------------*/ // Helpers /*---------------------------------------------------------------------------*/ bool isFile(std::string filename) { std::ifstream ifs(filename.c_str()); return ifs.good(); } /*---------------------------------------------------------------------------*/ void readFile(std::string& contents, const std::string& filename) { std::ifstream ifs(filename.c_str()); if(!ifs) { crash("File not found: %s", filename.c_str()); } std::stringstream ss; ss << ifs.rdbuf(); contents = ss.str(); } /*---------------------------------------------------------------------------*/ int getShaderVersion(const std::string& fragContents) { size_t pos = fragContents.find('\n'); if (pos == std::string::npos) { crash("cannot find end-of-line in fragment shader"); } std::string sub = fragContents.substr(0, pos); if (std::string::npos == sub.find("#version")) { crash("cannot find ``#version'' in first line of fragment shader"); } // TODO: use sscanf of c++ equivalent if (std::string::npos != sub.find("110")) { return 110; } if (std::string::npos != sub.find("120")) { return 120; } if (std::string::npos != sub.find("130")) { return 130; } if (std::string::npos != sub.find("140")) { return 140; } if (std::string::npos != sub.find("150")) { return 150; } if (std::string::npos != sub.find("330")) { return 330; } if (std::string::npos != sub.find("400")) { return 400; } if (std::string::npos != sub.find("410")) { return 410; } if (std::string::npos != sub.find("420")) { return 420; } if (std::string::npos != sub.find("430")) { return 430; } if (std::string::npos != sub.find("440")) { return 440; } if (std::string::npos != sub.find("450")) { return 450; } // The following are OpenGL ES if (std::string::npos != sub.find("100")) { return 100; } if (std::string::npos != sub.find("300")) { return 300; } crash("Cannot find a supported GLSL version in first line of fragment shader: ``%.80s''", sub.c_str()); } /*---------------------------------------------------------------------------*/ void generateVertexShader(std::string& out, const Params& params) { static const std::string vertGenericContents = std::string( "vec2 _GLF_vertexPosition;\n" "void main(void) {\n" " gl_Position = vec4(_GLF_vertexPosition, 0.0, 1.0);\n" "}\n" ); if (params.vertFilename != "") { readFile(out, params.vertFilename); return; } std::stringstream ss; ss << "#version " << params.shaderVersion; if (params.shaderVersion == 300) { // Version 300 must have the "es" suffix, and qualifies the // _GLF_vertexPosition as "in" rather than "attribute" ss << " es" << std::endl << "in "; } else { ss << std::endl << "attribute "; } ss << vertGenericContents; out = ss.str(); //std::cerr << "Generated vertex shader:\n" << out << std::endl; } /*---------------------------------------------------------------------------*/ // JSON uniforms /*---------------------------------------------------------------------------*/ static void setJSONDefaultEntries(json& j, const Params& params) { json defaults = { {"injectionSwitch", { {"func", "glUniform2f"}, {"args", {0.0f, 1.0f}} }}, {"time", { {"func", "glUniform1f"}, {"args", {0.0f}} }}, {"mouse", { {"func", "glUniform2f"}, {"args", {0.0f, 0.0f}} }}, {"resolution", { {"func", "glUniform2f"}, {"args", {float(params.width), float(params.height)}} }} }; for (json::iterator it = defaults.begin(); it != defaults.end(); ++it) { if (j.count(it.key()) == 0) { j[it.key()] = it.value(); } } } /*---------------------------------------------------------------------------*/ template<typename T> T *getArray(const json& j) { T *a = new T[j.size()]; for (unsigned i = 0; i < j.size(); i++) { a[i] = j[i]; } return a; } /*---------------------------------------------------------------------------*/ #define GLUNIFORM_ARRAYINIT(funcname, uniformloc, gltype, jsonarray) \ gltype *a = getArray<gltype>(jsonarray); \ funcname(uniformloc, jsonarray.size(), a); \ delete [] a /*---------------------------------------------------------------------------*/ void setUniformsJSON(const GLuint& program, const Params& params) { GLint nbUniforms; GL_SAFECALL(glGetProgramiv, program, GL_ACTIVE_UNIFORMS, &nbUniforms); if (nbUniforms == 0) { // If there are no uniforms to set, return now return; } // Read JSON file std::string jsonFilename(params.fragFilename); jsonFilename.replace(jsonFilename.end()-4, jsonFilename.end(), "json"); json j = json({}); if (isFile(jsonFilename)) { std::string jsonContent; readFile(jsonContent, jsonFilename); j = json::parse(jsonContent); } else { // If and only if no JSON file, use the defaults std::cerr << "Warning: file '" << jsonFilename << "' not found, will rely on default uniform values only" << std::endl; setJSONDefaultEntries(j, params); } GLint uniformNameMaxLength = 0; GL_SAFECALL(glGetProgramiv, program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &uniformNameMaxLength); GLchar *uniformName = new GLchar[uniformNameMaxLength]; GLint uniformSize; GLenum uniformType; for (int i = 0; i < nbUniforms; i++) { GL_SAFECALL(glGetActiveUniform, program, i, uniformNameMaxLength, NULL, &uniformSize, &uniformType, uniformName); // array name is '<name>[0]', sanitise it: char *p = strchr(uniformName, '['); if (p != NULL) { *p = '\0'; } if (j.count(uniformName) == 0) { crash("missing JSON entry for uniform: %s", uniformName); } if (j.count(uniformName) > 1) { crash("more than one JSON entry for uniform: %s", uniformName); } json uniformInfo = j[uniformName]; // Check presence of func and args entries if (uniformInfo.find("func") == uniformInfo.end()) { crash("malformed JSON: no 'func' entry for uniform: %s", uniformName); } if (uniformInfo.find("args") == uniformInfo.end()) { crash("malformed JSON: no 'args' entry for uniform: %s", uniformName); } // Get uniform location GLint uniformLocation = glGetUniformLocation(program, uniformName); GL_CHECKERR("glGetUniformLocation"); if (uniformLocation == -1) { crash("Cannot find uniform named: %s", uniformName); } // Dispatch to matching init function std::string uniformFunc = uniformInfo["func"]; json args = uniformInfo["args"]; // TODO: check that args has the good number of fields and type if (uniformFunc == "glUniform1f") { glUniform1f(uniformLocation, args[0]); } else if (uniformFunc == "glUniform2f") { glUniform2f(uniformLocation, args[0], args[1]); } else if (uniformFunc == "glUniform3f") { glUniform3f(uniformLocation, args[0], args[1], args[2]); } else if (uniformFunc == "glUniform4f") { glUniform4f(uniformLocation, args[0], args[1], args[2], args[3]); } else if (uniformFunc == "glUniform1i") { glUniform1i(uniformLocation, args[0]); } else if (uniformFunc == "glUniform2i") { glUniform2i(uniformLocation, args[0], args[1]); } else if (uniformFunc == "glUniform3i") { glUniform3i(uniformLocation, args[0], args[1], args[2]); } else if (uniformFunc == "glUniform4i") { glUniform4i(uniformLocation, args[0], args[1], args[2], args[3]); } // Note: GLES does not provide glUniformXui primitives #ifndef GL_VERSION_ES_CM_1_0 else if (uniformFunc == "glUniform1ui") { glUniform1ui(uniformLocation, args[0]); } else if (uniformFunc == "glUniform2ui") { glUniform2ui(uniformLocation, args[0], args[1]); } else if (uniformFunc == "glUniform3ui") { glUniform3ui(uniformLocation, args[0], args[1], args[2]); } else if (uniformFunc == "glUniform4ui") { glUniform4ui(uniformLocation, args[0], args[1], args[2], args[3]); } #endif // ifndef GL_VERSION_ES_CM_1_0 else if (uniformFunc == "glUniform1fv") { GLUNIFORM_ARRAYINIT(glUniform1fv, uniformLocation, GLfloat, args); } else if (uniformFunc == "glUniform2fv") { GLUNIFORM_ARRAYINIT(glUniform2fv, uniformLocation, GLfloat, args); } else if (uniformFunc == "glUniform3fv") { GLUNIFORM_ARRAYINIT(glUniform3fv, uniformLocation, GLfloat, args); } else if (uniformFunc == "glUniform4fv") { GLUNIFORM_ARRAYINIT(glUniform4fv, uniformLocation, GLfloat, args); } else if (uniformFunc == "glUniform1iv") { GLUNIFORM_ARRAYINIT(glUniform1iv, uniformLocation, GLint, args); } else if (uniformFunc == "glUniform2iv") { GLUNIFORM_ARRAYINIT(glUniform2iv, uniformLocation, GLint, args); } else if (uniformFunc == "glUniform3iv") { GLUNIFORM_ARRAYINIT(glUniform3iv, uniformLocation, GLint, args); } else if (uniformFunc == "glUniform4iv") { GLUNIFORM_ARRAYINIT(glUniform4iv, uniformLocation, GLint, args); } else { crash("unknown/unsupported uniform init func: %s", uniformFunc.c_str()); } GL_CHECKERR(uniformFunc.c_str()); } delete [] uniformName; } /*---------------------------------------------------------------------------*/ void setUniformTime(const Params& params) { GLint uniformLocation = glGetUniformLocation(params.program, params.timeVarName.c_str()); GL_CHECKERR("glGetUniformLocation"); if (uniformLocation == -1) { crash("Cannot find uniform named: %s", params.timeVarName.c_str()); } GLfloat timeVal = (GLfloat) (std::clock() / (float) CLOCKS_PER_SEC * 50.0); GL_SAFECALL(glUniform1f, uniformLocation, timeVal); } /*---------------------------------------------------------------------------*/ // OpenGL /*---------------------------------------------------------------------------*/ const char *openglErrorString(GLenum err) { switch (err) { case GL_INVALID_ENUM: return "GL_INVALID_ENUM"; case GL_INVALID_VALUE: return "GL_INVALID_VALUE"; case GL_INVALID_OPERATION: return "GL_INVALID_OPERATION"; case GL_STACK_OVERFLOW: return "GL_STACK_OVERFLOW"; case GL_STACK_UNDERFLOW: return "GL_STACK_UNDERFLOW"; case GL_OUT_OF_MEMORY: return "GL_OUT_OF_MEMORY"; default: return "UNKNOW_ERROR"; } } /*---------------------------------------------------------------------------*/ void dumpBin(const Params& params, GLuint program) { int supported = ((params.API == API_OPENGL && params.APIVersion >= 410) || (params.API == API_OPENGL_ES && params.APIVersion >= 300)); if (! supported) { printf("Cannot dump binary:" " requires OpenGL >= 4.1 or OpenGLES >= 3.0," " current version is: "); printAPI(params); printf("\n"); return; } GLint numFormats; GL_SAFECALL(glGetIntegerv, GL_NUM_PROGRAM_BINARY_FORMATS, &numFormats); if (numFormats <= 0) { printf("Cannot dump binary: driver supports zero binary format\n"); return; } GLint length; GL_SAFECALL(glGetProgramiv, program, GL_PROGRAM_BINARY_LENGTH, &length); char *binary = (char *) malloc(length); if (binary == NULL) { crash("malloc failed"); } GLenum format; GL_SAFECALL(glGetProgramBinary, program, length, NULL, &format, (void *)binary); std::ofstream binaryfile(params.binOut); binaryfile.write(binary, length); binaryfile.close(); } /*---------------------------------------------------------------------------*/ void printShaderError(GLuint shader) { GLint length = 0; glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length); // The length includes the NULL character std::vector<GLchar> errorLog((size_t) length, 0); glGetShaderInfoLog(shader, length, &length, &errorLog[0]); if(length > 0) { std::string s(&errorLog[0]); std::cout << s << std::endl; } } /*---------------------------------------------------------------------------*/ void printProgramError(GLuint program) { GLint length = 0; glGetProgramiv(program, GL_INFO_LOG_LENGTH, &length); // The length includes the NULL character std::vector<GLchar> errorLog((size_t) length, 0); glGetProgramInfoLog(program, length, &length, &errorLog[0]); if(length > 0) { std::string s(&errorLog[0]); std::cout << s << std::endl; } } /*---------------------------------------------------------------------------*/ void openglInit(Params& params, const std::string& fragContents) { const char *temp; steady_clock::time_point timeStart; GLint status = 0; GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER); GL_CHECKERR("glCreateShader"); std::string vertContents; generateVertexShader(vertContents, params); temp = vertContents.c_str(); GL_SAFECALL(glShaderSource, vertexShader, 1, &temp, NULL); if (params.profile) { GL_SAFECALL(glFinish); timeStart = steady_clock::now(); } GL_SAFECALL(glCompileShader, vertexShader); if (params.profile) { GL_SAFECALL(glFinish); printf("vertex shader compile time (us): %ld\n", duration_cast<microseconds>(steady_clock::now() - timeStart).count()); } GL_SAFECALL(glGetShaderiv, vertexShader, GL_COMPILE_STATUS, &status); if (!status) { printShaderError(vertexShader); errcode_crash(COMPILE_ERROR_EXIT_CODE, "Vertex shader compilation failed (%s)", params.fragFilename.c_str()); } GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); GL_CHECKERR("glCreateShader"); temp = fragContents.c_str(); GL_SAFECALL(glShaderSource, fragmentShader, 1, &temp, NULL); if (params.profile) { GL_SAFECALL(glFinish); timeStart = steady_clock::now(); } GL_SAFECALL(glCompileShader, fragmentShader); if (params.profile) { GL_SAFECALL(glFinish); printf("fragment shader compile time (us): %ld\n", duration_cast<microseconds>(steady_clock::now() - timeStart).count()); } GL_SAFECALL(glGetShaderiv, fragmentShader, GL_COMPILE_STATUS, &status); if (!status) { printShaderError(fragmentShader); errcode_crash(COMPILE_ERROR_EXIT_CODE, "Fragment shader compilation failed (%s)", params.fragFilename.c_str()); } if (params.exitCompile) { exit(EXIT_SUCCESS); } GLuint program = glCreateProgram(); int supported = ((params.API == API_OPENGL && params.APIVersion >= 410) || (params.API == API_OPENGL_ES && params.APIVersion >= 300)); if (supported) { GL_SAFECALL(glProgramParameteri, program, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, GL_TRUE); } GL_CHECKERR("glCreateProgram"); if (program == 0) { crash("glCreateProgram()"); } GL_SAFECALL(glAttachShader, program, vertexShader); GL_SAFECALL(glAttachShader, program, fragmentShader); if (params.profile) { GL_SAFECALL(glFinish); timeStart = steady_clock::now(); } GL_SAFECALL(glLinkProgram, program); if (params.profile) { GL_SAFECALL(glFinish); printf("link time (us): %ld\n", duration_cast<microseconds>(steady_clock::now() - timeStart).count()); } GL_SAFECALL(glGetProgramiv, program, GL_LINK_STATUS, &status); if (!status) { printProgramError(program); errcode_crash(LINK_ERROR_EXIT_CODE, "Program linking failed"); } if(strcmp(params.binOut.c_str(), "")) { dumpBin(params, program); } if (params.exitLinking) { exit(EXIT_SUCCESS); } GLint vertPosLocInt = glGetAttribLocation(program, "_GLF_vertexPosition"); GL_CHECKERR("glGetAttribLocation"); if (vertPosLocInt == -1) { crash("Cannot find position of _GLF_vertexPosition"); } GLuint vertPosLoc = (GLuint) vertPosLocInt; const float vertices[] = { -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f }; GLuint vertexBuffer; if (params.API == API_OPENGL_ES || params.APIVersion >= 300) { GLuint vertexArray; GL_SAFECALL(glGenVertexArrays, 1, &vertexArray); GL_SAFECALL(glBindVertexArray, vertexArray); } GL_SAFECALL(glGenBuffers, 1, &vertexBuffer); GL_SAFECALL(glBindBuffer, GL_ARRAY_BUFFER, vertexBuffer); GL_SAFECALL(glBufferData, GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); GL_SAFECALL(glEnableVertexAttribArray, vertPosLoc); GL_SAFECALL(glVertexAttribPointer, vertPosLoc, 2, GL_FLOAT, GL_FALSE, 0, 0); GL_SAFECALL(glUseProgram, program); setUniformsJSON(program, params); GL_SAFECALL(glViewport, 0, 0, params.width, params.height); params.program = program; } /*---------------------------------------------------------------------------*/ void openglRender(const Params& params) { steady_clock::time_point timeStart; if (params.animate) { setUniformTime(params); } GL_SAFECALL(glClearColor, 0.0f, 0.0f, 0.0f, 1.0f); GL_SAFECALL(glClear, GL_COLOR_BUFFER_BIT); // GL_SAFECALL(glDrawElements, GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, 0); if (params.profile) { GL_SAFECALL(glFinish); timeStart = steady_clock::now(); } GL_SAFECALL(glDrawArrays, GL_TRIANGLES, 0, 3); GL_SAFECALL(glDrawArrays, GL_TRIANGLES, 3, 3); if (params.profile) { GL_SAFECALL(glFinish); printf("render time (us): %ld\n", duration_cast<microseconds>(steady_clock::now() - timeStart).count()); } GL_SAFECALL(glFlush); } /*---------------------------------------------------------------------------*/ // PNG /*---------------------------------------------------------------------------*/ // 4 channels: RGBA #define CHANNELS (4) /*---------------------------------------------------------------------------*/ void savePNG(Params& params) { unsigned int uwidth = (unsigned int) params.width; unsigned int uheight = (unsigned int) params.height; std::vector<std::uint8_t> data(uwidth * uheight * CHANNELS); GL_SAFECALL(glReadPixels, 0, 0, uwidth, uheight, GL_RGBA, GL_UNSIGNED_BYTE, &data[0]); std::vector<std::uint8_t> flipped_data(uwidth * uheight * CHANNELS); for (unsigned int h = 0; h < uheight ; h++) for (unsigned int col = 0; col < uwidth * CHANNELS; col++) flipped_data[h * uwidth * CHANNELS + col] = data[(uheight - h - 1) * uwidth * CHANNELS + col]; unsigned png_error = lodepng::encode(params.output, flipped_data, uwidth, uheight); if (png_error) { crash("lodepng: %s", lodepng_error_text(png_error)); } } /*---------------------------------------------------------------------------*/ // Main /*---------------------------------------------------------------------------*/ int main(int argc, char* argv[]) { std::string fragContents; Context context; Params params; setParams(params, argc, argv); readFile(fragContents, params.fragFilename); params.shaderVersion = getShaderVersion(fragContents); contextInitAndGetAPI(params, context); openglInit(params, fragContents); int numFrames = 0; bool saved = false; while (contextKeepLooping(context)) { openglRender(params); contextSwap(context); numFrames++; if (numFrames == params.delay && !saved) { savePNG(params); saved = true; if (params.persist) { printf("Press any key to close the window...\n"); contextSetKeyCallback(context); } else { break; } } } contextTerminate(context); exit(EXIT_SUCCESS); } /*---------------------------------------------------------------------------*/
/** * Update the active handle * @public * @function handleActivator * @memberof Manipulators * * @param {*} element * @param {*} handles * @param {*} canvasPoint * @param {*} distanceThreshold * @returns {Boolean} - True if a handle was activated */ export default function _default(element: any, handles: any, canvasPoint: any, distanceThreshold: any): boolean;
/** * Acquire a mapped page with specific index from the factory * * @param index the index of the page * @return a mapped page */ public MappedPage acquirePage(final long index) { MappedPage mpi = cache.get(index); if (mpi == null) try { Object lock = null; synchronized (mapLock) { if (!pageCreationLockMap.containsKey(index)) pageCreationLockMap.put(index, new Object()); lock = pageCreationLockMap.get(index); } synchronized (lock) { mpi = cache.get(index); if (mpi == null) { RandomAccessFile raf = null; FileChannel channel = null; try { final String fileName = this.getFileNameByIndex(index); raf = new RandomAccessFile(fileName, "rw"); channel = raf.getChannel(); final MappedByteBuffer mbb = channel.map(READ_WRITE, 0, this.pageSize); mpi = new MappedPage(mbb, fileName, index); cache.put(index, mpi, ttl); if (logger.isDebugEnabled()) logger.debug("Mapped page for " + fileName + " was just created and cached."); } catch (final IOException e) { throw new BigQueueException(e); } finally { if (channel != null) CloseCommand.close(channel); if (raf != null) CloseCommand.close(raf); } } } } finally { synchronized (mapLock) { pageCreationLockMap.remove(index); } } else if (logger.isDebugEnabled()) logger.debug("Hit mapped page " + mpi.getPageFile() + " in cache."); return mpi; }
def begin_recurring(self): if len(self.cart.recurring_lineitems) == 0: return for ri in self.cart.recurring_lineitems: ri.is_active = True ri.save() self.cart.update_state()
Primary bone lymphoma: Clinical presentation and therapeutic considerations Highlights Primary lymphoma of bone is a rare entity with unspecific symptoms. Typical radiology is a large soft-tissue tumor around non-destructed bone. Treatment is based on systemic chemotherapy. Chemotherapy seems to produce a better outcome than radiotherapy alone. Positiv factors: age<60 y, solitary lesion, low LDH, favourable ECOG and IPI scores. Background Primary lymphoma of bone is a well-recognized but rather rare entity, accounting for about 5% of all patients with primary bone tumors. It was initially described by Oberling in 1928. In 1939 this subtype of lymphoma was described as a distinct entity with infiltration of the bone or the adjacent soft tissues. In advanced stages of the disease, it may be impossible to determine whether the lymphoma developed within the bone (primary) or invaded it (secondary). However, in general lymph node or visceral involvement is excluded by definition. Whereas in some studies regional lymph node involvement is permitted. According to the WHO classification, PBL is defined as a neoplasm composed of malignant lymphoid cells, producing one or more masses within bone, without any https://doi.org/10.1016/j.jbo.2020.100326 Received 14 May 2020; Received in revised form 24 September 2020; Accepted 24 September 2020 supraregional lymph-node involvement or other extranodal lesions. In general it has a single skeletal lesion with or without regional lymphnode involvement and should be distinguished from secondary bone involvement in systemic lymphoma. Affecting 1.7/1 Mio patients in the US approximately 4% of all patients with NHL present with an obvious skeletal lesion, comprising 5% of all extranodal lymphomas. In two series of NHL patients, routinely performed bonemarrow biopsies were positive in 18% and 23% of non-Hodgkin's lymphomas. In a group of 422 patients with primary or primary and secondary bone lymphomas at the Mayo Clinic, 38% showed extraskeletal involvement at the time of detection of bone involvement. Continued observation for 3 to 6 months, to ensure that visceral sites are not identified, prior to classifying as PBL may be considered. The occurrence of a primary Hodgkin's lymphoma of bone is exceedingly rare. In many patients with localized primary lymphoma of the bone (PBL), diagnosis is delayed due to unspecific clinical signs and equivocal radiographs. Magnetic resonance imaging (MRI) allows an early diagnosis, but due to the rareness of the lesion it is often not considered before biopsy. Therapy is multimodal, mainly based on chemo-and radiotherapy. Surgery is only used in cases of skeletal complications. The prognosis is superior to that of a localized Ewing's sarcoma (which sometimes has been confused with this tumor entity). This retrospective report includes 109 primary lymphomas of bone, updating also 36 cases published in 2002. Patients and methods A retrospective review was done of 109 patients with PBL treated in our institution between 1980 and 2015. Patient records of these 109 patients were reviewed including presenting symptoms, sites of involvement and imaging. Staging included the results of physical examination noted in the medical records, routine laboratory check-up and bone marrow biopsy. Depending on the location of the lesion and skeletal radiographs, computed tomography (CT) scans and magnetic resonance imaging (MRI) were analysed. This is a retrospective analysis going back to 1980. A standardized staging using advanced imaging methods as PET-CT scans has only been introduced in the last years. Statistical analysis All patients were followed for evidence of local or distant recurrence in general by regional MRI scans and CT scans of the thorax and abdomen. Overall survival (OS) was defined as the time from surgery to death from any cause and was calculated according to the Kaplan-Meier method. Significance analysis was performed using the Log-Rank, the Chi-Square test or the Cox proportional-hazards regression model. A p value of ≤0.05 was considered statistically significant. Results 109 patients could be evaluated (61 males, 48 females). The median age was 62.8 years (mean 59.9, range 20-100). The most common location was the trunk in 61% of the cases, the most common symptoms were pain in 76% and a swelling distinct from lymph nodes as a softtissue tumor in 29% (Table2). Median duration of symptoms was 8 months, but a wide variation was observed (0-197 months), median 3.3 months. Diagnosis was established by incisional biopsies in 54 cases and true-cut biopsies in 50 patients. Five patients had biopsies with first surgery. 72 patients got no surgical intervention, spinal surgery was performed in 14 patients, conservative therapy including ortheses in 12 patients and a spectrum of osteosynthesis and endoprosthetic reconstructions in the remaining patients. Non-surgical therapy consisted in the following forms of chemotherapy. CHOP scheme (4-6 cycles) alone or CHOP plus rituximab (RCHOP) was given in 88 (81%) of patients. Radiotherapy was delivered in a typically dose of 46 Gy in 67 (61%) of cases, 51 (47%) patients received both (CHOP + Radiotherapy). 4 patients got surgey alone and received neither CTX nor RTX. At the time of latest follow-up 46 (42%) of the patients had deceased by death of any course. In the surviving 63 patients, the followup was 1-421 months (mean 102, median 64 months, 2 patients less than 12 months, 7 others 12-24 months). 56 (89%) of surviving patients were without evidence of disease. For all patients the 5-year OS as shown in Fig. 1 was 66% (mean OS 197, median OS 178 months. There was a trend for a worse survival in aggressive lymphomas, but without significance (Fig. 2). In the subgroup of 78 patients with an aggressive NHL subtype there was a highly significant benefit for those patients receiving chemotherapy (Fig. 3, p = 0,003). Also shown in this figure there was a trend for better overall survival in combined chemotherapy and radiation treatment but in a detailed analysis no significance for that. Rituximab was used in 49 patients. Interestingly, compared to 37 patients receiving CTX without rituximab no difference in overall survival was seen. Raised LDH (Hazard ratio 1.92, 95% CI 2.29-6.26, p = 0.01) or age below 60 years (Hazard ratio 0.51, 95% CI 0.28-0.93, p = 0.027) could be proven as prognostic factors. Accordingly, the International Prognostic Index (IPI) showed a significant better overall survival in patients with scores 0 or 1 (Hazard ratio 1.45, 95% CI 1.12-1.87, p = 0.005), with ECOG scale of performance status also a clear dependence was proven (p = 0.028). Regional lymph node involvement did not change the prognosis. Local relapse was observed in 11 (10%) patients. In the event of local relapse, overall survival was significantly reduced (p = 0.0478). Using Cox regression for multivariate analysis, age, raised LDH levels and the subtype only kept significance (Table 3). Discussion This study represents a retrospective monocentric analysis in a large group of 109 patients with PBL and continues a study we published in 2002. The distribution of age and gender in the current study was similar to that in the literature as shown in a large population based study based on the SEER database. Malignant bone lymphoma was seen in all decades of life with the majority of patients being between 50 and 70 years of age. PBL in children is rare, and differentiation, especially from Ewing's sarcoma, is important. The differential diagnosis is long and generally considers all small blue round-cell lesions of bone. In addition from imaging analysis metastases, as well as chronic osteomyelitis, primary bone sarcomas, Ewing sarcoma, rhabdomyosarcoma, neuroectodermal tumors as PNET, small cell lung carcinoma, small-cell osteosarcomas, but also leukemic infiltrates have to be considered. Ostrowski et al. published a large study of 422 patients with malignant lymphoma of the bone seen at the Mayo Clinic from 1907 to 1982. Histological typing may be difficult especially in high-grade malignant lymphomas. The initial histological diagnosis in some of our cases was primarily undifferentiated sarcoma. This was later revised after discussing the radiological aspects of the cases and additional immunostaining resulting in the correct diagnosis. In PBL all bones may be affected, but the axial skeleton is the main site of involvement. This reflects the distribution of red marrow. For the same reason the metaphyseal location is predominantly affected. The most common location in our series was the affection of the pelvis, the spine was the second most common location. The lesions are most commonly osteolytic. However they can also show an osteoblastic or mixed osteolytic/blastic bone change. Pathologic fractures occurred in 16% of our patients. In the literature a pathological fracture was described as an independent adverse prognostic event. In our group of patients this could only be proven as a trend but without significance. In many cases in lymphoma only slight changes are seen in bone imaging despite a large soft tissue tumor in MRI. This is a major criteria for the diagnosis. This is due to the fact that the tumor sometimes shows such a rapid growth that it overruns the bony host response. Nuclear bone scans may produce false-negative results due to the predominantly osteolytic character of the lesions. PET scans were first used in lymphomas in 1990. In a large number of studies PET-CT has been established as the most sensitive current imaging study not only for response assessment but also for staging of the disease. Soft-tissue involvement in PBL is common, affecting more than 70% of the patients. Thus a large soft-tissue tumor extending concentrically around the bone with infiltration of the bone marrow in the typical age group of patients may be the major clue to the diagnosis. One could call it an 'Ewinglike' pattern in adults aged 50 years or older Overall survival in 78 patients with primary lymphoma of bone (aggressive NHL subtype) in respect to no radiotherapy/chemotherapy (n = 2), radiotherapy only (n = 6), chemotherapy alone (n = 29) and combined modality treatment (n = 40); p = 0.0034. If compared patients with chemotherapy only (n = 29) and combined modality treatment (n = 41), there was just the shown trend but no significance.. Local pain and swelling, may be the only signs of the disease. The duration of these symptoms was in some cases long, more than one year, but many patients described also a rapid growth of the lesions. This is reflected by the difference between the mean of 8 months and the median of 3.3 months. B-symptoms including fever, sweating, or weight loss may occur as described by Govi et al. in 16%, but are missing in many cases. So first suspect is often bone or soft tissue sarcoma in younger and metastatic disease in older patients. Treatment is based on systemic therapy. Surgical intervention is restricted to cases with neurological complications, impending fracture, or fractures. At present, there are no general protocols for applying and timing chemotherapy or radiotherapy. The optimal timing of radiation and chemotherapy in PBL is also unknown. As proposed by Mendenhall et al., radiotherapy should be delayed in monostotic and polyostotic diseases until chemotherapy is completed, in order to reduce the amount of radiotherapy and include only those sites of original gross involvement. In some institutions, local radiation alone was recommended. Chemotherapy seems to produce a better outcome than Radiotherapy alone; that still remains the best treatment for local disease control. Radiation therapy alone should be reserved for mandibular tumors, which are usually very small and earlier diagnosed. In the IELSG-14 study, patients managed with primary chemotherapy, whether followed by radiation or not, had a better OS compared with patients treated with primary radiotherapy, whether followed by chemotherapy or not. This was also described by Govi et al. Chemotherapy may also reduce the incidence of local recurrence in PBL and improve the prognosis in children and adults with disseminated disease. Our own results may strengthen this by a trend to better survival in patients with combined modality treatment (Fig. 3). In a large analysis including 9 prospective trials of the German High-Grade Non-Hodgkin lymphoma study Group with 3.840 patients (from which 292 had skeletal involvement) also Rituximab failed to improve the outcome of those patients. This underlines our own results with no effect of Rituximab in patients with aggressive forms of PBL on overall survival. Several prognostic factors in PBL have been established. Unifocal versus multifocal disease at presentation was a weak but significant result. In their large study of 422 patients, Ostrowski et al. were able to demonstrate a 5-year survival rate of 58% in unifocal disease versus 42% in multifocal osseous disease. This was also seen by Wu et al. comparing 81 cases of unifocal PBL with 35 cases of multifocal disease. In our patients we found a overall 5-year survival of 66%, there was no difference between multifocal or unilocular osseous disease. The correlation between the site of the primary lesion and the prognosis is controversial. Having found no correlation in one study, Ostrowski showed local recurrence was higher in malignant lymphoma of the jaw, and systemic recurrence had a higher incidence in pelvic and spinal lesions. The 5-year overall survival rate was also very low in this group (24%) as compared with the extremities, such as the femur (79%). In our study, a significant influence of trunk vs extremity lesions could not be shown. This might be contributed to advances obtained in radiotherapy of critical locations. Advanced age was significantly associated with a reduced overall survival, as found also by others. ECOG status, age, LDH levels, IPI stage are known significant factors of OS consistently seen in many larger studies of PBL [24,. Regarding the IPI stage which proved in our own group significant with 0/1 vs all olthers, there are studies showing no influence on OS, maybe attributed to a smaller sample number. Conclusion In summary PBL is a rare clinical entity. Clinical symptoms are unspecific, and the delay between onset of symptoms and diagnosis may either be short or long. Roentgenmorphology is heterogenous, one of the typical radiologic signs is large soft-tissue involvement surrounding the bone with little or no bone changes on radiographs. Treatment is based on systemic chemotherapy. Surgical intervention is restricted to cases with complications as fractures. Chemotherapy seems to produce a better outcome than radiotherapy alone; that still remains the best treatment for local disease control in unifocal cases. Long-term survival is based on the stage of the disease, favoring younger (< 60 years) patients with solitary bone lesions, low level of LDH and favourable ECOG and IPI scores. Declarations All authors have no financial and personal relationships with other people or organizations that could inappropriately influence (bias) this work. This study was not supported by any grants or external funding. Ethics approval and consent to participate This study was approved by the ethics committee of the Medical Faculty, University of Munich. Written consent was obtained from all surviving patients included in this study. For non-surviving patients data were irreversibly anonymized as recommended by the ethics committee. Competing interests The authors declare that they have no competing interests. Funding This study was not supported by any grants or external funding. Authors' contributions A.M. Student doing her thesis on PBL. She contacted the patients and acquired the data, involved in drafting and revising of the manuscript. M.D. Oncologist. Responsible for the decision to treat and how to treat the patients, involved in drafting and revising of the manuscript. F.R. Reviewing the radiotherapy and deciding which patient to treat or not to treat, involved in drafting and revising of the manuscript. A.B. Radiologist reviewing the radiologic investigations, involved in drafting and revising of the manuscript. T.K. Pathologist reviewing the pathologic investigations, involved in drafting and revising of the manuscript. A.K. Surgeon on many of the cases, involved in drafting and revising of the manuscript. C.B. Surgeon, involved in drafting and revising of the manuscript. Final manuscript approval for submission and publication. V.J. Surgeon on many of the cases, reviewer of the manuscript, involved in drafting and revising of the manuscript. H.R.D. Corresponding author. Developed the study concept, did the final data analysis and provided the major clinical input in writing and revising of the manuscript. Each author has contributed significantly to, and is willing to take public responsibility for this study: its design, data acquisition, and analysis and interpretation of data. All authors have been actively involved in the drafting and critical revision of the manuscript. All authors read and approved the final manuscript.
from rest_framework import serializers from account.models import User from care.models import Post, Comment class DoctorSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('name', 'sex', 'team', 'job', 'email', 'image', 'classify', 'id') related_fields = ['profile'] def get_image(self, instance): import os # 返回前端服务器地址 if hasattr(instance, 'profile'): return os.path.join('profile', instance.profile.image.name) if instance.profile.image.name else None return None image = serializers.SerializerMethodField() classify = serializers.CharField(source='profile.classify') class PostSerializer(serializers.ModelSerializer): class Meta: model = Post fields = ('title', 'detail', 'user', 'doctor') class PostListSerializer(serializers.ModelSerializer): class Meta: model = Post fields = ('title', 'doctor', 'update_time', 'id', 'user') related_fields = ['doctor', 'user'] doctor = serializers.CharField(source='doctor.name') user = serializers.CharField(source='user.name') class DoctorSimpleSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('name', 'team', 'job', 'image', 'classify') related_fields = ['doctor', 'comment'] def get_image(self, instance): import os # 返回前端服务器地址 if hasattr(instance, 'profile'): return os.path.join('profile', instance.profile.image.name) if instance.profile.image.name else None return None image = serializers.SerializerMethodField() classify = serializers.CharField(source='profile.classify') class CommentSerializer(serializers.ModelSerializer): class Meta: model = Comment fields = ('content', 'user', 'create_time') class PostUserDetailSerializer(serializers.ModelSerializer): doctor = DoctorSimpleSerializer(read_only=True) comment = CommentSerializer(many=True, read_only=True) class Meta: model = Post fields = ('title', 'detail', 'doctor', 'create_time', 'comment', 'id') class UserSimpleSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('name', 'sex', 'team', 'job', 'age') class PostDoctorDetailSerializer(serializers.ModelSerializer): user = UserSimpleSerializer(read_only=True) comment = CommentSerializer(many=True, read_only=True) class Meta: model = Post fields = ('title', 'detail', 'user', 'create_time', 'id', 'comment')
/** * Finds user given its login id. * * * @param loginId Id of the desired user * @return User for the given login id */ public Sysuser findUser(String loginId) { TypedQuery<Sysuser> query = em.createNamedQuery("Sysuser.findByLoginId", Sysuser.class).setParameter("loginId", loginId); List<Sysuser> emps = query.getResultList(); if (emps == null || emps.isEmpty()) { logger.log(Level.WARNING, "UserEJB: No user found with id {0}", loginId); return null; } if (emps.size() > 1) { logger.log(Level.WARNING, "UserEJB: there are more than 1 employee with the same login id {0}", loginId); } return emps.get(0); }
On This Day Sunday 17th April 1960 58 years ago The Ford Consul taxi driven by George Martin taking rock ‘n’ roll legends Eddie Cochran and Gene Vincent to London Airport crashed, killing 21-year old Cochran and injuring Vincent. Cochran's hit single at the time was 'Three Steps to Heaven'. Tour manager Patrick Thompkins and Eddie’s fiancée, songwriter Sharon Seeley (she wrote Ricky Nelson’s #1 hit “Poor Little Fool”) were also in the Ford Consul that was later estimated to have been traveling in excess of 60 mph through a dark and winding section of the two-lane A4 in the village of Chippenham. Gene Vincent would break a leg and walk with a limp for the rest of his life, but beyond that, the only serious injuries among the passengers were Eddie Cochran’s. Having been thrown from the vehicle when it smashed into a light post, Cochran sustained a serious head injury and died at hospital in Bath in the early hours of April 17, 1960. Cochran was on a triumphant concert tour of Britain in the spring of 1960—a tour that had been extended 10 weeks beyond its scheduled run due to intense demand for tickets. In America, a tamer brand of pop was in fashion, exemplified by the likes of Frankie Avalon, Paul Anka and Bobby Darin. In England, however, harder-edged rhythm-and-blues artists and rock-and-rollers like Eddie Cochran and his tour-mate Gene Vincent (of “Be Bop a Lula” fame) were far more popular. Theirs was the kind of music that the future members of the British Invasion were listening to in the late 50s and early 60s. It was “Be Bop A Lula,” in fact, that John Lennon was playing at the 1957 garden party where he first met Paul McCartney, and it was Cochran’s “Twenty Flight Rock” that Paul taught John to play that same afternoon, shortly after being invited to join Lennon’s Quarrymen. At least one Beatle, George Harrison, saw Eddie Cochran in Liverpool during his final tour, and both his guitar-playing and his stage persona made a strong impression. “He was standing at the microphone and as he started to talk he put his two hands through his hair, pushing it back,” Harrison later recalled. “And a girl, one lone voice, screamed out, ‘Oh, Eddie!’ and he coolly murmured into the mike, ‘Hi honey.’ I thought, ‘Yes! That’s it—rock and roll!”
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.felix.serializer.impl; import org.apache.felix.serializer.WriterFactory; import org.apache.felix.serializer.impl.json.JsonWriterFactory; import org.apache.felix.serializer.impl.yaml.YamlWriterFactory; import org.osgi.framework.Bundle; import org.osgi.framework.PrototypeServiceFactory; import org.osgi.framework.ServiceRegistration; public class PrototypeWriterFactory<T extends WriterFactory> implements PrototypeServiceFactory<T> { @SuppressWarnings( "unchecked" ) @Override public T getService(Bundle bundle, ServiceRegistration<T> registration) { String[] mimetype = (String[])registration.getReference().getProperty("mimetype"); if (isYaml(mimetype)) return (T)new YamlWriterFactory(); else return (T)new JsonWriterFactory(); } private boolean isYaml(String[] mimetype) { if (mimetype == null || mimetype.length == 0) return false; for (String entry : mimetype) { if ("application/yaml".equals(entry)) return true; } return false; } @Override public void ungetService(Bundle bundle, ServiceRegistration<T> registration, T service ) { } }
<reponame>Doom306/Invite-Tracker-v3 package com.general_hello.commands.commands; import com.general_hello.commands.Bot; import com.general_hello.commands.commands.Utils.UtilNum; import net.dv8tion.jda.api.entities.User; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import static com.general_hello.commands.Database.SQLiteDataSource.getConnection; import static com.general_hello.commands.Listener.cache; public class InviteUser { private static final Logger LOGGER = LoggerFactory.getLogger(InviteUser.class); private static final String[] letters = new String[]{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}; public static User getUserFromCode(String code) { try (Connection connection = getConnection(); PreparedStatement preparedStatement = connection .prepareStatement("SELECT User FROM InviteTracker WHERE Code = ?")) { preparedStatement.setString(1, String.valueOf(code)); try (final ResultSet resultSet = preparedStatement.executeQuery()) { if (resultSet.next()) { return Bot.jda.getUserById(resultSet.getLong("User")); } } } catch (SQLException e) { e.printStackTrace(); } return null; } public static User getUserFromCodeNoCheck(String code) { try (Connection connection = getConnection(); PreparedStatement preparedStatement = connection .prepareStatement("SELECT User FROM InviteTracker WHERE Code = ?")) { preparedStatement.setString(1, String.valueOf(code)); try (final ResultSet resultSet = preparedStatement.executeQuery()) { if (resultSet.next()) { return Bot.jda.getUserById(resultSet.getLong("User")); } } } catch (SQLException e) { e.printStackTrace(); } return null; } public static String getCodeFromUser(User user) { checkUser(user); try (Connection connection = getConnection(); PreparedStatement preparedStatement = connection .prepareStatement("SELECT Code FROM InviteTracker WHERE User = ?")) { preparedStatement.setString(1, user.getId()); try (final ResultSet resultSet = preparedStatement.executeQuery()) { if (resultSet.next()) { return resultSet.getString("Code"); } } } catch (SQLException e) { e.printStackTrace(); } return null; } public static String getCodeFromUserNoCheck(User user) { try (Connection connection = getConnection(); PreparedStatement preparedStatement = connection .prepareStatement("SELECT Code FROM InviteTracker WHERE User = ?")) { preparedStatement.setString(1, user.getId()); try (final ResultSet resultSet = preparedStatement.executeQuery()) { if (resultSet.next()) { return resultSet.getString("Code"); } } } catch (SQLException e) { e.printStackTrace(); } return null; } public static int getRealInvitesFromUser(User user) { checkUser(user); try (Connection connection = getConnection(); PreparedStatement preparedStatement = connection .prepareStatement("SELECT RealInvites FROM InviteTracker WHERE User = ?")) { preparedStatement.setString(1, user.getId()); try (final ResultSet resultSet = preparedStatement.executeQuery()) { if (resultSet.next()) { return resultSet.getInt("RealInvites"); } } } catch (SQLException e) { e.printStackTrace(); } return -1; } public static void addRealInvitesFromUser(User user) { checkUser(user); int invitesToSet = getRealInvitesFromUser(user)+1; try (Connection connection = getConnection(); PreparedStatement preparedStatement = connection .prepareStatement("UPDATE InviteTracker SET RealInvites=" + (invitesToSet) + " WHERE User=" + user.getId() )) { preparedStatement.execute(); } catch (SQLException e) { e.printStackTrace(); } } public static void addFakeInvitesFromUser(User user) { checkUser(user); int invitesToSet = getFakeInvitesFromUser(user)+1; try (Connection connection = getConnection(); PreparedStatement preparedStatement = connection .prepareStatement("UPDATE InviteTracker SET FakeInvites=" + (invitesToSet) + " WHERE User=" + user.getId() )) { preparedStatement.execute(); } catch (SQLException e) { e.printStackTrace(); } } public static int getFakeInvitesFromUser(User user) { checkUser(user); try (Connection connection = getConnection(); PreparedStatement preparedStatement = connection .prepareStatement("SELECT FakeInvites FROM InviteTracker WHERE User = ?")) { preparedStatement.setString(1, user.getId()); try (final ResultSet resultSet = preparedStatement.executeQuery()) { if (resultSet.next()) { return resultSet.getInt("FakeInvites"); } } } catch (SQLException e) { e.printStackTrace(); } return -1; } public static void addUser(User newUser, User owner) { LOGGER.info("Added new info for " + newUser.getAsTag() + " (Owner -> " + owner + ")"); try (final PreparedStatement preparedStatement = getConnection() .prepareStatement("INSERT INTO InvitedUsers" + "(User, InvitedUser)" + "VALUES (?, ?);")) { preparedStatement.setString(1, newUser.getId()); preparedStatement.setString(2, String.valueOf(owner)); preparedStatement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } } public static int getUsersOwner(User user) { try (Connection connection = getConnection(); PreparedStatement preparedStatement = connection .prepareStatement("SELECT User FROM InvitedUsers WHERE InvitedUser = ?")) { preparedStatement.setString(1, user.getId()); try (final ResultSet resultSet = preparedStatement.executeQuery()) { if (resultSet.next()) { return resultSet.getInt("User"); } } } catch (SQLException e) { e.printStackTrace(); } return -1; } public static void addLeftInvitesFromUser(User user) { checkUser(user); int invitesToSet = getLeftInvitesFromUser(user)+1; try (Connection connection = getConnection(); PreparedStatement preparedStatement = connection .prepareStatement("UPDATE InviteTracker SET LeftInvites=" + (invitesToSet) + " WHERE User=" + user.getId() )) { preparedStatement.execute(); } catch (SQLException e) { e.printStackTrace(); } } public static int getLeftInvitesFromUser(User user) { checkUser(user); try (Connection connection = getConnection(); PreparedStatement preparedStatement = connection .prepareStatement("SELECT LeftInvites FROM InviteTracker WHERE User = ?")) { preparedStatement.setString(1, user.getId()); try (final ResultSet resultSet = preparedStatement.executeQuery()) { if (resultSet.next()) { return resultSet.getInt("LeftInvites"); } } } catch (SQLException e) { e.printStackTrace(); } return -1; } public static boolean isCodeCreated(User user) { checkUser(user); try (Connection connection = getConnection(); PreparedStatement preparedStatement = connection .prepareStatement("SELECT IsCreated FROM InviteTracker WHERE User = ?")) { preparedStatement.setString(1, user.getId()); try (final ResultSet resultSet = preparedStatement.executeQuery()) { if (resultSet.next()) { return (resultSet.getInt("IsCreated") == 1); } } } catch (SQLException e) { e.printStackTrace(); } return false; } public static void setCodeCreated(User user) { checkUser(user); try (Connection connection = getConnection(); PreparedStatement preparedStatement = connection .prepareStatement("UPDATE InviteTracker SET IsCreated=1 WHERE User=" + user.getId() )) { preparedStatement.execute(); } catch (SQLException e) { e.printStackTrace(); } } public static int getInvitesFromUser(User user) { return getRealInvitesFromUser(user) + getFakeInvitesFromUser(user); } public static void newInfo(User user) { if (getCodeFromUserNoCheck(user) == null) { try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } LOGGER.info("Made new info for " + user.getAsTag()); try (final PreparedStatement preparedStatement = getConnection() .prepareStatement("INSERT INTO InviteTracker" + "(User, Code)" + "VALUES (?, ?);")) { preparedStatement.setString(1, user.getId()); preparedStatement.setString(2, generateCode()); preparedStatement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } } } private static String generateCode() { StringBuilder code = new StringBuilder(); final int codeLength = 7; int x = 0; while (x < codeLength) { String letterChosen = letters[UtilNum.randomNum(0, letters.length - 1)]; if (UtilNum.randomNum(0, 1) == 0) { code.append(letterChosen.toUpperCase()); } else { code.append(letterChosen); } x++; } return code.toString(); } private static void checkUser(User user) { if (!cache.contains(user.getIdLong())) { InviteUser.newInfo(user); cache.add(user.getIdLong()); LOGGER.info("Made new info for " + user.getAsTag()); } } }
/** * signal.h */ #ifndef _SIGNAL_H #define _SIGNAL_H typedef int sig_atomic_t; #define SIGHUP 1 /* hangup */ #define SIGINT 2 /* interrupt (DEL) */ #define SIGQUIT 3 /* quit (ASCII FS) */ #define SIGILL 4 /* illegal instruction */ #define SIGTRAP 5 /* trace trap (not reset when caught) */ #define SIGABRT 6 /* IOT instruction */ #define SIGBUS 7 #define SIGEMT 7 #define SIGFPE 8 /* floating point exception */ #define SIGKILL 9 /* kill (cannot be caught or ignored) */ #define SIGUSR1 10 /* user defined signal 1 */ #define SIGSEGV 11 /* segmentation violation */ #define SIGUSR2 12 /* user defined signal 2 */ #define SIGPIPE 13 /* write on a pipe with no one to read it */ #define SIGALRM 14 /* alarm clock */ #define SIGTERM 15 /* software termination signal from kill */ /** * For POSIX compliance */ #define SIGCHLD 17 /* child process terminated or stopped */ #define SIGCONT 18 /* continue if stopped */ #define SIGSTOP 19 /* stop signal */ #define SIGTSTP 20 /* interactive stop signal */ #define SIGTTIN 21 /* background process requesting read */ #define SIGTTOU 22 /* background process requesting write */ #if 0 #define SIG_ERR ((__sighandler_t) -1) /* error return */ #define SIG_DFL ((__sighandler_t) 0) /* default signal handling */ #define SIG_IGN ((__sighandler_t) 1) /* ignore signal */ #endif /* 0 */ #define _NSIG 23 #if 0 int raise(int sig); __sighandler_t signal(int sig, __sighandler_t func); int kill(pid_t pid, int sig); #endif /* 0 */ #endif /* _SIGNAL_H */
<reponame>unitycoder/CGALDotNet<gh_stars>0 #pragma once #include "../CGALWrapper.h" #include "../Geometry/Geometry2.h" #include <vector> #include <list> #include <CGAL/Arr_segment_traits_2.h> #include <CGAL/Surface_sweep_2_algorithms.h> template<class K> class SweepLine { private: typedef CGAL::Arr_segment_traits_2<K> Traits; typedef typename K::Point_2 Point_2; typedef typename Traits::Curve_2 Segment_2; std::list<Point_2> pointBuffer; std::list<Segment_2> segmentBuffer; public: inline static SweepLine* NewSweepLine() { return new SweepLine(); } inline static void DeleteSweepLine(void* ptr) { auto obj = static_cast<SweepLine*>(ptr); if (obj != nullptr) { delete obj; obj = nullptr; } } inline static SweepLine* CastToSweepLine(void* ptr) { return static_cast<SweepLine*>(ptr); } static void ClearPointBuffer(void* ptr) { auto sweep = CastToSweepLine(ptr); sweep->pointBuffer.clear(); } static void ClearSegmentBuffer(void* ptr) { auto sweep = CastToSweepLine(ptr); sweep->segmentBuffer.clear(); } static int PointBufferSize(void* ptr) { auto sweep = CastToSweepLine(ptr); return (int)sweep->pointBuffer.size(); } static int SegmentBufferSize(void* ptr) { auto sweep = CastToSweepLine(ptr); return (int)sweep->segmentBuffer.size(); } static BOOL DoIntersect(void* ptr, Segment2d* segments, int count) { auto sweep = CastToSweepLine(ptr); auto list = ToList(segments, count); return CGAL::do_curves_intersect(list.begin(), list.end()); } static int ComputeSubcurves(void* ptr, Segment2d* segments, int count) { auto sweep = CastToSweepLine(ptr); auto list = ToList(segments, count); sweep->segmentBuffer.clear(); CGAL::compute_subcurves(list.begin(), list.end(), std::back_inserter(sweep->segmentBuffer)); return (int)sweep->segmentBuffer.size(); } static int ComputeIntersectionPoints(void* ptr, Segment2d* segments, int count) { auto sweep = CastToSweepLine(ptr); auto list = ToList(segments, count); sweep->pointBuffer.clear(); CGAL::compute_intersection_points(list.begin(), list.end(), std::back_inserter(sweep->pointBuffer)); return (int)sweep->pointBuffer.size(); } static void GetPoints(void* ptr, Point2d* points, int count) { auto sweep = CastToSweepLine(ptr); int i = 0; for (auto point = sweep->pointBuffer.begin(); point != sweep->pointBuffer.end(); ++point, ++i) points[i] = Point2d::FromCGAL<K>(*point); } static void GetSegments(void* ptr, Segment2d* segments, int count) { auto sweep = CastToSweepLine(ptr); int i = 0; for (auto seg = sweep->segmentBuffer.begin(); seg != sweep->segmentBuffer.end(); ++seg, ++i) { auto a = seg->source(); auto b = seg->target(); segments[i] = Segment2d::FromCGAL<K>(a, b); } } static std::vector<Segment_2> ToList(Segment2d* segments, int count) { auto list = std::vector<Segment_2>(); for (int i = 0; i < count; i++) list.push_back(segments[i].ToCGAL<K, Segment_2>()); return list; } static Segment_2* ToArray(Segment2d* segments, int count) { auto arr = new Segment_2[count]; for (int i = 0; i < count; i++) arr[i] = segments[i].ToCGAL<K, Segment_2>(); return arr; } };
(Reuters) - Warren Buffett’s Berkshire Hathaway Inc deepened its commitment to the U.S. financial industry, announcing a $4.02 billion stake in JPMorgan Chase & Co and new investments in PNC Financial Services Group Inc and Travelers Companies Inc, plus a stake in Oracle Corp. The investments were disclosed in a Wednesday regulatory filing detailing Berkshire’s U.S.-listed stocks as of Sept. 30, following a quarter when the Omaha, Nebraska-based conglomerate spent $17.7 billion on equities. According to the filing, Berkshire owned $829 million of PNC stock, $460 million of the insurer Travelers, and $2.13 billion of Oracle, the database software company. It also added to its sizable stakes in two earlier Buffett investments, Bank of America Corp and Goldman Sachs Group Inc. Though the filing did not say which individual purchases Buffett or his investment managers Todd Combs and Ted Weschler were responsible for, investors watch Berkshire’s quarterly stock listings for signs about where the trio sees value. Shares of JPMorgan, PNC and Travelers each rose at least 1 percent in after-hours trading following Berkshire’s disclosure of its new stakes, while Oracle shares rose 2.4 percent. JPMorgan and Travelers declined to comment. PNC, Oracle and Buffett’s assistant did not immediately respond to requests for comment. The investment in JPMorgan, where Combs is a board member, closes a notable hole in Berkshire’s portfolio. Berkshire had already been the largest investor in several companies, including American Express Co, Bank of America, Bank of New York Mellon Corp, US Bancorp and Wells Fargo & Co, according to Refinitiv data. Buffett has long praised the leadership of JPMorgan Chief Executive Jamie Dimon, and over the last year partnered with him and Amazon.com Inc Chief Executive Jeff Bezos to create a new company aiming to cut U.S. employee healthcare costs. Atul Gawande, a surgeon and critic of medical industry practices, was named in June to lead the venture. Buffett and Dimon also teamed up in June to call on companies to stop giving quarterly earnings forecasts, because they encourage an unhealthy focus on short-term profit at the expense of sustainable long-term growth. Berkshire has more than 90 businesses in the insurance, energy, food and retail, industrial, railroad and other sectors. Buffett, however, has not made a major acquisition since buying aircraft parts maker Precision Castparts in January 2016. He often buys stocks such as Apple Inc, in which Berkshire previously disclosed a $57.6 billion stake, when buying whole companies appears too expensive. Berkshire also spent $928 million repurchasing its own stock in the quarter. Despite the stock purchases, Berkshire ended September with $103.6 billion of cash and equivalents. Berkshire also reported other portfolio changes, including the shedding of holdings in Walmart Inc and French drugmaker Sanofi SA and reduction in its stake in oil refiner Phillips 66.
/** * Created by Administrator on 10/19/2017. */ public class UploadFileToServer extends AsyncTask<String, String, String> { private final BaseActivity activity; // String FILE_UPLOAD_URL = "http://198.27.98.210:8080/1fitlab/jsp/video-upload.jsp"; String FILE_UPLOAD_URL = Config.API_URL + "video-upload.jsp"; // String FILE_UPLOAD_URL = "http://173.8.145.131:8080/1fitlab/jsp/video-upload.jsp"; String filePath; CompletionListener mListener; File sourceFile; int totalSize; String params; String type; public interface CompletionListener { void onCompleted(String message); void onFailed(String msg); } public UploadFileToServer(BaseActivity activity, String type, String filePath, String params, CompletionListener listener) { this.type = type; this.filePath = filePath; this.mListener = listener; this.params = params; this.activity = activity; } @Override protected void onPreExecute() { // setting progress bar to zero sourceFile = new File(filePath); totalSize = (int) sourceFile.length(); super.onPreExecute(); } @Override protected void onProgressUpdate(String... progress) { Log.d("PROG", progress[0]); //((BaseActivity) mListener).setProgressDialogProgress(Integer.parseInt(progress[0])); activity.setProgressDialogProgress(Integer.parseInt(progress[0])); } @Override protected String doInBackground(String... args) { HttpURLConnection.setFollowRedirects(false); HttpURLConnection connection = null; String fileName = sourceFile.getName(); try { connection = (HttpURLConnection) new URL(FILE_UPLOAD_URL + params).openConnection(); connection.setRequestMethod("POST"); Log.v("URL", connection.getURL().toString()); String boundary = "---------------------------boundary"; String tail = "\r\n--" + boundary + "--\r\n"; connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary); connection.setDoOutput(true); String metadataPart = "--" + boundary + "\r\n" + "Content-Disposition: form-data; name=\"metadata\"\r\n\r\n" + "" + "\r\n"; String fileHeader1 = "--" + boundary + "\r\n" + "Content-Disposition: form-data; name=\"fileToUpload\"; filename=\"" + fileName + "\"\r\n" + "Content-Type: application/octet-stream\r\n" + "Content-Transfer-Encoding: binary\r\n"; long fileLength = sourceFile.length() + tail.length(); String fileHeader2 = "Content-length: " + fileLength + "\r\n"; String fileHeader = fileHeader1 + fileHeader2 + "\r\n"; String stringData = metadataPart + fileHeader; long requestLength = stringData.length() + fileLength; connection.setRequestProperty("Content-length", "" + requestLength); connection.setFixedLengthStreamingMode((int) requestLength); connection.connect(); DataOutputStream out = new DataOutputStream(connection.getOutputStream()); out.writeBytes(stringData); out.flush(); int progress = 0; int bytesRead = 0; int maxBufferSize = 10 * 1024 * 1024; byte buf[] = new byte[maxBufferSize]; BufferedInputStream bufInput = new BufferedInputStream(new FileInputStream(sourceFile)); while ((bytesRead = bufInput.read(buf)) != -1) { // write output out.write(buf, 0, bytesRead); out.flush(); progress += bytesRead; // Here progress is total uploaded bytes publishProgress("" + (int) ((progress * 100) / totalSize)); // sending progress percent to publishProgress } // Write closing boundary and close stream out.writeBytes(tail); out.flush(); out.close(); // Get server response BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); String line = ""; StringBuilder builder = new StringBuilder(); while ((line = reader.readLine()) != null) { builder.append(line); } return builder.toString(); } catch (Exception e) { // Exception e.printStackTrace(); } finally { if (connection != null) connection.disconnect(); } return null; } @Override protected void onPostExecute(String result) { Log.e("Response", "Response from server: " + result); super.onPostExecute(result); if (result != null) { try { JSONObject response = new JSONObject(result); String status = response.getString("status"); if (status.equals("1")) { JSONObject data = response.getJSONObject("data"); if (type.equals("image")) { LocalImageHelper.getInstance().createItem(filePath, data); } else { LocalVideoHelper.getInstance().createItem(filePath, data); } } else { String message = response.getString("message"); mListener.onFailed(message); return; } } catch (JSONException e) { e.printStackTrace(); mListener.onFailed("Network error"); return; } mListener.onCompleted("Successfully uploaded"); } else { mListener.onFailed("Failure"); } } }
One weekend - five California lakes and rivers visited - and not a lot of water found. With all the talk of California’s drought, we thought to show you where Central Valley farmers get a good portion of their irrigation water. That is when state and federal officials say there’s enough of it to go around. This is not an exhaustive list of reservoirs which the irrigation districts source for farm water, but these are some of the major facilities in the San Joaquin Valley. It’s aimed at presenting a snap-shot in time – a critical time when lakes should be filling from snow runoff in the Sierra. There will be no runoff this year. Reservoirs named Pine Flat, Millerton, New Exchequer (Lake McClure), Don Pedro and New Melones hold, when full, nearly seven million acre feet of water behind dams. These reservoirs are on the Kings, San Joaquin, Merced, Tuolumne and Stanislaus rivers, respectively. As of April 11-12 when these photos were taken, these reservoirs held in combined storage just 27 percent of their total capacity, or about 1.8 million acre feet of water. The lowest was New Exchequer at 9 percent. Don Pedro faired the best of the lot at 42 percent of capacity. At 2.4 million acre feet, the largest of these facilities is New Melones on the Stanislaus River near Sonora. Current river flows into the Stanislaus River below New Melones Dam are being pulsed by the Bureau of Reclamation to push salmon and steelhead down river into the Delta. Those flows could total 30,000 acre feet of storage. Out of Millerton flows the Friant-Kern Canal which should supply water to farmers from Chowchilla to Bakersfield. Because the canal system is part of the federal Central Valley Project (CVP), it delivers water from the Bureau of Reclamation to growers in the San Joaquin Valley. This is the second consecutive year that growers will receive no surface water from the CVP. Though the canal had some water in it over the weekend, Eric Quinley with the Friant Water Authority said the water was what remained of a 200 cubic feet per second (cfs) flow that moved to Friant Division contractors on March 31 and April 1. The water was a carry-over allotment that Friant division contractors had the right to from water they did not use in previous seasons. Quinley said the canal would normally carry about 1,000 cfs to Friant Division contractors at this time of year under normal water allocations.
<reponame>trekmbikes/blackbird-java<filename>src/main/java/com/slickapps/blackbird/util/exception/SupplierWithException.java package com.slickapps.blackbird.util.exception; @FunctionalInterface public interface SupplierWithException<T> { T get() throws Exception; }
“Now you’ve stopped, now we can say ‘long live Stalin’ or whatever. We are not recorded there.” Slavoj Zizek was, in fact, being recorded, but I’m sure he didn’t mind. That’s how the critical theorist opens up his latest interview with Vice. A fitting introduction for a man whose sense of humor the narrator credits with his widespread popularity. The Vice team took a break from meeting cannibal warlords and corrupt Pakistani politicians to delve into a new kind of evil, the mind of Slavoj Zizek. Vice’s Alex Miller traveled to Slovenia and met Zizek who greeted them with an abrupt “I hate life, hi.” The Vice crew sits down with him in his apartment, which still touts infamous Stalin poster. It’s “purely to annoy idiots,” Zizek reminds us. Zizek hates the work of Martin Scorcese, we learn, and is “disgusted” at the site of himself on his screen. He has not seen either of his docuementaries, the “Pervert’s Guide to Cinema” and the “Pervert’s Guide to Cinema,” respectively. And his Slovenian fans? He has none. “People hate me pretty much here. I’m not kidding.”
import { IExecuteFunctions, } from 'n8n-core'; import { IDataObject, INodeExecutionData, INodeType, INodeTypeDescription, NodeOperationError, } from 'n8n-workflow'; import { actionNetworkApiRequest, adjustEventPayload, adjustPersonPayload, adjustPetitionPayload, handleListing, makeOsdiLink, resourceLoaders, simplifyResponse, } from './GenericFunctions'; import { attendanceFields, attendanceOperations, eventFields, eventOperations, personFields, personOperations, personTagFields, personTagOperations, petitionFields, petitionOperations, signatureFields, signatureOperations, tagFields, tagOperations, } from './descriptions'; import { AllFieldsUi, EmailAddressUi, Operation, PersonResponse, Resource, Response, } from './types'; export class ActionNetwork implements INodeType { description: INodeTypeDescription = { displayName: 'Action Network', name: 'actionNetwork', icon: 'file:actionNetwork.svg', group: ['transform'], version: 1, subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}', description: 'Consume the Action Network API', defaults: { name: 'Action Network', }, inputs: ['main'], outputs: ['main'], credentials: [ { name: 'actionNetworkApi', required: true, }, ], properties: [ { displayName: 'Resource', name: 'resource', type: 'options', options: [ { name: 'Attendance', value: 'attendance', }, { name: 'Event', value: 'event', }, { name: 'Person', value: 'person', }, { name: 'Person Tag', value: 'personTag', }, { name: 'Petition', value: 'petition', }, { name: 'Signature', value: 'signature', }, { name: 'Tag', value: 'tag', }, ], default: 'attendance', description: 'Resource to consume', }, ...attendanceOperations, ...attendanceFields, ...eventOperations, ...eventFields, ...personOperations, ...personFields, ...petitionOperations, ...petitionFields, ...signatureOperations, ...signatureFields, ...tagOperations, ...tagFields, ...personTagOperations, ...personTagFields, ], }; methods = { loadOptions: resourceLoaders, }; async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> { const items = this.getInputData(); const returnData: IDataObject[] = []; const resource = this.getNodeParameter('resource', 0) as Resource; const operation = this.getNodeParameter('operation', 0) as Operation; let response; for (let i = 0; i < items.length; i++) { try { if (resource === 'attendance') { // ********************************************************************** // attendance // ********************************************************************** // https://actionnetwork.org/docs/v2/attendances if (operation === 'create') { // ---------------------------------------- // attendance: create // ---------------------------------------- const personId = this.getNodeParameter('personId', i) as string; const eventId = this.getNodeParameter('eventId', i); const body = makeOsdiLink(personId) as IDataObject; const endpoint = `/events/${eventId}/attendances`; response = await actionNetworkApiRequest.call(this, 'POST', endpoint, body); } else if (operation === 'get') { // ---------------------------------------- // attendance: get // ---------------------------------------- const eventId = this.getNodeParameter('eventId', i); const attendanceId = this.getNodeParameter('attendanceId', i); const endpoint = `/events/${eventId}/attendances/${attendanceId}`; response = await actionNetworkApiRequest.call(this, 'GET', endpoint); } else if (operation === 'getAll') { // ---------------------------------------- // attendance: getAll // ---------------------------------------- const eventId = this.getNodeParameter('eventId', i); const endpoint = `/events/${eventId}/attendances`; response = await handleListing.call(this, 'GET', endpoint); } } else if (resource === 'event') { // ********************************************************************** // event // ********************************************************************** // https://actionnetwork.org/docs/v2/events if (operation === 'create') { // ---------------------------------------- // event: create // ---------------------------------------- const body = { origin_system: this.getNodeParameter('originSystem', i), title: this.getNodeParameter('title', i), } as IDataObject; const additionalFields = this.getNodeParameter('additionalFields', i) as AllFieldsUi; if (Object.keys(additionalFields).length) { Object.assign(body, adjustEventPayload(additionalFields)); } response = await actionNetworkApiRequest.call(this, 'POST', '/events', body); } else if (operation === 'get') { // ---------------------------------------- // event: get // ---------------------------------------- const eventId = this.getNodeParameter('eventId', i); response = await actionNetworkApiRequest.call(this, 'GET', `/events/${eventId}`); } else if (operation === 'getAll') { // ---------------------------------------- // event: getAll // ---------------------------------------- response = await handleListing.call(this, 'GET', '/events'); } } else if (resource === 'person') { // ********************************************************************** // person // ********************************************************************** // https://actionnetwork.org/docs/v2/people if (operation === 'create') { // ---------------------------------------- // person: create // ---------------------------------------- const emailAddresses = this.getNodeParameter('email_addresses', i) as EmailAddressUi; const body = { person: { email_addresses: [emailAddresses.email_addresses_fields], // only one accepted by API }, } as IDataObject; const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; if (Object.keys(additionalFields).length) { Object.assign(body.person, adjustPersonPayload(additionalFields)); } response = await actionNetworkApiRequest.call(this, 'POST', '/people', body); } else if (operation === 'get') { // ---------------------------------------- // person: get // ---------------------------------------- const personId = this.getNodeParameter('personId', i); response = await actionNetworkApiRequest.call(this, 'GET', `/people/${personId}`) as PersonResponse; } else if (operation === 'getAll') { // ---------------------------------------- // person: getAll // ---------------------------------------- response = await handleListing.call(this, 'GET', '/people') as PersonResponse[]; } else if (operation === 'update') { // ---------------------------------------- // person: update // ---------------------------------------- const personId = this.getNodeParameter('personId', i); const body = {} as IDataObject; const updateFields = this.getNodeParameter('updateFields', i) as IDataObject; if (Object.keys(updateFields).length) { Object.assign(body, adjustPersonPayload(updateFields)); } else { throw new NodeOperationError( this.getNode(), `Please enter at least one field to update for the ${resource}.`, ); } response = await actionNetworkApiRequest.call(this, 'PUT', `/people/${personId}`, body); } } else if (resource === 'petition') { // ********************************************************************** // petition // ********************************************************************** // https://actionnetwork.org/docs/v2/petitions if (operation === 'create') { // ---------------------------------------- // petition: create // ---------------------------------------- const body = { origin_system: this.getNodeParameter('originSystem', i), title: this.getNodeParameter('title', i), } as IDataObject; const additionalFields = this.getNodeParameter('additionalFields', i) as AllFieldsUi; if (Object.keys(additionalFields).length) { Object.assign(body, adjustPetitionPayload(additionalFields)); } response = await actionNetworkApiRequest.call(this, 'POST', '/petitions', body); } else if (operation === 'get') { // ---------------------------------------- // petition: get // ---------------------------------------- const petitionId = this.getNodeParameter('petitionId', i); const endpoint = `/petitions/${petitionId}`; response = await actionNetworkApiRequest.call(this, 'GET', endpoint); } else if (operation === 'getAll') { // ---------------------------------------- // petition: getAll // ---------------------------------------- response = await handleListing.call(this, 'GET', '/petitions'); } else if (operation === 'update') { // ---------------------------------------- // petition: update // ---------------------------------------- const petitionId = this.getNodeParameter('petitionId', i); const body = {} as IDataObject; const updateFields = this.getNodeParameter('updateFields', i) as AllFieldsUi; if (Object.keys(updateFields).length) { Object.assign(body, adjustPetitionPayload(updateFields)); } else { throw new NodeOperationError( this.getNode(), `Please enter at least one field to update for the ${resource}.`, ); } response = await actionNetworkApiRequest.call(this, 'PUT', `/petitions/${petitionId}`, body); } } else if (resource === 'signature') { // ********************************************************************** // signature // ********************************************************************** // https://actionnetwork.org/docs/v2/signatures if (operation === 'create') { // ---------------------------------------- // signature: create // ---------------------------------------- const personId = this.getNodeParameter('personId', i) as string; const petitionId = this.getNodeParameter('petitionId', i); const body = makeOsdiLink(personId) as IDataObject; const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; if (Object.keys(additionalFields).length) { Object.assign(body, additionalFields); } const endpoint = `/petitions/${petitionId}/signatures`; response = await actionNetworkApiRequest.call(this, 'POST', endpoint, body); } else if (operation === 'get') { // ---------------------------------------- // signature: get // ---------------------------------------- const petitionId = this.getNodeParameter('petitionId', i); const signatureId = this.getNodeParameter('signatureId', i); const endpoint = `/petitions/${petitionId}/signatures/${signatureId}`; response = await actionNetworkApiRequest.call(this, 'GET', endpoint); } else if (operation === 'getAll') { // ---------------------------------------- // signature: getAll // ---------------------------------------- const petitionId = this.getNodeParameter('petitionId', i); const endpoint = `/petitions/${petitionId}/signatures`; response = await handleListing.call(this, 'GET', endpoint); } else if (operation === 'update') { // ---------------------------------------- // signature: update // ---------------------------------------- const petitionId = this.getNodeParameter('petitionId', i); const signatureId = this.getNodeParameter('signatureId', i); const body = {}; const updateFields = this.getNodeParameter('updateFields', i) as AllFieldsUi; if (Object.keys(updateFields).length) { Object.assign(body, updateFields); } else { throw new NodeOperationError( this.getNode(), `Please enter at least one field to update for the ${resource}.`, ); } const endpoint = `/petitions/${petitionId}/signatures/${signatureId}`; response = await actionNetworkApiRequest.call(this, 'PUT', endpoint, body); } } else if (resource === 'tag') { // ********************************************************************** // tag // ********************************************************************** // https://actionnetwork.org/docs/v2/tags if (operation === 'create') { // ---------------------------------------- // tag: create // ---------------------------------------- const body = { name: this.getNodeParameter('name', i), } as IDataObject; response = await actionNetworkApiRequest.call(this, 'POST', '/tags', body); } else if (operation === 'get') { // ---------------------------------------- // tag: get // ---------------------------------------- const tagId = this.getNodeParameter('tagId', i); response = await actionNetworkApiRequest.call(this, 'GET', `/tags/${tagId}`); } else if (operation === 'getAll') { // ---------------------------------------- // tag: getAll // ---------------------------------------- response = await handleListing.call(this, 'GET', '/tags'); } } else if (resource === 'personTag') { // ********************************************************************** // personTag // ********************************************************************** // https://actionnetwork.org/docs/v2/taggings if (operation === 'add') { // ---------------------------------------- // personTag: add // ---------------------------------------- const personId = this.getNodeParameter('personId', i) as string; const tagId = this.getNodeParameter('tagId', i); const body = makeOsdiLink(personId) as IDataObject; const endpoint = `/tags/${tagId}/taggings`; response = await actionNetworkApiRequest.call(this, 'POST', endpoint, body); } else if (operation === 'remove') { // ---------------------------------------- // personTag: remove // ---------------------------------------- const tagId = this.getNodeParameter('tagId', i); const taggingId = this.getNodeParameter('taggingId', i); const endpoint = `/tags/${tagId}/taggings/${taggingId}`; response = await actionNetworkApiRequest.call(this, 'DELETE', endpoint); } } const simplify = this.getNodeParameter('simple', i, false) as boolean; if (simplify) { response = operation === 'getAll' ? response.map((i: Response) => simplifyResponse(i, resource)) : simplifyResponse(response, resource); } Array.isArray(response) ? returnData.push(...response) : returnData.push(response); } catch (error) { if (this.continueOnFail()) { returnData.push({ error: error.message }); continue; } throw error; } } return [this.helpers.returnJsonArray(returnData)]; } }
<filename>networking/src/main/java/com/lyft/networking/apiObjects/GoogleLatLng.java<gh_stars>10-100 package com.lyft.networking.apiObjects; import com.google.gson.annotations.SerializedName; public class GoogleLatLng { @SerializedName("lat") public final Double lat; @SerializedName("lng") public final Double lng; public GoogleLatLng(Double lat, Double lng) { this.lat = lat; this.lng = lng; } @Override public String toString() { return "GoogleLatLng{" + "lat=" + lat + ", lng=" + lng + '}'; } }
package fr.tvbarthel.games.chasewhisply.mechanics.behaviors; import java.util.List; import fr.tvbarthel.games.chasewhisply.mechanics.informations.GameInformation; import fr.tvbarthel.games.chasewhisply.model.DisplayableItem; import fr.tvbarthel.games.chasewhisply.model.TargetableItem; public interface GameBehavior { public void setGameInformation(GameInformation gameInformation); public GameInformation getGameInformation(); public void setCurrentPosition(float posX, float posY, float posZ); public float[] getCurrentPosition(); public List<DisplayableItem> getItemsForDisplay(); public TargetableItem getCurrentTarget(); public void setCurrentTarget(TargetableItem t); public int getLastScoreAdded(); public void removeTarget(); public void setInterface(IGameBehavior iGameBehavior); public void onClick(); public interface IGameBehavior { public abstract void stop(); public abstract void onTargetKilled(TargetableItem target); public abstract void onSoundRequest(int soundType); } }
// listen listens keyboard eventsa and sends them to control channel. func listen(control chan<- rune, ec chan<- error) { for { switch ev := termbox.PollEvent(); ev.Type { case termbox.EventError: ec <- ev.Err case termbox.EventKey: control <- ev.Ch } } }
Nanotechnology In Medicine: Huge Potential, But What Are The Risks? Nanotechnology, the manipulation of matter at the atomic and molecular scale to create materials with remarkably varied and new properties, is a rapidly expanding area of research with huge potential in many sectors, ranging from healthcare to construction and electronics. In medicine, it promises to revolutionize drug delivery, gene therapy, diagnostics, and many areas of research, development and clinical application. This article does not attempt to cover the whole field, but offers, by means of some examples, a few insights into how nanotechnology has the potential to change medicine, both in the research lab and clinically, while touching on some of the challenges and concerns that it raises. The prefix "nano" stems from the ancient Greek for "dwarf". In science it means one billionth (10 to the minus 9) of something, thus a nanometer (nm) is is one billionth of a meter, or 0.000000001 meters. A nanometer is about three to five atoms wide, or some 40,000 times smaller than the thickness of human hair. A virus is typically 100 nm in size. The ability to manipulate structures and properties at the nanoscale in medicine is like having a sub-microscopic lab bench on which you can handle cell components, viruses or pieces of DNA, using a range of tiny tools, robots and tubes. Therapies that involve the manipulation of individual genes, or the molecular pathways that influence their expression, are increasingly being investigated as an option for treating diseases. One highly sought goal in this field is the ability to tailor treatments according to the genetic make-up of individual patients. This creates a need for tools that help scientists experiment and develop such treatments. Imagine, for example, being able to stretch out a section of DNA like a strand of spaghetti, so you can examine or operate on it, or building nanorobots that can "walk" and carry out repairs inside cell components. Nanotechnology is bringing that scientific dream closer to reality. For instance, scientists at the Australian National University have managed to attach coated latex beads to the ends of modified DNA, and then using an "optical trap" comprising a focused beam of light to hold the beads in place, they have stretched out the DNA strand in order to study the interactions of specific binding proteins. Meanwhile chemists at New York University (NYU) have created a nanoscale robot from DNA fragments that walks on two legs just 10 nm long. In a 2004 paper published in the journal Nano Letters, they describe how their "nanowalker", with the help of psoralen molecules attached to the ends of its feet, takes its first baby steps: two forward and two back. One of the researchers, Ned Seeman, said he envisages it will be possible to create a molecule-scale production line, where you move a molecule along till the right location is reached, and a nanobot does a bit chemisty on it, rather like "spot-welding" on a car assembly line. Seeman's lab at NYU is also looking to use DNA nanotechnology to make a biochip computer, and to find out how biological molecules crystallize, an area that is currently fraught with challenges. The work that Seeman and colleagues are doing is a good example of "biomimetics", where with nanotechnology they can imitate some of the biological processes in nature, such as the behavior of DNA, to engineer new methods and perhaps even improve them. DNA-based nanobots are also being created to target cancer cells. For instance, researchers at Harvard Medical School in the US reported recently in Science how they made an "origami nanorobot" out of DNA to transport a molecular payload. The barrel-shaped nanobot can carry molecules containing instructions that make cells behave in a particular way. In their study, the team successfully demonstrates how it delivered molecules that trigger cell suicide in leukemia and lymphoma cells. Nanobots made from other materials are also in development. For instance, gold is the material scientists at Northwestern University use to make "nanostars", simple, specialized, star-shaped nanoparticles that can href="http://www.medicalnewstoday.com/articles/243856.php">deliver drugs directly to the nuclei of cancer cells. In a recent paper in the journal ACS Nano, they describe how drug-loaded nanostars behave like tiny hitchhikers, that after being attracted to an over-expressed protein on the surface of human cervical and ovarian cancer cells, deposit their payload right into the nuclei of those cells. The researchers found giving their nanobot the shape of a star helped to overcome one of the challenges of using nanoparticles to deliver drugs: how to release the drugs precisely. They say the shape helps to concentrate the light pulses used to release the drugs precisely at the points of the star. Scientists are discovering that protein-based drugs are very useful because they can be programmed to deliver specific signals to cells. But the problem with conventional delivery of such drugs is that the body breaks most of them down before they reach their destination. But what if it were possible to produce such drugs in situ, right at the target site? Well, in a recent issue of Nano Letters, researchers at Massachusetts Institute of Technology (MIT) in the US show how it may be possible to do just that. In their proof of principle study, they demonstrate the feasibility of self-assembling "nanofactories" that make protein compounds, on demand, at target sites. So far they have tested the idea in mice, by creating nanoparticles programmed to produce either green fluorescent protein (GFP) or luciferase exposed to UV light. The MIT team came up with the idea while trying to find a way to attack metastatic tumors, those that grow from cancer cells that have migrated from the original site to other parts of the body. Over 90% of cancer deaths are due to metastatic cancer. They are now working on nanoparticles that can synthesize potential cancer drugs, and also on other ways to switch them on. Nanofibers are fibers with diameters of less than 1,000 nm. Medical applications include special materials for wound dressings and surgical textiles, materials used in implants, tissue engineering and artificial organ components. Nanofibers made of carbon also hold promise for medical imaging and precise scientific measurement tools. But there are huge challenges to overcome, one of the main ones being how to make them consistently of the correct size. Historically, this has been costly and time-consuming. But last year, researchers from North Carolina State University, revealed how they had developed a new method for making carbon nanofibers of specific sizes. Writing in ACS Applied Materials & Interfaces in March 2011, they describe how they managed to grow carbon nanofibers uniform in diameter, by using nickel nanoparticles coated with a shell made of ligands, small organic molecules with functional parts that bond directly to metals. Nickel nanoparticles are particularly interesting because at high temperatures they help grow carbon nanofibers. The researchers also found there was another benefit in using these nanoparticles, they could define where the nanofibers grew and by correct placement of the nanoparticles they could grow the nanofibers in a desired specific pattern: an important feature for useful nanoscale materials. Lead is another substance that is finding use as a nanofiber, so much so that neurosurgeon-to-be Matthew MacEwan, who is studying at Washington University School of Medicine in St. Louis, started his own nanomedicine company aimed at revolutionizing the surgical mesh that is used in operating theatres worldwide. The lead product is a synthetic polymer comprising individual strands of nanofibers, and was developed to repair brain and spinal cord injuries, but MacEwan thinks it could also be used to mend hernias, fistulas and other injuries. Currently, the surgical meshes used to repair the protective membrane that covers the brain and spinal cord are made of thick and stiff material, which is difficult to work with. The lead nanofiber mesh is thinner, more flexible and more likely to integrate with the body's own tissues, says MacEwan. Every thread of the nanofiber mesh is thousands of times smaller than the diameter of a single cell. The idea is to use the nanofiber material not only to make operations easier for surgeons to carry out, but also so there are fewer post-op complications for patients, because it breaks down naturally over time. Researchers at the Polytechnic Institute of New York University (NYU-Poly) have recently demonstrated a new way to make nanofibers out of proteins. Writing recently in the journal Advanced Functional Materials, the researchers say they came across their finding almost by chance: they were studying certain cylinder-shaped proteins derived from cartilage, when they noticed that in high concentrations, some of the proteins spontaneously came together and self-assembled into nanofibers. They carried out further experiments, such as adding metal-recognizing amino acids and different metals, and found they could control fiber formation, alter its shape, and how it bound to small molecules. For instance, adding nickel transformed the fibers into clumped mats, which could be used to trigger the release of an attached drug molecule. The researchers hope this new method will greatly improve the delivery of drugs to treat cancer, heart disorders and Alzheimer's disease. They can also see applications in regeneration of human tissue, bone and cartilage, and even as a way to develop tinier and more powerful microprocessors for use in computers and consumer electronics. What of the Future and Concerns Surrounding Nanomaterials? Recent years have seen an explosion in the number of studies showing the variety of medical applications of nanotechnology and nanomaterials. In this article we have glimpsed just a small cross-section of this vast field. However, across the range, there exist considerable challenges, the greatest of which appear to be how to scale up production of materials and tools, and how to bring down costs and timescales. But another challenge is how to quickly secure public confidence that this rapidly expanding technology is safe. And so far, it is not clear whether that is being done. There are those who suggest concerns about nanotechnology may be over-exaggerated. They point to the fact that just because a material is nanosized, it does not mean it is dangerous, indeed nanoparticles have been around since the Earth was born, occurring naturally in volcanic ash and sea-spray, for example. As byproducts of human activity, they have been present since the Stone Age, in smoke and soot. Of attempts to investigate the safety of nanomaterials, the National Cancer Institute in the US says there are so many nanoparticles naturally present in the environment that they are "often at order-of-magnitude higher levels than the engineered particles being evaluated". In many respects, they point out, "most engineered nanoparticles are far less toxic than household cleaning products, insecticides used on family pets, and over-the-counter dandruff remedies," and that for instance, in their use as carriers of chemotherapeutics in cancer treatment, they are much less toxic than the drugs they carry. It is perhaps more in the food sector that we have seen some of the greatest expansion of nanomaterials on a commercial level. Although the number of foods that contain nanomaterials is still small, it appears set to change over the next few years as the technology develops. Nanomaterials are already used to lower levels of fat and sugar without altering taste, or to improve packaging to keep food fresher for longer, or to tell consumers if the food is spoiled. They are also being used to increase the bioavailablity of nutrients (for instance in food supplements). But, there are also concerned parties, who highlight that while the pace of research quickens, and the market for nanomaterials expands, it appears not enough is being done to discover their toxicological consequences. This was the view of a science and technology committee of the House of Lords of the British Parliament, who in a recent report on nanotechnology and food, raise several concerns about nanomaterials and human health, particularly the risk posed by ingested nanomaterials. For instance, one area that concerns the committee is the size and exceptional mobility of nanoparticles: they are small enough, if ingested, to penetrate cell membranes of the lining of the gut, with the potential to access the brain and other parts of the body, and even inside the nuclei of cells. Another is the solubility and persistence of nanomaterials. What happens, for instance, to insoluble nanoparticles? If they can't be broken down and digested or degraded, is there a danger they will accumulate and damage organs? Nanomaterials comprising inorganic metal oxides and metals are thought to be the ones most likely to pose a risk in this area. Also, because of their high surface area to mass ratio, nanoparticles are highly reactive, and may for instance, trigger as yet unknown chemical reactions, or by bonding with toxins, allow them to enter cells that they would otherwise have no access to. For instance, with their large surface area, reactivity and electrical charge, nanomaterials create the conditions for what is described as "particle aggregation" due to physical forces and "particle agglomoration" due to chemical forces, so that individual nanoparticles come together to form larger ones. This may lead not only to dramatically larger particles, for instance in the gut and inside cells, but could also result in disaggregation of clumps of nanoparticles, which could radically alter their physicochemical properties and chemical reactivity. "Such reversible phenomena add to the difficulty in understanding the behaviour and toxicology of nanomaterials," says the committee, whose overall conclusion is that neither Government nor the Research Councils are giving enough priority to researching the safety of nanotechnology, especially "considering the timescale within which products containing nanomaterials may be developed". They recommend much more research is needed to "ensure that regulatory agencies can effectively assess the safety of products before they are allowed onto the market". It would appear, therefore, whether actual or perceived, the potential risk that nanotechnology poses to human health must be investigated, and be seen to be investigated. Most nanomaterials, as the NCI suggests, will likely prove to be harmless. But when a technology advances rapidly, knowledge and communication about its safety needs to keep pace in order for it to benefit, especially if it is also to secure public confidence. We only have to look at what happened, and to some extent is still happening, with genetically modified food to see how that can go badly wrong. Paddock, Catharine. "Nanotechnology In Medicine: Huge Potential, But What Are The Risks?." Medical News Today. MediLexicon, Intl., 4 May. 2012. Web.
<gh_stars>10-100 package mssqldb import ( "encoding/json" "fmt" ) // Config is a struct used for configuring the connection and the usage of the database. // It contains the information needed to form a connection string and the name of the table used for storing the data. type Config struct { Name string `envconfig:"database,default=orderservice" json:"Name"` Host string `envconfig:"host,default=127.0.0.1" json:"Host"` Port int `envconfig:"port,default=1433" json:"Port"` User string `envconfig:"username,default=test" json:"User"` Pass string `envconfig:"password,default=<PASSWORD>" json:"-"` // hidden from logging DbOrdersTableName string `envconfig:"tablename,default=orders" json:"OrdersTable"` } // String returns a printable representation of the config as JSON. // Use the struct field tag `json:"-"` to hide fields that should not be revealed such as credentials and secrets. func (config Config) String() string { json, err := json.Marshal(config) if err != nil { return fmt.Sprintf("Error marshalling DB configuration JSON: %v", err) } return fmt.Sprintf("DB Configuration: %s", json) }
Autoimmune hemolytic anemia induced by anti-PD-1 therapy in metastatic melanoma. We report the occurrence of autoimmune hemolytic anemia in a patient receiving the anti-PD-1 monoclonal antibody, nivolumab, for metastatic melanoma in the presence of known red cell alloantibodies, despite having received prior ipilimumab without evidence of hemolysis. The patient had a history of multiple red cell alloantibodies and a positive direct antiglobulin test, identified at the time of a prior transfusion, which occurred before treatment with ipilimumab. The patient developed symptomatic warm autoimmune hemolytic anemia after four cycles of treatment with nivolumab. Clinical improvement was noted following cessation of the drug and treatment with corticosteroids. Given that there was no prior history of hemolysis, even during treatment with ipilimumab, we hypothesize that anti-PD-1 therapy disrupted peripheral tolerance, unmasking an underlying autoimmune predisposition.
<reponame>SerejkaSJ/fiasko_bro<gh_stars>10-100 import os.path import pytest from fiasko_bro import validate @pytest.fixture(scope='session') def non_existent_directory(): directory = 'test_fixtures{}directory_that_should_not_exist'.format(os.path.sep) assert not os.path.isdir(directory) return directory def test_not_existing_file_raises_correct_exception(non_existent_directory): with pytest.raises(FileNotFoundError): validate(non_existent_directory)
package org.bukkit.craftbukkit.entity; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Set; import net.minecraft.util.DamageSource; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityDragonFireball; import net.minecraft.entity.projectile.EntityEgg; import net.minecraft.entity.item.EntityEnderPearl; import net.minecraft.entity.projectile.EntityFishHook; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityFireball; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.projectile.EntityLargeFireball; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityLlamaSpit; import net.minecraft.entity.projectile.EntityPotion; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.entity.projectile.EntityShulkerBullet; import net.minecraft.entity.projectile.EntitySmallFireball; import net.minecraft.entity.projectile.EntitySnowball; import net.minecraft.entity.item.EntityExpBottle; import net.minecraft.entity.projectile.EntityTippedArrow; import net.minecraft.entity.projectile.EntitySpectralArrow; import net.minecraft.entity.boss.EntityWither; import net.minecraft.entity.projectile.EntityWitherSkull; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.potion.PotionEffect; import net.minecraft.potion.Potion; import org.apache.commons.lang.Validate; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.attribute.Attribute; import org.bukkit.attribute.AttributeInstance; import org.bukkit.block.Block; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.inventory.CraftEntityEquipment; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.potion.CraftPotionUtil; import org.bukkit.entity.Arrow; import org.bukkit.entity.DragonFireball; import org.bukkit.entity.Egg; import org.bukkit.entity.EnderPearl; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Fireball; import org.bukkit.entity.Fish; import org.bukkit.entity.HumanEntity; import org.bukkit.entity.LingeringPotion; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LlamaSpit; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; import org.bukkit.entity.ShulkerBullet; import org.bukkit.entity.SmallFireball; import org.bukkit.entity.Snowball; import org.bukkit.entity.SpectralArrow; import org.bukkit.entity.ThrownExpBottle; import org.bukkit.entity.ThrownPotion; import org.bukkit.entity.TippedArrow; import org.bukkit.entity.WitherSkull; import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.inventory.EntityEquipment; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionData; import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionType; import org.bukkit.util.BlockIterator; import org.bukkit.util.Vector; public class CraftLivingEntity extends CraftEntity implements LivingEntity { private CraftEntityEquipment equipment; public CraftLivingEntity(final CraftServer server, final EntityLivingBase entity) { super(server, entity); if (entity instanceof EntityLiving || entity instanceof EntityArmorStand) { equipment = new CraftEntityEquipment(this); } } @Override public double getHealth() { return Math.min(Math.max(0, getHandle().func_110143_aJ()), getMaxHealth()); } @Override public void setHealth(double health) { health = (float) health; if ((health < 0) || (health > getMaxHealth())) { // Paper - Be more informative throw new IllegalArgumentException("Health must be between 0 and " + getMaxHealth() + ", but was " + health + ". (attribute base value: " + this.getHandle().func_110148_a(SharedMonsterAttributes.field_111267_a).func_111125_b() + (this instanceof CraftPlayer ? ", player: " + this.getName() + ')' : ')')); } getHandle().func_70606_j((float) health); if (health == 0) { getHandle().func_70645_a(DamageSource.field_76377_j); } } @Override public double getMaxHealth() { return getHandle().func_110138_aP(); } @Override public void setMaxHealth(double amount) { Validate.isTrue(amount > 0, "Max health must be greater than 0"); getHandle().func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(amount); if (getHealth() > amount) { setHealth(amount); } } @Override public void resetMaxHealth() { setMaxHealth(getHandle().func_110148_a(SharedMonsterAttributes.field_111267_a).func_111123_a().func_111110_b()); } @Override public double getEyeHeight() { return getHandle().func_70047_e(); } @Override public double getEyeHeight(boolean ignorePose) { return getEyeHeight(); } private List<Block> getLineOfSight(Set<Material> transparent, int maxDistance, int maxLength) { if (maxDistance > 120) { maxDistance = 120; } ArrayList<Block> blocks = new ArrayList<Block>(); Iterator<Block> itr = new BlockIterator(this, maxDistance); while (itr.hasNext()) { Block block = itr.next(); blocks.add(block); if (maxLength != 0 && blocks.size() > maxLength) { blocks.remove(0); } Material material = block.getType(); if (transparent == null) { if (!material.equals(Material.AIR)) { break; } } else { if (!transparent.contains(material)) { break; } } } return blocks; } @Override public List<Block> getLineOfSight(Set<Material> transparent, int maxDistance) { return getLineOfSight(transparent, maxDistance, 0); } @Override public Block getTargetBlock(Set<Material> transparent, int maxDistance) { List<Block> blocks = getLineOfSight(transparent, maxDistance, 1); return blocks.get(0); } @Override public List<Block> getLastTwoTargetBlocks(Set<Material> transparent, int maxDistance) { return getLineOfSight(transparent, maxDistance, 2); } @Override public int getRemainingAir() { return getHandle().func_70086_ai(); } @Override public void setRemainingAir(int ticks) { getHandle().func_70050_g(ticks); } @Override public int getMaximumAir() { return getHandle().maxAirTicks; } @Override public void setMaximumAir(int ticks) { getHandle().maxAirTicks = ticks; } @Override public void damage(double amount) { damage(amount, null); } @Override public void damage(double amount, org.bukkit.entity.Entity source) { DamageSource reason = DamageSource.field_76377_j; if (source instanceof HumanEntity) { reason = DamageSource.func_76365_a(((CraftHumanEntity) source).getHandle()); } else if (source instanceof LivingEntity) { reason = DamageSource.func_76358_a(((CraftLivingEntity) source).getHandle()); } entity.func_70097_a(reason, (float) amount); } @Override public Location getEyeLocation() { Location loc = getLocation(); loc.setY(loc.getY() + getEyeHeight()); return loc; } @Override public int getMaximumNoDamageTicks() { return getHandle().field_70771_an; } @Override public void setMaximumNoDamageTicks(int ticks) { getHandle().field_70771_an = ticks; } @Override public double getLastDamage() { return getHandle().field_110153_bc; } @Override public void setLastDamage(double damage) { getHandle().field_110153_bc = (float) damage; } @Override public int getNoDamageTicks() { return getHandle().field_70172_ad; } @Override public void setNoDamageTicks(int ticks) { getHandle().field_70172_ad = ticks; } @Override public EntityLivingBase getHandle() { return (EntityLivingBase) entity; } public void setHandle(final EntityLivingBase entity) { super.setHandle(entity); } @Override public String toString() { return "CraftLivingEntity{" + "id=" + getEntityId() + '}'; } @Override public Player getKiller() { return getHandle().field_70717_bb == null ? null : (Player) getHandle().field_70717_bb.getBukkitEntity(); } // Paper start @Override public void setKiller(Player killer) { net.minecraft.entity.player.EntityPlayerMP entityPlayer = killer == null ? null : ((CraftPlayer) killer).getHandle(); getHandle().field_70717_bb = entityPlayer; getHandle().field_70755_b = entityPlayer; getHandle().field_70718_bc = entityPlayer == null ? 0 : 100; // 100 value taken from EntityLiving#damageEntity } // Paper end @Override public boolean addPotionEffect(org.bukkit.potion.PotionEffect effect) { return addPotionEffect(effect, false); } @Override public boolean addPotionEffect(org.bukkit.potion.PotionEffect effect, boolean force) { if (hasPotionEffect(effect.getType())) { if (!force) { return false; } removePotionEffect(effect.getType()); } getHandle().func_70690_d(new PotionEffect(Potion.func_188412_a(effect.getType().getId()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles())); return true; } @Override public boolean addPotionEffects(Collection<org.bukkit.potion.PotionEffect> effects) { boolean success = true; for (org.bukkit.potion.PotionEffect effect : effects) { success &= addPotionEffect(effect); } return success; } @Override public boolean hasPotionEffect(PotionEffectType type) { return getHandle().func_70644_a(Potion.func_188412_a(type.getId())); } @Override public org.bukkit.potion.PotionEffect getPotionEffect(PotionEffectType type) { PotionEffect handle = getHandle().func_70660_b(Potion.func_188412_a(type.getId())); return (handle == null) ? null : new org.bukkit.potion.PotionEffect(PotionEffectType.getById(Potion.func_188409_a(handle.func_188419_a())), handle.func_76459_b(), handle.func_76458_c(), handle.func_82720_e(), handle.func_188418_e()); } @Override public void removePotionEffect(PotionEffectType type) { getHandle().func_184589_d(Potion.func_188412_a(type.getId())); } @Override public Collection<org.bukkit.potion.PotionEffect> getActivePotionEffects() { List<org.bukkit.potion.PotionEffect> effects = new ArrayList<org.bukkit.potion.PotionEffect>(); for (PotionEffect handle : getHandle().field_70713_bf.values()) { effects.add(new org.bukkit.potion.PotionEffect(PotionEffectType.getById(Potion.func_188409_a(handle.func_188419_a())), handle.func_76459_b(), handle.func_76458_c(), handle.func_82720_e(), handle.func_188418_e())); } return effects; } @Override public <T extends Projectile> T launchProjectile(Class<? extends T> projectile) { return launchProjectile(projectile, null); } @Override @SuppressWarnings("unchecked") public <T extends Projectile> T launchProjectile(Class<? extends T> projectile, Vector velocity) { net.minecraft.world.World world = ((CraftWorld) getWorld()).getHandle(); net.minecraft.entity.Entity launch = null; if (Snowball.class.isAssignableFrom(projectile)) { launch = new EntitySnowball(world, getHandle()); ((EntityThrowable) launch).func_184538_a(getHandle(), getHandle().field_70125_A, getHandle().field_70177_z, 0.0F, 1.5F, 1.0F); // ItemSnowball } else if (Egg.class.isAssignableFrom(projectile)) { launch = new EntityEgg(world, getHandle()); ((EntityThrowable) launch).func_184538_a(getHandle(), getHandle().field_70125_A, getHandle().field_70177_z, 0.0F, 1.5F, 1.0F); // ItemEgg } else if (EnderPearl.class.isAssignableFrom(projectile)) { launch = new EntityEnderPearl(world, getHandle()); ((EntityThrowable) launch).func_184538_a(getHandle(), getHandle().field_70125_A, getHandle().field_70177_z, 0.0F, 1.5F, 1.0F); // ItemEnderPearl } else if (Arrow.class.isAssignableFrom(projectile)) { if (TippedArrow.class.isAssignableFrom(projectile)) { launch = new EntityTippedArrow(world, getHandle()); ((EntityTippedArrow) launch).setType(CraftPotionUtil.fromBukkit(new PotionData(PotionType.WATER, false, false))); } else if (SpectralArrow.class.isAssignableFrom(projectile)) { launch = new EntitySpectralArrow(world, getHandle()); } else { launch = new EntityTippedArrow(world, getHandle()); } ((EntityArrow) launch).func_184547_a(getHandle(), getHandle().field_70125_A, getHandle().field_70177_z, 0.0F, 3.0F, 1.0F); // ItemBow } else if (ThrownPotion.class.isAssignableFrom(projectile)) { if (LingeringPotion.class.isAssignableFrom(projectile)) { launch = new EntityPotion(world, getHandle(), CraftItemStack.asNMSCopy(new ItemStack(org.bukkit.Material.LINGERING_POTION, 1))); } else { launch = new EntityPotion(world, getHandle(), CraftItemStack.asNMSCopy(new ItemStack(org.bukkit.Material.SPLASH_POTION, 1))); } ((EntityThrowable) launch).func_184538_a(getHandle(), getHandle().field_70125_A, getHandle().field_70177_z, -20.0F, 0.5F, 1.0F); // ItemSplashPotion } else if (ThrownExpBottle.class.isAssignableFrom(projectile)) { launch = new EntityExpBottle(world, getHandle()); ((EntityThrowable) launch).func_184538_a(getHandle(), getHandle().field_70125_A, getHandle().field_70177_z, -20.0F, 0.7F, 1.0F); // ItemExpBottle } else if (Fish.class.isAssignableFrom(projectile) && getHandle() instanceof EntityPlayer) { launch = new EntityFishHook(world, (EntityPlayer) getHandle()); } else if (Fireball.class.isAssignableFrom(projectile)) { Location location = getEyeLocation(); Vector direction = location.getDirection().multiply(10); if (SmallFireball.class.isAssignableFrom(projectile)) { launch = new EntitySmallFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ()); } else if (WitherSkull.class.isAssignableFrom(projectile)) { launch = new EntityWitherSkull(world, getHandle(), direction.getX(), direction.getY(), direction.getZ()); } else if (DragonFireball.class.isAssignableFrom(projectile)) { launch = new EntityDragonFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ()); } else { launch = new EntityLargeFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ()); } ((EntityFireball) launch).projectileSource = this; launch.func_70012_b(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); } else if (LlamaSpit.class.isAssignableFrom(projectile)) { Location location = getEyeLocation(); Vector direction = location.getDirection(); launch = new EntityLlamaSpit(world); ((EntityLlamaSpit) launch).field_190539_a = getHandle(); ((EntityLlamaSpit) launch).func_70186_c(direction.getX(), direction.getY(), direction.getZ(), 1.5F, 10.0F); // EntityLlama launch.func_70012_b(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); } else if (ShulkerBullet.class.isAssignableFrom(projectile)) { Location location = getEyeLocation(); launch = new EntityShulkerBullet(world, getHandle(), null, null); launch.func_70012_b(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); } Validate.notNull(launch, "Projectile not supported"); if (velocity != null) { ((T) launch.getBukkitEntity()).setVelocity(velocity); } world.func_72838_d(launch); return (T) launch.getBukkitEntity(); } @Override public EntityType getType() { return EntityType.UNKNOWN; } @Override public boolean hasLineOfSight(Entity other) { return getHandle().func_70685_l(((CraftEntity) other).getHandle()); } @Override public boolean getRemoveWhenFarAway() { return getHandle() instanceof EntityLiving && !((EntityLiving) getHandle()).field_82179_bU; } @Override public void setRemoveWhenFarAway(boolean remove) { if (getHandle() instanceof EntityLiving) { ((EntityLiving) getHandle()).field_82179_bU = !remove; } } @Override public EntityEquipment getEquipment() { return equipment; } @Override public void setCanPickupItems(boolean pickup) { getHandle().canPickUpLoot = pickup; } @Override public boolean getCanPickupItems() { return getHandle().canPickUpLoot; } @Override public boolean teleport(Location location, PlayerTeleportEvent.TeleportCause cause) { if (getHealth() == 0) { return false; } return super.teleport(location, cause); } @Override public boolean isLeashed() { if (!(getHandle() instanceof EntityLiving)) { return false; } return ((EntityLiving) getHandle()).func_110166_bE() != null; } @Override public Entity getLeashHolder() throws IllegalStateException { if (!isLeashed()) { throw new IllegalStateException("Entity not leashed"); } return ((EntityLiving) getHandle()).func_110166_bE().getBukkitEntity(); } private boolean unleash() { if (!isLeashed()) { return false; } ((EntityLiving) getHandle()).func_110160_i(true, false); return true; } @Override public boolean setLeashHolder(Entity holder) { if ((getHandle() instanceof EntityWither) || !(getHandle() instanceof EntityLiving)) { return false; } if (holder == null) { return unleash(); } if (holder.isDead()) { return false; } unleash(); ((EntityLiving) getHandle()).func_110162_b(((CraftEntity) holder).getHandle(), true); return true; } @Override public boolean isGliding() { return getHandle().func_70083_f(7); } @Override public void setGliding(boolean gliding) { getHandle().func_70052_a(7, gliding); } @Override public AttributeInstance getAttribute(Attribute attribute) { return getHandle().craftAttributes.getAttribute(attribute); } @Override public void setAI(boolean ai) { if (this.getHandle() instanceof EntityLiving) { ((EntityLiving) this.getHandle()).func_94061_f(!ai); } } @Override public boolean hasAI() { return (this.getHandle() instanceof EntityLiving) ? !((EntityLiving) this.getHandle()).func_175446_cd(): false; } @Override public void setCollidable(boolean collidable) { getHandle().collides = collidable; } @Override public boolean isCollidable() { return getHandle().collides; } // Paper start @Override public int getArrowsStuck() { return getHandle().func_85035_bI(); } @Override public void setArrowsStuck(int arrows) { getHandle().func_85034_r(arrows); } @Override public int getShieldBlockingDelay() { return getHandle().getShieldBlockingDelay(); } @Override public void setShieldBlockingDelay(int delay) { getHandle().setShieldBlockingDelay(delay); } // Paper end }
/* * Copyright 2012 astamuse company,Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.astamuse.asta4d.test.render.infra; public class TimeCalculator { public final static void shouldRunInTime(Runnable run, long time) { long begin = System.currentTimeMillis(); run.run(); long end = System.currentTimeMillis(); long period = end - begin; assert period < time : "Execution is expected less than " + time + "ms but it takes " + period + "ms"; } }
There are many responsibilities involved in running a business successfully, but maintaining strong control over accounts payable is among the most crucial. The mission of accounts payable is to pay only the company's bills and invoices that are legitimate and accurate. We have an exciting opportunity for an Accounts Payable Representative to join our Accounts Payable team. In this new role you will be working on various aspects of Accounts Payable processing in a dynamic and fast paced environment.
Role of staging laparoscopy in gastric malignancies - our institutional experience. AIM To investigate the value of staging laparoscopy with laparoscopic ultrasound (LUS) and peritoneal lavage cytology in patients with newly-diagnosed gastric tumours in our department. METHODS Retrospective review of prospectively-collected data was conducted in all patients with newly-diagnosed gastric tumours on oesophagogastroduodenoscopy between December 2003 and July 2008. All the patients had a pre-treatment histological diagnosis and were discussed at the hospital multidisciplinary tumour board meeting for their definitive management. Computed tomography scan was performed in all patients as a part of standard preoperative staging work up. Staging laparoscopy was subsequently performed in selected patients and staging by both modalities was compared. RESULTS Twenty seven patients were included. Majority of patients had cardio-oesophageal junction adenocarcinoma. Thirteen patients (48%) were upstaged following staging laparoscopy and one patient was downstaged (3.7%). None of the patients had procedure-related complications. None of the patients with metastasis detected at laparoscopy underwent laparotomy. Gastrectomy after staging laparoscopy was performed in 13 patients (9 R0 resections, 3 R1 resections and 1 R2 resection). Only one patient did not have gastrectomy at laparotomy because of extensive local invasion. Three patients were subjected to neoadjuvant therapy following laparoscopy but only one patient subsequently underwent gastrectomy. CONCLUSION In this small series reflecting our institutional experience, staging laparoscopy appears to be safe and more accurate in detecting peritoneal and omental metastases as compared to conventional imaging. Peritoneal cytology provided additional prognostic information although there appeared to be a high false negative rate.
<reponame>ives9638/isomorphicdb<gh_stars>100-1000 // Copyright 2020 - 2021 <NAME> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use super::*; #[rstest::rstest] fn update_all_records(with_schema: TransactionManager) { let txn = with_schema.start_transaction(); assert_statement( &txn, "create table schema_name.table_name (column_test smallint);", vec![OutboundMessage::TableCreated, OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "insert into schema_name.table_name values (123), (456);", vec![OutboundMessage::RecordsInserted(2), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_test".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(123)]), OutboundMessage::DataRow(vec![small_int(456)]), OutboundMessage::RecordsSelected(2), OutboundMessage::ReadyForQuery, ], ); assert_statement( &txn, "update schema_name.table_name set column_test=789;", vec![OutboundMessage::RecordsUpdated(2), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_test".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(789)]), OutboundMessage::DataRow(vec![small_int(789)]), OutboundMessage::RecordsSelected(2), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn update_single_column_of_all_records(with_schema: TransactionManager) { let txn = with_schema.start_transaction(); assert_statement( &txn, "create table schema_name.table_name (col1 smallint, col2 smallint);", vec![OutboundMessage::TableCreated, OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "insert into schema_name.table_name values (123, 789), (456, 789);", vec![OutboundMessage::RecordsInserted(2), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("col1".to_owned(), SMALLINT), ("col2".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(123), small_int(789)]), OutboundMessage::DataRow(vec![small_int(456), small_int(789)]), OutboundMessage::RecordsSelected(2), OutboundMessage::ReadyForQuery, ], ); assert_statement( &txn, "update schema_name.table_name set col2=357;", vec![OutboundMessage::RecordsUpdated(2), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("col1".to_owned(), SMALLINT), ("col2".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(123), small_int(357)]), OutboundMessage::DataRow(vec![small_int(456), small_int(357)]), OutboundMessage::RecordsSelected(2), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn update_multiple_columns_of_all_records(with_schema: TransactionManager) { let txn = with_schema.start_transaction(); assert_statement( &txn, "create table schema_name.table_name (col1 smallint, col2 smallint, col3 smallint);", vec![OutboundMessage::TableCreated, OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "insert into schema_name.table_name values (111, 222, 333), (444, 555, 666);", vec![OutboundMessage::RecordsInserted(2), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![ ("col1".to_owned(), SMALLINT), ("col2".to_owned(), SMALLINT), ("col3".to_owned(), SMALLINT), ]), OutboundMessage::DataRow(vec![small_int(111), small_int(222), small_int(333)]), OutboundMessage::DataRow(vec![small_int(444), small_int(555), small_int(666)]), OutboundMessage::RecordsSelected(2), OutboundMessage::ReadyForQuery, ], ); assert_statement( &txn, "update schema_name.table_name set col3=777, col1=999;", vec![OutboundMessage::RecordsUpdated(2), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![ ("col1".to_owned(), SMALLINT), ("col2".to_owned(), SMALLINT), ("col3".to_owned(), SMALLINT), ]), OutboundMessage::DataRow(vec![small_int(999), small_int(222), small_int(777)]), OutboundMessage::DataRow(vec![small_int(999), small_int(555), small_int(777)]), OutboundMessage::RecordsSelected(2), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn update_all_records_in_multiple_columns(with_schema: TransactionManager) { let txn = with_schema.start_transaction(); assert_statement( &txn, "create table schema_name.table_name (column_1 smallint, column_2 smallint, column_3 smallint);", vec![OutboundMessage::TableCreated, OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "insert into schema_name.table_name values (1, 2, 3), (4, 5, 6), (7, 8, 9);", vec![OutboundMessage::RecordsInserted(3), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![ ("column_1".to_owned(), SMALLINT), ("column_2".to_owned(), SMALLINT), ("column_3".to_owned(), SMALLINT), ]), OutboundMessage::DataRow(vec![small_int(1), small_int(2), small_int(3)]), OutboundMessage::DataRow(vec![small_int(4), small_int(5), small_int(6)]), OutboundMessage::DataRow(vec![small_int(7), small_int(8), small_int(9)]), OutboundMessage::RecordsSelected(3), OutboundMessage::ReadyForQuery, ], ); assert_statement( &txn, "update schema_name.table_name set column_1=10, column_2=20, column_3=30;", vec![OutboundMessage::RecordsUpdated(3), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![ ("column_1".to_owned(), SMALLINT), ("column_2".to_owned(), SMALLINT), ("column_3".to_owned(), SMALLINT), ]), OutboundMessage::DataRow(vec![small_int(10), small_int(20), small_int(30)]), OutboundMessage::DataRow(vec![small_int(10), small_int(20), small_int(30)]), OutboundMessage::DataRow(vec![small_int(10), small_int(20), small_int(30)]), OutboundMessage::RecordsSelected(3), OutboundMessage::ReadyForQuery, ], ); } #[rstest::rstest] fn update_non_existent_columns_of_records(with_schema: TransactionManager) { let txn = with_schema.start_transaction(); assert_statement( &txn, "create table schema_name.table_name (column_test smallint);", vec![OutboundMessage::TableCreated, OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "insert into schema_name.table_name values (123);", vec![OutboundMessage::RecordsInserted(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_test".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(123)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); assert_statement( &txn, "update schema_name.table_name set col1=456, col2=789;", vec![QueryError::column_does_not_exist("col1").into(), OutboundMessage::ReadyForQuery], ); txn.commit(); } #[rstest::rstest] fn test_update_with_dynamic_expression(with_schema: TransactionManager) { let txn = with_schema.start_transaction(); assert_statement( &txn, "create table schema_name.table_name (\ si_column_1 smallint, \ si_column_2 smallint, \ si_column_3 smallint);", vec![OutboundMessage::TableCreated, OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "insert into schema_name.table_name values (1, 2, 3), (4, 5, 6), (7, 8, 9);", vec![OutboundMessage::RecordsInserted(3), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![ ("si_column_1".to_owned(), SMALLINT), ("si_column_2".to_owned(), SMALLINT), ("si_column_3".to_owned(), SMALLINT), ]), OutboundMessage::DataRow(vec![small_int(1), small_int(2), small_int(3)]), OutboundMessage::DataRow(vec![small_int(4), small_int(5), small_int(6)]), OutboundMessage::DataRow(vec![small_int(7), small_int(8), small_int(9)]), OutboundMessage::RecordsSelected(3), OutboundMessage::ReadyForQuery, ], ); assert_statement( &txn, "update schema_name.table_name \ set \ si_column_1 = 2 * si_column_1, \ si_column_2 = 2 * (si_column_1 + si_column_2), \ si_column_3 = (si_column_3 + (2 * (si_column_1 + si_column_2)));", vec![OutboundMessage::RecordsUpdated(3), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![ ("si_column_1".to_owned(), SMALLINT), ("si_column_2".to_owned(), SMALLINT), ("si_column_3".to_owned(), SMALLINT), ]), OutboundMessage::DataRow(vec![small_int(2), small_int(2 * (1 + 2)), small_int(3 + (2 * (1 + 2)))]), OutboundMessage::DataRow(vec![small_int(2 * 4), small_int(2 * (4 + 5)), small_int(6 + (2 * (4 + 5)))]), OutboundMessage::DataRow(vec![small_int(2 * 7), small_int(2 * (7 + 8)), small_int(9 + (2 * (7 + 8)))]), OutboundMessage::RecordsSelected(3), OutboundMessage::ReadyForQuery, ], ); } #[rstest::rstest] fn update_value_by_predicate_on_single_field(with_schema: TransactionManager) { let txn = with_schema.start_transaction(); assert_statement( &txn, "create table schema_name.table_name (col1 smallint, col2 smallint, col3 smallint);", vec![OutboundMessage::TableCreated, OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "insert into schema_name.table_name values (1, 2, 3), (4, 5, 6), (7, 8, 9);", vec![OutboundMessage::RecordsInserted(3), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "update schema_name.table_name set col1 = 7 where col1 = 4;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name where col1 = 4", vec![ OutboundMessage::RowDescription(vec![ ("col1".to_owned(), SMALLINT), ("col2".to_owned(), SMALLINT), ("col3".to_owned(), SMALLINT), ]), OutboundMessage::RecordsSelected(0), OutboundMessage::ReadyForQuery, ], ); assert_statement( &txn, "select * from schema_name.table_name where col1 = 7", vec![ OutboundMessage::RowDescription(vec![ ("col1".to_owned(), SMALLINT), ("col2".to_owned(), SMALLINT), ("col3".to_owned(), SMALLINT), ]), OutboundMessage::DataRow(vec![small_int(7), small_int(5), small_int(6)]), OutboundMessage::DataRow(vec![small_int(7), small_int(8), small_int(9)]), OutboundMessage::RecordsSelected(2), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[cfg(test)] mod operators { use super::*; #[cfg(test)] mod integers { use super::*; #[rstest::fixture] fn with_table(with_schema: TransactionManager) -> TransactionManager { let txn = with_schema.start_transaction(); assert_statement( &txn, "create table schema_name.table_name(column_si smallint);", vec![OutboundMessage::TableCreated, OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "insert into schema_name.table_name values (2);", vec![OutboundMessage::RecordsInserted(1), OutboundMessage::ReadyForQuery], ); txn.commit(); with_schema } #[rstest::rstest] fn addition(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = 1 + 2;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(3)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn subtraction(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = 1 - 2;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(-1)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn multiplication(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = 3 * 2;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(6)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn division(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = 8 / 2;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(4)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn modulo(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = 8 % 2;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(0)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn exponentiation(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = 8 ^ 2;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(64)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] #[ignore] //TODO: TypeInference#infer_static is not implemented fn square_root(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = |/ 16;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(4)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] #[ignore] //TODO: TypeInference#infer_static is not implemented fn cube_root(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = ||/ 8;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(1)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn factorial(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = 5!;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(120)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn prefix_factorial(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = !!5;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(120)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn absolute_value(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = @ -5;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(5)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn bitwise_and(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = 5 & 1;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(1)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn bitwise_or(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = 5 | 2;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(7)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn bitwise_not(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = ~1;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(-2)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn bitwise_shift_left(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = 1 << 4;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(16)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn bitwise_right_left(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = 8 >> 2;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(2)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn evaluate_many_operations(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set column_si = 5 & 13 % 10 + 1 * 20 - 40 / 4;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("column_si".to_owned(), SMALLINT)]), OutboundMessage::DataRow(vec![small_int(5)]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } } #[cfg(test)] mod string { use super::*; #[rstest::fixture] fn with_table(with_schema: TransactionManager) -> TransactionManager { let txn = with_schema.start_transaction(); assert_statement( &txn, "create table schema_name.table_name(strings char(5));", vec![OutboundMessage::TableCreated, OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "insert into schema_name.table_name values ('x');", vec![OutboundMessage::RecordsInserted(1), OutboundMessage::ReadyForQuery], ); txn.commit(); with_schema } #[rstest::rstest] fn concatenation(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set strings = '123' || '45';", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("strings".to_owned(), CHAR)]), OutboundMessage::DataRow(vec![string("12345")]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] #[ignore] //TODO: TypeInference#infer_static is not implemented fn concatenation_with_number(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set strings = 1 || '45';", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("strings".to_owned(), CHAR)]), OutboundMessage::DataRow(vec![string("145")]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); assert_statement( &txn, "update schema_name.table_name set strings = '45' || 1;", vec![OutboundMessage::RecordsUpdated(1), OutboundMessage::ReadyForQuery], ); assert_statement( &txn, "select * from schema_name.table_name;", vec![ OutboundMessage::RowDescription(vec![("strings".to_owned(), CHAR)]), OutboundMessage::DataRow(vec![string("451")]), OutboundMessage::RecordsSelected(1), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } #[rstest::rstest] fn non_string_concatenation_not_supported(with_table: TransactionManager) { let txn = with_table.start_transaction(); assert_statement( &txn, "update schema_name.table_name set strings = 1 || 2;", vec![ QueryError::undefined_function("||".to_owned(), "integer".to_owned(), "integer".to_owned()).into(), OutboundMessage::ReadyForQuery, ], ); txn.commit(); } } }
Investigators have not determined a motive or received enough information from witnesses to develop a description of the suspect. The Sheriff's Office asks anyone with information to contact Investigator Sgt. Brian Chapman at 843-470-3469 or the Beaufort County Dispatch Center at 843-524-2777.
Tag-Based Browsing of Digital Collections with Inverted Indexes and Browsing Cache In this paper we describe one of the browsing strategies for learning object repositories implemented in the Clavy platform, a platform for the management of repositories with reconfigurable structures. Since Clavy makes it possible to dynamically modify the structure of the repositories, it must support a navigation model independent of that structure. For this purpose, the platform adopts a tag-based browsing model, according to which users select descriptive tags to filter learning objects (in Clavy, these descriptive tags correspond to element-value pairs). In our experience using Clavy, we have realized that updating the browsing state when the user changes the set of selected tags can be a costly process. The proposed strategy alleviates this cost by combining inverted indexes with a multilevel cache model that enables the system, on the one hand, to cache filtered objects (i.e., set of objects filtered by sets of selected tags), and, on the other hand, selectable tags (i.e., set of tags able to shrink sets of objects).
import pandas as pd import os import numpy as np import csv from pandas.plotting import scatter_matrix from datetime import datetime from scipy.stats import pearsonr, betai import matplotlib.pyplot as plt class CorrelCoeffAnalysis(object): '''A class to help analyse the data; try to identify linear correlations in the data; calculate Pearson Correlation Coefficient with and without p-values; create a scatter matrix; inout data must not contain any strings or NaN values; also remove any columns with categorical data or transform them first; remove any text except column labels''' def __init__(self, X_train): if X_train.isnull().any().any() == True: X_train = X_train.dropna(axis=1) pass def calculate_pearson_cc(X_train): '''This functions calculates a simple statistics of Pearson correlation coefficient''' attr = list(X_train) datestring = datetime.strftime(datetime.now(), '%Y%m%d_%H%M') for a in attr: corr_X_train = X_train.corr() with open(os.path.join(METRIX_PATH, 'linear_PearsonCC_values_'+datestring+'.txt'), 'a') as text_file: corr_X_train[a].sort_values(ascending=False).to_csv(text_file) text_file.close() #calculate_pearson_cc(metrix) def print_scatter_matrix(X_train): '''A function to create a scatter matrix of the data''' datestring = datetime.strftime(datetime.now(), '%Y%m%d_%H%M') columns = [X_train.columns] for c in columns: if X_train.isnull().any().any() == True: X_train = X_train.dropna(axis=1) attr = list(X_train) scatter_matrix(X_train[attr], figsize=(25,20)) plt.savefig(os.path.join(METRIX_PATH, 'linear_PearsonCC_scattermatrix'+datestring+'.png')) #print_scatter_matrix(metrix) def corrcoef_loop(X_train): attr = list(X_train) rows = len(attr) r = np.ones(shape=(rows, rows)) p = np.ones(shape=(rows, rows)) for i in range(rows): for j in range(i+1, rows): c1 = X_train[attr[i]] c2 = X_train[attr[j]] r_, p_ = pearsonr(c1, c2) r[i, j] = r[j, i] = r_ p[i, j] = p[j, i] = p_ return r, p #r,p = corrcoef_loop(metrix_num) def write_corr(r, p, X_train): datestring = datetime.strftime(datetime.now(), '%Y%m%d_%H%M') with open(os.path.join(METRIX_PATH, 'linear_corr_pvalues_X_database_train_work' +datestring+'.csv'), 'a') as csv_file: attr = list(X_train) rows = len(attr) for i in range(rows): for j in range(i+1, rows): csv_file.write('%s, %s, %f, %f\n' %(attr[i], attr[j], r[i,j], p[i,j])) csv_file.close() #write_corr(r,p, metrix_num) #calculate_pearson_cc(metrix_num) #print_scatter_matrix(metrix_num) #r,p = corrcoef_loop(metrix_num) #write_corr(r,p, metrix_num) #CorrelCoeffAnalysis(metrix)
def _decorate_namespace_function(bases: List[type], namespace: MutableMapping[str, Any], key: str) -> None: value = namespace[key] assert inspect.isfunction(value) or isinstance(value, (staticmethod, classmethod)) if inspect.isfunction(value): func = value elif isinstance(value, (staticmethod, classmethod)): func = value.__func__ else: raise NotImplementedError("Unexpected value for a function: {}".format(value)) preconditions = [] snapshots = [] postconditions = [] contract_checker = icontract._checkers.find_checker(func=func) if contract_checker is not None: preconditions = contract_checker.__preconditions__ snapshots = contract_checker.__postcondition_snapshots__ postconditions = contract_checker.__postconditions__ Preconditions and postconditions of __init__ of base classes are deliberately ignored (and not collapsed) since initialization is an operation specific to the concrete class and does not relate to the class hierarchy. if key not in ['__init__']: base_preconditions = [] base_snapshots = [] base_postconditions = [] bases_have_func = False for base in bases: if hasattr(base, key): bases_have_func = True Check if there is a checker function in the base class base_func = getattr(base, key) base_contract_checker = icontract._checkers.find_checker(func=base_func) Ignore functions which don't have preconditions or postconditions if base_contract_checker is not None: base_preconditions.extend(base_contract_checker.__preconditions__) base_snapshots.extend(base_contract_checker.__postcondition_snapshots__) base_postconditions.extend(base_contract_checker.__postconditions__) Collapse preconditions and postconditions from the bases with the the function's own ones preconditions = _collapse_preconditions( base_preconditions=base_preconditions, bases_have_func=bases_have_func, preconditions=preconditions, func=func) snapshots = _collapse_snapshots(base_snapshots=base_snapshots, snapshots=snapshots) postconditions = _collapse_postconditions( base_postconditions=base_postconditions, postconditions=postconditions) if preconditions or postconditions: if contract_checker is None: contract_checker = icontract._checkers.decorate_with_checker(func=func) Replace the function with the function decorated with contract checks if inspect.isfunction(value): namespace[key] = contract_checker elif isinstance(value, staticmethod): namespace[key] = staticmethod(contract_checker) elif isinstance(value, classmethod): namespace[key] = classmethod(contract_checker) else: raise NotImplementedError("Unexpected value for a function: {}".format(value)) Override the preconditions and postconditions contract_checker.__preconditions__ = preconditions contract_checker.__postcondition_snapshots__ = snapshots contract_checker.__postconditions__ = postconditions
Neuroprotective effects of resveratrol and epigallocatechin gallate polyphenols are mediated by the activation of protein kinase C gamma Polyphenols such as epigallocatechin gallate (EGCG) and resveratrol have received a great deal of attention because they may contribute to the purported neuroprotective action of the regular consumption of green tea and red wine. Many studies, including those published by our group, suggest that this protective action includes their abilities to prevent the neurotoxic effects of beta-amyloid, a protein whose accumulation likely plays a pivotal role in Alzheimer's disease. Moreover, the scavenging activities of polyphenols on reactive oxygen species and their inhibitory action of cyclooxygenase likely explain, at least in part, their antioxidant and anti-inflammatory activities. Besides these well-documented properties, the modulatory action of these polyphenols on intracellular signaling pathways related to cell death/survival (e.g., protein kinase C, PKC) has yet to be investigated in detail. Using rat hippocampal neuronal cells, we aimed to investigate here the effects of EGCG and resveratrol on cell death induced by GF 109203X, a selective inhibitor of PKC. The MTT/resazurin and spectrin assays indicated that EGCG and resveratrol protected against GF 109203X-induced cell death and cytoskeleton degeneration, with a maximal effect at 1 and 3 M, respectively. Moreover, immunofluorescence data revealed that cells treated with these polyphenols increased PKC gamma () activation and promoted neuronal interconnections. Finally, we found that the protective effects of both polyphenols on the cytoskeleton and synaptic plasticity were mediated by the PKC subunit. Taken together, the results suggest that PKC, and more specifically its subunit, plays a critical role in the protective action of EGCG and resveratrol on neuronal integrity. INTRODUCTION It is well established that the regular consumption of fruit, vegetables, and beverages such as green tea and red wine (in moderation) reduces the risk of developing age-related neurological disorders such as Alzheimer's disease (AD) (;;;). Polyphenols present in high amounts in fruit, vegetables, tea, and red wine likely contribute to their beneficial effects.In support of this hypothesis, two follow-up studies reported that regular consumption of polyphenols was inversely correlated with the risk of dementia and cognitive decline (;). Moreover, in vitro and animal studies reported that epigallocatechin gallate (EGCG), the most abundant polyphenol present in green tea, and resveratrol, a stilbene enriched in red wine, exerts neuroprotective actions against the toxicity induced by -amyloid (A) (;;;;;;), a protein whose accumulation plays a pivotal role in AD-related cognitive symptoms. The modulation of intracellular effectors has been proposed to explain, at least partly, the effects of polyphenols in neurodegenerative processes. Among other effects, we have shown that protein kinase C (PKC) enzymes are involved in the neuroprotective effect of resveratrol against A-induced neurotoxicity (;), while other groups have suggested that EGCG promotes the release of nonamyloidogenic soluble precursor through a PKC-dependent pathway (). Moreover, Levites et al. have shown that activation of PKC by EGCG is linked to cell survival in Parkinson's disease, suggesting that PKC plays an important role in the neuroprotective action of theses polyphenols. Recently, among the 12 isoforms of PKC, our group has reported that gamma () activity is linked to successful cognitive aging (Menard and Quirion, 2012), while another group found that protein levels of PKC are lower in an AD mouse model (). It is thus hypothesized that the purported cognitive enhancing properties of polyphenols in memory-impaired animals could be due to their stimulatory effects on PKC activity. Accordingly, we investigate here the effects of resveratrol and EGCG on PKC activation in hippocampal neuronal cells exposed to a broad spectrum inhibitor of PKC known as dihydrochloride3-{1--1H-indol-3yl}-4-(1H-indol-3-yl)-1Hpyrrole-2,5-dione (GF 109203X). Both compounds prevent GF 109203X-induced neuronal death and the disruption of cytoskeleton organization. Interestingly, resveratrol and EGCG increase not only PKC (Thr674) phosphorylation, but also the expression of the kinase, suggesting an active role for this enzyme in neuronal cell survival promoted by these polyphenols. MATERIAL Materials used for cell cultures were obtained from Invitrogen-Gibco BRL (Burlington, Ontario, Canada). Resveratrol, EGCG and other chemicals were purchased from Sigma Chemical Co. (Oakville, Ontario, Canada). All drugs were freshly prepared on the day of the experiment in a final concentration of either ethanol or DMSO not exceeding 0.01%. These solvents at 0.01% (v/v) have no effect by themselves on cell survival (data not shown). NEURONAL HIPPOCAMPAL CELL CULTURES Enriched rat hippocampal cell cultures were prepared from E19 fetuses obtained from Sprague-Dawley rats (Charles River Canada, St-Constant, Quebec, Canada) as described previously (). Animal care complied with protocols and guidelines of the McGill University Animal Care Committee and the Canadian Council for Animal Care. Hippocampal cells were plated at day 0 at a density of approximately 12 10 4 viable cells per well in 96-well plates. In brief, hippocampal neuronal cells were grown in Dulbecco's modified Eagles medium (D-MEM) high glucose supplemented with 20 mM KCl, 15 mM HEPES and 1% (v/v) serum-free growth medium N2 (final composition: 5 g/ml insulin, 100 M putrescine, 20 nM progesterone, 1.0 g/ml transferrin, 30 nM selenium), and maintained at 37 C in a 95% air/5% CO 2 humidified atmosphere. Medium was removed at day 3 and replaced with the same medium until the day of experiment (day 6). GF 109203X-INDUCED TOXICITY is a potent and selective inhibitor of PKC () that has been shown to produce neuronal hippocampal cell death (). Briefly, cells were incubated in HEPESbuffered DMEM high-glucose medium and co-treated with GF 109203X (5 M) and either EGCG (1-10 M) or resveratrol (1-10 M). After a 24 h incubation period, cell viability was determined using the MTT and resazurin colorimetric assays (see below). ASSESSMENT OF NEURONAL SURVIVAL Neuronal survival was estimated using MTT , a dye that measures the mitochondrial activity of living cells (;). Cell survival was measured in parallel with resazurin, a widely used indicator of cell viability in mammalian cell cultures (). The resazurin assay is based on the ability of viable, metabolically active cells to reduce resazurin to resorufin and dihydro-resorufin. Toxic insults that impair cell viability affect the capacity to reduce resazurin, and the rate of dye reduction is directly proportional to the number of viable cells present (Vega-Avila and Pugsley, 2011). Cell survival estimated by the MTT and resazurin assays was spectrophotometrically determined at 570 nm. Regarding resazurin assay, background optical density (OD) at 600 nm was subtracted from OD at 570 nm for optimal result. Colorimetric assays were performed using a micro-plate reader (Bio-Tek Instruments® Inc., Ville St-Laurent, Quebec, Canada). IMMUNOFLUORESCENCE On day 0, hippocampal neurons were plated on poly-d-lysine (25 g/mL)-coated 12 mm glass coverslips (Fisher, Nepean, On, Canada) placed in multiwell plates and grown in the same medium as described above. On day 3, the medium was removed, hippocampal cells were washed in PBS (pH 7.4) for 5 min, then fixed in 4% paraformaldehyde. After several PBS washes, cells were permeabilized with 0.2% Tween 20 in PBS for 10 min at room temperature, then processed for immunofluorescence labeling. In brief, sections were first incubated in 10% normal goat serum diluted in 0.1 M PBS with 0.05% Tween 20 (PBST) and 1% BSA for 60 min at room temperature, followed by overnight incubation with primary antibodies at 4 C in a solution of 1% serum and 1% BSA in 0.1 M PBST. The anti-rabbit PKC (Thr674) and PKC antibodies were purchased from Abcam (Cambridge, MA, USA) and used at 1/100 dilution. To reveal the cytoskeleton structure, a spectrin antibody (1/250 dilution, produced in mouse) was purchased from Cell Signaling (Danvers, MA, USA). After 3 washes in PBS, sections were incubated with corresponding secondary antibodies (1:500, Invitrogen, Carlsbad, CA, USA) conjugated with Alexa Fluor 488 or Alexa Fluor 568 in 1% BSA in PBST for 2 h at room temperature in the dark. Sections were washed three times with PBS for 5 min each in the dark. Nuclei were stained with Hoechst solution (2 g/ml, Invitrogen, Carlsbad, CA, USA) for 5 min and subsequently the sections were washed and coverslipped with Fluoromount-G (Southern Biotech, Birmingham, AL, USA). Pictures were taken at 40x magnification with an Axio Observer microscope with Apotome (Carl Zeiss MicroImaging GmbH, Germany). STATISTICAL ANALYSES OD values reflecting MTT and resazurin reduction were proportional to the number of viable cells. The OD of the control group (vehicle alone) was regarded as 100%. The rate of surviving cells treated with various drugs was expressed as a percentage of control groups. Statistical analysis was performed using One-Way ANOVA followed by a Dunnett's multiple comparison test, with p < 0.05 being considered statistically significant. EFFECTS OF RESVERATROL AND EGCG AGAINST TOXICITY INDUCED BY GF 109203X As described previously () 30% hippocampal neuronal cell death, as monitored using MTT and resazurin colorimetric assays (Figures 1A,B). Cell death was strongly reduced, in a concentration-dependent manner, in the presence of resveratrol with maximal effect obtained at 3 M ( Figures 1A). The effect of resveratrol was shared by EGCG, which offered maximal and almost complete protection at 1 M, as estimated by both colorimetric assays ( Figures 1B). Moreover, 24 h exposure to either resveratrol or EGCG in the initial medium (i.e., without GF 109203X) exerted a protective and maximal effect per se at 1-3 M (MTT and resazurin), and higher concentrations tended to be less effective (Figures 1A,B). FIGURE 1 | Resveratrol (R) and epigallocatechin gallate (E) increase hippocampal cell survival, whether exposed or not to a PKC inhibitor. (A) Cell survival is significantly enhanced by resveratrol treatment in comparison with the vehicle alone, with a maximal effect at 3 M, as assessed by MTT and resazurin assays. The selective PKC inhibitor GF 109230X (5 M) induces significant cell death that is rescued by co-treatment with resveratrol, these effects being maximal at 3 M. (B) Similarly, cell survival is increased by EGCG treatment alone, with a maximal effect at 3 M. Cell death produced by GF 109230X (5 M) can be attenuated by EGCG, with a maximal effect at 1 M. Data represent mean ± SEM from three (resazurin assay) to four (MTT assay) separate cultures and are expressed as percentages of the vehicle alone. Values were compared to the vehicle or GF 109203X alone for statistical analysis, * p < 0.05, * * p < 0.01. POLYPHENOLS ACTIVATE PKC ENZYME, INCREASE NEURONAL INTERCONNECTIONS AND PREVENT CYTOSKELETON DEGENERATION Neuroprotective effects have been associated with PKC activation and signaling () but have not yet been explored for polyphenols. Using co-immunofluorescence, we evaluated the effects of resveratrol and EGCG treatments on PKC activation and cell morphology. Indeed, PKC interact with proteins associated with neurite elongation, formation and maintenance of synaptic contacts (). As shown in Figure 2A, resveratrol (3 M) increased both PKC (Thr674) phosphorylation and expression in hippocampal cultured cells. Moreover, cells treated with this polyphenol showed higher interconnections, as revealed by spectrin staining and indicated by arrows (Figure 2A). On the other hand, cells exposed to GF 109203X were characterized by altered synaptic connexions and cytoskeleton degeneration (Figure 2B). Few cells showed PKC activation, suggesting a compensatory mechanism to reduce cell death. PKC was phosphorylated on the Thr674 residue in multiple hippocampal cells treated with resveratrol following PKC inhibition ( Figure 2B). Like resveratrol, EGCG (3 M) alone seemed to promote neuronal interconnections and clearly increased PKC phosphorylation ( Figure 3A). PKC enzymes were seen most prominently around the nuclei of cells treated with EGCG ( Figure 3A), while it was evenly distributed in the cytoplasm after resveratrol application (Figure 2A). EGCG strongly increased PKC activity in GF109203X-treated cells and prevented cytoskeleton degeneration ( Figure 3B). DISCUSSION In this study, EGCG and resveratrol, two active ingredients found in tea and wine respectively, were shown to, concentration (low M)-dependently, protect against GF109203X-induced toxicity in cultured hippocampal neurons. These findings confirm and extend previous studies suggesting that the neuroprotective actions of resveratrol and EGCG involve the modulation of kinases such as PKC and cell death mediators (;;Bastianetto and Quirion, 2010;;). Earlier, our group showed that resveratrol can reduce PKC phosphorylation in cultured hippocampal neuronal cells exposed to A, suggesting that PKC is likely involved in resveratrolmediated protection against A-induced neurotoxicity (). We report here on the potential role of another isoform, PKC, in the neuroprotective effects of resveratrol and EGCG. It is well established that this isoenzyme is involved in synaptic development and neuronal plasticity. Indeed, PKC has been shown to interact with proteins associated with neurite elongation and formation, and the maintenance of synaptic contacts (). Moreover, it has been reported that PKC levels decline after ischemic preconditioning (Shamloo and Wieloch, 1999), and a down-regulation of PKC membrane translocation may be involved in a mouse model of hippocampal cell death mediated by oxygen-glucose deprivation (). Finally, insulin-mediated inhibition of cortical neuronal necrosis following hypoxia has been reported to be associated with the translocation of PKC (). disrupted the cellular cytoskeleton, as shown by spectrin immunofluorescence, and activation of PKC by resveratrol prevented this neurodegenerative process. Scale bar is set at 100 m. Pictures are representative of average observations from three separate culture preparations. Both polyphenols increased PKC (Thr674) phosphorylation and its expression in presence of the PKC inhibitor. These effects occurred in the same concentration range as those protecting neuronal cells, suggesting an involvement of this PKC isoform in the neuroprotective action of the polyphenols. This hypothesis is supported by the finding that both polyphenols were able to prevent altered synaptic connexions and cytoskeleton degeneration induced by GF 109203X. Moreover, in the absence of the toxic agent, EGCG and resveratrol per se increased cell survival, accompanied by stimulation of PKC phosphorylation and maintenance of cytoskeleton architecture and neuronal plasticity. The effect of resveratrol on PKC was somewhat surprising, since we previously reported a lack of effects of resveratrol on PKC phosphorylation (). This apparent discrepancy may be explained by the concentrations used in the two studies (20 M vs 3 M in the present study). These findings are of particular interest, since it is known that cytosolic PKC interacts with synapsin, a protein associated with synaptic vesicle release, which also binds with high affinity to actin, an essential component of the architecture of the cytoskeleton (). PKC can regulate cytoskeleton assembly (Rosenberg and Ravid, 2006) and has been reported to be actively involved in glutamate receptor trafficking, suggesting an important role for this kinase in synaptic development and plasticity (Patten and Ali, 2009). N-methyl-d-aspartate (NMDA) receptors are known to control dendritic spine motility, synaptogenesis and synapse stabilization (Gambrill and Barria, 2011). The stimulation of both ionotropic and metabotropic glutamate receptors can activate PKC, thus facilitating intracellular signaling and gene expression associated with learning and memory processes (). Recently, () reported that reduction of the PKC-ERK (extracellular signal-regulated protein kinase) signaling pathway activation was involved in hippocampal neurodegeneration and persistent learning and memory impairments induced by ketamine, a NMDA receptor antagonist. Interestingly, the present results suggest that resveratrol and EGCG can facilitate hippocampal plasticity and interconnections through PKC activation, a process that could be associated with several higher brain functions, and that these polyphenols also prevent the suppression of PKC phosphorylation associated with hippocampal neurodegeneration (). Several missense mutations in the PKC gene have been found in spinocerebellar ataxia type 14 (SCA14), an autosomal dominant neurodegenerative disease ). Mutant PKC kinases act as a dominant negative regulator on wild-type PKC enzymes, disrupting synaptic pruning, plasticity and transmission (). Mutant cytosolic PKCs have a tendency to aggregate, resulting in neuronal cell death (;). Interestingly, Yamamoto et al. reported that stimulation of autophagy provoked by treatment with rapamycin can promote the degradation of mutant PKC enzymes, while normal kinases are not affected. Moreover, aggregate formation and the cytotoxicity induced by mutant PKCs has been reported to be inhibited in SH-SY5Y cells by congo red, a dye known to inhibit amyloid oligomers and fibril formation of misfolded proteins. Various groups, including ours, have shown that EGCG and resveratrol can stimulate autophagy in various types of cells, including macrophages (;;Pallauf and Rimbach, 2013), and prevent the formation of A oligomers and fibrils ((Bastianetto et al.,, 2008), suggesting that polyphenols may be beneficial in the treatment of SCA14 patients. The concentrations of EGCG (165-275 M) and resveratrol (19-34 M) present in tea extracts and red wine (;;Del ;) are much higher than those required to produce their invitro protective effects as seen in the present study. Although polyphenols such as EGCG and resveratrol undergo significant metabolism and conjugation during absorption in humans (;Spencer, 2009;), several animal studies have shown that they are able to cross the blood-brain barrier. For example, peripheral administration of EGCG (50 mg/kg i.p.) (;) and resveratrol (20 mg/kg, i.p.) (;) exerted neuroprotective actions in rodent models of ischemia (;Bastianetto and Quirion, 2010) and transgenic models of AD (;). Moreover, a significant (one-third) portion of administered EGCG was found in the mouse brain after a single administration of the radioligand, suggesting that regular consumption of green tea may enable the brain to maintain a fairly high level of EGCG (). It is therefore likely that regular consumption of tea (black or green) provides sufficient amounts of phenolic compounds to offer neuroprotection. In support of this hypothesis, various epidemiological studies have reported that tea consumption (2 or more cups /day) reduces (from 28 to 60%) the risk of Parkinson's disease (;) and attenuates (up to 43%) the rate of cognitive decline (;), whereas red wine (in moderation) reduces the risk of developing dementia (;;;). The exact mechanisms involved in the activation of PKC remain to be established. It has been shown that PKC is upstream of several signaling pathways, including ERK and the mammalian target of rapamycin (mTOR) (Menard and Quirion, 2012), which are involved in several neurological disorders, including AD (;). Interestingly, it has been reported that resveratrol can facilitate cell survival in the ischemic heart by modulating ERK signaling () and decreasing the volume of infarcts in rats (). It is also known that serum deprivation reduces intercellular communication that can be attenuated by EGCG through ERK activation in endothelial cells (). In contrast, EGCG restores A-induced cognitive impairments through the inhibition of ERK in mice (). Moreover, opposite effects of polyphenols on the mTOR signaling pathway have been reported. While the inhibition of inflammation by resveratrol in microglial cells requires mTOR activation (), polyphenols are generally considered inhibitors of this pathway (). It would thus be worthwhile to explore further the effects of polyphenols on ERK and mTOR signaling following PKC inhibition in neural cells. Taken together, these results highlight a role for PKC in cell survival, maintenance of the cytoskeleton architecture and neuronal plasticity. Interestingly, treatment with polyphenols protects hippocampal neurons against GF 109203X-induced cell death and cytoskeleton degeneration through stimulation of PKC phosphorylation. Thus, regular consumption of green tea and red wine, which are enriched in EGCG and resveratrol respectively, may activate neuroprotective signaling pathways, confirming their relevance in preventing age-related neurological disorders.
<gh_stars>1-10 // This file is made available under Elastic License 2.0. // This file is based on code available under the Apache license here: // https://github.com/apache/incubator-doris/blob/master/be/src/runtime/buffered_tuple_stream2.inline.h // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. #ifndef STARROCKS_BE_SRC_RUNTIME_BUFFERED_TUPLE_STREAM2_INLINE_H #define STARROCKS_BE_SRC_RUNTIME_BUFFERED_TUPLE_STREAM2_INLINE_H #include "runtime/buffered_tuple_stream2.h" #include "runtime/descriptors.h" #include "runtime/tuple_row.h" namespace starrocks { inline bool BufferedTupleStream2::add_row(TupleRow* row, Status* status) { DCHECK(!_closed); if (LIKELY(deep_copy(row))) { return true; } bool got_block; int64_t row_size = compute_row_size(row); *status = new_block_for_write(row_size, &got_block); if (!status->ok() || !got_block) { return false; } return deep_copy(row); } inline uint8_t* BufferedTupleStream2::allocate_row(int size, Status* status) { DCHECK(!_closed); if (UNLIKELY(_write_block == nullptr || _write_block->bytes_remaining() < size)) { bool got_block; *status = new_block_for_write(size, &got_block); if (!status->ok() || !got_block) { return nullptr; } } DCHECK(_write_block != nullptr); DCHECK(_write_block->is_pinned()); DCHECK_GE(_write_block->bytes_remaining(), size); ++_num_rows; _write_block->add_row(); return _write_block->allocate<uint8_t>(size); } inline void BufferedTupleStream2::get_tuple_row(const RowIdx& idx, TupleRow* row) const { DCHECK(row != nullptr); DCHECK(!_closed); DCHECK(is_pinned()); DCHECK(!_delete_on_read); DCHECK_EQ(_blocks.size(), _block_start_idx.size()); DCHECK_LT(idx.block(), _blocks.size()); uint8_t* data = _block_start_idx[idx.block()] + idx.offset(); if (_nullable_tuple) { // Stitch together the tuples from the block and the NULL ones. const int tuples_per_row = _desc.tuple_descriptors().size(); uint32_t tuple_idx = idx.idx() * tuples_per_row; for (int i = 0; i < tuples_per_row; ++i) { const uint8_t* null_word = _block_start_idx[idx.block()] + (tuple_idx >> 3); const uint32_t null_pos = tuple_idx & 7; const bool is_not_null = ((*null_word & (1 << (7 - null_pos))) == 0); row->set_tuple(i, reinterpret_cast<Tuple*>(reinterpret_cast<uint64_t>(data) * is_not_null)); data += _desc.tuple_descriptors()[i]->byte_size() * is_not_null; ++tuple_idx; } } else { for (int i = 0; i < _desc.tuple_descriptors().size(); ++i) { row->set_tuple(i, reinterpret_cast<Tuple*>(data)); data += _desc.tuple_descriptors()[i]->byte_size(); } } } } // namespace starrocks #endif // STARROCKS_BE_SRC_RUNTIME_BUFFERED_TUPLE_STREAM2_INLINE_H
<filename>module_2.py # Модуль 2 def f2(a, b): return a * b def f3(a, b): return a - b
An intelligent assistant for navigation of visually impaired people This paper presents the navigation methodology employed by an intelligent assistant (agent) for people with disabilities. In particular, the intelligent assistant, called Tyflos, would help a visually impaired user to be partially independent and able to walk and work in a 3D dynamic environment. The Tyflos system carries two vision cameras and captures images from the surrounding 3D environment, either by the user's command or in a continuous mode (video), then it converts these images into verbal descriptions for each image into a verbal communication with the user. In other words the system plays the role of human assistant, who describes to the user the 3D visual environment.
State estimation methods applied to transformer monitoring State estimation methods are valuable for monitoring complex systems with not directly measurable states. One case in point is the monitoring of power transformers. The thermal condition of the transformer is very crucial in determining the life expectancy of the transformer, yet the hot spot temperature of the transformer cannot be directly measured. Other events such as inter-coil discharges cannot be directly measured unless they develop into a power fault. This paper describes the application of state estimation methods in a transformer diagnostic system. This system consists of hardware and software that continuously monitor the transformer electro-thermal states. The transformer states are obtained from redundant measurements of transformer terminal voltages, currents, tank temperature, oil temperature and ambient temperature. This data are fitted into the electro-thermal model of the transformer via state estimation methods that provide the full range of the transformer electro-thermal states. The paper describes the electrothermal model, the unique features of the data acquisition system and focuses on the application of the state estimation methods to derive important transformer quantities such as: (a) loss of life; and (b) transformer coil integrity. The system has been implemented on a trial basis on four Entergy System transformers. In the present implementation, the minimum input data requirements are: phase currents and voltages at both ends of the transformer (a total of twelve); top of oil and bottom of oil temperatures; and load tap changer position. Actual data and the performance of the state estimation methods are presented.
Shibusawa Eiichi Shibusawa Eiichi, 1st Viscount Shibusawa (渋沢 栄一, March 16, 1840 – November 11, 1931) was a Japanese industrialist widely known today as the "father of Japanese capitalism". He spearheaded the introduction of Western capitalism to Japan after the Meiji Restoration. He introduced many economic reforms including use of double-entry accounting, joint-stock corporations and modern note-issuing banks. He founded the first modern bank based on joint stock ownership in Japan. The bank was aptly named The First National Bank (Dai Ichi Kokuritsu Ginkō, now merged into Mizuho Bank) and had the power to issue its own notes. Through this bank, he founded hundreds of other joint stock corporations in Japan. Many of these companies still survive to this day as quoted companies in the Tokyo Stock Exchange, which Shibusawa also founded. The Japanese Chamber of Commerce and Industry was founded by him as well. He was also involved in the foundation of many hospitals, schools, universities (including the first women's university), the Imperial Hotel in Tokyo and charitable organizations including the Japan Red Cross. Another notable aspect of Shibusawa's career is that, despite being the founder of hundreds of corporations, he refused to maintain a controlling stake in these corporations, effectively preventing himself from forming a zaibatsu. What is known as the Shibusawa zaibatsu was a holding company to look after his estate for his family. The Shibusawa Zaibatsu did not hold any controlling stake in any companies. Despite his lowly origin as a farmer, he was granted the title of Viscount, while all other zaibatsu founders were awarded the title of Baron. He was also awarded Shōnii, Second Honour under the ritsuryō rank system, which is usually given to high-ranking nobility and prime ministers. On April 9, 2019, it was announced that Eiichi would be the historical figure featured on Japanese ¥10000 banknotes expected to enter circulation around 2024. Life Shibusawa was born on March 16, 1840 in a farmhouse in Chiaraijima (located in the present-day city of Fukaya in Saitama Prefecture). As a boy, he learned reading and writing from his father. He grew up helping with the family business of dry field farming, indigo production and sale, and silk raising and later studied the Confucian classics and the history of Japan under Odaka Junchu, a scholar who was his cousin. Under the influence of sonnō jōi (expel the barbarians; revere the emperor) sentiment, he formulated a plan along with cousins and friends to capture Takasaki Castle and set fires in the foreign settlement in Yokohama. Ultimately, however, this plan was canceled and he moved on to Kyoto. Shibusawa left his hometown at the age of twenty-three, and entered the service of Hitotsubashi Yoshinobu (then in line for the position of shōgun). He distinguished himself by his work in strengthening the household finances of the Hitotsubashi family. When he was twenty-seven years old, he visited France and other European countries as a member of Tokugawa Akitake's delegation to the Exposition Universelle (1867). On this trip Shibusawa observed modern European societies and cultures for the first time, and realized the importance of industrial and economic development. After returning from Europe at the news of the change of governments now known as the Meiji Restoration, he established the Shōhō Kaishō, one of the first joint-stock companies in Japan, in Shizuoka Prefecture. Afterwards, he was invited by the Meiji government to become a member of the Ministry of Finance, where he became a driving force in the building of a modern Japan as head of the Kaisei Kakari, or office of the Ministry of Finance in charge of reform. In 1873 Shibusawa resigned from the Ministry of Finance and became the president of the Dai-ichi Bank (First National Bank). This was Japan's first modern bank, established under his own guidance while still employed by the Ministry of Finance. With this bank as a base, Shibusawa devoted himself to founding and encouraging businesses of all sorts. Shibusawa was an advocate throughout his life of the idea that good ethics and business should be in harmony. The number of enterprises in which he was involved as founder or supporter is said to exceed five hundred, and includes Mizuho Financial Group, The 77 Bank, Tokio Marine Nichido, Imperial Hotel, Tokyo Stock Exchange, Tokyo Gas, Toyobo, Tokyu Corporation, Keihan Electric Railway, Taiheiyo Cement, Oji Paper Company, Sapporo Breweries, NYK Line, and the Gyeongin Railway and the Gyeongbu Railway in Korea. He was president of the Tokyo Chamber of Commerce. Moreover, he spearheaded many works for the betterment of society, and was an enthusiastic supporter of education, especially higher education in the field of business such as current Hitotsubashi University and current Tokyo Keizai University, higher education for women, and private schools. Shibusawa involved himself in some 600 projects related to education, social welfare and others. In addition, Shibusawa made efforts to promote the exchange of goods and good will across national boundaries through private-sector diplomacy. In 1902 he visited Germany, France and the United Kingdom. During Shibusawa's 1915 visit to the United States, two former U.S. Presidents Theodore Roosevelt and William Howard Taft honored Shibusawa by attending a diplomatic banquet reception held for Shibusawa in New York City. One of the 1915 photos to the right is linked to this event. Numerous guests from overseas visited the Shibusawa residence in Asukayama, where they talked candidly with him. Shibusawa had served in various capacities for the last shogun of Japan, Yoshinobu. After the Tokugawa shogunate ended, Shibusawa continued as a friend and political ally of Yoshinobu's son Iyesato Tokugawa (also known as Tokugawa Iesato). Together, these two impressive statesmen Eiichi Shibusawa and Iyesato Tokugawa strove to maintain democracy in Japan and promote international goodwill with the United States and with Japan's other allies. In 1917, out of empathy for the suffering resulting from the enormous death and destruction in Europe during World War One, Prince Iyesato Tokugawa and Baron Eiichi Shibusawa representing Japan, published a condolence booklet honoring her fellow Allies. Japan not only militarily supported her democratic allies’ in their war efforts, she also aided the Allies’ sick and wounded during the war. This condolence booklet described the Japanese creating an association that collected a monetary fund that was gifted to Allied nations to help with their health costs. Prince Iyesato Tokugawa was the president of this organization and Baron Eiichi Shibusawa and S. Shimada were its vice-presidents. The 1917 photo illustration to the right shows these three fine statesmen who headed this association. Many of Japan’s top leaders contributed articles to this booklet expressing their support of the Allies. This booklet was published in a French and English edition. The booklet was titled: Japan to her Allies: A Message of Practical Sympathy from the Japan Association for Aiding the Sick and Wounded Soldiers and Others Suffering from the War in the Allied Countries. Published in Tokyo, Japan, 1917. The illustrated biography titled The Art of Peace by Stan S. Katz highlights the alliance between Prince Iyesato Tokugawa and Baron Eiichi Shibusawa as they promoted democracy and international stability and goodwill. The 1930 photo to the right shows Prince Tokugawa and Baron Shibusawa attending a diplomatic event honoring U.S. - Japan relations. They were commemorating the first United States Minister to Japan Townsend Harris. Shibusawa died at the age of ninety-one on November 11, 1931. In fiction Shibusawa, along with many other famous historical figures from the Meiji Restoration, is a supporting character in the historical fantasy novel Teito Monogatari by Aramata Hiroshi. In the 1988 adaptation, known in the west as Tokyo: The Last Megalopolis, he is portrayed by renowned Japanese actor Katsu Shintarō. In the animated adaptation his voice is done by Osamu Saka. Shibusawa is highlighted in the historical novel The Emperor and the Spy by Stan S. Katz. Shibusawa is shown assisting the Japanese who were injured during the devastating Great Kanto Earthquake of 1923. The friendship between Baron Shibusawa and Prince Iesato Tokugawa is also presented.
<gh_stars>0 package de.energy.optimax.trading.bot.unit.predictor; import de.energy.optimax.trading.bot.data.BidRound; import de.energy.optimax.trading.bot.service.predictor.impl.AllTheSameBidsPredictor; import org.springframework.beans.factory.annotation.Autowired; import org.testng.Assert; import org.testng.annotations.Test; import java.util.List; public class AllTheSameBidsPredictorTest extends BasePredictorTest<AllTheSameBidsPredictor> { @Autowired public void setPredictor(AllTheSameBidsPredictor predictor) { this.predictor = predictor; } @Override protected List<BidRound> testData() { return List.of( new BidRound(7, 8), new BidRound(6, 8), new BidRound(10, 7), new BidRound(11, 8), new BidRound(12, 9) ); } @Test(testName = "Check AllTheSameBidsPredictor predict()") public void checkPrediction() { var predictedValue = predictor.predict(); Assert.assertTrue(predictedValue.isPresent()); Assert.assertEquals((int) predictedValue.get(), 9); } }
The minimalist pair of blue USB 3 ports seen on current motherboards could soon expand to a block of four ports, thanks to VIA's new VL800 controller chip. The tiny square of silicon is the first USB 3 host controller to support four downstream ports, which gives it an immediate advantage over other popular controllers that only support two ports, such as NEC's uPD720200. VIA says the chip can be used in a variety of implementations, including on-board integration onto motherboards for laptops, desktops and servers. However, the Taiwanese chip specialist says the chip is also equally at home on a separate PCI-E controller card, or an ExpressCard adaptor for laptops. The company plans to demonstrate the VL800 on a desktop PCI-E controller card at Computex next week, showing how four ports can be supported by a single-lane PCI-E slot. VIA says the chip is fully compliant with Universal Serial Bus 3.0 specification, revision 1.0 for data transfer speeds of up to 5Gb/sec. and notes that the ports will also be backwardly-compatible with Legacy USB devices. The chip also features upgradeable firmware, which can be integrated into a motherboard's BIOS if need be. VIA Labs' associate vice president, David Hsu, claimed the VL 800, "is an easy and cost-effective way for motherboard manufacturers to bring additional USB 3.0 performance to their product lines. It means increased design opportunities for system integrators, and of course it means consumers can use more of their USB 3.0 devices at the same time,” he said. There's no word on Mac-compatibility yet, but VIA says its initial drivers for the chip already support Windows 7, Vista and XP, as well as various Linux kernels.
Measuring substantial reductions in functioning in patients with chronic fatigue syndrome Purpose.All the major current case definitions for chronic fatigue syndrome (CFS) specify substantial reductions in previous levels of occupational, educational, social, or personal activities to meet criteria. Difficulties have been encountered in operationalizing substantial reductions. For example, the Medical Outcomes Study Short Form-36 Health Survey (SF-36) has been used to determine whether individuals met the CFS disability criterion. However, previous methods of using the SF-36 have been prone to including people without substantial reductions in key areas of physical functioning when diagnosing CFS. This study sought to empirically identify the most appropriate SF-36 subscales for measuring substantial reductions in patients with CFS. Method.The SF-36 was administered to two samples of patients with CFS: one recruited from tertiary care and the other a community-based sample; as well as a non-fatigued control group. Receiver operating characteristics were used to determine the optimal cutoff scores for identifying patients with CFS. Results.The SF-36 Role-Emotional subscale had the worst sensitivity and specificity, whereas the Vitality, Role-Physical, and Social Functioning subscales had the best sensitivity and specificity. Conclusion.Based on the evidence from this study, the potential criteria for defining substantial reductions in functioning and diagnosing CFS is provided.
/** * @author wangzhichao * @since 2021/3/2 */ public class YourTypeToken<T> { private final Type type; protected YourTypeToken() { Type superClass = getClass().getGenericSuperclass(); if (superClass instanceof Class) { throw new IllegalArgumentException("not a parameterized type"); } ParameterizedType parameterizedType = (ParameterizedType) superClass; type = parameterizedType.getActualTypeArguments()[0]; } public Type getType() { return type; } }
Self-made texture and clustering based road recognition for UGV Three hierarchical algorithms are proposed to get the passable driving road detection for unmanned ground vehicle (UGV). The innovation of this paper is the self-made directional texture which will be produced if the inverse homography transform is exerted on the image. This self-made texture is firstly used to remove the image corresponding to the objects above road. In order to avoid the influence of other color object, the k-means clustering is used to get the seed for region growing. Finally, the directional texture is secondly used to judge whether the image holes after region growing are the road or not. The final experimental results show the proposed algorithm can remove the non-road objects, can and fill the stained color region and can get the rational driving road.
<gh_stars>0 package org.knowm.xchange.cryptsy.service.polling; import java.io.IOException; import java.math.BigDecimal; import org.knowm.xchange.Exchange; import org.knowm.xchange.cryptsy.CryptsyAdapters; import org.knowm.xchange.currency.Currency; import org.knowm.xchange.dto.account.AccountInfo; import org.knowm.xchange.exceptions.ExchangeException; import org.knowm.xchange.service.polling.account.PollingAccountService; /** * @author ObsessiveOrange */ public class CryptsyAccountService extends CryptsyAccountServiceRaw implements PollingAccountService { /** * Constructor * * @param exchange */ public CryptsyAccountService(Exchange exchange) { super(exchange); } @Override public AccountInfo getAccountInfo() throws IOException, ExchangeException { return new AccountInfo(CryptsyAdapters.adaptWallet(getCryptsyAccountInfo())); } @Override public String withdrawFunds(Currency currency, BigDecimal amount, String address) throws IOException, ExchangeException { return makeCryptsyWithdrawal(address, amount).getReturnValue(); } @Override public String requestDepositAddress(Currency currency, String... args) throws IOException, ExchangeException { return getCurrentCryptsyDepositAddresses().getReturnValue().get(currency); // return generateNewCryptsyDepositAddress(null, currency).getReturnValue().getAddress(); } }
Preparation of gelatin-N-vinylpyrrolidone graft copolymer The graft copolymerization of N-vinylpyrrolidone (VP) onto gelatin was carried out by the following four different initiator systems: AIBN, K 2 S 2 O 8, H 2 O 2 -Fe 2+, and Ce 4+ - HN0 3. The last one caused the monomer to lose the double-bond and polymerization ability due to the hydrolysis of the monomer. Using,-azobisisobutyronitrile as an initiator, the graft copolymerization of gelatin and N-vinylpyrrolidone in aqueous medium was studied systematically. The relationships between the rate of grafting and the concentration of initiator, monomer, and gelatin were established experimentally. Meanwhile, the rate equation was also derived from the proposed reaction mechanism, and it was similar to the equation previously obtained experimentally. The apparent activation energies for homopolymerization (E h ), graft copolymerization (E g ), and over all polymerization (E p ) were calculated. The graft efficiency and molecular weight of the grafted PVP were measured by hydrolyzing the backbone with hydrochloric acid. The graft copolymers Gel-g-PVP were added into the coating films, and the physical properties of the films, such as hardening ability, dimensional stability, and wetting property were investigated.
Online Measurement Based Power System Reduced Order Model Generation and Validation In this paper, a new generalized algorithm is presented, which identifies subspace from power system measurement data in a recursive manner, to identify oscillatory modes and corresponding system model. Compared to a generalized framework presented in the literature, the paper introduces an algorithm which solves the generalized framework recursively to reduce the computation time, suitable for the online oscillation monitoring tool. Moreover, the proposed algorithm can identify the subspace in a predefined state coordinate system, which enables to identify the physical system states, which in turn can help in oscillation source localization. The proof of concept is tested on three machine nine bus system, and the efficacy of the proposed method is evaluated in Kundur two-area test system.
async def async_added_to_hass(self) -> None: self.react.log.debug(f"Registry: '{self.entity_id}' added to registry") await super().async_added_to_hass() self.workflow_state = WorkflowState(self) self.workflow_runtime = WorkflowRuntime(self.react, self.workflow_state, self.workflow) self.workflow_runtime.on_update(self.async_write_ha_state) if state := await self.async_get_last_state(): enable_workflow = state.state == STATE_ON last_triggered = state.attributes.get("last_triggered") if last_triggered is not None: self.workflow_runtime.last_triggered = parse_datetime(last_triggered) self.react.log.debug(f"Registry: '{self.entity_id}' setting state: {format_data(last_state=enable_workflow, enabled=state.state)}") else: enable_workflow = DEFAULT_INITIAL_STATE self.react.log.debug(f"Registry: '{self.entity_id}' setting state (no last state found): {format_data(enabled=enable_workflow)}") if enable_workflow: await self.async_enable()
<reponame>cellvinchung/mailgo // webpack > dist/mailgo.nocss.min.js import mailgo from "../src/mailgo"; // call init mailgo attached to the event DOMContentLoaded const mailgoConfig = { initEvent: "DOMContentLoaded", loadCSS: false, }; mailgo(mailgoConfig);
<filename>src/main/java/org/contentmine/graphics/svg/misc/Penrose.java package org.contentmine.graphics.svg.misc; import java.io.File; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.contentmine.eucl.euclid.Angle; import org.contentmine.eucl.euclid.Real2; import org.contentmine.eucl.euclid.Real2Array; import org.contentmine.eucl.euclid.Transform2; import org.contentmine.graphics.AbstractCMElement; import org.contentmine.graphics.svg.SVGCircle; import org.contentmine.graphics.svg.SVGElement; import org.contentmine.graphics.svg.SVGG; import org.contentmine.graphics.svg.SVGLine; import org.contentmine.graphics.svg.SVGPath; import org.contentmine.graphics.svg.SVGSVG; import org.contentmine.graphics.svg.path.MovePrimitive; import org.contentmine.graphics.svg.path.PathPrimitiveList; import org.contentmine.graphics.svg.path.QuadPrimitive; public class Penrose { private static final Logger LOG = Logger.getLogger(Penrose.class); static { LOG.setLevel(Level.DEBUG); } public final static Double SCALE = 10.0; public final static Double TWOPI5 = 2 * Math.PI / 5.0; public final static Double PHI = (1.0 + Math.sqrt(5.0)) / 2.0; public final static Double PI4 = Math.PI / 4.0; public final static Double PI5 = Math.PI / 5.0; public final static Double JIG = PI5; public final static Real2 OFFSET = new Real2(200.0, 200.0); public final static Double L1 = 4.0 * SCALE; public final static Real2 VECT1 = new Real2(L1, 0.0); public final static Double L2 = 2.0 * SCALE; public final static Double L2Y = 0.7 * L2; public final static Real2 VECT2 = new Real2(L2, 0.0); public final static Real2 VECT2A = new Real2(-1.0 * L2, 1.0 * L2Y); public final static Real2 VECT2B = new Real2(-1.5 * L2, -1.0 * L2Y); public final static Double L3 = 7.0 * SCALE; public final static Real2 VECT3 = new Real2(L3, 0.0); public final static Double L4 = 14.0 * SCALE; public final static Real2 VECT4 = new Real2(L4, 0.0); private Real2 currentPoint; public static void main(String[] args) { Penrose penrose = new Penrose(); SVGG g; Angle angle = new Angle(0.0); g = penrose.drawKite(OFFSET, angle); SVGSVG.wrapAndWriteAsSVG(g, new File("target/penrose/kite.svg")); g = penrose.drawKite(OFFSET, new Angle(Math.PI / 2.0)); SVGSVG.wrapAndWriteAsSVG(g, new File("target/penrose/kite2.svg")); g = penrose.drawKite5(OFFSET); SVGSVG.wrapAndWriteAsSVG(g, new File("target/penrose/kite5.svg")); g = penrose.drawDart(OFFSET, angle); SVGSVG.wrapAndWriteAsSVG(g, new File("target/penrose/dart.svg")); g = penrose.drawDart(OFFSET, new Angle(Math.PI / 2.0)); SVGSVG.wrapAndWriteAsSVG(g, new File("target/penrose/dart2.svg")); g = penrose.drawDart5(OFFSET); SVGSVG.wrapAndWriteAsSVG(g, new File("target/penrose/dart5.svg")); } public Penrose() { } public SVGG drawKite(Real2 offset, Angle axisAngle) { Angle a1 = new Angle(1.0 * PI5); Angle a3 = new Angle(3.0 * PI5); int direction = -1; SVGG gg = new SVGG(); // edges gg.appendChild(drawEdge(offset, 1.0 , axisAngle.plus(a1), direction)); gg.appendChild(drawEdge(offset, 1.0 , axisAngle.subtract(a1), direction)); Real2 axisVector = createAxisVector(axisAngle); offset = offset.plus(axisVector.multiplyBy(PHI)); gg.appendChild(new SVGCircle(offset, 4.0)); // small edges gg.appendChild(drawEdge(offset, 1.0 / PHI, axisAngle.plus(a3), direction)); gg.appendChild(drawEdge(offset, 1.0 / PHI, axisAngle.subtract(a3), direction)); return gg; } public SVGG drawDart(Real2 offset, Angle axisAngle) { Angle a3 = new Angle(3.0 * PI5); Angle a4 = new Angle(4.0 * PI5); int direction = 1; SVGG gg = new SVGG(); // small edges gg.appendChild(drawEdge(offset, 1.0 / PHI, axisAngle.plus(a3), direction)); gg.appendChild(drawEdge(offset, 1.0 / PHI, axisAngle.subtract(a3), direction)); Real2 axisVector = createAxisVector(axisAngle); offset = offset.plus(axisVector); // large edges gg.appendChild(drawEdge(offset, 1.0, axisAngle.plus(a4), direction)); gg.appendChild(drawEdge(offset, 1.0, axisAngle.subtract(a4), direction)); return gg; } public SVGG drawKite5(Real2 offset) { SVGG g = new SVGG(); for (int i = 0; i < 5; i++) { Angle angle = new Angle(i * 2.0 * PI5 / 100.); g.appendChild(drawKite(offset, angle)); } return g; } public SVGG drawDart5(Real2 offset) { SVGG g = new SVGG(); for (int i = 0; i < 5; i++) { Angle angle = new Angle(i * 2.0 * PI5 / 100.); g.appendChild(drawDart(offset, angle)); } return g; } private Real2 createAxisVector(Angle axisAngle) { Transform2 rot = new Transform2(axisAngle); Real2Array horizontalEdge = createHorizontalEdge(); Real2 axisVector = horizontalEdge.get(11); axisVector.transformBy(rot); axisVector = axisVector.multiplyBy(1.0 / PHI); return axisVector; } private AbstractCMElement drawEdge(Real2 offset, double scale, Angle angle, int direction) { AbstractCMElement g; Real2Array horizontalEdge = createHorizontalEdge(); if (direction == -1) { horizontalEdge = horizontalEdge.getRotatedAboutMidPoint(); } horizontalEdge.multiplyBy(scale); horizontalEdge = horizontalEdge.plusEquals(offset); horizontalEdge.transformBy(Transform2.getRotationAboutPoint(angle, offset)); g = drawEdge(horizontalEdge); SVGCircle c = new SVGCircle(offset, 3.); c.setFill("red"); g.appendChild(c); return g; } private Real2Array createHorizontalEdge() { Real2 xy1 = new Real2(0.0, 0.0); Real2 xy2 = xy1.plus(VECT1); Real2 xy3 = xy2.plus(VECT2); Real2 xy4 = xy3.plus(VECT2A); Real2 xy5 = xy4.plus(VECT2A); Real2 xy6 = xy5.plus(VECT2); Real2 xy7 = xy6.plus(VECT3); Real2 xy8 = xy7.plus(VECT2); Real2 xy9 = xy8.plus(VECT2B); Real2 xy10 = xy9.plus(VECT2B); Real2 xy11 = xy10.plus(VECT2); Real2 xy12 = xy11.plus(VECT4); return Real2Array.createReal2Array(xy1, xy2, xy3, xy4, xy5, xy6, xy7, xy8, xy9, xy10, xy11, xy12); } private AbstractCMElement drawEdge(Real2Array ra) { AbstractCMElement g = new SVGG(); SVGElement line = createLine(ra.get(0), ra.get(1)); g.appendChild(line); SVGPath path = createQuadPath(ra.get(1), ra.get(2), ra.get(3)); g.appendChild(path); path = createQuadPath(ra.get(3), ra.get(4), ra.get(5)); path.setStroke("blue"); g.appendChild(path); line = createLine(ra.get(5), ra.get(6)); g.appendChild(line); path = createQuadPath(ra.get(6), ra.get(7), ra.get(8)); g.appendChild(path); path = createQuadPath(ra.get(8), ra.get(9), ra.get(10)); path.setStroke("blue"); g.appendChild(path); line = createLine(ra.get(10), ra.get(11)); g.appendChild(line); return g; } private SVGPath createQuadPath(Real2 xy0, Real2 xy1, Real2 xy2) { PathPrimitiveList ppl = new PathPrimitiveList(); Real2Array ra = Real2Array.createReal2Array(xy1, xy2); MovePrimitive move = new MovePrimitive(xy0); ppl.add(move); QuadPrimitive quad = new QuadPrimitive(ra); ppl.add(quad); SVGPath path = new SVGPath(ppl); path.setStroke("red"); path.setStrokeWidth(1.0); path.setFill("none"); return path; } private SVGElement createLine(Real2 xy1, Real2 xy2) { SVGLine line = new SVGLine(xy1, xy2); line.setWidth(0.5); line.setStroke("black"); return line; } }
In a blog post for Foreign Policy magazine, Rosa Brooks, a former Obama administration official, outlined four ways to “get rid” of President Trump, including declaring him mentally unfit for command or carrying out a military coup. Brooks is a Schwartz senior fellow at the New America Foundation, which is funded by billionaire George Soros’s Open Society Foundations. She served from 2009-2011 as Counselor to the Under Secretary of Defense for Policy and served as a senior adviser at Obama’s State Department. Her posting is titled “3 Ways to Get Rid of President Trump Before 2020,” although the piece actually outlines four ways. In what seems to be a deliberate tactic, Brooks repeatedly questions Trump’s mental stability, claiming that the president’s first week in office “has made it all too clear: Yes, he is as crazy as everyone feared.” Brooks, who is not a mental health professional, offered no evidence for her armchair psychological evaluation other than citing policies that she doesn’t like. Remember those optimistic pre-inauguration fantasies? I cherished them, too. You know: “Once he’s president, I’m sure he’ll realize it doesn’t really make sense to withdraw from all those treaties.” “Once he’s president, surely he’ll understand that he needs to stop tweeting out those random insults.” “Once he’s president, he’ll have to put aside that ridiculous campaign braggadocio about building a wall along the Mexican border.” And so on. Nope. In his first week in office, Trump has made it eminently clear that he meant every loopy, appalling word — and then some. Brooks listed four ways to get rid of a “crummy” president. Elect him out of office after his four-year term. “But after such a catastrophic first week, four years seems like a long time to wait,” she wrote. Impeachment. However, she lamented, “impeachments take time: months, if not longer — even with an enthusiastic Congress. And when you have a lunatic controlling the nuclear codes, even a few months seems like a perilously long time to wait.” Utilizing a claim of mental instability to invoke the 25th Amendment of the Constitution, which sets the path for the commander-in-chief’s removal if the “president is unable to discharge the powers and duties of his office.” A military coup. She writes: “The fourth possibility is one that until recently I would have said was unthinkable in the United States of America: a military coup, or at least a refusal by military leaders to obey certain orders.” Regarding her suggested military coup, a creative Brooks proposes preposterous scenarios that she fears Trump might try to play out: What would top U.S. military leaders do if given an order that struck them as not merely ill-advised, but dangerously unhinged? An order that wasn’t along the lines of “Prepare a plan to invade Iraq if Congress authorizes it based on questionable intelligence,” but “Prepare to invade Mexico tomorrow!” or “Start rounding up Muslim Americans and sending them to Guantánamo!” or “I’m going to teach China a lesson — with nukes!” When it comes to invoking the 25th Amendment, Brooks argues for appealing to the “ambitions” of Vice President Mike Pence. That Amendment states: Whenever the Vice President and a majority of either the principal officers of the executive departments or of such other body as Congress may by law provide, transmit to the President pro tempore of the Senate and the Speaker of the House of Representatives their written declaration that the President is unable to discharge the powers and duties of his office, the Vice President shall immediately assume the powers and duties of the office as Acting President. “Surely Pence wants to be president himself one day, right?” Brooks writes. “Pence isn’t exactly a political moderate — he’s been unremittingly hostile to gay rights, he’s a climate change skeptic, etc. — but, unappealing as his politics may be to many Americans, he does not appear to actually be insane. (This is the new threshold for plausibility in American politics: ‘not actually insane.’)” During the 2016 presidential campaign, opponents of Trump similarly attempted to delegitimize his policies by raising questions about his mental health. As I wrote at the time, the template for such attacks may have been set more than five decades ago when such claims were deployed against Senator Barry Goldwater during his 1964 presidential campaign, which was widely considered a threat to the political establishment. That theme has continued into Trump’s first two weeks in office. Earlier this week, U.S. News and World Report ran a story titled, “Temperament Tantrum: Some say President Donald Trump’s personality isn’t just flawed, it’s dangerous.” Apparently violating the so-called Goldwater Rule, established by the American Psychiatric Association after similar attacks against Goldwater, the magazine quoted numerous health care professionals attempting to categorize Trump’s mental stability. The APA’s Goldwater Rule forbids psychiatrists from commenting on someone’s mental status unless they first carry out an examination and the doctor is authorized by the patient to speak to the public. The U.S. News story, for example, quotes John D. Gartner, described as a “practicing psychotherapist who taught psychiatric residents at Johns Hopkins University Medical School” as claiming Trump is “dangerously mentally ill and temperamentally incapable of being president.” The Independent newspaper this week ran a story that also attempted to diagnose Trump. It was titled, “’Malignant narcisissm’: Donald Trump displays classic traits of mental illness, claim psychologists.” The article similarly cited mental health professionals commenting on Trump’s alleged psychological disorder. The Independent article partially drew from a New York Daily News story from this week titled, “President Trump exhibits classic signs of mental illness, including ‘malignant narcissism,’ shrinks say.” “Narcissism impairs his ability to see reality,” Dr. Julie Futrell, a clinical psychologist, told the newspaper while pointing out that she never actually treated Trump. During Goldwater’s candidacy, the campaign to distort the public’s perception of the politician culminated in an infamous 1964 article in Fact Magazine, which surveyed members of the American Psychiatric Association, or APA, on Goldwater’s mental stability, though none of the psychiatrists had personally examined the presidential candidate. The New York Times reported on the Goldwater smear: The survey, highly unscientific even by the standards of the time, was sent to 12,356 psychiatrists, of whom 2,417 responded. The results were published as a special issue: “The Unconscious of a Conservative: A Special Issue on the Mind of Barry Goldwater.” The psychiatrists’ assessment was brutal. Half of the respondents judged Mr. Goldwater psychologically unfit to be president. They used terms like “megalomaniac,” “paranoid,” and “grossly psychotic,” and some even offered specific diagnoses, including schizophrenia and narcissistic personality disorder. Only 27 percent of the respondents said Mr. Goldwater was mentally fit, and 23 percent said they didn’t know enough about him to make a judgment. Aaron Klein is Breitbart’s Jerusalem bureau chief and senior investigative reporter. He is a New York Times bestselling author and hosts the popular weekend talk radio program, “Aaron Klein Investigative Radio.” Follow him on Twitter @AaronKleinShow. Follow him on Facebook. With additional research by Joshua Klein.
AB1145Acute posterior multifocal placoid pigment epitheliopathy: clinical pattern and management of 79 patients Background Acute Posterior Multifocal Placoid Pigment Epitheliopathy (APMPPE) is an uncommon inflammatory disease causing acute-onset chorioretinal bilateral disease. It typically affects the posterior pole of both eyes leading to visual blurring or scotomas. Although it is thought to be benign, APMPPE has been associated with central nervous system (CNS) manifestations: cerebral vasculitis, meningoencephalitis and cerebral vascular disease. Objectives The aim of this study was to define clinical features, systemic manifestations, treatment and outcomes of a review of 79 patients with APPMPE. Methods We retrospectively analysed the epidemiology, potential triggers, prodromes, clinical data, ophthalmological study, extraocular manifestations, treatment and outcomes of 79 patients collected through an extensive review of the literature from the first description of Gass JD up to the present time. Results A total of 79 patients were reviewed (47 male). Mean age at diagnosis was 30 years (with a range of 8 to 58 years old). 27 patients (34.2%) presented with a previous triggering being flu-like illness the most frequent.15 However, the complete serological study was only requested in 28 patients (and the immunological study just in 22) Median time from trigger to overt APPMPE was 9 days. Main clinical symptoms were: decreased visual acuity/blurry vision (100%), headache (51.8%) and photophobia (12.2%). Average decreased visual acuity was 13/20. APPMPE is defined by the presence of multiple white-yellowish plaques in funduscopy, and early hypofluorescent areas with late hyperfluorescence in fluorescein angiography. The fundus was pathological and compatible with APPMPE in all cases (100%), as was fluorescein angiography in those that had been performed. CNS involvement appeared in up to 50.6% (40 patients). The CNS manifestations were divided into language disorders (11 patients), motor deficit,20 sensory deficit20 and other CNS manifestations.23 The mean time from visual deficit to neurological manifestations was approximately 2 weeks. Cerebrospinal fluid was studied in 37 patients, with a predominance of lymphocytic pleocytosis (mean of 46cells/mm3) and elevated proteins (mean of 111mg/dl). Within the neuroimaging studies carried out up to 69.7% were pathological. 67 patients (84.8%) received treatment with corticosteroids. 14 patients (17.7%) also received other immunosuppressants (mainly azathioprine and cyclophosphamide), especially if CNS involvement. Regarding the evolution, 55 patients (69.6%) presented improvement, 12 (15.2%) relapsed and 6 (7.5%) died due to APPMPE. Conclusions APPMPE is a rare inflammatory disease which primarily affects the retina. However, the CNS involvement could be more frequent than what is classically described. Also, it seems that there might be a trigger effect either inflammatory or infectious. Steroids and immunosuppressants should be considered in patients with CNS involvement from the beginning. Reference Case D, Seinfeld J, Kumpe D, Folzenlogen Z, Jones W, Simpson J, et al. Acute posterior multifocal placoid pigment epitheliopathy associated with stroke: a case report and review of the literature. J Stroke Cerebrovasc Dis2015;24:e295-e302. Disclosure of Interest None declared
<reponame>thatmooglie/epilepsy-detection /* Copyright 2018 The MathWorks, Inc. */ #ifndef _MAKECXSPARSEMATRIX_H #define _MAKECXSPARSEMATRIX_H #include "cs.h" #include "rtwtypes.h" #ifdef __cplusplus extern "C" { #endif cs_di* makeCXSparseMatrix(int nnz, int n, int m, const int* colidx, const int* rowidx, const double* x); cs_ci* makeComplexCXSparseMatrix(int nnz, int n, int m, const int* colidx, const int* rowidx, const creal_T* xi); #ifdef __cplusplus } #endif #endif /*_MAKECXSPARSEMATRIX_H*/
<reponame>chandraneel/azure-hybrid-sdk-for-node<gh_stars>0 import { StorageAccounts } from "./storageAccounts"; import { UsageOperations } from "./usageOperations"; export { StorageAccounts, UsageOperations };
<filename>operator_ui/src/pages/JobsIndex/JobsIndex.tsx import React from 'react' import Button from 'components/Button' import { Title } from 'components/Title' import Content from 'components/Content' import BaseLink from 'components/BaseLink' import { v2 } from 'api' import * as models from 'core/store/models' import { Grid, Card, CardContent, Table, TableBody, TableCell, TableHead, TableRow, Typography, TextField, } from '@material-ui/core' import Link from 'components/Link' import { useErrorHandler } from 'hooks/useErrorHandler' import { useLoadingPlaceholder } from 'hooks/useLoadingPlaceholder' import { createStyles, withStyles, WithStyles, Theme, } from '@material-ui/core/styles' import { DirectRequestRow } from './DirectRequestRow' import { JobV2Row } from './JobV2Row' import SearchIcon from '@material-ui/icons/Search' enum JobSpecTypes { v1 = 'specs', v2 = 'jobs', } interface Job<T> { attributes: T id: string type: string } export type DirectRequest = Job<models.JobSpec> export type JobSpecV2 = Job<models.JobSpecV2> export type CombinedJobs = DirectRequest | JobSpecV2 function isJobSpecV1(job: CombinedJobs): job is DirectRequest { return job.type === JobSpecTypes.v1 } function isJobSpecV2(job: CombinedJobs): job is JobSpecV2 { return job.type === JobSpecTypes.v2 } function isFluxMonitorJobSpecV2(job: JobSpecV2) { return job.attributes.type === 'fluxmonitor' } function isOCRJobSpecV2(job: JobSpecV2) { return job.attributes.type === 'offchainreporting' } function getCreatedAt(job: CombinedJobs) { if (isJobSpecV1(job)) { return job.attributes.createdAt } else if (isJobSpecV2(job)) { switch (job.attributes.type) { case 'offchainreporting': return job.attributes.offChainReportingOracleSpec.createdAt case 'fluxmonitor': return job.attributes.fluxMonitorSpec.createdAt case 'directrequest': return job.attributes.directRequestSpec.createdAt } } else { return new Date().toString() } } const PAGE_SIZE = 1000 // We intentionally set this to a very high number to avoid pagination async function getJobs() { return Promise.all([ v2.specs.getJobSpecs(1, PAGE_SIZE), v2.jobs.getJobSpecs(), ]).then(([v1Jobs, v2Jobs]) => { const combinedJobs = [...v1Jobs.data, ...v2Jobs.data] const jobsByDate = combinedJobs.sort((a, b) => { const jobA = new Date(getCreatedAt(a)).getTime() const jobB = new Date(getCreatedAt(b)).getTime() return jobA > jobB ? -1 : 1 }) return jobsByDate }) } const searchIncludes = (searchParam: string) => { const lowerCaseSearchParam = searchParam.toLowerCase() return (stringToSearch: string) => { return stringToSearch.toLowerCase().includes(lowerCaseSearchParam) } } export const simpleJobFilter = (search: string) => (job: CombinedJobs) => { if (isJobSpecV1(job)) { return matchV1Job(job, search) } if (isJobSpecV2(job)) { if (isFluxMonitorJobSpecV2(job)) { return matchFluxMonitor(job, search) } if (isOCRJobSpecV2(job)) { return matchOCR(job, search) } } return false } /** * matchV1Job determines whether the V1 job matches the search term * * @param job {DirectRequest} The V1 Job Spec * @param term {string} */ function matchV1Job(job: DirectRequest, term: string) { const match = searchIncludes(term) const dataset: string[] = [ job.id, job.attributes.name, ...job.attributes.initiators.map((i) => i.type), // Match any of the initiators 'direct request', ] return dataset.some(match) } /** * matchFluxMonitor determines whether the Flux Monitor job matches the search * terms. * * @param job {JobSpecV2} The V2 Job Spec * @param term {string} The search term */ function matchFluxMonitor(job: JobSpecV2, term: string) { const match = searchIncludes(term) const dataset: string[] = [ job.id, job.attributes.name || '', 'direct request', // Hardcoded to match the type column 'fluxmonitor', // Hardcoded to match initiator column ] return dataset.some(match) } /** * matchOCR dettermines whether the OCR job matches the search terms * * @param job {JobSpecV2} The V2 Job Spec * @param term {string} The search term */ function matchOCR(job: JobSpecV2, term: string) { const match = searchIncludes(term) const { offChainReportingOracleSpec } = job.attributes const dataset: string[] = [ job.id, job.attributes.name || '', 'off-chain reporting', ] const searchableProperties = [ 'contractAddress', 'keyBundleID', 'p2pPeerID', 'transmitterAddress', ] as Array<keyof models.JobSpecV2['offChainReportingOracleSpec']> if (offChainReportingOracleSpec) { searchableProperties.forEach((property) => { dataset.push(String(offChainReportingOracleSpec[property])) }) } return dataset.some(match) } const styles = (theme: Theme) => createStyles({ card: { padding: theme.spacing.unit, marginBottom: theme.spacing.unit * 3, }, search: { marginBottom: theme.spacing.unit, }, }) export const JobsIndex = ({ classes, }: { classes: WithStyles<typeof styles>['classes'] }) => { const [search, setSearch] = React.useState('') const [jobs, setJobs] = React.useState<CombinedJobs[]>() const { error, ErrorComponent, setError } = useErrorHandler() const { LoadingPlaceholder } = useLoadingPlaceholder(!error && !jobs) React.useEffect(() => { document.title = 'Jobs' }, []) const jobFilter = React.useMemo(() => simpleJobFilter(search), [search]) React.useEffect(() => { getJobs().then(setJobs).catch(setError) }, [setError]) return ( <Content> <Grid container> <Grid item xs={9}> <Title>Jobs</Title> </Grid> <Grid item xs={3}> <Grid container justify="flex-end"> <Grid item> <Button variant="secondary" component={BaseLink} href={'/jobs/new'} > New Job </Button> </Grid> </Grid> </Grid> <Grid item xs={12}> <ErrorComponent /> <LoadingPlaceholder /> {!error && jobs && ( <Card className={classes.card}> <CardContent> <Grid container spacing={8} alignItems="flex-end" className={classes.search} > <Grid item> <SearchIcon /> </Grid> <Grid item> <TextField label="Search" value={search} name="search" onChange={(event) => setSearch(event.target.value)} /> </Grid> </Grid> <Table> <TableHead> <TableRow> <TableCell> <Typography variant="body1" color="textSecondary"> ID </Typography> </TableCell> <TableCell> <Typography variant="body1" color="textSecondary"> Created </Typography> </TableCell> <TableCell> <Typography variant="body1" color="textSecondary"> Type </Typography> </TableCell> <TableCell> <Typography variant="body1" color="textSecondary"> Initiator </Typography> </TableCell> </TableRow> </TableHead> <TableBody> {jobs && !jobs.length && ( <TableRow> <TableCell component="th" scope="row" colSpan={3}> You haven’t created any jobs yet. Create a new job{' '} <Link href={`/jobs/new`}>here</Link> </TableCell> </TableRow> )} {jobs && jobs.filter(jobFilter).map((job: CombinedJobs) => { if (isJobSpecV1(job)) { return <DirectRequestRow key={job.id} job={job} /> } else if (isJobSpecV2(job)) { return <JobV2Row key={job.id} job={job} /> } else { return <TableRow>Unknown Job Type</TableRow> } })} </TableBody> </Table> </CardContent> </Card> )} </Grid> </Grid> </Content> ) } export default withStyles(styles)(JobsIndex)
THE NIGHTINGALE'S SONG By Robert Timberg Illustrated. 544 pages. Simon & Schuster. $27.50. The idea that moved Robert Timberg to write "The Nightingale's Song" seems to have been to take five famous graduates of the United States Naval Academy and show how their training at Annapolis imbued them with values that subsequently made them military heroes: Senator John McCain, John M. Poindexter, Robert C. McFarlane, James Webb and Oliver L. North. He would then dramatize the sense of betrayal these men felt when America turned against the Vietnam War and spell out the tragic consequences of their feelings. In light of his own background as a graduate of the Naval Academy and a Marine veteran of Vietnam, he would write in a spirit of indignation over what he saw as the American middle class's abandonment of the country's patriotic heritage. But when Mr. Webb, a 1968 graduate and a former Secretary of the Navy, said to him during an interview, "I'm not sure I'm as angry as you want me to be," Mr. Timberg realized that his project might not be as neat as he had hoped. He admits in his prologue, where he reports Mr. Webb's remark, that "this book did not turn out precisely as I expected." He concludes, "In the end, it gets messy, in some ways as messy as the war that spawned it." Mr. Timberg does well enough describing his subjects' careers at Annapolis, how they were tempered in the furnace of the academy's almost sadistic rituals of initiation. From this experience they learned lessons summed up by "A Message to Garcia," the Spanish-American War tale of doubtful authenticity about a resourceful young naval lieutenant who takes on a difficult assignment as a courier without asking for more than the name of the missive's recipient. The undergraduate exploits make for theatrical narrative: how Mr. Poindexter quietly excelled while Mr. McCain noisily goofed off, with each in his way establishing himself as a leader of men; how Mr. McFarlane led an assault against upperclassmen in which he ended up the lone attacker of a roomful of football behemoths, how Mr. North barely defeated Mr. Webb in a famous boxing match whose outcome turned on a psychological stratagem. Even more arresting are some of the later experiences: Mr. McCain's heroic endurance as a prisoner of war undergoing torture in Vietnam; Mr. Poindexter's resourcefulness in acquiring a doctorate in nuclear physics at Caltech; Mr. Webb's development as a novelist. These stories are marred only by the author's occasional brushes with cliche: "During the four years '68 was at the Academy, the social fabric of the nation was shredded and rewoven in a way that Webb and North barely recognized." And once or twice Mr. Timberg forces a point: when he suggests, for instance, that Mr. Poindexter's appearance on the television show "Music Bingo" shortly before the quiz scandals broke was somehow a premonition of his involvement in the Iran-contra scandal. One larger problem with "The Nightingale's Song" is that Mr. Timberg does too good a job digging into the background of his characters. For what his explorations suggest is that where Mr. McCain and Mr. Webb were psychologically resilient and able to learn from suffering, Mr. Poindexter, Mr. McFarlane and Mr. North were flawed in various ways and therefore more vulnerable to the pressures they would face. Not only does this point compromise Mr. Timberg's narrative by forcing him to follow stories so disparate that the reader begins to lose the thread of the argument, it also undermines the author's thesis by suggesting that individual character, not America's revulsion with Vietnam, was the real source of what happened. But where the book gets into serious trouble is in the thesis summed up by its title, a reference to the fact that, as Mr. Timberg reports, while the nightingale "has a template in its brain that contains all the notes for the music . . . the bird cannot sing unless its song is first triggered by the song of another nightingale." In Mr. Timberg's view, while Mr. McFarlane, Mr. Poindexter and Mr. North were programmed by the Naval Academy with the sense of "duty, honor, country," they could not act on it until President Ronald Reagan came along and reaffirmed their patriotism by calling Vietnam a "noble cause." But, writes Mr. Timberg, Mr. Reagan ultimately betrayed them after encouraging them to sell arms to Iran in exchange for American hostages and then divert the profits to the Nicaraguan contras. "The singer, in many important ways, was a fraud," Mr. Timberg concludes. The problems with this thesis are multiple. For one thing, it leaves out Mr. McCain and Mr. Webb, who, because they never had any trouble singing their particular songs, become irrelevant to the main thrust of the book. For another, it ignores the whole issue of character shortcomings that Mr. Timberg has been at such pains to develop. Most damaging of all, the argument places far too much blame on Mr. Reagan for singing a nightingale's song that begged his couriers to deliver a message to Garcia. After all, Mr. Reagan was not some aberration who came out of nowhere. The point Mr. Timberg misses, or fails to develop in any depth, is that he was elected by a majority of citizens and was therefore an expression of something this majority felt, which was precisely the longing for the simpler moral code that the nightingale's song seemed to express. So in blaming Mr. Reagan for the complex set of catastrophes he narrates, Mr. Timberg ignores the real villain of his narrative. This villain is the history that taught us all the straightforward lessons of World War II and then, in the age of colonial insurrection that followed, changed all the rules of the geopolitical game.
/** * Represents the command result returned by {@code GuessCommand}. * This class is needed to pass some info to the {@code GameManager} to populate the {@code GameStatistics}. */ public class SkipCommandResult extends GameCommandResult { private static final String MESSAGE_SKIPPED = "Word skipped!"; public SkipCommandResult(Card card, String additionalMsg, boolean isFinished) { super(card, MESSAGE_SKIPPED + "\n" + additionalMsg, isFinished); } @Override public GameDataPoint getGameDataPoint(long millisElapsed) { return GameDataPoint.createSkipData(millisElapsed); } }
/** * An iterator that takes a 3-dimensional Delaney symbol with some undefined * branching numbers and defines these in all possible combinations such that * the results are locally euclidean symbols. * * Solutions which would correspond to tilings with face or edge degrees of 2 or * less are excluded. * * For each isomorphism class of resulting symbols, only one respresentative is * produced. The order or naming of elements is not preserved. * * @author Olaf Delgado * @version $Id: DefineBranching3d.java,v 1.4 2007/04/26 20:21:58 odf Exp $ */ public class DefineBranching3d extends IteratorAdapter { // --- set to true to enable logging final private static boolean LOGGING = false; // --- the input data final private DelaneySymbol input; final private List acceptedValues; final private boolean allowEdgeDegreeTwo; // --- properties of the input symbol final private int size; final private int dim; // --- auxiliary data final private Map nextValue; final private List inputAutomorphisms; // --- true if current sybmol is complete and has not yet been delivered boolean immediate = false; // --- the current state final private DynamicDSymbol current; final private LinkedList stack; // --- statistics int countNonSpherical = 0; /** * The instances of this class represent individual moves of setting * branch values. These become the entries of the trial stack. */ protected class Move { final public int index; final public int element; final public Integer value; final public boolean isChoice; public Move(final int index, final int element, final Integer value, final boolean isChoice) { this.index = index; this.element = element; this.value = value; this.isChoice = isChoice; } public String toString() { return "Move(" + index + ", " + element + ", " + value + ", " + isChoice + ")"; } } /** * The accepted branch values for a symbol fullfilling the crystallographic * restriction. */ private final static List standardValues = Collections.unmodifiableList(Arrays.asList(new Integer[] { new Integer(1), new Integer(2), new Integer(3), new Integer(4), new Integer(6) })); /** * Constructs an instance with standard options. */ public DefineBranching3d(final DelaneySymbol ds) { this(ds, standardValues, false); } /** * Constructs an instance with the standard set of accepted branch values. */ public DefineBranching3d(final DelaneySymbol ds, final boolean allowEdgeDegreeTwo) { this(ds, standardValues, allowEdgeDegreeTwo); } /** * Constructs an instance with no edges of degree two allowed. */ public DefineBranching3d(final DelaneySymbol ds, final List acceptedValues) { this(ds, acceptedValues, false); } /** * Constructs an instance. */ public DefineBranching3d(final DelaneySymbol ds, final List acceptedValues, final boolean allowEdgeDegreeTwo) { // --- check the argument check(ds, acceptedValues); // --- store the input parameters this.input = ds; this.acceptedValues = acceptedValues; this.allowEdgeDegreeTwo = allowEdgeDegreeTwo; // --- compute successors for acepted values this.nextValue = new HashMap(); final Set seen = new HashSet(); seen.add(null); Object previous = null; for (final Iterator iter = this.acceptedValues.iterator(); iter.hasNext();) { final Object v = iter.next(); if (!seen.contains(v)) { this.nextValue.put(previous, v); seen.add(v); previous = v; } } // --- initialize the state this.size = this.input.size(); this.dim = this.input.dim(); this.stack = new LinkedList(); this.current = new DynamicDSymbol(new DSymbol(this.input.canonical())); // --- compute more auxiliary data this.inputAutomorphisms = DSMorphism.automorphisms(this.current); // --- compute intitial deductions if (LOGGING) { System.err.println("Computing initial deductions..."); } for (int i = 0; i < this.dim; ++i) { final int j = i+1; final List idcs = new IndexList(i, j); for (final Iterator reps = this.current.orbitReps(idcs); reps.hasNext();) { final Object D = reps.next(); if (this.current.definesV(i, j, D)) { final boolean success = performMove(new Move(i, ((Integer) D) .intValue(), new Integer(this.current.v(i, j, D)), true)); this.stack.clear(); if (!success) { // --- given branching number lead to inconsistencies, so no solution return; } } } } if (LOGGING) { System.err.println("Initial deductions done."); } // --- find the next open choice final Move choice = nextChoice(-1, 1); if (choice == null) { // --- only one solution immediate = true; } else { // --- put a dummy move on the stack this.stack.addLast(choice); } } /** * Checks if a given symbol is a valid argument to the constructor. * @param ds the symbol to check. * @param acceptedValues list of accepted branching values. */ private void check(DelaneySymbol ds, java.util.List acceptedValues) { // --- check simple properties if (ds == null) { throw new IllegalArgumentException("null argument"); } if (ds.dim() != 3) { throw new IllegalArgumentException("dimension must be 3"); } try { ds.size(); } catch (UnsupportedOperationException ex) { throw new UnsupportedOperationException("symbol must be finite"); } if (!ds.isConnected()) { throw new UnsupportedOperationException("symbol must be connected"); } // --- check that all neighbor relations (ops) are defined. for (final Iterator elms = ds.elements(); elms.hasNext();) { final Object D = elms.next(); for (final Iterator idcs = ds.indices(); idcs.hasNext();) { final int i = ((Integer) idcs.next()).intValue(); if (!ds.definesOp(i, D)) { throw new UnsupportedOperationException("symbol must define all ops"); } } } if (!acceptedValues.contains(new Integer(1))) { throw new UnsupportedOperationException( "1 must be an accepted branching value."); } if (!acceptedValues.contains(new Integer(2))) { throw new UnsupportedOperationException( "2 must be an accepted branching value."); } // --- check local curvatures (must be positive for locally euclidean end result) if (!Utils.mayBecomeLocallyEuclidean3D(ds)) { throw new IllegalArgumentException( "symbol must have positive local curvatures"); } } /** * Repeatedly finds the next legal choice in the enumeration tree and * executes it, together with all its implications, until all branch values * are defined and in canonical form, in which case the resulting symbol is * returned. * * Does appropriate backtracking in order to find the respective next * choice. Also backtracks if the partial symbol resulting from the latest * choice is not in canonical form. * * To simplify the code, the algorithm makes use of "dummy moves", which are * put on the stack as fallback entries but do not have any effect on the * symbol. A dummy move is of the form * <code>Move(index, element, 0, false)</code> and effectively indicates * that the next value to be set is for that index and element. * * @return the next symbol, if any. */ protected Object findNext() throws NoSuchElementException { if (LOGGING) { System.err.println("findNext(): stack size = " + this.stack.size()); } if (immediate) { if (LOGGING) { System.err.println(" delivering a precomputed solution"); } immediate = false; return new DSymbol(this.current); } while (true) { final Move choice = undoLastChoice(); if (LOGGING) { System.err.println(" last choice was " + choice); } if (choice == null) { if (LOGGING) { System.err.println("Encountered " + this.countNonSpherical + " bad subsymbols."); System.err.println(); } throw new NoSuchElementException(); } final Move move = nextMove(choice); if (move == null) { if (LOGGING) { System.err.println(" no potential move"); } continue; } if (LOGGING) { System.err.println(" found potential move " + move); } if (performMove(move)) { if (LOGGING) { System.err.println(" move was successful"); } if (isCanonical()) { final Move next = nextChoice(choice.index, choice.element); if (next == null) { return new DSymbol(this.current); } else { this.stack.addLast(next); } } else { if (LOGGING) { System.err.println(" result of move is not canonical"); } } } else { if (LOGGING) { System.err.println(" move was rejected"); } } } } /** * Finds the next undefined branching position, giving rise to a new choice. * * @param lastIndex index of last defined position. * @param lastElement element of last defined position. * @return a move describing the choice found. */ private Move nextChoice(final int lastIndex, final int lastElement) { int D = lastElement; int i = lastIndex; while (D <= this.size) { while (i < this.dim-1) { ++i; if (!this.current.definesV(i, i+1, new Integer(D))) { return new Move(i, D, null, true); } } ++D; i = -1; } // --- nothing found return null; } /** * Undoes the last choice and all its implications by popping moves from the * stack until one is found which is a choice. The corresponding branching * assignment are cleared and the last choice is returned. If there was no * choice left on the stack, a <code>null</code> result is returned. * * @return the last choice or null. */ private Move undoLastChoice() { Move last; do { if (this.stack.size() == 0) { return null; } last = (Move) this.stack.removeLast(); if (LOGGING) { System.err.println("Undoing " + last); } this.current.undefineV(last.index, last.index+1, new Integer(last.element)); } while (!last.isChoice); return last; } /** * Finds the next legal move for the same choice. * @param choice describes the previous move. * @return the next move or null. */ private Move nextMove(Move choice) { final Integer next = (Integer) this.nextValue.get(choice.value); if (next == null) { return null; } else { return new Move(choice.index, choice.element, next, true); } } /** * Performs a move with all its implications. This includes setting the * branching value described by the move, pushing the move on the stack * and as well performing all the deduced moves as dictated by the * local euclidicity condition. * * @param initial the move to try. * @return true if the move did not lead to a contradiction. */ private boolean performMove(final Move initial) { if (LOGGING) { System.err.println("Performing " + initial); } // --- a little shortcut final DynamicDSymbol ds = this.current; // --- we maintain a queue of deductions, starting with the initial move final LinkedList queue = new LinkedList(); queue.addLast(initial); boolean firstMove = true; while (queue.size() > 0) { // --- get some info on the next move in the queue final Move move = (Move) queue.removeFirst(); final int i = move.index; final Object D = new Integer(move.element); // --- see if the move would contradict the current state if (ds.definesV(i, i+1, D)) { if (ds.v(i, i+1, D) == move.value.intValue()) { if (!firstMove) { continue; } } else { if (LOGGING) { System.err.println(" found contradiction at " + move); } if (move == initial) { // --- the initial move was impossible throw new IllegalArgumentException( "Internal error: received illegal move."); } return false; } } firstMove = false; // --- perform the move ds.redefineV(i, i+1, D, move.value.intValue()); // --- record the move we have performed this.stack.addLast(move); // --- make sure we have not introduced a face of degree 2 or less if (i == 0 && ds.m(i, i+1, D) < 3) { if (LOGGING) { System.err.println(" found degenerate face"); } return false; } // --- make sure we have not introduced an edge of degree 2 or less if (i == 2 && ds.m(i, i+1, D) < (this.allowEdgeDegreeTwo ? 2 : 3)) { if (LOGGING) { System.err.println(" found degenerate edge"); } return false; } // --- handle deductions or contradictions specified by a derived class final List extraDeductions = getExtraDeductions(ds, move); if (extraDeductions == null) { return false; } else { if (LOGGING) { for (final Iterator iter = extraDeductions.iterator(); iter.hasNext();) { final Move ded = (Move) iter.next(); System.err.println(" found extra deduction " + ded); } } queue.addAll(extraDeductions); } // --- look for problems or deductions from the required local euclidicity for (int j = 0; j <= this.dim; ++j) { if (j != i-1 && j != i+2) { continue; } final List idcs = new IndexList(i, i+1, j); final DelaneySymbol sub = new Subsymbol(ds, idcs, D); final List deductions = getDeductions(sub); if (deductions == null) { if (LOGGING) { System.err.println(" found invalid 2d subsymbol"); } ++this.countNonSpherical; return false; } else { if (LOGGING) { for (final Iterator iter = deductions.iterator(); iter.hasNext();) { final Move ded = (Move) iter.next(); System.err.println(" found deduction " + ded); } } queue.addAll(deductions); } } // --- look for more deductions at "trivial" 2d orbits final int k; if (i == 0) { k = 3; } else if (i == 2) { k = 0; } else { continue; } final Integer Dk = (Integer) this.current.op(k, D); final Move deduction = new Move(i, Dk.intValue(), move.value, false); if (ds.definesV(i, i + 1, Dk)) { if (ds.v(i, i + 1, Dk) != move.value.intValue()) { if (LOGGING) { System.err.println(" found contradiction at " + deduction); } return false; } } else { if (LOGGING) { System.err.println(" found deduction " + deduction); } queue.addLast(deduction); } } return true; } /** * Tests if the current symbol is in canonical form with respect to this * generator class. That means it is the form of the symbol that should be * reported. * * @return true if the symbol is canonical. */ private boolean isCanonical() { for (final Iterator iter = this.inputAutomorphisms.iterator(); iter.hasNext();) { final DSMorphism map = (DSMorphism) iter.next(); if (compareWithPermuted(this.current, map) > 0) { return false; } } return true; } /** * Lexicographically compares the sequence of v-values of a Delaney symbol * with the sequence as permuted by an automorphism of the symbol. If both * sequences are equal, 0 is returned. If the unpermuted one is smaller, a * negative value, and if the permuted one is smaller, a positive value is * returned. An undefined v-value is considered larger than any defined * v-value. * * @param ds the input symbol. * @param map the automorphism. * @return an integer indicating if the result. */ private static int compareWithPermuted(final DelaneySymbol ds, final DSMorphism map) { for (final Iterator elms = ds.elements(); elms.hasNext();) { final Object D1 = elms.next(); final Object D2 = map.getASource(D1); for (int i = 0; i < ds.dim(); ++i) { final int v1 = ds.definesV(i, i + 1, D1) ? ds.v(i, i + 1, D1) : 0; final int v2 = ds.definesV(i, i + 1, D2) ? ds.v(i, i + 1, D2) : 0; if (v1 != v2) { if (v1 == 0) { return 1; } else if (v2 == 0) { return -1; } else { return v1 - v2; } } } } return 0; } /** * Computes those settings for undefined branching numbers which are deducible * from the defined ones in the given 2-dimensional Delaney symbol. * * @param ds the input symbol. * @return the list of deductions (may be empty) or null in case of a contradiction. */ private List getDeductions(final DelaneySymbol ds) { if (ds.dim() != 2) { throw new IllegalArgumentException("symbol must be 2-dimensional"); } ds.setVDefaultToOne(true); if (!ds.curvature2D().isPositive()) { return null; } class Undefined { final public int i; final public Object D; final public boolean twice; public Undefined(final int i, final Object D, final boolean twice) { this.i = i; this.D = D; this.twice = twice; } } final List allIndices = new IndexList(ds); final boolean oriented = ds.isOriented(); final List result = new LinkedList(); final List degrees = new ArrayList(); final List undefined = new ArrayList(); boolean singleUndefinedExists = false; for (int ii = 0; ii < 2; ++ii) { final int i = ((Integer) allIndices.get(ii)).intValue(); for (int jj = ii+1; jj <= 2; ++jj) { final int j = ((Integer) allIndices.get(jj)).intValue(); final List idcs = new IndexList(i, j); for (final Iterator reps = ds.orbitReps(idcs); reps.hasNext();) { final Object D = reps.next(); final boolean twice = !oriented && ds.orbitIsOriented(idcs, D); if (ds.definesV(i, j, D)) { final int v = ds.v(i, j, D); if (v > 1) { degrees.add(new Integer(v)); if (twice) { degrees.add(new Integer(v)); } } } else { if (j != i+1) { throw new RuntimeException("this should not happen"); } undefined.add(new Undefined(i, D, twice)); if (!twice) { singleUndefinedExists = true; } } } } } // --- find contradictions and deductions final int n = degrees.size(); if (n == 3) { for (final Iterator iter = undefined.iterator(); iter.hasNext();) { final Undefined orb = (Undefined) iter.next(); result.add(new Move(orb.i, ((Integer) orb.D).intValue(), new Integer(1), false)); } } else if (n == 2) { final int a = ((Integer) Collections.max(degrees)).intValue(); final int b = ((Integer) Collections.min(degrees)).intValue(); if (a != b) { if ((a > 5 && b > 2) || b > 3 || undefined.size() == 0 || !singleUndefinedExists) { return null; } else if (undefined.size() == 1) { final Undefined orb = (Undefined) undefined.get(0); if (!orb.twice) { if ((a <= 5 && b == 3) || (a >= 5 && b == 2)) { result.add(new Move(orb.i, ((Integer) orb.D).intValue(), new Integer(2), false)); } } } } else { if (a >= 4 || !singleUndefinedExists) { for (final Iterator iter = undefined.iterator(); iter.hasNext();) { final Undefined orb = (Undefined) iter.next(); result.add(new Move(orb.i, ((Integer) orb.D).intValue(), new Integer(1), false)); } } } } else if (n == 1) { final int a = ((Integer) degrees.get(0)).intValue(); if (undefined.size() == 0) { return null; } else if (undefined.size() == 1) { final Undefined orb = (Undefined) undefined.get(0); if (orb.twice) { if (a != 2) { result.add(new Move(orb.i, ((Integer) orb.D).intValue(), new Integer(2), false)); } } else { result.add(new Move(orb.i, ((Integer) orb.D).intValue(), (Integer) degrees.get(0), false)); } } } else if (n == 0) { if (undefined.size() == 1) { final Undefined orb = (Undefined) undefined.get(0); if (!orb.twice) { result.add(new Move(orb.i, ((Integer) orb.D).intValue(), new Integer(1), false)); } } } return result; } /** * Hook for derived classes to specify additional deductions of a move. * * @param ds the current symbol. * @param move the last move performed. * @return the list of deductions (may be empty) or null in case of a contradiction. */ protected List getExtraDeductions(final DelaneySymbol ds, final Move move) { return new ArrayList(); } public static void main(String[] args) { boolean verbose = false; boolean check = true; int i = 0; while (i < args.length && args[i].startsWith("-")) { if (args[i].equals("-v")) { verbose = !verbose; } else if (args[i].equals("-e")){ check = !check; } else { System.err.println("Unknown option '" + args[i] + "'"); } ++i; } final Iterator syms; if (args.length > i) { final DSymbol ds = new DSymbol(args[i]); syms = Iterators.singleton(ds); } else { syms = new InputIterator(new BufferedReader(new InputStreamReader(System.in))); } int inCount = 0; int outCount = 0; int countGood = 0; int countAmbiguous = 0; while (syms.hasNext()) { final DSymbol ds = (DSymbol) syms.next(); final Iterator iter = new DefineBranching3d(ds); ++inCount; try { while (iter.hasNext()) { final DSymbol out = (DSymbol) iter.next(); ++outCount; if (check) { final EuclidicityTester tester = new EuclidicityTester(out); if (tester.isAmbiguous()) { System.out.println("??? " + out); ++countAmbiguous; } else if (tester.isGood()) { System.out.println(out); ++countGood; } } else { System.out.println(out); } } } catch (Exception ex) { ex.printStackTrace(System.err); } } System.err.println("Processed " + inCount + " input symbols."); System.err.println("Produced " + outCount + " output symbols."); if (check) { System.err.println("Of the latter, " + countGood + " were found euclidean."); if (countAmbiguous > 0) { System.err.println("For " + countAmbiguous + " symbols, euclidicity could not yet be decided."); } } System.err.println("Options: " + (check ? "" : "no") + " euclidicity check, " + (verbose ? "verbose" : "quiet") + "."); } }
/** * A Fudge-specific IO exception to wrap the checked {@code IOException}. * <p> * Fudge will never throw a checked exception. * Wherever possible, IO exceptions will be wrapped in this exception. */ public class FudgeRuntimeIOException extends FudgeRuntimeException { /** * Creates a wrapper for the checked {@code IOException}. * * @param cause the underlying exception, should not be null */ public FudgeRuntimeIOException(final IOException cause) { super(cause.getMessage(), cause); } /** * Creates a wrapper for the checked {@code IOException} with an overridden message. * * @param message the description of the error condition, may be null * @param cause the underlying exception, should not be null */ public FudgeRuntimeIOException(final String message, final IOException cause) { super(message, cause); } //------------------------------------------------------------------------- /** * Gets the underlying {@code IOException} wrapped by this runtime exception. * * @return the IO exception, should not be null */ @Override public IOException getCause() { return (IOException) super.getCause(); } }
‘Please Not the Horror-Clown!’: How the Foreign Press Is Covering Election Day If you’re in the United States watching Election Day with a knot in your stomach, you’re not alone. International media has covered the 2016 campaign wall-to-wall and with a sense of total disbelief over Donald Trump’s relentless rise. With Election Day upon us, the foreign press is covering it like the end days. In Germany, the Bonn Express pleaded with Americans not to choose the horror-clown: There’s something about the German language that really lends itself to describing the end-times. When the Neue Vorarlberger Tageszeitung declared Tuesday as “Die Nacht, die unsere Zukunft entscheidet,” it just has a nicer ring to it than its English equivalent: “The night that decides our future.” Swedish tabloid Expressen, meanwhile, comes through with this awful photoshop and asks: “The American nightmare … or the first woman?” In Jamaica, the Daily Observer casts Clinton and Trump as a Revolutionary War-era soldiers: And as Brazil’s Diário Catarinense sees it, nothing less than the fate of the world hangs in the balance: But for the all the Sturm und Drang in the foreign press, it doesn’t hold a candle to the paranoia and conspiracy theories that have marked the Russian media’s coverage of the 2016 campaign. And Election Day was no different. As the BBC’s Steve Rosenberg reports from Moscow, Tuesday’s papers include a report that Hillary Clinton will surround Russia with nuclear weapons, among other gloomy predictions. One Russian paper today claims "Clinton will surround us with nuclear rockets". What Russia's press is saying as Americans go to the polls. pic.twitter.com/AcFjcN3OlL — Steve Rosenberg (@BBCSteveR) November 8, 2016 According to Robinson, Tuesday’s papers include a report from Komsomolskaya Pravda, which is close to the Kremlin, claiming that the U.S. president isn’t chosen by popular vote but is appointed by a shadowy council calling itself “the irreplaceables.” Amid repeated claims from Trump that the election is rigged against him, Russian news website Gazeta.ru passed along to its readers the number to the GOP nominee’s voter-fraud hotline. To reach the U.S. number, the outlet helpfully reminded its Russian readers, they have to first dial “1”: From @GazetaRu live feed. Trump's voting violation hotline. Dial 1 if you're calling from Russia. pic.twitter.com/P12NTVClOB — Sean Guillory (@seansrussiablog) November 8, 2016 On Sunday, Dmitry Kiselyov, the television presenter slapped with EU sanctions for his propaganda activities, used his Sunday television show to rail against the U.S. election. Some 1.8 million “dead souls” will be used to boost vote totals, he claimed, in a likely allusion to the Gogol masterpiece by the same name. “This has been the dirtiest campaign in the history of the United States,” Kiselyov said. In its propaganda efforts around the 2016 election, the Kremlin has sought to discredit American democracy. Convinced that the United States is attempting to foment a popular uprising against him in an attempt to install a Western-style democracy, Russian President Vladimir Putin has used this election system to cast doubt on the integrity of the American political system, as is reflected in the efforts of his propagandists. Or as RT editor in chief Margarita Simonyan put it: Democracy. R.I.P. — Маргарита Симоньян (@M_Simonyan) November 8, 2016 Photo by Joe Raedle/Getty Images
/** * Close the file reader and the record scanner for the given file slice. * * @param partitionFileSlicePair - Partition and FileSlice */ private synchronized void close(Pair<String, String> partitionFileSlicePair) { Pair<HoodieFileReader, HoodieMetadataMergedLogRecordReader> readers = partitionReaders.remove(partitionFileSlicePair); if (readers != null) { try { if (readers.getKey() != null) { readers.getKey().close(); } if (readers.getValue() != null) { readers.getValue().close(); } } catch (Exception e) { throw new HoodieException("Error closing resources during metadata table merge", e); } } }
1. Field of the Invention This invention is concerned with a method of producing a borated alkyl aromatic polyol. More particularly, it relates to a method of producing a borated alkyl aromatic polyol used in lubricating oil formulations to reduce oxidation, wear, and deposits in internal combustion engines. 2. Description of the Relevant Art Wear and deposits limit the useful life of automobile and truck engines. Thus, there is a great need to find lubricants that reduce the oxidation, wear, and deposits in the engine, thus increasing the lifetime of the engine. U.S. Pat. No. 2,795,548 discloses the use of lubricating oil compositions containing a borated alkyl catechol. The oil compositions are useful in the crankcase of an internal combustion engine in order to reduce oxidation of the oil and corrosion and wear of the metal parts of the engine. Borated alkyl catechols are conventionally prepared via alkylation of catechol with an olefin, followed by boration of the alkyl catechol product with boric acid or boric anhydride (see, for example, U.S. Pat. No. 4,629,578). Hereinafter this will be referred to as the "forward process". This procedure produces borated products containing both monoalkyl and dialkyl catechols; however, the superior antioxidant properties of the monoalkyl catechols make them more desirable products. To enhance the production of monoalkyl products, a large excess of catechol, the most expensive reactant in the process, is needed in the forward process. Unfortunately, this excess catechol must be recovered and recycled to make the process economical.
Systematic Literature Review of Metaheuristic Methodologies for High School Timetabling Problem The purpose of this study is to review metaheuristic methods and provide fair comparisons of different metaheuristic methodologies in High School Timetabling Problem (HSTP) as many previous comparative studies that were performed are based on different structure and classification. This study is conducted to provide answer on what metaheuristic algorithm were applied in HSTP, types of datasets most used by metaheuristic algorithm, and metaheuristic algorithms that have yet to be explored. This study starts by forming research questions and performing search process using search terms on identified resources. The selected resources were further scrutinized and went through quality assessment before data synthesis. The most used metaheuristic methods are found to be from type of non-population based and in hybrid approaches. The most used HSTP data set by researchers is the XSHTT data set. Population based and nature inspired metaheuristic methodologies were explored further as many methods of these type have not been applied in HSTP. This study provides opportunities for further studies particularly in metaheuristic algorithm regarding HSTP.
It’s only right that we start 2017 where we left off at the end of 2016. The last show we covered was one half of the Juno award-winning group Swollen Members, Prevail, performing with his new group Alpha Omega at The Rockpile. Now we’re back at the same venue to see the other half of Swollen Members, Madchild. Like Prevail, Madchild has also been working on side projects when they’re not collaborating as Swollen Members. He’s released several solo albums in recent years and is preparing to release his fourth one, Darkest Hour, in March this year. This would be my first time seeing Madchild perform, and would be my first time hearing most of his songs, as I’m not too familiar with his solo work other than a few music videos. He has established a near twenty-year legacy with Swollen Members and only started releasing solo material in this current decade. He would reflect later on in the show by saying that although he’s old, it means he’s maintained the longest relevance out of any Canadian Hip-Hop artist. While I may lack familiarity, the numbers prove his point, as his social media as a solo artist has more followers than the former platinum-selling group. By the time I got to The Rockpile, there were still a few opening acts left to perform, and Tragedy was just getting on stage. Tragedy is a local MC who also opened for Alpha Omega here in December, and just as last time, he stood out with his rhymes and punchlines. The delivery was smooth and it was easy to pick up on the lyrics. After him would be another local group I had seen many times, but it had been a while. The host Stacee Brizzle referred to them as her “favourite assholes,” as Marmel took the stage. It’s been at least a year since the last time I saw Marmel perform, and the six-man group seems much more refined now. They perform more like a group than a loose collective of individual artists, and they seem to have a more clear direction on where they want to take their sound, with hard-hitting rap verses surrounding reggae-flavoured hooks. They brought great energy, had well-structured songs, and controlled the stage smoothly between the six of them. After rocking the house, they gave away some free CDs, and there would be a bit of a wait before the next artist. The DJ spun some songs and really got to know the crowd, starting off with some rap classics before suddenly switching to hard rock. He played some Rage Against The Machine and Limp Bizkit, and Stacee Brizzle brought back some middle school memories by picking out “Last Resort” by Papa Roach. The crowd was absolutely with it, and even called for more rock music when given the option to switch back to hip-hop. You could tell this wasn’t your typical hip-hop crowd just by the look, as some fans wore more biker style clothing, and some even showed up in Halloween costumes! We eventually got back into the hip-hop, as DJ Dow Jones took over the stage and spun for a bit before the final opener came out, Vancouver’s own Joseph Rose. I had seen Rose perform back in 2015 with his group Aileron as they opened for ¡Mayday! here at The Rockpile, but this would be my first time seeing him perform as a solo artist. He had some cool songs promoting positivity, and also performed his guest verse on Madchild’s “Little Things,” although Madchild didn’t come out for the collaborative track. He seemed to wrap up his set quickly so that Madchild could come out for the headlining set shortly after midnight. The whole Marmel crew along with some Battle Axe Warriors lined up along the back of the stage so it would look like Madchild had a whole mob with him when he took over. He got things started with his 2012 single “Devil’s Reject” before pausing to take in the energy as the crowd chanted his name. One of the first things he did was got RezMade, another artist who had opened for Alpha Omega last month, to get brought on stage in his wheelchair so that he could have a better view of the show. He then got the crowd jumping with a performance of “Lawn Mower Man.” I didn’t recognize several of his songs, but the combination he used was simple: dope beats and hard rhymes. There was a moment when Madchild gave a big shoutout to the Marmel Entertainment crew, and let the guys go off on some freestyle raps as the DJ switched the beats on them. They made flowing off the top look easy. More lyrical exercises would be done, as Madchild then brought a fan on stage to rap his songs “Gremlin” and “Tom Cruise” with him. It was hard to tell how well the fan was doing, as Madchild rapped along with him, and I’m pretty sure they had the recorded vocals playing on the speakers too, but both Madchild and the crowd seemed impressed and the fan got to pick out an item to keep from the merch booth. Madchild performed some more older tracks I wasn’t familiar with, but also did the new single off of the upcoming Darkest Hour album, “Write It Down.” He jumped down into the crowd and rapped the entire song among the people, taking selfies and giving props as he rapped. The Marmel crew would play hypemen and controlled the energy as Madchild stayed amongst the crowd for the next couple songs. When he returned to the stage, Madchild brought a few female fans up with him to dance during the next few songs, including the sexually aggressive “Dickhead.” Despite the aggressive lyrics, the ladies seemed to enjoy themselves. Madchild pretended to end the show, but really wanted the crowd to chant for an encore. He had to prompt them to do it, but the chant was loud! He then did one more track before officially ending the show by getting DJ Dow Jones to play some trap music for the ladies on stage to dance to. Madchild would stick around on stage to sign autographs and take pictures. Overall, this was a fun show to start the year off with. While there were several songs I didn’t know, I could tell that the bars were well-crafted with the sharpness of a skilled battle rapper. Madchild has entered a new chapter in his career and has proven he can be just as successful as a solo artist or as a Swollen Member. He has one of the most unique voices in Hip-Hop and is able to stand out among other artists. Madchild will continue his tour across Canada throughout February, with a couple more shows in Ontario before heading out west. Remember to check out the SYpherSights Youtube channel for more concert videos. Also follow SYpherSights on social media below: Facebook Twitter Instagram Advertisements
<reponame>ngmiller/fabrik package main import ( "archive/zip" "bytes" "encoding/json" "errors" "io" "io/ioutil" "net/http" "strings" "github.com/opolis/build/pipeline" "github.com/aws/aws-lambda-go/events" "github.com/aws/aws-lambda-go/lambda" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" log "github.com/sirupsen/logrus" ) func init() { log.SetFormatter(&log.JSONFormatter{DisableTimestamp: true}) } func main() { lambda.Start(Handler) } func Handler(event events.CodePipelineEvent) error { defer func() { if r := recover(); r != nil { log.Errorln("recovered from panic:", r) } }() // AWS session sess := session.Must(session.NewSession()) pipeline := pipeline.NewAWSPipelineManager(sess) id := event.CodePipelineJob.ID data := event.CodePipelineJob.Data log := log.WithFields(log.Fields{"jobId": id}) // Get input artifacts stackArtifact, buildArtifact, err := getArtifacts(sess, data) if err != nil { if err := pipeline.JobFailure(id, err.Error()); err != nil { log.Errorln("could not post failure", id, err.Error()) } return nil } defer stackArtifact.Close() defer buildArtifact.Close() // Read deploy bucket name bucket, err := readDeployBucket(stackArtifact) if err != nil { if err := pipeline.JobFailure(id, err.Error()); err != nil { log.Errorln("could not post failure", id, err.Error()) } return nil } // Deploy build artifact if err := deployBuild(sess, bucket, buildArtifact); err != nil { if err := pipeline.JobFailure(id, err.Error()); err != nil { log.Errorln("could not post failure", id, err.Error()) } return nil } if err := pipeline.JobSuccess(id); err != nil { log.Errorln("could not post success", id, err.Error()) } return nil } // // Helpers // // getAritifacts - return (stack artifact, build artifact, error) func getArtifacts(sess *session.Session, data events.CodePipelineData) (io.ReadCloser, io.ReadCloser, error) { if len(data.InputArtifacts) == 0 { return nil, nil, errors.New("no input artifacts") } // Check for deploy stack and build output artifacts if len(data.InputArtifacts) == 2 { stack, err := getS3(sess, data.InputArtifacts[0]) if err != nil { return nil, nil, err } build, err := getS3(sess, data.InputArtifacts[1]) if err != nil { return nil, nil, err } return stack, build, nil } return nil, nil, errors.New("invalid amount of parameters") } func getS3(sess *session.Session, input events.CodePipelineInputArtifact) (io.ReadCloser, error) { bucket := input.Location.S3Location.BucketName key := input.Location.S3Location.ObjectKey resp, err := s3.New(sess).GetObject(&s3.GetObjectInput{ Bucket: aws.String(bucket), Key: aws.String(key), }) return resp.Body, err } func readDeployBucket(stackArtifact io.ReadCloser) (string, error) { buffer, err := ioutil.ReadAll(stackArtifact) if err != nil { return "", err } // open the zip archive for reading reader, err := zip.NewReader(bytes.NewReader(buffer), int64(len(buffer))) if err != nil { return "", err } // look for `outputs.json` and marshal into a map // extracting the `Bucket` key for _, f := range reader.File { if f.Name == "outputs.json" { body, err := f.Open() if err != nil { return "", err } content, _ := ioutil.ReadAll(body) body.Close() var object map[string]string if err := json.Unmarshal(content, &object); err != nil { return "", err } return object["Bucket"], nil } } return "", errors.New("outputs.json does not exist in stack artifact") } func deployBuild(sess *session.Session, bucket string, buildArtifact io.ReadCloser) error { buffer, err := ioutil.ReadAll(buildArtifact) if err != nil { return err } // open the zip archive for reading reader, err := zip.NewReader(bytes.NewReader(buffer), int64(len(buffer))) if err != nil { return err } // Iterate through the files in the archive, and upload them to S3 for _, f := range reader.File { key := f.Name body, err := f.Open() if err != nil { return err } content, _ := ioutil.ReadAll(body) body.Close() contentType := http.DetectContentType(content) // manual override for svg content if strings.HasSuffix(key, ".svg") { contentType = "image/svg+xml" } _, err = s3.New(sess).PutObject(&s3.PutObjectInput{ Body: bytes.NewReader(content), Bucket: aws.String(bucket), Key: aws.String(key), ContentType: aws.String(contentType), }) if err != nil { return err } } return nil }
/* Return information about the given file * * Return 0 on success * -ENOENT if any path element was not found in the directory or if the path is malformed * -EIO on I/O issues reading media * -ENOMEM on out of memory */ int f_stat(fatvol_t *fv, char *fn, struct stat *st) { fileinfo_t info; CHECK_RET(dir_find_path(fv, fn, &info)); fillstat(fv, &info, st); return 0; }
The 9/11 commission has drawn more attention for the testimony it has gathered than for the purpose it has set for itself. Today the commission will hear from Condoleezza Rice, national security adviser to President Bush, and her account of the administration's policies before Sept. 11 is likely to differ from that of Richard Clarke, the president's former counterterrorism chief, in most particulars except one: it will be disputed. A black swan is an outlier, an event that lies beyond the realm of normal expectations. Most people expect all swans to be white because that's what their experience tells them; a black swan is by definition a surprise. Nevertheless, people tend to concoct explanations for them after the fact, which makes them appear more predictable, and less random, than they are. Our minds are designed to retain, for efficient storage, past information that fits into a compressed narrative. This distortion, called the hindsight bias, prevents us from adequately learning from the past. Black swans can have extreme effects: just a few explain almost everything, from the success of some ideas and religions to events in our personal lives. Moreover, their influence seems to have grown in the 20th century, while ordinary events -- the ones we study and discuss and learn about in history or from the news -- are becoming increasingly inconsequential. Consider: How would an understanding of the world on June 27, 1914, have helped anyone guess what was to happen next? The rise of Hitler, the demise of the Soviet bloc, the spread of Islamic fundamentalism, the Internet bubble: not only were these events unpredictable, but anyone who correctly forecast any of them would have been deemed a lunatic (indeed, some were). This accusation of lunacy would have also applied to a correct prediction of the events of 9/11 -- a black swan of the vicious variety. A vicious black swan has an additional elusive property: its very unexpectedness helps create the conditions for it to occur. Had a terrorist attack been a conceivable risk on Sept. 10, 2001, it would likely not have happened. Jet fighters would have been on alert to intercept hijacked planes, airplanes would have had locks on their cockpit doors, airports would have carefully checked all passenger luggage. None of that happened, of course, until after 9/11. Much of the research into humans' risk-avoidance machinery shows that it is antiquated and unfit for the modern world; it is made to counter repeatable attacks and learn from specifics. If someone narrowly escapes being eaten by a tiger in a certain cave, then he learns to avoid that cave. Yet vicious black swans by definition do not repeat themselves. We cannot learn from them easily. All of which brings us to the 9/11 commission. America will not have another chance to hold a first inquiry into 9/11. With its flawed mandate, however, the commission is in jeopardy of squandering this opportunity. The first flaw is the error of excessive and naïve specificity. By focusing on the details of the past event, we may be diverting attention from the question of how to prevent future tragedies, which are still abstract in our mind. To defend ourselves against black swans, general knowledge is a crucial first step. The mandate is also a prime example of the phenomenon known as hindsight distortion. To paraphrase Kirkegaard, history runs forward but is seen backward. An investigation should avoid the mistake of overestimating cases of possible negligence, a chronic flaw of hindsight analyses. Unfortunately, the hearings show that the commission appears to be looking for precise and narrowly defined accountability. Yet infinite vigilance is not possible. Negligence in any specific case needs to be compared with the normal rate of negligence for all possible events at the time of the tragedy -- including those events that did not take place but could have. Before 9/11, the risk of terrorism was not as obvious as it seems today to a reasonable person in government (which is part of the reason 9/11 occurred). Therefore the government might have used its resources to protect against other risks -- with invisible but perhaps effective results. The third flaw is related. Our system of rewards is not adapted to black swans. We can set up rewards for activity that reduces the risk of certain measurable events, like cancer rates. But it is more difficult to reward the prevention (or even reduction) of a chain of bad events (war, for instance). Job-performance assessments in these matters are not just tricky, they may be biased in favor of measurable events. Sometimes, as any good manager knows, avoiding a certain outcome is an achievement. The greatest flaw in the commission's mandate, regrettably, mirrors one of the greatest flaws in modern society: it does not understand risk. The focus of the investigation should not be on how to avoid any specific black swan, for we don't know where the next one is coming from. The focus should be on what general lessons can be learned from them. And the most important lesson may be that we should reward people, not ridicule them, for thinking the impossible. After a black swan like 9/11, we must look ahead, not in the rear-view mirror.
George Soros, the billionaire investor and philanthropist, has had a busy year. Since the beginning of 2017, he has faked a chemical attack in Syria, funded anti-Trump marches in Washington, come up with the "Soros plan" to flood Hungary with refugees, forced a change of government in Macedonia, undermined the Israeli prime minister and got several key White House aides sacked. Not bad for a man of 87. All of the above are, of course, conspiracy theories. But the fact that they have surfaced this year — and all feature the name of Mr Soros — is not just a curiosity. It says something important and worrying about global politics. In the 1990s, Mr Soros was in tune with the spirit of the age, as he used the billions he had made in finance to support the transition to democracy in post-communist Europe and elsewhere. But now the global political climate has changed and liberal ideas are in retreat. For a new generation of nationalists — from the US to Russia and Hungary — Mr Soros has become the perfect villain. He is an internationalist in an age of nationalism. He is a supporter of individual rights, not group rights. He is the 29th-richest man in the world, according to the Forbes rich list. And he is also Jewish, so is easily cast in the role of the shadowy and manipulative international financier, once reserved for the Rothschilds. One of the nastier bits of anti-Soros propaganda this year explicitly linked him to the old slurs against the Rothschilds. When America First nationalists became worried that HR McMaster, national security adviser to President Donald Trump, was purging their allies in the White House, they set up a website called "McMaster leaks" which featured a cartoon of Mr McMaster being manipulated by puppetmasters labelled "Soros" and "Rothschilds". In 1989, one of the beneficiaries of a Soros scholarship to study at Oxford was a young Hungarian activist named Viktor Orban. Today, the same Mr Orban is prime minister of Hungary and demonises his one-time benefactor. The Hungarian leader has made denunciation of an alleged "Soros plan" to flood Hungary with Muslims central to his re-election campaign. There is no such plan. What is true is that Mr Soros is a generous backer of refugee charities and has also supported the EU's plan to resettle Syrian refugees across the bloc, including in Hungary. That was excuse enough for Mr Orban to plaster the country with posters featuring a grinning Mr Soros, and urging: "Don't let Soros have the last laugh." The demonisation of Mr Soros in Hungary, where he was born, is not an isolated case. In the past year, he has been denounced by political leaders in Macedonia, Poland, Romania and Turkey, all of whom claim he is plotting against them. The paranoid right in America also churns out anti-Soros material. As long ago as 2007, Mr Soros was denounced on Fox News as the "Dr Evil of the whole world of leftwing foundations". The origins of Soros-hatred in the US may date back to his opposition to the Iraq war. His support of liberal causes in the US, as well as of international institutions such as the UN, has kept the far-right pot boiling. There is clearly an echo-chamber element to the anti-Soros campaigns around the world, as far-right groups pick up on the same conspiracy theories. But some strongman leaders have more concrete reasons to fear Mr Soros's Open Society Foundation, which funds civil society organisations that promote education, a free press, minority rights and anti-corruption initiatives. In 2015, Vladimir Putin's government chucked the Open Society Foundation out of Russia since it was no longer willing to tolerate the latter's support for organisations such as Memorial, which promoted research into the Soviet terror. Mr Soros's activities have even made him a target in Israel. The obvious anti-Semitism in many of the anti-Soros campaigns around the world evidently matters less to the Netanyahu government than Mr Soros's support for Palestinian rights and other causes unpopular on the Israeli right. There is also a personal element in prime minister Benjamin Netanyahu's anti-Soros ire. As an anti-corruption probe has got closer and closer to Israel's first family, so they have lashed out against Mr Soros. Yair Netanyahu, the prime minister's son, complained recently that the "Fund for the Destruction of Israel, funded by Soros and the European Union, is threatening me". He even re-published a cartoon of Mr Soros dangling the world in front of a reptilian creature, the kind of image that his father would routinely denounce as anti-Semitic if it had been published by another source. Conspiracy theorists have an explanation for everything. So the fact that the FT should publish a column defending Mr Soros will simply be taken as further evidence of his nefarious influence. For the record, I have had precisely two conversations with Mr Soros. On both occasions, we were on the same public panel at seminars organised by the European Council on Foreign Relations, a think-tank that he partially funds. We have never had a private conversation and I certainly would not claim him as a friend. But I have no hesitation in applauding his philanthropy. The fact that it even needs to be defended says something sad about the times we are living in. More from the Financial Times: EU acts against Hungary over civil society curbs Egypt's developers reach limit of what homebuyers can afford City congestion drives urban invention in the Middle East
#include <iostream> #include <cmath> using namespace std; int main(){ int n; cin>>n; string arr[n]; double v,t,x,h1,h2; double res; for (int i = 0; i < n; i++) { cin>>v>>t>>x>>h1>>h2; res = x*tan(t*M_PI/180)-9.81/2*pow(x/v/cos(t*M_PI/180),2); if(res>=h1+1 && res<=h2-1){ arr[i] = "Safe"; } else{ arr[i] = "Not Safe"; } } for(int i = 0; i<n;i++){ cout<<arr[i]<<'\n'; } return 0; }
export const environment = { production: true, plannerBackendRootUrl: '', plannerBackendEventsContext: '/api/events', plannerBackendCommentsContext: '/api/comments', plannerBackendImageContext: '/api/images', plannerAuthBackend: '' };
. OBJECTIVE To identify hereditary nonpolyposis colorectal cancer (HNPCC) families based on the germline mutations of MLH1 and MSH2 mRNA. METHODS RNA was extracted from the peripheral blood of the 14 members from 12 different families fulfilling Amsterdam Criteria II. The germline mutations of MLH1 and MSH2 mRNA were detected by cDNA sequencing analysis following reverse transcription-PCR(RT-PCR) with special primers, heat-resistance reverse transcriptase, and expand long template PCR. DNA was extracted from the peripheral blood of the 14 members, the corresponding exons, in which mutations were found using the above method, were amplified with Taq enzyme, sequencing analysis was followed. RESULTS Six germline mutations were detected and identified from the 6 different families based on mRNA, 4 of them to be in MLH1, the other 2 in MSH2. The MLH1 mutations distribute in the exon 8, 12, 16, and 19. The MSH2 mutations distribute in exons 1 and 2. The 6 mutations were identified from the corresponding exons respectively in genomic DNA sequencing analysis. The mutation types involve in 4 missense, 1 silent, and 1 non-coding area mutations. Five out of the 6 mutations have not been reported previously. Five out of the 6 mutations were pathological, involving in 5 different families. The five families were identified to HNPCC families. CONCLUSION HNPCC family can be identified with RNA-based sequencing of MLH1 and MSH2 from peripheral blood, which has the advantages of both cost, time saving and high sensitivity.
1. Field of the Invention The present invention relates to an exhaust discharge control device for an internal combustion engine. 2. Description of the Related Art It is assumed that the ratio of the entire air amount to the entire amounts of fuel and a reducing agent supplied into an exhaust passage, a combustion chamber and an intake passage upstream of a certain position within the exhaust passage is referred to as an air-fuel ratio of an exhaust gas flowing at that position. Here, there is a known exhaust discharge control device for an internal combustion engine that allows burning of a lean air-fuel mixture gas, in which an NO.sub.x absorbent that absorbs NO.sub.x if the air-fuel ratio of the inflowing exhaust gas is lean and discharges the absorbed NO.sub.x if the oxygen concentration of the inflowing exhaust gas is low, is disposed in the exhaust passage of the internal combustion engine such that the air-fuel ratio of the exhaust gas flowing into the NO.sub.x absorbent is made rich or a stoichiometric air fuel ratio temporarily to discharge and reduce the absorbed NO.sub.x from the NO.sub.x absorbent (see Japanese Patent Publication No. 2600492). If the oxygen concentration of the exhaust gas flowing into the NO.sub.x absorbent is reduced, NO.sub.x or SO.sub.x is discharged and removed. Based on this, it is considered that as the oxygen concentration of the exhaust gas flowing into the NO.sub.x absorbent becomes lower, NO.sub.x or SO.sub.x is purified more excellently, and if oxygen is hardly contained in the exhaust gas flowing into the NO.sub.x absorbent, NO.sub.x or SO.sub.x is can be purified further excellently.
// Copyright 2019 Google LLC // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. // // Auto-generated file. Do not edit! // Specification: test/f32-raddstoreexpminusmax.yaml // Generator: tools/generate-raddstoreexpminusmax-test.py #include <gtest/gtest.h> #include <xnnpack/common.h> #include <xnnpack/isa-checks.h> #include <xnnpack/raddstoreexpminusmax.h> #include "raddstoreexpminusmax-microkernel-tester.h" #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X4, elements_eq_4) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(4) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x4, xnn_init_f32_expminus_neon_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X4, elements_div_4) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 8; elements < 40; elements += 4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x4, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X4, elements_lt_4) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x4, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X4, elements_gt_4) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 5; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x4, xnn_init_f32_expminus_neon_rr2_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X8, elements_eq_8) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(8) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x8, xnn_init_f32_expminus_neon_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X8, elements_div_8) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 16; elements < 80; elements += 8) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x8, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X8, elements_lt_8) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x8, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X8, elements_gt_8) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 9; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x8, xnn_init_f32_expminus_neon_rr2_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X8_ACC2, elements_eq_8) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(8) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x8_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X8_ACC2, elements_div_8) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 16; elements < 80; elements += 8) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x8_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X8_ACC2, elements_lt_8) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x8_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X8_ACC2, elements_gt_8) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 9; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x8_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X12, elements_eq_12) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x12, xnn_init_f32_expminus_neon_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X12, elements_div_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x12, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X12, elements_lt_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x12, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X12, elements_gt_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x12, xnn_init_f32_expminus_neon_rr2_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X12_ACC2, elements_eq_12) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x12_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X12_ACC2, elements_div_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x12_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X12_ACC2, elements_lt_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x12_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X12_ACC2, elements_gt_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x12_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X12_ACC3, elements_eq_12) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x12_acc3, xnn_init_f32_expminus_neon_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X12_ACC3, elements_div_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x12_acc3, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X12_ACC3, elements_lt_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x12_acc3, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X12_ACC3, elements_gt_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x12_acc3, xnn_init_f32_expminus_neon_rr2_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X16, elements_eq_16) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x16, xnn_init_f32_expminus_neon_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X16, elements_div_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x16, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X16, elements_lt_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x16, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X16, elements_gt_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x16, xnn_init_f32_expminus_neon_rr2_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X16_ACC2, elements_eq_16) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x16_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X16_ACC2, elements_div_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x16_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X16_ACC2, elements_lt_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x16_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X16_ACC2, elements_gt_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x16_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X16_ACC4, elements_eq_16) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x16_acc4, xnn_init_f32_expminus_neon_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X16_ACC4, elements_div_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x16_acc4, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X16_ACC4, elements_lt_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x16_acc4, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X16_ACC4, elements_gt_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x16_acc4, xnn_init_f32_expminus_neon_rr2_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X20, elements_eq_20) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x20, xnn_init_f32_expminus_neon_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X20, elements_div_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x20, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X20, elements_lt_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x20, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X20, elements_gt_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x20, xnn_init_f32_expminus_neon_rr2_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X20_ACC2, elements_eq_20) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x20_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X20_ACC2, elements_div_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x20_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X20_ACC2, elements_lt_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x20_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X20_ACC2, elements_gt_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x20_acc2, xnn_init_f32_expminus_neon_rr2_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X20_ACC5, elements_eq_20) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x20_acc5, xnn_init_f32_expminus_neon_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X20_ACC5, elements_div_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x20_acc5, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X20_ACC5, elements_lt_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x20_acc5, xnn_init_f32_expminus_neon_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_P5_X20_ACC5, elements_gt_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_p5_x20_acc5, xnn_init_f32_expminus_neon_rr2_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X4, elements_eq_4) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(4) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x4, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X4, elements_div_4) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 8; elements < 40; elements += 4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x4, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X4, elements_lt_4) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x4, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X4, elements_gt_4) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 5; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x4, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X8, elements_eq_8) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(8) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x8, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X8, elements_div_8) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 16; elements < 80; elements += 8) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x8, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X8, elements_lt_8) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x8, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X8, elements_gt_8) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 9; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x8, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X8_ACC2, elements_eq_8) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(8) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x8_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X8_ACC2, elements_div_8) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 16; elements < 80; elements += 8) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x8_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X8_ACC2, elements_lt_8) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x8_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X8_ACC2, elements_gt_8) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 9; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x8_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X12, elements_eq_12) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x12, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X12, elements_div_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x12, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X12, elements_lt_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x12, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X12, elements_gt_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x12, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X12_ACC2, elements_eq_12) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x12_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X12_ACC2, elements_div_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x12_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X12_ACC2, elements_lt_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x12_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X12_ACC2, elements_gt_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x12_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X12_ACC3, elements_eq_12) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x12_acc3, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X12_ACC3, elements_div_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x12_acc3, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X12_ACC3, elements_lt_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x12_acc3, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X12_ACC3, elements_gt_12) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x12_acc3, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X16, elements_eq_16) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x16, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X16, elements_div_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x16, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X16, elements_lt_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x16, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X16, elements_gt_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x16, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X16_ACC2, elements_eq_16) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x16_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X16_ACC2, elements_div_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x16_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X16_ACC2, elements_lt_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x16_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X16_ACC2, elements_gt_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x16_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X16_ACC4, elements_eq_16) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x16_acc4, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X16_ACC4, elements_div_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x16_acc4, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X16_ACC4, elements_lt_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x16_acc4, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X16_ACC4, elements_gt_16) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x16_acc4, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X20, elements_eq_20) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x20, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X20, elements_div_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x20, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X20, elements_lt_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x20, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X20, elements_gt_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x20, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X20_ACC2, elements_eq_20) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x20_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X20_ACC2, elements_div_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x20_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X20_ACC2, elements_lt_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x20_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X20_ACC2, elements_gt_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x20_acc2, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X20_ACC5, elements_eq_20) { TEST_REQUIRES_ARM_NEON; RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x20_acc5, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X20_ACC5, elements_div_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x20_acc5, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X20_ACC5, elements_lt_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x20_acc5, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEON_RR2_LUT64_P2_X20_ACC5, elements_gt_20) { TEST_REQUIRES_ARM_NEON; for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neon_rr2_lut64_p2_x20_acc5, xnn_init_f32_expminus_neon_rr2_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X4, elements_eq_4) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(4) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x4, xnn_init_f32_expminus_neonfma_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X4, elements_div_4) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 8; elements < 40; elements += 4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x4, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X4, elements_lt_4) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x4, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X4, elements_gt_4) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 5; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x4, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X8, elements_eq_8) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(8) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x8, xnn_init_f32_expminus_neonfma_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X8, elements_div_8) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 16; elements < 80; elements += 8) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x8, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X8, elements_lt_8) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x8, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X8, elements_gt_8) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 9; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x8, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X8_ACC2, elements_eq_8) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(8) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x8_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X8_ACC2, elements_div_8) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 16; elements < 80; elements += 8) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x8_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X8_ACC2, elements_lt_8) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x8_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X8_ACC2, elements_gt_8) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 9; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x8_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X12, elements_eq_12) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x12, xnn_init_f32_expminus_neonfma_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X12, elements_div_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x12, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X12, elements_lt_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x12, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X12, elements_gt_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x12, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X12_ACC2, elements_eq_12) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x12_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X12_ACC2, elements_div_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x12_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X12_ACC2, elements_lt_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x12_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X12_ACC2, elements_gt_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x12_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X12_ACC3, elements_eq_12) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x12_acc3, xnn_init_f32_expminus_neonfma_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X12_ACC3, elements_div_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x12_acc3, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X12_ACC3, elements_lt_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x12_acc3, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X12_ACC3, elements_gt_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x12_acc3, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X16, elements_eq_16) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x16, xnn_init_f32_expminus_neonfma_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X16, elements_div_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x16, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X16, elements_lt_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x16, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X16, elements_gt_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x16, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X16_ACC2, elements_eq_16) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x16_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X16_ACC2, elements_div_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x16_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X16_ACC2, elements_lt_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x16_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X16_ACC2, elements_gt_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x16_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X16_ACC4, elements_eq_16) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x16_acc4, xnn_init_f32_expminus_neonfma_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X16_ACC4, elements_div_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x16_acc4, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X16_ACC4, elements_lt_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x16_acc4, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X16_ACC4, elements_gt_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x16_acc4, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X20, elements_eq_20) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x20, xnn_init_f32_expminus_neonfma_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X20, elements_div_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x20, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X20, elements_lt_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x20, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X20, elements_gt_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x20, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X20_ACC2, elements_eq_20) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x20_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X20_ACC2, elements_div_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x20_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X20_ACC2, elements_lt_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x20_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X20_ACC2, elements_gt_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x20_acc2, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X20_ACC5, elements_eq_20) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x20_acc5, xnn_init_f32_expminus_neonfma_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X20_ACC5, elements_div_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x20_acc5, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X20_ACC5, elements_lt_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x20_acc5, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_P5_X20_ACC5, elements_gt_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_p5_x20_acc5, xnn_init_f32_expminus_neonfma_rr1_p5_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X4, elements_eq_4) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(4) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x4, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X4, elements_div_4) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 8; elements < 40; elements += 4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x4, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X4, elements_lt_4) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x4, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X4, elements_gt_4) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 5; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x4, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X8, elements_eq_8) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(8) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x8, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X8, elements_div_8) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 16; elements < 80; elements += 8) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x8, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X8, elements_lt_8) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x8, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X8, elements_gt_8) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 9; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x8, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X8_ACC2, elements_eq_8) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(8) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x8_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X8_ACC2, elements_div_8) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 16; elements < 80; elements += 8) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x8_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X8_ACC2, elements_lt_8) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x8_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X8_ACC2, elements_gt_8) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 9; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x8_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X12, elements_eq_12) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x12, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X12, elements_div_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x12, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X12, elements_lt_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x12, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X12, elements_gt_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x12, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X12_ACC2, elements_eq_12) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x12_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X12_ACC2, elements_div_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x12_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X12_ACC2, elements_lt_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x12_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X12_ACC2, elements_gt_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x12_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X12_ACC3, elements_eq_12) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x12_acc3, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X12_ACC3, elements_div_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x12_acc3, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X12_ACC3, elements_lt_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x12_acc3, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X12_ACC3, elements_gt_12) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x12_acc3, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X16, elements_eq_16) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x16, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X16, elements_div_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x16, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X16, elements_lt_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x16, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X16, elements_gt_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x16, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X16_ACC2, elements_eq_16) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x16_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X16_ACC2, elements_div_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x16_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X16_ACC2, elements_lt_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x16_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X16_ACC2, elements_gt_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x16_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X16_ACC4, elements_eq_16) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x16_acc4, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X16_ACC4, elements_div_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x16_acc4, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X16_ACC4, elements_lt_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x16_acc4, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X16_ACC4, elements_gt_16) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x16_acc4, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X20, elements_eq_20) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x20, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X20, elements_div_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x20, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X20, elements_lt_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x20, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X20, elements_gt_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x20, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X20_ACC2, elements_eq_20) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x20_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X20_ACC2, elements_div_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x20_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X20_ACC2, elements_lt_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x20_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X20_ACC2, elements_gt_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x20_acc2, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X20_ACC5, elements_eq_20) { TEST_REQUIRES_ARM_NEON_FMA; RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x20_acc5, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X20_ACC5, elements_div_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x20_acc5, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X20_ACC5, elements_lt_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x20_acc5, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__NEONFMA_RR1_LUT64_P2_X20_ACC5, elements_gt_20) { TEST_REQUIRES_ARM_NEON_FMA; for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__neonfma_rr1_lut64_p2_x20_acc5, xnn_init_f32_expminus_neonfma_rr1_lut64_p2_params); } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X4, elements_eq_4) { TEST_REQUIRES_X86_SSE2; RAddStoreExpMinusMaxMicrokernelTester() .elements(4) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x4, xnn_init_f32_expminus_sse2_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X4, elements_div_4) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 8; elements < 40; elements += 4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x4, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X4, elements_lt_4) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 1; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x4, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X4, elements_gt_4) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 5; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x4, xnn_init_f32_expminus_sse2_rr2_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X8, elements_eq_8) { TEST_REQUIRES_X86_SSE2; RAddStoreExpMinusMaxMicrokernelTester() .elements(8) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x8, xnn_init_f32_expminus_sse2_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X8, elements_div_8) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 16; elements < 80; elements += 8) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x8, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X8, elements_lt_8) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 1; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x8, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X8, elements_gt_8) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 9; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x8, xnn_init_f32_expminus_sse2_rr2_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X8_ACC2, elements_eq_8) { TEST_REQUIRES_X86_SSE2; RAddStoreExpMinusMaxMicrokernelTester() .elements(8) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x8_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X8_ACC2, elements_div_8) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 16; elements < 80; elements += 8) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x8_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X8_ACC2, elements_lt_8) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 1; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x8_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X8_ACC2, elements_gt_8) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 9; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x8_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X12, elements_eq_12) { TEST_REQUIRES_X86_SSE2; RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x12, xnn_init_f32_expminus_sse2_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X12, elements_div_12) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x12, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X12, elements_lt_12) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x12, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X12, elements_gt_12) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x12, xnn_init_f32_expminus_sse2_rr2_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X12_ACC2, elements_eq_12) { TEST_REQUIRES_X86_SSE2; RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x12_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X12_ACC2, elements_div_12) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x12_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X12_ACC2, elements_lt_12) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x12_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X12_ACC2, elements_gt_12) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x12_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X12_ACC3, elements_eq_12) { TEST_REQUIRES_X86_SSE2; RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x12_acc3, xnn_init_f32_expminus_sse2_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X12_ACC3, elements_div_12) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x12_acc3, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X12_ACC3, elements_lt_12) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x12_acc3, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X12_ACC3, elements_gt_12) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x12_acc3, xnn_init_f32_expminus_sse2_rr2_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X16, elements_eq_16) { TEST_REQUIRES_X86_SSE2; RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x16, xnn_init_f32_expminus_sse2_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X16, elements_div_16) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x16, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X16, elements_lt_16) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x16, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X16, elements_gt_16) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x16, xnn_init_f32_expminus_sse2_rr2_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X16_ACC2, elements_eq_16) { TEST_REQUIRES_X86_SSE2; RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x16_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X16_ACC2, elements_div_16) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x16_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X16_ACC2, elements_lt_16) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x16_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X16_ACC2, elements_gt_16) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x16_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X16_ACC4, elements_eq_16) { TEST_REQUIRES_X86_SSE2; RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x16_acc4, xnn_init_f32_expminus_sse2_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X16_ACC4, elements_div_16) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x16_acc4, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X16_ACC4, elements_lt_16) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x16_acc4, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X16_ACC4, elements_gt_16) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x16_acc4, xnn_init_f32_expminus_sse2_rr2_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X20, elements_eq_20) { TEST_REQUIRES_X86_SSE2; RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x20, xnn_init_f32_expminus_sse2_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X20, elements_div_20) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x20, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X20, elements_lt_20) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x20, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X20, elements_gt_20) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x20, xnn_init_f32_expminus_sse2_rr2_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X20_ACC2, elements_eq_20) { TEST_REQUIRES_X86_SSE2; RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x20_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X20_ACC2, elements_div_20) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x20_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X20_ACC2, elements_lt_20) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x20_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X20_ACC2, elements_gt_20) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x20_acc2, xnn_init_f32_expminus_sse2_rr2_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X20_ACC5, elements_eq_20) { TEST_REQUIRES_X86_SSE2; RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x20_acc5, xnn_init_f32_expminus_sse2_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X20_ACC5, elements_div_20) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x20_acc5, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X20_ACC5, elements_lt_20) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x20_acc5, xnn_init_f32_expminus_sse2_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SSE2_RR2_P5_X20_ACC5, elements_gt_20) { TEST_REQUIRES_X86_SSE2; for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__sse2_rr2_p5_x20_acc5, xnn_init_f32_expminus_sse2_rr2_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X64, elements_eq_64) { TEST_REQUIRES_X86_AVX2; RAddStoreExpMinusMaxMicrokernelTester() .elements(64) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x64, xnn_init_f32_expminus_avx2_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X64, elements_div_64) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 128; elements < 640; elements += 64) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x64, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X64, elements_lt_64) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 1; elements < 64; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x64, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X64, elements_gt_64) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 65; elements < 128; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x64, xnn_init_f32_expminus_avx2_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X64_ACC2, elements_eq_64) { TEST_REQUIRES_X86_AVX2; RAddStoreExpMinusMaxMicrokernelTester() .elements(64) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x64_acc2, xnn_init_f32_expminus_avx2_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X64_ACC2, elements_div_64) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 128; elements < 640; elements += 64) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x64_acc2, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X64_ACC2, elements_lt_64) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 1; elements < 64; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x64_acc2, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X64_ACC2, elements_gt_64) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 65; elements < 128; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x64_acc2, xnn_init_f32_expminus_avx2_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X64_ACC4, elements_eq_64) { TEST_REQUIRES_X86_AVX2; RAddStoreExpMinusMaxMicrokernelTester() .elements(64) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x64_acc4, xnn_init_f32_expminus_avx2_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X64_ACC4, elements_div_64) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 128; elements < 640; elements += 64) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x64_acc4, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X64_ACC4, elements_lt_64) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 1; elements < 64; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x64_acc4, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X64_ACC4, elements_gt_64) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 65; elements < 128; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x64_acc4, xnn_init_f32_expminus_avx2_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X72, elements_eq_72) { TEST_REQUIRES_X86_AVX2; RAddStoreExpMinusMaxMicrokernelTester() .elements(72) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x72, xnn_init_f32_expminus_avx2_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X72, elements_div_72) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 144; elements < 720; elements += 72) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x72, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X72, elements_lt_72) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 1; elements < 72; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x72, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X72, elements_gt_72) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 73; elements < 144; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x72, xnn_init_f32_expminus_avx2_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X72_ACC3, elements_eq_72) { TEST_REQUIRES_X86_AVX2; RAddStoreExpMinusMaxMicrokernelTester() .elements(72) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x72_acc3, xnn_init_f32_expminus_avx2_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X72_ACC3, elements_div_72) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 144; elements < 720; elements += 72) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x72_acc3, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X72_ACC3, elements_lt_72) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 1; elements < 72; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x72_acc3, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X72_ACC3, elements_gt_72) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 73; elements < 144; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x72_acc3, xnn_init_f32_expminus_avx2_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X80, elements_eq_80) { TEST_REQUIRES_X86_AVX2; RAddStoreExpMinusMaxMicrokernelTester() .elements(80) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x80, xnn_init_f32_expminus_avx2_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X80, elements_div_80) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 160; elements < 800; elements += 80) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x80, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X80, elements_lt_80) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 1; elements < 80; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x80, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X80, elements_gt_80) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 81; elements < 160; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x80, xnn_init_f32_expminus_avx2_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X80_ACC2, elements_eq_80) { TEST_REQUIRES_X86_AVX2; RAddStoreExpMinusMaxMicrokernelTester() .elements(80) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x80_acc2, xnn_init_f32_expminus_avx2_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X80_ACC2, elements_div_80) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 160; elements < 800; elements += 80) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x80_acc2, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X80_ACC2, elements_lt_80) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 1; elements < 80; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x80_acc2, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X80_ACC2, elements_gt_80) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 81; elements < 160; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x80_acc2, xnn_init_f32_expminus_avx2_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X80_ACC5, elements_eq_80) { TEST_REQUIRES_X86_AVX2; RAddStoreExpMinusMaxMicrokernelTester() .elements(80) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x80_acc5, xnn_init_f32_expminus_avx2_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X80_ACC5, elements_div_80) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 160; elements < 800; elements += 80) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x80_acc5, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X80_ACC5, elements_lt_80) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 1; elements < 80; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x80_acc5, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X80_ACC5, elements_gt_80) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 81; elements < 160; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x80_acc5, xnn_init_f32_expminus_avx2_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96, elements_eq_96) { TEST_REQUIRES_X86_AVX2; RAddStoreExpMinusMaxMicrokernelTester() .elements(96) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96, xnn_init_f32_expminus_avx2_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96, elements_div_96) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 192; elements < 960; elements += 96) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96, elements_lt_96) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 1; elements < 96; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96, elements_gt_96) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 97; elements < 192; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96, xnn_init_f32_expminus_avx2_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96_ACC2, elements_eq_96) { TEST_REQUIRES_X86_AVX2; RAddStoreExpMinusMaxMicrokernelTester() .elements(96) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96_acc2, xnn_init_f32_expminus_avx2_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96_ACC2, elements_div_96) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 192; elements < 960; elements += 96) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96_acc2, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96_ACC2, elements_lt_96) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 1; elements < 96; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96_acc2, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96_ACC2, elements_gt_96) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 97; elements < 192; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96_acc2, xnn_init_f32_expminus_avx2_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96_ACC3, elements_eq_96) { TEST_REQUIRES_X86_AVX2; RAddStoreExpMinusMaxMicrokernelTester() .elements(96) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96_acc3, xnn_init_f32_expminus_avx2_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96_ACC3, elements_div_96) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 192; elements < 960; elements += 96) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96_acc3, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96_ACC3, elements_lt_96) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 1; elements < 96; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96_acc3, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96_ACC3, elements_gt_96) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 97; elements < 192; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96_acc3, xnn_init_f32_expminus_avx2_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96_ACC6, elements_eq_96) { TEST_REQUIRES_X86_AVX2; RAddStoreExpMinusMaxMicrokernelTester() .elements(96) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96_acc6, xnn_init_f32_expminus_avx2_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96_ACC6, elements_div_96) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 192; elements < 960; elements += 96) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96_acc6, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96_ACC6, elements_lt_96) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 1; elements < 96; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96_acc6, xnn_init_f32_expminus_avx2_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX2_RR1_P5_X96_ACC6, elements_gt_96) { TEST_REQUIRES_X86_AVX2; for (size_t elements = 97; elements < 192; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx2_rr1_p5_x96_acc6, xnn_init_f32_expminus_avx2_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X128, elements_eq_128) { TEST_REQUIRES_X86_AVX512F; RAddStoreExpMinusMaxMicrokernelTester() .elements(128) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x128, xnn_init_f32_expminus_avx512_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X128, elements_div_128) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 256; elements < 1280; elements += 128) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x128, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X128, elements_lt_128) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 1; elements < 128; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x128, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X128, elements_gt_128) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 129; elements < 256; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x128, xnn_init_f32_expminus_avx512_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X128_ACC2, elements_eq_128) { TEST_REQUIRES_X86_AVX512F; RAddStoreExpMinusMaxMicrokernelTester() .elements(128) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x128_acc2, xnn_init_f32_expminus_avx512_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X128_ACC2, elements_div_128) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 256; elements < 1280; elements += 128) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x128_acc2, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X128_ACC2, elements_lt_128) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 1; elements < 128; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x128_acc2, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X128_ACC2, elements_gt_128) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 129; elements < 256; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x128_acc2, xnn_init_f32_expminus_avx512_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X128_ACC4, elements_eq_128) { TEST_REQUIRES_X86_AVX512F; RAddStoreExpMinusMaxMicrokernelTester() .elements(128) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x128_acc4, xnn_init_f32_expminus_avx512_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X128_ACC4, elements_div_128) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 256; elements < 1280; elements += 128) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x128_acc4, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X128_ACC4, elements_lt_128) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 1; elements < 128; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x128_acc4, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X128_ACC4, elements_gt_128) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 129; elements < 256; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x128_acc4, xnn_init_f32_expminus_avx512_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X144, elements_eq_144) { TEST_REQUIRES_X86_AVX512F; RAddStoreExpMinusMaxMicrokernelTester() .elements(144) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x144, xnn_init_f32_expminus_avx512_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X144, elements_div_144) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 288; elements < 1440; elements += 144) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x144, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X144, elements_lt_144) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 1; elements < 144; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x144, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X144, elements_gt_144) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 145; elements < 288; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x144, xnn_init_f32_expminus_avx512_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X144_ACC3, elements_eq_144) { TEST_REQUIRES_X86_AVX512F; RAddStoreExpMinusMaxMicrokernelTester() .elements(144) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x144_acc3, xnn_init_f32_expminus_avx512_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X144_ACC3, elements_div_144) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 288; elements < 1440; elements += 144) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x144_acc3, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X144_ACC3, elements_lt_144) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 1; elements < 144; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x144_acc3, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X144_ACC3, elements_gt_144) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 145; elements < 288; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x144_acc3, xnn_init_f32_expminus_avx512_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X160, elements_eq_160) { TEST_REQUIRES_X86_AVX512F; RAddStoreExpMinusMaxMicrokernelTester() .elements(160) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x160, xnn_init_f32_expminus_avx512_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X160, elements_div_160) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 320; elements < 1600; elements += 160) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x160, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X160, elements_lt_160) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 1; elements < 160; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x160, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X160, elements_gt_160) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 161; elements < 320; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x160, xnn_init_f32_expminus_avx512_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X160_ACC2, elements_eq_160) { TEST_REQUIRES_X86_AVX512F; RAddStoreExpMinusMaxMicrokernelTester() .elements(160) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x160_acc2, xnn_init_f32_expminus_avx512_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X160_ACC2, elements_div_160) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 320; elements < 1600; elements += 160) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x160_acc2, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X160_ACC2, elements_lt_160) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 1; elements < 160; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x160_acc2, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X160_ACC2, elements_gt_160) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 161; elements < 320; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x160_acc2, xnn_init_f32_expminus_avx512_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X160_ACC5, elements_eq_160) { TEST_REQUIRES_X86_AVX512F; RAddStoreExpMinusMaxMicrokernelTester() .elements(160) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x160_acc5, xnn_init_f32_expminus_avx512_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X160_ACC5, elements_div_160) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 320; elements < 1600; elements += 160) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x160_acc5, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X160_ACC5, elements_lt_160) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 1; elements < 160; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x160_acc5, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X160_ACC5, elements_gt_160) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 161; elements < 320; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x160_acc5, xnn_init_f32_expminus_avx512_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192, elements_eq_192) { TEST_REQUIRES_X86_AVX512F; RAddStoreExpMinusMaxMicrokernelTester() .elements(192) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192, xnn_init_f32_expminus_avx512_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192, elements_div_192) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 384; elements < 1920; elements += 192) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192, elements_lt_192) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 1; elements < 192; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192, elements_gt_192) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 193; elements < 384; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192, xnn_init_f32_expminus_avx512_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192_ACC2, elements_eq_192) { TEST_REQUIRES_X86_AVX512F; RAddStoreExpMinusMaxMicrokernelTester() .elements(192) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192_acc2, xnn_init_f32_expminus_avx512_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192_ACC2, elements_div_192) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 384; elements < 1920; elements += 192) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192_acc2, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192_ACC2, elements_lt_192) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 1; elements < 192; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192_acc2, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192_ACC2, elements_gt_192) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 193; elements < 384; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192_acc2, xnn_init_f32_expminus_avx512_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192_ACC3, elements_eq_192) { TEST_REQUIRES_X86_AVX512F; RAddStoreExpMinusMaxMicrokernelTester() .elements(192) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192_acc3, xnn_init_f32_expminus_avx512_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192_ACC3, elements_div_192) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 384; elements < 1920; elements += 192) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192_acc3, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192_ACC3, elements_lt_192) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 1; elements < 192; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192_acc3, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192_ACC3, elements_gt_192) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 193; elements < 384; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192_acc3, xnn_init_f32_expminus_avx512_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192_ACC6, elements_eq_192) { TEST_REQUIRES_X86_AVX512F; RAddStoreExpMinusMaxMicrokernelTester() .elements(192) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192_acc6, xnn_init_f32_expminus_avx512_rr1_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192_ACC6, elements_div_192) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 384; elements < 1920; elements += 192) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192_acc6, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192_ACC6, elements_lt_192) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 1; elements < 192; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192_acc6, xnn_init_f32_expminus_avx512_rr1_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__AVX512F_RR1_P5_SCALEF_X192_ACC6, elements_gt_192) { TEST_REQUIRES_X86_AVX512F; for (size_t elements = 193; elements < 384; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__avx512f_rr1_p5_scalef_x192_acc6, xnn_init_f32_expminus_avx512_rr1_p5_params); } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X4, elements_eq_4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(4) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x4, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X4, elements_div_4) { for (size_t elements = 8; elements < 40; elements += 4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x4, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X4, elements_lt_4) { for (size_t elements = 1; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x4, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X4, elements_gt_4) { for (size_t elements = 5; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x4, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X8, elements_eq_8) { RAddStoreExpMinusMaxMicrokernelTester() .elements(8) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x8, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X8, elements_div_8) { for (size_t elements = 16; elements < 80; elements += 8) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x8, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X8, elements_lt_8) { for (size_t elements = 1; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x8, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X8, elements_gt_8) { for (size_t elements = 9; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x8, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X8_ACC2, elements_eq_8) { RAddStoreExpMinusMaxMicrokernelTester() .elements(8) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x8_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X8_ACC2, elements_div_8) { for (size_t elements = 16; elements < 80; elements += 8) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x8_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X8_ACC2, elements_lt_8) { for (size_t elements = 1; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x8_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X8_ACC2, elements_gt_8) { for (size_t elements = 9; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x8_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X12, elements_eq_12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x12, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X12, elements_div_12) { for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x12, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X12, elements_lt_12) { for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x12, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X12, elements_gt_12) { for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x12, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X12_ACC2, elements_eq_12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x12_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X12_ACC2, elements_div_12) { for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x12_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X12_ACC2, elements_lt_12) { for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x12_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X12_ACC2, elements_gt_12) { for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x12_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X12_ACC3, elements_eq_12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(12) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x12_acc3, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X12_ACC3, elements_div_12) { for (size_t elements = 24; elements < 120; elements += 12) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x12_acc3, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X12_ACC3, elements_lt_12) { for (size_t elements = 1; elements < 12; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x12_acc3, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X12_ACC3, elements_gt_12) { for (size_t elements = 13; elements < 24; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x12_acc3, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X16, elements_eq_16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x16, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X16, elements_div_16) { for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x16, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X16, elements_lt_16) { for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x16, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X16, elements_gt_16) { for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x16, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X16_ACC2, elements_eq_16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x16_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X16_ACC2, elements_div_16) { for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x16_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X16_ACC2, elements_lt_16) { for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x16_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X16_ACC2, elements_gt_16) { for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x16_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X16_ACC4, elements_eq_16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(16) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x16_acc4, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X16_ACC4, elements_div_16) { for (size_t elements = 32; elements < 160; elements += 16) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x16_acc4, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X16_ACC4, elements_lt_16) { for (size_t elements = 1; elements < 16; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x16_acc4, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X16_ACC4, elements_gt_16) { for (size_t elements = 17; elements < 32; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x16_acc4, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X20, elements_eq_20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x20, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X20, elements_div_20) { for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x20, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X20, elements_lt_20) { for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x20, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X20, elements_gt_20) { for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x20, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X20_ACC2, elements_eq_20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x20_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X20_ACC2, elements_div_20) { for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x20_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X20_ACC2, elements_lt_20) { for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x20_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X20_ACC2, elements_gt_20) { for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x20_acc2, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X20_ACC5, elements_eq_20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(20) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x20_acc5, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X20_ACC5, elements_div_20) { for (size_t elements = 40; elements < 200; elements += 20) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x20_acc5, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X20_ACC5, elements_lt_20) { for (size_t elements = 1; elements < 20; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x20_acc5, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__WASMSIMD_RR2_P5_X20_ACC5, elements_gt_20) { for (size_t elements = 21; elements < 40; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__wasmsimd_rr2_p5_x20_acc5, xnn_init_f32_expminus_wasmsimd_rr2_p5_params); } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X1, elements_eq_1) { RAddStoreExpMinusMaxMicrokernelTester() .elements(1) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x1, xnn_init_f32_expminus_scalar_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X1, elements_gt_1) { for (size_t elements = 2; elements < 10; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x1, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X2, elements_eq_2) { RAddStoreExpMinusMaxMicrokernelTester() .elements(2) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x2, xnn_init_f32_expminus_scalar_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X2, elements_div_2) { for (size_t elements = 4; elements < 20; elements += 2) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x2, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X2, elements_lt_2) { for (size_t elements = 1; elements < 2; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x2, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X2, elements_gt_2) { for (size_t elements = 3; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x2, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X2_ACC2, elements_eq_2) { RAddStoreExpMinusMaxMicrokernelTester() .elements(2) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x2_acc2, xnn_init_f32_expminus_scalar_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X2_ACC2, elements_div_2) { for (size_t elements = 4; elements < 20; elements += 2) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x2_acc2, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X2_ACC2, elements_lt_2) { for (size_t elements = 1; elements < 2; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x2_acc2, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X2_ACC2, elements_gt_2) { for (size_t elements = 3; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x2_acc2, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X4, elements_eq_4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(4) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x4, xnn_init_f32_expminus_scalar_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X4, elements_div_4) { for (size_t elements = 8; elements < 40; elements += 4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x4, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X4, elements_lt_4) { for (size_t elements = 1; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x4, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X4, elements_gt_4) { for (size_t elements = 5; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x4, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X4_ACC2, elements_eq_4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(4) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x4_acc2, xnn_init_f32_expminus_scalar_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X4_ACC2, elements_div_4) { for (size_t elements = 8; elements < 40; elements += 4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x4_acc2, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X4_ACC2, elements_lt_4) { for (size_t elements = 1; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x4_acc2, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X4_ACC2, elements_gt_4) { for (size_t elements = 5; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x4_acc2, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X4_ACC4, elements_eq_4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(4) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x4_acc4, xnn_init_f32_expminus_scalar_rr2_p5_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X4_ACC4, elements_div_4) { for (size_t elements = 8; elements < 40; elements += 4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x4_acc4, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X4_ACC4, elements_lt_4) { for (size_t elements = 1; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x4_acc4, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_P5_X4_ACC4, elements_gt_4) { for (size_t elements = 5; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_p5_x4_acc4, xnn_init_f32_expminus_scalar_rr2_p5_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X1, elements_eq_1) { RAddStoreExpMinusMaxMicrokernelTester() .elements(1) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x1, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X1, elements_gt_1) { for (size_t elements = 2; elements < 10; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x1, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X2, elements_eq_2) { RAddStoreExpMinusMaxMicrokernelTester() .elements(2) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x2, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X2, elements_div_2) { for (size_t elements = 4; elements < 20; elements += 2) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x2, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X2, elements_lt_2) { for (size_t elements = 1; elements < 2; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x2, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X2, elements_gt_2) { for (size_t elements = 3; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x2, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X2_ACC2, elements_eq_2) { RAddStoreExpMinusMaxMicrokernelTester() .elements(2) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x2_acc2, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X2_ACC2, elements_div_2) { for (size_t elements = 4; elements < 20; elements += 2) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x2_acc2, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X2_ACC2, elements_lt_2) { for (size_t elements = 1; elements < 2; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x2_acc2, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X2_ACC2, elements_gt_2) { for (size_t elements = 3; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x2_acc2, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X4, elements_eq_4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(4) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x4, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X4, elements_div_4) { for (size_t elements = 8; elements < 40; elements += 4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x4, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X4, elements_lt_4) { for (size_t elements = 1; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x4, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X4, elements_gt_4) { for (size_t elements = 5; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x4, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X4_ACC2, elements_eq_4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(4) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x4_acc2, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X4_ACC2, elements_div_4) { for (size_t elements = 8; elements < 40; elements += 4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x4_acc2, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X4_ACC2, elements_lt_4) { for (size_t elements = 1; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x4_acc2, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X4_ACC2, elements_gt_4) { for (size_t elements = 5; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x4_acc2, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X4_ACC4, elements_eq_4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(4) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x4_acc4, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X4_ACC4, elements_div_4) { for (size_t elements = 8; elements < 40; elements += 4) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x4_acc4, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X4_ACC4, elements_lt_4) { for (size_t elements = 1; elements < 4; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x4_acc4, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } } TEST(F32_RADDSTOREEXPMINUSMAX__SCALAR_RR2_LUT64_P2_X4_ACC4, elements_gt_4) { for (size_t elements = 5; elements < 8; elements++) { RAddStoreExpMinusMaxMicrokernelTester() .elements(elements) .Test(xnn_f32_raddstoreexpminusmax_ukernel__scalar_rr2_lut64_p2_x4_acc4, xnn_init_f32_expminus_scalar_rr2_lut64_p2_params); } }
// UrlFormats returns options for URL formats func (i InternetProvider) UrlFormats() []string { return []string{ "http://www.{{domainName}}/", "http://{{domainName}}/", "http://www.{{domainName}}/{{slug}}", "http://www.{{domainName}}/{{slug}}", "https://www.{{domainName}}/{{slug}}", "http://www.{{domainName}}/{{slug}}.html", "http://{{domainName}}/{{slug}}", "http://{{domainName}}/{{slug}}", "http://{{domainName}}/{{slug}}.html", "https://{{domainName}}/{{slug}}.html", } }
<gh_stars>0 import { ExtractJwt, Strategy } from 'passport-jwt'; import { PassportStrategy } from '@nestjs/passport'; import { Injectable } from '@nestjs/common'; import { userJwtConstants } from '../constants/userJwtConstants'; import { JWTPayload } from '../interfaces/user-token-payload.interface'; @Injectable() export class JwtUserStrategy extends PassportStrategy(Strategy) { constructor() { super({ jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(), ignoreExpiration: false, secretOrKey: userJwtConstants.secret, }); } async validate(payload: JWTPayload) { return payload; } }
if __name__=="__main__": s='+'.join(sorted(input().split('+'))) print(s)
Hedge fund manager David Einhorn has trimmed his Apple stake in the last quarter of 2014, according to his fund's latest 13F filing. During the fourth quarter, Greenlight Capital sold 566,500 shares of Apple. Still, the fund held just over 8.6 million shares even after the sales, according to the filing. In his fourth quarter letter to investors, Einhorn wrote that Apple was one of the fund's "significant winners." Apple remains one of Greenlight's top stock holdings. Hedge funds only have to disclose their long equity holdings in 13Fs. These filings come out 45 days after the end of each quarter.
from django.urls import re_path from pretalx.event.models.event import SLUG_CHARS from .views import VimeoSettings, api_list, api_single urlpatterns = [ re_path( fr"^orga/event/(?P<event>[{SLUG_CHARS}]+)/settings/p/vimeo/$", VimeoSettings.as_view(), name="settings", ), re_path( fr"^api/events/(?P<event>[{SLUG_CHARS}]+)/p/vimeo/$", api_list, name="api_list", ), re_path( fr"^api/events/(?P<event>[{SLUG_CHARS}]+)/submissions/(?P<code>[A-Z0-9]+)/p/vimeo/$", api_single, name="api_single", ), ]
P2Y1 purinoreceptors are fundamental to inhibitory motor control of murine colonic excitability and transit Key points Normal colonic motility is regulated by excitatory and inhibitory motor neurons, and previous studies have shown that both components of neural regulation are important for normal propulsion of colonic contents. Inhibitory neural control consists of two main components, and the major neurotransmitters have been identified as nitric oxide and purines; we investigated the nature of the receptors responsible for purine inhibitory motor control of the colon using mice with P2Y1 receptors deactivated. Inhibitory control of the colon by purine neurotransmitters was dramatically decreased in these animals and transit of fecal pellets was delayed. Inhibitory responses to purine neurotransmission and exogenous NAD, a neurotransmitter candidate, were completely abolished in P2Y1 receptor knockouts. These studies demonstrate the importance of purinergic neural regulation of colonic motility and suggest this form of neural regulation depends upon P2Y1 receptors to receive and transduce inhibitory neural signals.
Role of endoscopy in diagnosis and treatment of gallstone disease complicated by the pathology of the extrahepatic bilary tract (literature review) The article presents current literature data of domestic and foreign authors on the main problems of endoscopic diagnostics and complex approach to treatment of gallstone disease complicated by pathology of the extrahepatic biliary tract. Efficiency of one-stage and two-stage methods of surgical treatment of cholelithiasis and the possibility of their practical application are considered. Complex approach for minimally invasive bile duct interventions with cholecystoccholedocholitiase, which can be conditionally divided into laparoscopic, mini-access, endoscopic by duodenoscope, cholangioscopy, ultrasound-controlled biliary intervention, is analyzed. Methods of diagnostic testing that can be divided into preoperative and intraoperative, non-invasive and invasive used in patients with cholecystoccholedocholitiase, namely fibrogastroduodenoscopy, endoscopic retrograde cholangiopancreatography, percutaneous-transhepatic cholangiography, diagnostic laparoscopy, intraoperative cholangiography, intraoperative ultrasound, angiography. New concepts of providing surgical care to patients with this pathology are presented, which include one-stage performance of cholecystectomy with priority use of intraoperative antegrade endoscopic papillosphincterotomy, and retrograde litho-extraction under duodenoscope control, in comparison with the two-stage tactics of correction of cholelithiasis with pathology of extrahepatic biliary tract, when the first stage includes its decompression, rehabilitation, and the second cholecystectomy. Statistical data of complications arising during diagnostic and therapeutic manipulations in patients with cholelithiasis complicated by pathology of the extrahepatic biliary tract are presented. Number of cases of postoperative mortality depending on the severity of complications of cholelithiasis is also considered.
Interparental conflict and the children of discord and divorce. Data on the relation between marital turmoil (i.e., discord and divorce) and behavior problems in children are reviewed. It is concluded that a relation between the two domains docs exist. Several parameters of this relation are outlined, including type of marital turmoil, form of the child's behavioral response, sex differences, age effects, parental buffering, and effects of parental psychopathology. Conclusions drawn from this review are used to evaluate several broad etiological hypotheses about the effect of marital turmoil on children, and implications for the treatment of behavior problems in children from these families are discussed. Finally, interpretative and methodological refinements are suggested for future research.
Cathode ray tube (CRT) displays have been available for many years. The first cathode ray tube applications were primarily in television and oscilloscopes. Later, as computers developed, information display devices, employing a CRT responsive to a general purpose or special purpose digital computer, were developed to provide a two level, black-white, alphanumeric display. Often, the video amplifier driving the computer responsive display was the same video amplifier used in analog (television and oscilloscope) applications and consequently the earlier computer responsive displays had severe bandwidth constraints compared with the available digital switching rates. Soon thereafter, however, CRT displays for presenting alphanumerics employed video amplifiers having on-off solid state switching so that one brightness level and a black level could be displayed on the cathode ray tube face at a relatively high bandwidth. As the applications in which the cathode ray tube displays were used increased in both complexity and sophistication, and to increase their appeal for the user, two levels of brightness (plus a black level) were provided to allow the user the option of emphasizing selected display material by using a different brightness background. As the display applications of cathode ray tubes became yet more sophisticated, there continued a pressing need to increase the speed (or bandwidth) of the video circuitry driving the tube to provide a faster display and hence a "crisper" display, that is, a display having sharper edges and hence a generally more pleasing aesthetic appearance at high display rates. As a result, the assignee of the present invention has provided video displays having two brightness levels plus a black level (a total of three video levels) which operate at a video bandwidth of approximately 25-50 MHz. A principle object of this invention is a video amplifier capable of operating at still higher speeds while providing greater brightness level flexibility. Other objects of the invention are a video amplifier having a relatively low cost, high reliability, and which can be a plug-in replacement for present slower video amplifiers. Still further objects of the invention are a video amplifier having a flexible decoding arrangement wherein different digital input signal coding can be accommodated.
<gh_stars>10-100 //! Standard library timers with dynamic allocation of the timer's storage. use std::{time::{Duration, Instant}}; use crate::{FsmBackend, FsmTimers}; pub struct TimersStd<F> where F: FsmBackend { timers: Vec<(<F as FsmBackend>::Timers, StdTimer)>, pending_intervals: Option<(<F as FsmBackend>::Timers, usize)> } #[derive(Debug)] enum StdTimer { Timeout { started_at: Instant, duration: Duration }, Interval { started_at: Instant, interval: Duration } } impl<F> TimersStd<F> where F: FsmBackend { pub fn new() -> Self { Self { timers: vec![], pending_intervals: None } } } impl<F> FsmTimers<F> for TimersStd<F> where F: FsmBackend { fn create(&mut self, id: <F as FsmBackend>::Timers, settings: &crate::TimerSettings) -> crate::FsmResult<()> { // try to cancel any existing ones self.cancel(id.clone())?; if settings.renew { self.timers.push((id, StdTimer::Interval { started_at: Instant::now(), interval: settings.timeout })); } else { self.timers.push((id, StdTimer::Timeout { started_at: Instant::now(), duration: settings.timeout })); } Ok(()) } fn cancel(&mut self, id: <F as FsmBackend>::Timers) -> crate::FsmResult<()> { self.timers.retain(|(timer_id, _)| *timer_id != id); Ok(()) } fn get_triggered_timer(&mut self) -> Option<<F as FsmBackend>::Timers> { if let Some((id, mut times)) = self.pending_intervals.take() { times -= 1; if times > 0 { self.pending_intervals = Some((id.clone(), times)); } return Some(id); } let mut timed_out_idx = None; let now = Instant::now(); for (idx, (timer_id, timer)) in self.timers.iter_mut().enumerate() { match timer { StdTimer::Timeout { started_at, duration } if now.duration_since(*started_at) >= *duration => { timed_out_idx = Some(idx); break; }, StdTimer::Interval { ref mut started_at, interval } if now.duration_since(*started_at) >= *interval => { let t = now.duration_since(*started_at); let times = ((t.as_secs_f32() / interval.as_secs_f32()).floor() as usize) - 1; if times > 0 { self.pending_intervals = Some((timer_id.clone(), times)); } *started_at = now; return Some(timer_id.clone()); }, _ => () } } if let Some(idx) = timed_out_idx { let (id, _) = self.timers.remove(idx); return Some(id); } None } }
The effect of native silk fibroin powder on the physical properties and biocompatibility of biomedical polyurethane membrane Naturally derived fibers such as silk fibroin can potentially enhance the biocompatibility of currently used biomaterials. This study investigated the physical properties of native silk fibroin powder and its effect on the biocompatibility of biomedical polyurethane. Native silk fibroin powder with an average diameter of 3m was prepared on a purpose-built machine. A simple method of phase inversion was used to produce biomedical polyurethane/native silk fibroin powder hybrid membranes at different blend ratios by immersing a biomedical polyurethane/native silk fibroin powder solution in deionized water at room temperature. The physical properties of the membranes including morphology, hydrophilicity, roughness, porosity, and compressive modulus were characterized, and in vitro biocompatibility was evaluated by seeding the human umbilical vein endothelial cells on the top surface. Native silk fibroin powder had a concentration-dependent effect on the number and morphology of human umbilical vein endothelial cells growing on the membranes; cell number increased as native silk fibroin powder content in the biomedical polyurethane/native silk fibroin powder hybrid membrane was increased from 0% to 50%, and cell morphology changed from spindle-shaped to cobblestone-like as the native silk fibroin powder content was increased from 0% to 70%. The latter change was related to the physical characteristics of the membrane, including hydrophilicity, roughness, and mechanical properties. The in vivo biocompatibility of the native silk fibroin powdermodified biomedical polyurethane membrane was evaluated in a rat model; the histological analysis revealed no systemic toxicity. These results indicate that the biomedical polyurethane/native silk fibroin powder hybrid membrane has superior in vitro and in vivo biocompatibility relative to 100% biomedical polyurethane membranes and thus has potential applications in the fabrication of small-diameter vascular grafts and in tissue engineering.
#ifndef EFFECTFACTORY_H #define EFFECTFACTORY_H #include <effects/effect.h> class EffectFactory { public: static EffectFactory *instance(); void registerPrototype(const Effect *prototype); bool unregisterPrototype(const Effect *prototype); bool unregisterPrototype(const QString &id); bool isRegistered(const QString &id) const; const Effect *prototype(const QString &id) const; Effect *create(const QString &id) const; // template <typename T> // T *create(const QString &id) const; Effect *deserialize(const QJsonObject effectJson) const; // template <typename T> // T *deserialize(const QJsonDocument effectJson) const; private: EffectFactory(); static EffectFactory *gInstance; QHash<const QString, const Effect *> mPrototypes; }; #endif // EFFECTFACTORY_H
Scheduling temporal data for real-time requests in roadside-to-vehicle communication Recent advances in wireless communication technologies have spawned many new applications in vehicular networks. Data dissemination via roadside-to-vehicle communication is a vital approach to enabling most of these applications. In this work, we investigate in the scenario where data items are broadcasted from the road-side unit (RSU) in response to requests submitted by passing vehicles. Data items are associated with temporal constraints and updated periodically to reflect dynamic states of traffic information. Each request may ask for multiple temporal data items, and it is associated with a deadline, which may either be specified by the driver or imposed by the time when the vehicle drives through the service region. In particular, we develop a real-time data dissemination model based on roadside-to-vehicle communication by formulating the time-constraint of requests and the consistency requirement of retrieving temporal data items. On this basis, we propose an online scheduling algorithm to enhance the system performance in terms of maximizing request service and improving bandwidth utilization. Lastly, we build a simulation model to evaluate the algorithm performance in a variety of situations. Experimental results demonstrate that the proposed algorithm outperforms existing algorithms significantly in both request serving and bandwidth utilization.
/* * Copyright (C) 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include "NetscapePluginModule.h" #if ENABLE(NETSCAPE_PLUGIN_API) #include "Module.h" #include "NPRuntimeUtilities.h" #include "NetscapeBrowserFuncs.h" #include <wtf/NeverDestroyed.h> #include <wtf/text/CString.h> namespace WebKit { static Vector<NetscapePluginModule*>& initializedNetscapePluginModules() { static NeverDestroyed<Vector<NetscapePluginModule*>> initializedNetscapePluginModules; return initializedNetscapePluginModules; } NetscapePluginModule::NetscapePluginModule(const String& pluginPath) : m_pluginPath(pluginPath) , m_isInitialized(false) , m_loadCount(0) , m_shutdownProcPtr(0) , m_pluginFuncs() { } NetscapePluginModule::~NetscapePluginModule() { ASSERT(initializedNetscapePluginModules().find(this) == notFound); } Vector<String> NetscapePluginModule::sitesWithData() { Vector<String> sites; incrementLoadCount(); tryGetSitesWithData(sites); decrementLoadCount(); return sites; } bool NetscapePluginModule::clearSiteData(const String& site, uint64_t flags, uint64_t maxAge) { incrementLoadCount(); bool result = tryClearSiteData(site, flags, maxAge); decrementLoadCount(); return result; } bool NetscapePluginModule::tryGetSitesWithData(Vector<String>& sites) { if (!m_isInitialized) return false; // Check if the plug-in supports NPP_GetSitesWithData. if (!m_pluginFuncs.getsiteswithdata) return false; char** siteArray = m_pluginFuncs.getsiteswithdata(); // There were no sites with data. if (!siteArray) return true; for (int i = 0; siteArray[i]; ++i) { char* site = siteArray[i]; String siteString = String::fromUTF8(site); if (!siteString.isNull()) sites.append(siteString); npnMemFree(site); } npnMemFree(siteArray); return true; } bool NetscapePluginModule::tryClearSiteData(const String& site, uint64_t flags, uint64_t maxAge) { if (!m_isInitialized) return false; // Check if the plug-in supports NPP_ClearSiteData. if (!m_pluginFuncs.clearsitedata) return false; CString siteString; if (!site.isNull()) siteString = site.utf8(); return m_pluginFuncs.clearsitedata(siteString.data(), flags, maxAge) == NPERR_NO_ERROR; } void NetscapePluginModule::shutdown() { ASSERT(m_isInitialized); m_shutdownProcPtr(); m_isInitialized = false; size_t pluginModuleIndex = initializedNetscapePluginModules().find(this); ASSERT(pluginModuleIndex != notFound); initializedNetscapePluginModules().remove(pluginModuleIndex); } RefPtr<NetscapePluginModule> NetscapePluginModule::getOrCreate(const String& pluginPath) { // First, see if we already have a module with this plug-in path. for (size_t i = 0; i < initializedNetscapePluginModules().size(); ++i) { NetscapePluginModule* pluginModule = initializedNetscapePluginModules()[i]; if (pluginModule->m_pluginPath == pluginPath) return pluginModule; } auto pluginModule(adoptRef(*new NetscapePluginModule(pluginPath))); // Try to load and initialize the plug-in module. if (!pluginModule->load()) return nullptr; return WTFMove(pluginModule); } void NetscapePluginModule::incrementLoadCount() { if (!m_loadCount) { // Load the plug-in module if necessary. load(); } m_loadCount++; } void NetscapePluginModule::decrementLoadCount() { ASSERT(m_loadCount > 0); m_loadCount--; if (!m_loadCount && m_isInitialized) { shutdown(); unload(); } } bool NetscapePluginModule::load() { if (m_isInitialized) { ASSERT(initializedNetscapePluginModules().find(this) != notFound); return true; } if (!tryLoad()) { unload(); return false; } m_isInitialized = true; ASSERT(initializedNetscapePluginModules().find(this) == notFound); initializedNetscapePluginModules().append(this); determineQuirks(); return true; } #if PLATFORM(GTK) static bool moduleMixesGtkSymbols(Module* module) { #ifdef GTK_API_VERSION_2 return module->functionPointer<gpointer>("gtk_application_get_type"); #else return module->functionPointer<gpointer>("gtk_object_get_type"); #endif } #endif bool NetscapePluginModule::tryLoad() { m_module = std::make_unique<Module>(m_pluginPath); if (!m_module->load()) return false; #if PLATFORM(GTK) if (moduleMixesGtkSymbols(m_module.get())) return false; #endif NP_InitializeFuncPtr initializeFuncPtr = m_module->functionPointer<NP_InitializeFuncPtr>("NP_Initialize"); if (!initializeFuncPtr) return false; #if !PLUGIN_ARCHITECTURE(UNIX) NP_GetEntryPointsFuncPtr getEntryPointsFuncPtr = m_module->functionPointer<NP_GetEntryPointsFuncPtr>("NP_GetEntryPoints"); if (!getEntryPointsFuncPtr) return false; #endif m_shutdownProcPtr = m_module->functionPointer<NPP_ShutdownProcPtr>("NP_Shutdown"); if (!m_shutdownProcPtr) return false; m_pluginFuncs.size = sizeof(NPPluginFuncs); m_pluginFuncs.version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR; // On Mac, NP_Initialize must be called first, then NP_GetEntryPoints. On Windows, the order is // reversed. Failing to follow this order results in crashes (e.g., in Silverlight on Mac and // in Flash and QuickTime on Windows). #if PLUGIN_ARCHITECTURE(MAC) #ifndef NP_NO_CARBON #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" // Plugins (at least QT) require that you call UseResFile on the resource file before loading it. ResFileRefNum currentResourceFile = CurResFile(); ResFileRefNum pluginResourceFile = m_module->bundleResourceMap(); UseResFile(pluginResourceFile); #endif bool result = initializeFuncPtr(netscapeBrowserFuncs()) == NPERR_NO_ERROR && getEntryPointsFuncPtr(&m_pluginFuncs) == NPERR_NO_ERROR; #ifndef NP_NO_CARBON // Restore the resource file. UseResFile(currentResourceFile); #pragma clang diagnostic pop #endif return result; #elif PLUGIN_ARCHITECTURE(UNIX) if (initializeFuncPtr(netscapeBrowserFuncs(), &m_pluginFuncs) != NPERR_NO_ERROR) return false; #endif return true; } void NetscapePluginModule::unload() { ASSERT(!m_isInitialized); m_module = nullptr; } } // namespace WebKit #endif // ENABLE(NETSCAPE_PLUGIN_API)
Present and future of secondary prevention after an acute coronary syndrome Despite a marked improvement of in-hospital outcome of patients with Acute Coronary Syndrome (ACS), long-term outcome remains poor. There remains a high risk of complications, Non ST-Elevation ACS (NSTE-ACS) patients being at higher risk than those with ST-elevation ACS, in part due to more diffuse coronary artery disease. Whether with conservative medical management or an early invasive approach, of which they less frequently benefit, NSTE-ACS patients are less frequently treated according to guidelines. Therapeutic adhesion within the months following hospital discharge is low and associated with an increase in one-year mortality. The next step in the improvement of care of ACS patients will be to use multi-dimensional prevention programs that use didactic information tools and improve patient motivation, aimed at reinforcing the use of guidelines, promoting in-hospital therapeutic education, creating patient-health care provider partnerships and including discharge programs that ensure the prescription of recommended therapies. Introduction to the pathogenesis and treatment strategies of acute coronary syndromes Coronary artery disease is the result of the development of coronary atherosclerosis. The pathogenesis is complex and linked to the proliferation of smooth muscle cells, synthesis of connective tissue matrix, focal accumulation of monocytes/ macrophages, infiltration of lymphocytes and various levels of intracellular and extracellular lipid accumulation. Atherosclerosis can be considered to be a response to injury, with the major risk factors being elevated blood pressure, pathological lipid profiles, cigarette smoking, diabetes mellitus, family history, age and gender, some of these being modifiable. Atherosclerosis is a chronic disease that can affect all arteries, and in particular the cerebral, cardiac, renal and peripheral ones. The clinical manifestations are a consequence of the subsequent progressive or acute occlusion of these arteries and include coronary heart disease, cerebrovascular disease and peripheral arterial disease. With regard to cardiac manifestations, the disease ranges from an asymptomatic state to potential sudden death. Angina pectoris (chest pain) often presents in patients who develop progressive obstruction of their coronary arteries, referred to as stable coronary artery disease. Acute coronary syndromes (ACS) cover the constellation of acute clinical presentations linked to the rupture of an unstable atherosclerotic plaque and the subsequent platelet aggregation and thrombus formation that acutely and often completely occludes a coronary artery. ACSs have been categorized using clinical, elecrocardiographical and biological criteria. Thus clinical presentations associating elevation of biomarkers of myocardial injury with electrocardiographic ST segment elevation are referred to as ST elevation myocardial infarction (MI) (STEMI), those without ST elevation are referred to as Non ST-elevation MI (NSTEMI or NSTE-ACS) and when the syndrome is accompanied by neither ST elevation or biomarker elevation, it is referred to as Unstable Angina (UA). The overall therapeutic aim in all circumstances is to reestablish coronary patency and thus balance myocardial demand and supply of oxygenated blood. Revascularization is primarily achieved using percutaneous coronary interventions (PCI) and angioplasty in association with powerful anti-thrombotic agents and subsequent clinical and electrocardiographic monitoring. Secondary Introduction The prognosis of acute coronary syndrome (ACS) has much improved in recent years as a result of advances in the early initiation of anti-thrombotic therapies, early invasive management and the development of coronary care units. Nevertheless, the risk of recurrence of cardiovacular complications after an ACS remains as high as 15% at 12 months. International guidelines recommend pharmacologic and lifestyle interventions to reduce recurrent events in patients with coronary and other atherosclerotic vascular disease. However, audits of practice reveal suboptimal control of cardiovascular risk factors and under use of evidence-based cardiovascular medication. Consequently the lack of in-hospital initiation of evidence-based cardiovascular medications seems to alter long-term patient compliance and clinical outcomes. In addition, 30% of patients stop their treatment either partially or totally within 30 days after hospital discharge with a significant increase in 1-year mortality. In the United States, projects have tested pragmatic interventions targeting an increase in prescription rates by physicians and/or long-term medication adherence by patients. In Europe, Wood et al. recently showed an association between healthier lifestyle and improvements in cardiovascular risk factor control for patients with coronary heart disease who benefitted from a nurse coordinated, multidisciplinary, family-based, ambulatory program. The benefit of in-hospital multidimensional interventions for patients after an ACS was demonstrated in a recent review and meta-analysis. In this meta-analysis, secondary prevention programs were categorized as patient-, health care provider-(HCP) and system-level interventions. It was demonstrated that multidimensional interventions, targeting the patients, the provider and the health care system increased prescription rates of proven efficacious medication and seemed to reduce mortality and recurrent ACS. Data from the international GRACE registry showed various prescription rates of cardiovascular medication according to regions of the world. Variations across countries might be due to national quality improvement strategies and probably cultural differences as well. To date, there is no systematic prospective data collection in the setting of a nation-level multidimensional quality improvement strategy or incentives to improve the care of patients with coronary heart disease. Multi-dimensional quality improvement programs should be implemented to firstly improve the application of recommended therapies for patients admitted to the hospital for an ACS, secondly, to improve patient therapeutic education, and finally to improve the continuation of education and recommended medical management for long-term secondary prevention in a health care system network including acute care hospitals, rehabilitation centers and outpatient physicians. ACS patients have a high risk of recurrent cardiovascular events and of mortality Overall mortality rates from the onstart of myocardial injury before hospital admission until discharge is difficult to determine because of several clinical and epidemiological limitations such as the frequent occurrence of silent ischemia or silent MI, the consistent rate of pre-hospital sudden death, and the varying methods and definitions used in the diagnosis of death and its etiology. Population studies have consistently shown that overall case fatality rates of patients with presumed MI or ACS in the first 30 days is higher than 50%, and about half of these deaths occur within the first 2 h. Pre-hospital mortality seems to have modestly decreased over the last decades in contrast with in-hospital mortality after an ACS, which was markedly decreased thanks to monitoring in coronary care units, improvement of in-hospital care including urgent reperfusion using thrombolytic therapy and primary percutaneous coronary intervention (PCI) in STEMI, new anti-thrombotic therapies, the use of more sensitive biomarkers of risk such as troponin, and a better stratification of the predicted risk with an early invasive strategy for intermediate and higher risk NST-ACS patients. The short-term mortality rate after an ACS is markedly higher for patients with ST-elevation myocardial infarction (STEMI) than for patients with non ST-elevation myocardial infarction (NSTEMI) itself higher than that of patients with unstable angina (UA) for NSTEMI and UA due to the implementation of more recent guidelines, which include more aggressive antithrombotic therapy associated with early invasive approaches or coronary angiography and subsequent PCI. Of note this study demonstrated the favorable impact of the implementation of new guidelines on the outcome of patients in the setting of NSTE-ACS. Paradoxically, long-term mortality rate is higher for patients with non ST-elevation ACS (NSTE-ACS) than those with STEMI as it was shown in the data published by Terkelsen et al.: from hospital admission, 1 year mortality was 31% for NSTEMI patients, 21% for STEMI patients, and 55% for MI associated with a bundle branch block (P<0.001) ( Fig. 1). Interestingly, one-month mortality has since been reduced to a much lower level of 4-6% or even less in large-scale randomized trials compared to registries suggesting that patients included in randomized trials are at lower risk when compared with those observed in the real world. All these data demonstrate that inhospital and 30-day mortality has been markedly decreased over the last decades due in part to improvements in medical therapies and to more aggressive earlier invasive interventions. Short-term mortality rate is higher in STEMI than in NSTE-ACS, however this difference is already abolished after 1 year and the decrease of one-year mortality rate over the years is less pronounced than the decrease of 30-days mortality rate. These data summarize the favorable impact of in-hospital management of the acute phase of ACS and the weaker impact of therapeutic progresses on long-term outcome after an ACS. Long-term outcome of patients after an ACS is mainly dependent on the chronic nature of atherosclerosis, which exposes ACS patients to a high risk (15%) of recurrent cardiovascular events at 1 year. In the past, restenosis was a reason for recurrent target lesion revascularization after PCI in 20-30% after stenting procedures without significant impact on mortality, however the use of drug-eluting stents gave a definite solution to this issue. Recurrent cardiovascular events after an ACS are therefore today mainly explained by the natural history of atherosclerosis with plaque progression and rupture. Indeed Cutlip et al. demonstrated even before the era of drug-eluting stents that after 2 years, the rate of stable and unstable recurrent coronary events occurred 5 times more frequently in other coronary arteries than that involved during the initial ACS. In-hospital underuse of recommended therapies after an ACS Unfortunately, important gaps exist between international recommendations for the management of patients with ACS and atherosclerosis and everyday practice (Fig. 2). Of note, if treatment in secondary prevention of atherosclerosis after a MI is not initiated at the time of discharge, the likelihood of ever receiving treatment is low. On the other hand if medical therapy in secondary prevention after MI is started early, most patients adhere to treatment on the long term. Furthermore, the prescribed doses of medications are usually and substantially lower than those recommended and seldom adjusted during long-term therapy. Interestingly, patients admitted for an ACS treated medically are less likely to be treated according to guidelines than those who benefit from an invasive management. Therefore reinforcement of the application of guidelines in ACS and secondary prevention must be implemented to increase the rate of prescription of recommended therapies during the hospital stay of patients admitted for an ACS. Such programs have been successfully implemented for example the Cardiac Hospitalization Atherosclerosis Management Program (CHAMP), which was developed and implemented at a university-affiliated teaching hospital. The program focused on initiation of aspirin, cholesterol-lowering medication titrated to achieve the recommended target level of LDL-cholesterol, betablocker, and angiotensin-converting enzyme (ACE) inhibitor therapy in conjunction with lifestyle change counseling in patients with established coronary artery disease before hospital discharge. A clinical study assessed the impact of the CHAMP program on secondary prevention medication utilization in a before/after design including 256 and 302 patients respectively in each time period. Aspirin use at discharge improved from 68% to 92% (p<0.01), betablocker use improved from 12% to 62% (p<0.01), ACE inhibitor use increased from 6% to 58% (p<0.01), and statin use increased from 6% to 86% (p<0.01). This increased use of treatment persisted during subsequent one-year follow-up. There was also a significant increase in patients achieving LDL cholesterol <100 mg/dl (6% vs 58%, p<0.001) and a reduction in recurrent 1-year MI (7.8% vs 3.1%, p<0.05), total mortality (7% vs 3.3%, p<0.05), and cardiac mortality (5.1% vs 2%, p<0.05). The American College of Cardiology, in partnership with the Michigan quality improvement organization and the Greater Detroit Area Health Council, initiated the American College of Cardiology's Guidelines Applied in Practice (GAP) in Michigan in 1999 to improve the quality of care after MI by reinforcing the application of guidelines and by using standard admission ordersets and standard discharge contracts associated with strong physician and nurse administrative case management controls. This pilot program included 2,857 patients admitted for MI (1,368 patients before and 1,489 patients after program implementation in a before/after design) and showed a 21% to 26% reduction in mortality, particularly at 30 days (odds ratio of GAP to baseline 0.74; 95% CI 0.59 to 0.94; p=0.012) and 1 year (odds ratio 0.78; 95% CI 0.64 to 0.95; p=0.013). In addition to such quality improvement programs based on medical therapy, lifestyle change programs initiated at hospital have also demonstrated significant impact on outcomes after an ACS. In-hospital non-pharmacologic and smoking cessation counseling interventions seemed to be effective in a systematic review of randomized controlled trials including patients with coronary artery diseases. Importantly, cardiac rehabilitation programs are an important corner stone in the educational process of care after an ACS. Indeed Taylor et al. demonstrated in a meta-analysis including 48 trials with a total of 8940 patients that phase 2 cardiac rehabilitation program reduced all-cause mortality by 20% (OR 0.80; 95% CI: 0.68 to 0.93) and cardiac mortality by 26% (OR=0.74; 95% CI: 0.61 to 0.96). Therefore phase 2 cardiac rehabilitation is a class 1 recommendation according to international guidelines. Unfortunately and despite these robust recommendations only 30% of patients after an ACS benefit from a phase 2 cardiac rehabilitation program. Referring patients to cardiac rehabilitation centers is one major intervention of the numerous interventions recommended for patients after an ACS. Of note cardiac rehabilitation programs reinforce the use of recommended therapies and of therapeutic education in secondary prevention. Lack of medication adherence after an ACS Therapeutic adherence rates to medication are typically higher among patients with acute disease than those with chronic illness. Furthermore, adherence rates among patients with chronic conditions are disappointingly decreased over time, dropping most dramatically after the first 6 months of therapy. For example, approximately half of elderly patients receiving a statin therapy for dyslipidemia in primary and secondary prevention will discontinue their medication within 6 months after starting the medication. Taking into account the definition of the International Society for Pharmacoeconomics and Outcome Research, medication compliance or medication adherence refers to the act of conforming to the recommendations of medical prescription with respect to timing, dosage, and frequency of medication taking. In summary medication adherence is the extent to which a patient acts in accordance with the prescribed dosing regiment. The unit of measure is administered doses per defined period of time, reported as the proportion of prescribed doses taken in the prescribed time interval (%) (Fig. 3). Medication persistence is defined as "the duration of time from initiation to discontinuation of therapy", independently of the regiment dose or frequency of the medication (Fig. 3). Noncompliant behavior is a critical issue in the care of patients with chronic disease. Noncompliant behavior is a consequence of several parameters ( Table 1) and especially of a physician-patient alliance failure. The impact of the lack of therapeutic adhesion was noted in observational studies and also noticed in controlled randomized trials According with the publication of Cramer et al. showing average adherence rates of only 43-78% among patients receiving medication for chronic diseases. Importantly, patients included in randomized trials benefit from a close monitoring of medication following the quality and safety control of such studies and this should be in favor of more favorable therapeutic adhesion rates. In the modern era, there have been major changes in physicianpatient interaction and agreement. The traditional authoritarian approach of the caregiver has evolved towards a collaborative partnership with the patient in order to jointly define the modalities of the medical management of health, disease and preventive medical and lifestyle interventions. Noncompliant behavior is most often the result of a communication failure consecutive to lack of consideration of several important psychosocial dimensions of individuals facing chronic disease. These psychosocial dimensions include the self-representation of illness and the benefit of its medical management, the belief of such a benefit, the confidence in medical management and in the caregiver, and finally in the motivation to change daily habits by taking long-term medication and by changing lifestyle, which implies important behavior changes. Therefore these changes have to be discussed with the patient and the discussion needs to be interactive with a common objective of patient-caregiver partnership instead of a simple recommendation of treatment. The result should be that the patient himself decides on the long-term medical management of his chronic disease. Therapeutic education of the patient and motivational interviewing has been developed to help patients and caregivers to change and evolve towards a collaborative partnership, which consists of care centered on the patient. A widely used current model in therapeutic education of the patient is that of shared decision making, in which physician and patient discuss, negotiate and finally agree on the medical condition and on problem solving. The future for patients admitted to the hospital with an ACS: use of multi-dimensional secondary prevention programs As a result of the benefit and safety of an early invasive strategy in the care of patients with high risk ACS and thanks to a trans-radial PCI approach, the duration of hospital stay has decreased dramatically during the last decade. Indeed even after administration of an intensive anti-thrombotic therapy including glycoprotein IIb-IIIa (GPIIbIIIa) receptor inhibitors, a same-day home discharge after PCI via trans-radial approach has been demonstrated to be safe and with a markedly favorable economic impact in part due to the marked reduction in bleeding complications. Therefore the future of Diagnostic-Related Group (DRG) reimbursement for patients admitted to hospital for an ACS will be based on recommended international guidelines, which recommend at least 24 h of hospitalization after PCI of the culprit lesion and also be based on the more recent data about same-day safety discharge after PCI under GPIIbIIIa receptor inhibitors. Consequently hospital stay will shorten in the future. This will reduce the time period for the educational process of patients and might decrease its quality in the actual context of suboptimal care of patients with an ACS as it has been described above. The future challenges in the care of patients with ACS will be to sensitize physicians about the high long-term risk Table 1 Predictors of noncompliant behavior according with illness and care-related predictors as well as patient related predictors with their corresponding references Predictors of noncompliant behavior for the management of chronic diseases References Illness and care-related predictors Complexity of treatment Inadequate follow-up or discharge planning Treatment of asymptomatic disease Side effects of medication Poor provider-patient relationship Patient's lack of belief in benefit of treatment Presence of barriers to care or medications Cost of medication, unsufficient reimbursement, or both Missed appointments Patient-related predictors Presence of cognitive impairment or psychological problems such as depression Patient's misinterpretation or lack of insight into the illness of all patients having suffered from an ACS, to improve the quality of care by increasing the rate of recommended prescriptions according to guidelines, to improve in-hospital education of care caregivers in the acute and long-term treatments of patients with an ACS, to improve in-hospital education of the patient and finally to improve communication between hospitals, outpatient physician practices and cardiac rehabilitation centers. These challenges will be of primary importance in the future of hospital cost reimbursement. The first essential step to achieve this complex objective in quality improvement for patients with an ACS will be to sensitize caregivers, including cardiologists, of the real risk of ACS patients and to measure local practice of care for these patients. Similarly to the recommended multidisciplinary work-up necessary to perform primary PCI in tertiary hospitals, a local inventory of practice and outcome should first be planned. After the assessment of this local analysis of care and outcome of patients with an ACS, a multidisciplinary improvement program should be developed including all caregivers from nurses, internists, cardiologists (non-invasive and invasive), specialists in therapeutic education, nurses assistants, and physiotherapists. The program should answer the critical issues discussed above about the gap between an ideal situation and the reality of care of patients with an ACS. To achieve this objective, we have developed a multidimensional prevention program after an Acute Coronary Syndrome (ELIPS). The ELIPS program has been deployed in all university hospitals in Switzerland, under the direction of the Geneva University Hospitals. The ELIPS program aims at improving the acute care of patients with an ACS and long-term secondary prevention of atherosclerosis by using a multi-dimensional or multilevel approach. First of all, a reinforcement of guidelines has been implemented at the caregivers-level and associated with a discharge program of care to ensure the use of the recommended therapies and lifestyle recommendation (patient-level intervention). This discharge program was designed based on the GAP program. This program includes a discharge card which is given to the patient and allows for discussion with his family physician as well as his cardiologist (system-level intervention). In addition, information sessions have been given throughout the country to inform caregivers of referring hospitals and outpatient physicians of the implementation of the overall ELIPS program. Secondly, an educational process has been developed taking into account the time limitation due to the briefness of hospital stay in the setting of ACS and also the limited resources for education of acute patients in public hospitals. Because of these limitations, the most suitable educational approach in the setting of ACS was motivational interviewing. We therefore developed a program of motivational interviewing including an e-learning (www.elips-elearning.org) and a face-to-face training course dedicated to nurses and in-hospital physicians (care-givers-level intervention). Finally numerous and novel ACS and atherosclerosis information tools were created in a uniform and complementary manner, dedicated to patients and healthcare providers (patient-level intervention as well as healthcareproviders-level intervention). These information tools include a DVD film, a website (www.elips.ch), a smartphone application, flyers, and an interactive wallchart for hospital and rehabilitation center use ( Table 2). All tools including the motivational interviewing e-learning were translated into the main spoken languages in Switzerland, namely English, German, French and Italian. Moreover, the tools were validated in all languages by all Swiss university hospitals, by a university legal department and by a patient representative commission of validation. A clinical study is ongoing to assess the efficacy of the ELIPS program (Clinicaltrial.gov: NCT01075867) supported by the Swiss National Science Foundation in a global translational research project of ACS (www.spum-acs.ch). In the context of this quality improvement program, including a media campaign and a training process with potential "contamination", the evaluation study has a before-after design. One thousand two hundred control patients were included between 2009 and the deployment of ELIPS in November 2010 and the same number of patients will be included in the post-implementation phase. The results of the study are expected for 2013. The primary endpoint will be the recurrence of cardiovascular events (cardiovascular death, non-fatal myocardial infarction, cerebrovascular attack, transient cerebral ischemic accident and lower limb ischemia) at 1 year. Events and endpoints will be assessed by an independent adjudication committee. Numerous sub-studies will assess the impact of the program on therapeutic adhesion, the effect of a tobacco cessation program, and the effect on quality of life and numerous biological markers. Conclusions Despite the marked improvement of the in-hospital outcome of patients admitted for ACS due to improved electrocardiographic monitoring, early invasive management and newer anti-thrombotic therapies, long-term outcome of these patients remains relatively poor, especially for NSTE-ACS as compared to STEMI. The poorer outcome of NSTE-ACS compared with STEMI patients is due to the different characteristics of these two populations with a higher rate of diffuse coronary disease in patients with NSTE-ACS, who are often older and who present more comorbidities such as diabetes and renal failure. Despite these differences in longterm outcomes, physicians often consider NSTE-ACS as a "smaller MI" than STEMI because of the better short-term inhospital outcome and these patients are less frequently referred for coronary angiography and subsequent PCI. Furthermore, the medical management for secondary prevention of ACS patients who do not benefit from an invasive approach is less frequently in accordance with recommendations than their invasively treated counterparts. Of note, audits have demonstrated a gap between the ideal management of patients admitted to hospitals with an ACS and the actual received treatment and this is a major concern when aiming to improve the outcome of these patients. In addition to the insufficient application of the recommended therapies by physicians, there is an important gap between medical prescription and patient therapeutic adhesion; this also has a significant impact on outcome including mortality. Following these observations, numerous quality improvement programs have been developed, which will be of importance considering the future projected reduction in hospital stay duration after an ACS. The latter is linked to progress in the acute care of ACS including early invasive approaches and the radial artery access for PCI with subsequent decrease of bleeding. The results of the assessment of the ELIPS nation wide multi-dimensional quality improvement program for patients admitted to the hospital for an ACS are expected in 2013.
Understanding the Strength of General-Purpose Cutting Planes Cutting planes for a mixed-integer program are linear inequalities which are satisfied by all feasible solutions of the latter. These are fundamental objects in mixed-integer programming that are critical for solving large-scale problems in practice. One of the main challenge in employing them is that there are limitless possibilities for generating cutting planes; the selection of the strongest ones is crucial for their effective use. In this thesis, we provide a principled study of the strength of generalpurpose cutting planes, giving a better understanding of the relationship between the different families of cuts available and analyzing the properties and limitations of our current methods for deriving cuts. We start by analyzing the strength of disjunctive cuts that generalize the ubiquitous split cuts. We first provide a complete picture of the containment relationship of the split closure, second split closure, cross closure, crooked cross closure and tbranch split closure. In particular, we show that rank-2 split cuts and crooked cross cuts are neither implied by cross cuts, which points out the limitations of the latter; these results answer questions left open in. Moreover, given the prominent role of relaxations and their computational advantages, we explore how strong are cross cuts obtained from basic and 2-row relaxations. Unfortunately we show that not all cross cuts can be obtained as cuts based on these relaxation, answering a question left open in. One positive message from this result, though, is that cross cuts do not suffer from the limitations of these relaxations. Our second contribution is the introduction of a probabilistic model for comparing the strength of families of cuts for the continuous relaxation. We employ this model to compare the important split and triangle cuts, obtaining results that provide improved information about their behavior. More precisely, while previous works indicated that triangle cuts should be much stronger than split cuts, we provide the first theoretical support for the effect that is observed in practice: for most instances,
Person, behaviour, and contingencies (an aesthetic view of behaviourism) The concept of person is a fundamental one in any psychology worthy of the name, yet it is not among the technical terms of behaviourism. Indeed, behaviourism was reticent, not surprisingly, about the concept of person, given its traditional substantiality and intrapsychic sense. But behaviourism, particularly the Skinnerian variety, has the ideas to develop a perfectly acceptable conception of the person. Notable among these would be the idea of operant subject (author and actor). With regard precisely to the person as subjectactor of the behaviour, it is worth underlining the affinity of behaviourism with person in its radical (etymological) sense, derived from the theatre (persona = mask = role = behavioural repertoires). In fact, in its original dramaturgical sense, the person gives a face to others and according to socially organized contingencies (scripts, norms, rules). Thus, person is a term correlative to the stage, or, in other words, to contingencies. The present work sets out to develop this...
Rational Construction of Molecular Electron-Conducting Nanowires Encapsulated in a Proton-Conducting Matrix in a Charge Transfer Salt. Insulated molecular wires have gained significant attention owing to their potential contribution in the fields of nanoelectronics and low-dimensional chemistry/physics. Based on molecular charge transfer salts, we demonstrate, for the first time, the rational construction of molecular electron-conducting wires encapsulated in a proton-conducting matrix, which possibly paves the way to ionoelectronics. As expected from the molecular structure of the newly designed complex anion (i.e., propeller-shaped structure with hydrogen-bonding sites at four edges), a three-dimensional hydrogen-bonded framework was constructed within the crystal, which contains a one-dimensional array of an electron donor, tetrathiafulvalene (TTF). From the single-crystal crystallographic and spectroscopic studies, it was clarified that the nonstoichiometric deprotonation of anions and partial oxidation of TTFs occur, whereas the anion is electronically inert. Moderate conductivities of electron and proton were confirmed by dc and ac conductivity measurements. In addition, the electronic isolation of TTF wires was confirmed by the magnetic susceptibility data.
/* * Copyright 2020 Metastring Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.metastringfoundation.datareader.helpers; import org.apache.commons.io.IOUtils; import java.io.*; import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.nio.file.Paths; public class FileManager { public static Reader getFileReader(Path nioPath) throws FileNotFoundException { String path = nioPath.toString(); return new FileReader(path); } public static Path getPathFromString(String path) { return Paths.get(path); } public static String getFileContentsAsString(String path) throws IOException { return IOUtils.toString(new FileInputStream(path), StandardCharsets.UTF_8); } }
/**************************************************************************************************************************************************** * Copyright (c) 2014 Freescale Semiconductor, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name of the Freescale Semiconductor, Inc. nor the names of * its contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************************************************************************************/ #include "FurShaderBase.hpp" #include <FslDemoApp/Base/Service/Content/IContentManager.hpp> #include <FslUtil/OpenGLES2/GLCheck.hpp> #include <FslUtil/OpenGLES2/GLValues.hpp> #include <algorithm> #include <cassert> namespace Fsl { using namespace GLES2; namespace { IO::Path GetVert(const IO::Path& shaderPath, const bool useHighPrecision) { return IO::Path::Combine(shaderPath, (useHighPrecision ? "Fur_hp.vert" : "Fur_lp.vert")); } IO::Path GetFrag(const IO::Path& shaderPath, const bool useHighPrecision, const int lightCount) { switch (lightCount) { case 1: return IO::Path::Combine(shaderPath, (useHighPrecision ? "Fur1_hp.frag" : "Fur1_lp.frag")); case 2: return IO::Path::Combine(shaderPath, (useHighPrecision ? "Fur2_hp.frag" : "Fur2_lp.frag")); case 3: return IO::Path::Combine(shaderPath, (useHighPrecision ? "Fur3_hp.frag" : "Fur3_lp.frag")); case 4: return IO::Path::Combine(shaderPath, (useHighPrecision ? "Fur4_hp.frag" : "Fur4_lp.frag")); default: return IO::Path::Combine(shaderPath, (useHighPrecision ? "FurN_hp.frag" : "FurN_lp.frag")); } } } FurShaderBase::FurShaderBase(const IContentManager& contentManager, const IO::Path& shaderPath, const bool useHighPrecision, const int lightCount) : ShaderBase(contentManager.ReadAllText(GetVert(shaderPath, useHighPrecision)), contentManager.ReadAllText(GetFrag(shaderPath, useHighPrecision, lightCount))) , m_lightCount(lightCount) , m_locWorld(GLValues::INVALID_LOCATION) , m_locView(GLValues::INVALID_LOCATION) , m_locProjection(GLValues::INVALID_LOCATION) , m_locTexture0(GLValues::INVALID_LOCATION) , m_locTexture1(GLValues::INVALID_LOCATION) , m_locLightCount(GLValues::INVALID_LOCATION) , m_locAmbientColor(GLValues::INVALID_LOCATION) , m_locMaxHairLength(GLValues::INVALID_LOCATION) , m_locDisplacement(GLValues::INVALID_LOCATION) { Construct(lightCount); } FurShaderBase::FurShaderBase(const IContentManager& contentManager, const IO::Path& vertShaderPath, const IO::Path& fragShaderPath, const int lightCount) : ShaderBase(contentManager.ReadAllText(vertShaderPath), contentManager.ReadAllText(fragShaderPath)) , m_lightCount(lightCount) , m_locWorld(GLValues::INVALID_LOCATION) , m_locView(GLValues::INVALID_LOCATION) , m_locProjection(GLValues::INVALID_LOCATION) , m_locTexture0(GLValues::INVALID_LOCATION) , m_locTexture1(GLValues::INVALID_LOCATION) , m_locLightCount(GLValues::INVALID_LOCATION) , m_locAmbientColor(GLValues::INVALID_LOCATION) , m_locMaxHairLength(GLValues::INVALID_LOCATION) , m_locDisplacement(GLValues::INVALID_LOCATION) { Construct(lightCount); } void FurShaderBase::SetWorld(const Matrix& matrix) { glUniformMatrix4fv(m_locWorld, 1, GL_FALSE, matrix.DirectAccess()); } void FurShaderBase::SetView(const Matrix& matrix) { glUniformMatrix4fv(m_locView, 1, GL_FALSE, matrix.DirectAccess()); } void FurShaderBase::SetProjection(const Matrix& matrix) { glUniformMatrix4fv(m_locProjection, 1, GL_FALSE, matrix.DirectAccess()); } void FurShaderBase::SetDisplacement(const Vector3& displacement) { assert(IsLoaded()); glUniform3f(m_locDisplacement, displacement.X, displacement.Y, displacement.Z); } int FurShaderBase::GetLightCount() const { return m_lightCount; } void FurShaderBase::SetLightDirection(const int index, const Vector3& lightDirection) { // This is very inefficient, we should actually only send it to the driver on bind and only dirty ones (but that goes for all the params) assert(IsLoaded()); if (index < 0 || index > m_lightCount) { throw std::invalid_argument("invalid light index"); } if (m_lightCount <= 4) { glUniform3f(m_locLightDirection[index], lightDirection.X, lightDirection.Y, lightDirection.Z); } else { m_lightDirection[index * 3 + 0] = lightDirection.X; m_lightDirection[index * 3 + 1] = lightDirection.Y; m_lightDirection[index * 3 + 2] = lightDirection.Z; glUniform3fv(m_locLightDirection[0], m_lightCount * 3, &m_lightDirection[0]); } } void FurShaderBase::SetLightColor(const int index, const Vector3& lightColor) { // This is very inefficient, we should actually only send it to the driver on bind and only dirty ones (but that goes for all the params) assert(IsLoaded()); if (index < 0 || index > m_lightCount) { throw std::invalid_argument("invalid light index"); } if (m_lightCount <= 4) { glUniform3f(m_locLightColor[index], lightColor.X, lightColor.Y, lightColor.Z); } else { m_lightColor[index * 3 + 0] = lightColor.X; m_lightColor[index * 3 + 1] = lightColor.Y; m_lightColor[index * 3 + 2] = lightColor.Z; glUniform3fv(m_locLightColor[0], m_lightCount * 3, &m_lightColor[0]); } } void FurShaderBase::SetLightAmbientColor(const Vector3& ambientColor) { assert(IsLoaded()); glUniform3f(m_locAmbientColor, ambientColor.X, ambientColor.Y, ambientColor.Z); } void FurShaderBase::SetMaxHairLength(const float maxHairLength) { assert(IsLoaded()); glUniform1f(m_locMaxHairLength, maxHairLength); } void FurShaderBase::SetTexture0(const int unit) { assert(IsLoaded()); glUniform1i(m_locTexture1, unit); } void FurShaderBase::SetTexture1(const int unit) { assert(IsLoaded()); glUniform1i(m_locTexture1, unit); } void FurShaderBase::SetLightCount(const int lightCount) { assert(IsLoaded()); if (m_locLightCount != GLValues::INVALID_LOCATION) { glUniform1f(m_locLightCount, GLfloat(lightCount)); } } void FurShaderBase::Construct(const int32_t lightCount) { const GLuint hProgram = Get(); // Get attribute locations of non-fixed attributes like color and texture coordinates. m_shaderConfig.Position = GL_CHECK(glGetAttribLocation(hProgram, "VertexPosition")); m_shaderConfig.Normal = GL_CHECK(glGetAttribLocation(hProgram, "VertexNormal")); m_shaderConfig.TexCoord = GL_CHECK(glGetAttribLocation(hProgram, "TexCoord")); // Get uniform locations m_locWorld = GL_CHECK(glGetUniformLocation(hProgram, "World")); m_locView = GL_CHECK(glGetUniformLocation(hProgram, "View")); m_locProjection = GL_CHECK(glGetUniformLocation(hProgram, "Projection")); m_locTexture0 = GL_CHECK(glGetUniformLocation(hProgram, "Texture0")); m_locTexture1 = GL_CHECK(glGetUniformLocation(hProgram, "Texture1")); // Fill the arrays with default values if (lightCount <= 4) { m_locLightDirection.resize(lightCount); m_locLightColor.resize(lightCount); const GLint fillValue = GLValues::INVALID_LOCATION; std::fill(m_locLightDirection.begin(), m_locLightDirection.end(), fillValue); std::fill(m_locLightColor.begin(), m_locLightColor.end(), fillValue); m_locLightDirection[0] = GL_CHECK(glGetUniformLocation(hProgram, "LightDirection1")); m_locLightColor[0] = GL_CHECK(glGetUniformLocation(hProgram, "LightColor1")); if (lightCount >= 2) { m_locLightDirection[1] = GL_CHECK(glGetUniformLocation(hProgram, "LightDirection2")); m_locLightColor[1] = GL_CHECK(glGetUniformLocation(hProgram, "LightColor2")); } if (lightCount >= 3) { m_locLightDirection[2] = GL_CHECK(glGetUniformLocation(hProgram, "LightDirection3")); m_locLightColor[2] = GL_CHECK(glGetUniformLocation(hProgram, "LightColor3")); } if (lightCount >= 4) { m_locLightDirection[3] = GL_CHECK(glGetUniformLocation(hProgram, "LightDirection4")); m_locLightColor[3] = GL_CHECK(glGetUniformLocation(hProgram, "LightColor4")); } } else { m_locLightDirection.resize(1); m_locLightColor.resize(1); m_locLightDirection[0] = GL_CHECK(glGetUniformLocation(hProgram, "LightDirection")); m_locLightColor[0] = GL_CHECK(glGetUniformLocation(hProgram, "LightColor")); m_locLightCount = GL_CHECK(glGetUniformLocation(hProgram, "LightCount")); m_lightDirection.resize(3 * lightCount); m_lightColor.resize(3 * lightCount); std::fill(m_lightDirection.begin(), m_lightDirection.end(), 0.0f); std::fill(m_lightColor.begin(), m_lightColor.end(), 0.0f); } m_locAmbientColor = GL_CHECK(glGetUniformLocation(hProgram, "AmbientColor")); m_locMaxHairLength = GL_CHECK(glGetUniformLocation(hProgram, "MaxHairLength")); m_locDisplacement = GL_CHECK(glGetUniformLocation(hProgram, "Displacement")); { // Set the default values ScopedUse scope(*this); SetWorld(Matrix::GetIdentity()); SetView(Matrix::GetIdentity()); SetProjection(Matrix::GetIdentity()); SetDisplacement(Vector3::Zero()); for (int i = 0; i < lightCount; ++i) { SetLightDirection(i, Vector3(0.0f, 1.0f, 0.0f)); SetLightColor(i, Vector3::One()); } SetLightCount(lightCount); SetLightAmbientColor(Vector3::One()); SetMaxHairLength(1.0f); SetTexture0(0); SetTexture1(0); } } }